diff --git a/.gitattributes b/.gitattributes index a185d697627566..fa5162684b8dc8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ test/fixtures/* -text +vcbuild.bat text eol=crlf diff --git a/.gitignore b/.gitignore index 50e672fed9b811..c3a9e464540fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,12 +10,13 @@ tags doc/api.xml tmp/ test/tmp*/ -node -node_g +iojs +iojs_g *.swp .benchmark_reports /.project /.cproject +icu_config.gypi /out @@ -43,10 +44,14 @@ ipch/ /dist-osx /npm.wxs /tools/msvs/npm.wixobj +/tools/osx-pkg.pmdoc/index.xml /test/addons/doc-*/ email.md deps/v8-* deps/icu +deps/icu*.zip +deps/icu*.tgz +deps/icu-tmp ./node_modules .svn/ @@ -62,7 +67,7 @@ deps/openssl/openssl.target.mk deps/zlib/zlib.target.mk # build/release artifacts -/*.tar.gz +/*.tar.* /SHASUMS*.txt* /tools/wrk/wrk diff --git a/.mailmap b/.mailmap index f52014580396f8..bca33526ad6988 100644 --- a/.mailmap +++ b/.mailmap @@ -2,12 +2,15 @@ Aaron Heckmann Abe Fettig Alex Kocharin Alex Kocharin +Alexey Kupershtokh +Alexis Campailla Alexis Sellier Alexis Sellier Arlo Breault Artem Zaytsev +Arnout Kazemier <3rd-Eden@users.noreply.github.com> Atsuo Fukaya -Ben Noordhuis +Ben Noordhuis Ben Taber Bert Belder Bert Belder @@ -25,12 +28,14 @@ Daniel Pihlström Dave Pacheco David Siegel Domenic Denicola +Domenic Denicola Eduard Burtescu Einar Otto Stangvik Elliott Cable EungJun Yi Evan Larkin Farid Neshat +Fedor Indutny Felix Böhm Felix Geisendörfer Felix Geisendörfer @@ -57,6 +62,7 @@ Jérémy Lal Jérémy Lal Kai Sasaki Lewuathe Kazuyuki Yamada +Keith M Wesolowski Koichi Kobayashi Kris Kowal Kyle Robinson Young @@ -67,18 +73,21 @@ Michael Bernstein Michael Wilber Micheil Smith Mikael Bourges-Sevenier +Mitar Milutinovic Nebu Pookins Nicholas Kinsey Onne Gorter Paul Querna Ray Morgan Ray Solomon +Raymond Feng Rick Olson Ryan Dahl Ryan Emery Sam Shull Sam Shull Sambasiva Suda +Sam Roberts San-Tai Hsu Scott Blomquist Sergey Kryzhanovsky @@ -98,8 +107,8 @@ Tim Caswell Tim Price Tim Smart Tim Smart -Tom Hughes-Croucher -Tom Hughes-Croucher +Tom Hughes +Tom Hughes-Croucher Trevor Burnham Tyler Larson Vincent Voyer diff --git a/AUTHORS b/AUTHORS index 5aa6137928e6e6..214be6a8338d05 100644 --- a/AUTHORS +++ b/AUTHORS @@ -41,7 +41,6 @@ Benjamin Thomas San-Tai Hsu Ben Williamson Joseph Pecoraro -Erich Ocean Alexis Sellier Blaine Cook Stanislav Opichal @@ -70,7 +69,6 @@ James Herdman Julian Lamb Brian Hammond Mathias Pettersson -Trevor Blackwell Thomas Lee Daniel Berger Paulo Matias @@ -111,7 +109,7 @@ Danny Coates Nick Stenning Bert Belder Trent Mick -Fedor Indutny +Fedor Indutny Illarionov Oleg Aria Stewart Johan Euphrosine @@ -124,7 +122,7 @@ Sam Stephenson Jorge Chamorro Bieling Evan Larkin Sean Coates -Tom Hughes-Croucher +Tom Hughes Joshua Peek Nathan Rajlich Peteris Krumins @@ -223,8 +221,8 @@ Evan Martin Peter Lyons Jann Horn Abimanyu Raja -Niclas Hoyer Karl Skomski +Niclas Hoyer Michael Jackson Ashok Mudukutore Sean Cunningham @@ -347,14 +345,15 @@ Tim Macfarlane Jonas Westerlund Dominic Tarr Justin Plock -Timothy J Fontaine Toshihiro Nakamura Ivan Torres Philipp Hagemeister Mike Morearty Pavel Lang Peter Rybin +Timothy J Fontaine Joe Andaverde +Tom Hughes-Croucher Eugen Dueck Gil Pedersen Tyler Neylon @@ -379,42 +378,43 @@ Aaditya Bhatia Max Ogden Igor Soarez Olivier Lalonde +Scott Blomquist Francois Marier -Trevor Norris -Kai Sasaki Lewuathe -Nicolas Chambrier -Tim Bradshaw -Johannes Ewald -Chris Dent -Dan Milon Brandon Philips Frederico Silva Jan Wynholds Girish Ramakrishnan Anthony Pesch Stephen Gallagher +Trevor Norris Sergey Kholodilov Tim Kuijsten Michael Axiak Chad Rhyner +Kai Sasaki Lewuathe +Nicolas Chambrier Ben Taber Luke Arduini Luke Bayes +Tim Bradshaw Nirk Niggler +Johannes Ewald James Hight Mike Harsch +Chris Dent Alexandr Emelin James Campos +Dan Milon Dave Olszewski Tim Price Jake Verbaten Jacob Gable -Rick Yakubowski -Dan Kohn Andy Burke Sugendran Ganess +Rick Yakubowski Jim Schubert Victor Costan +Dan Kohn Arianit Uka Andrei Sedoi Eugene Girshov @@ -424,20 +424,18 @@ Raymond Feng Aaron Cannon Xidorn Quan Paolo Fragomeni -Scott Blomquist Henry Chin Julian Gruber JeongHoon Byun Iskren Ivov Chernev Alexey Kupershtokh -Benjamin Ruston Manav Rathi +Benjamin Ruston Marcin Kostrzewa Suwon Chae David Braun Mitar Milutinovic Michael Hart -Jeff Barczewski Andrew Hart Rafael Garcia Tobias Müllerleile @@ -452,38 +450,41 @@ Sam Roberts Kevin Locke Daniel Moore Robert Kowalski +Nick Sullivan Benoit Vallée Ryuichi Okumura Brandon Frohs -Nick Sullivan Nathan Zadoks Rafael Henrique Moreira Daniel G. Taylor Kiyoshi Nomo +Nick Desaulniers Veres Lajos Yuan Chuan Krzysztof Chrapka Linus Mårtensson Peter Rust +Jeff Barczewski Shuan Wang Wyatt Preul -David Björklund +David Björklund Dav Glass Andrew Chilton Antony Bailey Forrest L Norvell Evan Solomon Eran Hammer +Matthias Bartelmeß Daniel Chatfield Eivind Uggedal Edward Hutchins -Chris Wren -Duan Yao -Matthias Bartelmeß James Halliday +ChrisWren +Duan Yao Matthew Aynalem Vsevolod Strukchinsky Jay Beavers +Mathias Buus Eric Schrock Jeff Switzer Glen Mailer @@ -499,11 +500,15 @@ Jackson Tian fengmk2 Tim Wood Linus Unnebäck +Vladimir Kurchatkin +David Chan +Alexis Campailla Nikolai Vavilov Michael Ridgway Yazhong Liu Gabriel Falkenberg Kai Groner +Lalit Kapoor Steven Kabbes Gabriel Farrell Nicolas Kaiser @@ -512,59 +517,169 @@ Cam Swords Paul Loyd Benjamin Waters Lev Gimelfarb -Peter Flannery +Yorkie +pflannery Tuğrul Topuz Lorenz Leutgeb -Brandon Cheng -Alexis Campailla -Yang Tianyang +ayanamist +gluxon Tom Gallacher Jo Liss Jun Ma Jacob Hoffman-Andrews Keith M Wesolowski Maxime Quandalle -Doron Pagot Oguz Bastemur +Yuriy Nemtsov +Benjamin Waters +iamdoron +Austin Moran Kenan Sulayman -Christian Schulz +Christian Pedro Ballesteros Anton Khlynovskiy Nicolas Talle -Austin Moran Mike Pennisi Maxwell Krohn Saúl Ibarra Corretgé Greg Brail Shuhei Kagawa -Yuriy Nemtsov Josh Dague Goh Yisheng (Andrew) -William Bert James Pickard Andrew Low Nick Apperson C. Scott Ananian Yuki KAN Evan Carroll +William Bert goussardg Geir Hauge Farrin Reid +Ben Noordhuis Denys Zariaiev Sean McArthur Rasmus Christian Pedersen +Forrest L Norvell +Adrian Lang +Feross Aboukhadijeh +Refael Ackermann +Taojie +Greg Sabia Tucker +Dan Kaplun +Colin Ihrig Greg Sabia Tucker +Mark Stosberg Calvin Metcalf -cjihrig +Ryan Cole +Kevin Decker +Rohini Harendra Chris Barber -Nick Apperson -Oguz Bastemur -Maurice Butler +Michael Kebe +Nick Muerdter +Roman Klauke +Xavi Magrinyà +Euan +Ed Morley +Charles +Jan Krems +Fred K. Schott Chris Dickinson +Jonathan Reem +Refael Ackermann +Ionică Bizău +Eli Skeggs +Andrius Bentkus +Ed Umansky +Maurice Butler +John Albietz +Andrew Oppenlander Julien Gilli +Gabriel Wicke Jakob Gillich -James Halliday +Lucio M. Tato +Herman Lee Kevin Simper -Jackson Tian +Thorsten Lorenz +Ezequiel Rabinovich +Cheng Zhao Tristan Berger +Isaac Burns +Jesús Leganés Combarro "piranna +Majid Arif Siddiqui +Trevor Livingston Mathias Schreck +Adam Lippai +Guilherme de Souza +Mickael van der Beek +Andrew Teich +Kang-Hao Kenny +Patrick Mooney +Jicheng Li +James Ferguson +Julien Fontanet +Steven R. Loomis +gyson +Steve Sharp +Victor Widell +Evan Rutledge Borden +Johnny Ray +Steve Mao +Stiliyan Lazarov +Wang Xinyong +Ray Donnelly +dead-horse +Luis Reis +Jackson Tian +sudodoki +haoxin +Artur Cistov +MK Safi +Rory Bradford +Calvin Metcalf +Nathan Woltman +James Cowgill +Jamund Ferguson +Jonathan Johnson +Martin Cozzi +Carlos Campderrós +Leonardo Balter +Bryce Kahle +The Gitter Badger +Brendan Ashworth +Jose Luis Rivas +Evan Lucas +Vincent Weevers +Tyler Kellen +Evan Torrie +Juanjo +brian m. carlson +Kevin O'Hara +micnic +Alejandro Oviedo +Ben Burns +Julian Duque +teppeis +Rudi Cilibrasi +Tim Ruffles +CGavrila +Aleksey Smolenchuk +Caitlin Potter +Calvin Metcalf +Eric Mill +pkcs +James M Snell +Evan Lucas +Cydox +Steven Rockarts +Vladimir Guguiev +Yosuke Furukawa +Tiago Ribeiro +Rui Marinho +Jesse cogollo +Chris Alley +Michal Tehnik +Aaron Bieber +Phil Hughes + +# Generated by tools/update-authors.sh diff --git a/ChangeLog b/CHANGELOG.md similarity index 65% rename from ChangeLog rename to CHANGELOG.md index ef860651fc8f91..05418af2e07b3d 100644 --- a/ChangeLog +++ b/CHANGELOG.md @@ -1,867 +1,925 @@ -2014.09.24, Version 0.11.14 (Unstable) +# io.js ChangeLog + +## 2015-01-20, Version 1.0.3, @rvagg + +### Notable changes + +* V8 upgrade from 3.31 to 4.1, this is not a major upgrade, the version number "4.1" signifies tracking towards Chrome 41. The 3.31 branch is now not tracking towards a stable release. +* Re-enable Windows XP / 2003 support +* npm upgrade to 2.2.0 +* Improved FreeBSD support + +### Known issues + +* ARMv6 builds still not working, there is a hold-up in V8 on this, issue #283 +* Template strings can cause segfaults in V8 4.1, https://codereview.chromium.org/857433004, also issue #333 + +### Commits + +* 9419e1f - src: fix inconsistency between a check and error (toastynerd) +* 03ee4d8 - fs: add error code on null byte paths (cjihrig) +* e2558f0 - net: fix error details in connect() (cjihrig) +* 4af5746 - win,build: remove duplicate definition (Bert Belder) +* e8d0850 - win: bring back xp/2k3 support (Bert Belder) +* 4dd22b9 - cluster: avoid race enabling debugger in worker (Timothy J Fontaine) +* 6b91c78 - test: reland changes from 11c1bae (Ben Noordhuis) +* 992a1e7 - test: debug-signal-cluster should not be racey (Timothy J Fontaine) +* cdf0df1 - test: temporarily back out changes from 11c1bae (Ben Noordhuis) +* 1ea607c - test: move sequential/test-debug-port-from-cmdline (Ben Noordhuis) +* 2f33e00 - test: fix test-debug-port-from-cmdline.js (Julien Gilli) +* b7365c1 - repl: make REPL support multiline template literals (Xiaowei Li) +* 2253d30 - build: remove unused variable (Johan Bergström) +* ab04a43 - doc: add optional sudo to make install in README (Glen Keane) +* 1b1cd1c - build: shorten configurate script print on stdout (Roman Reiss) +* d566ded - deps: fix V8 debugger bugs (Jay Jaeho Lee) +* 6f36630 - doc: fix util.isBuffer examples (Thomas Jensen) +* 3abfb56 - benchmark: fix tcp bench after internal api change (Yosuke Furukawa) +* 50177fb - benchmark: stop v8 benchmark clobbering RegExp (Ben Noordhuis) +* 1952219 - deps: make node-gyp work again on windows (Bert Belder) +* a28de9b - deps: make node-gyp fetch tarballs from iojs.org (Ben Noordhuis) +* 9dc8f59 - deps: upgrade npm to 2.2.0 (Forrest L Norvell) +* e8ad773 - src: remove --noharmony_classes again (Ben Noordhuis) +* 334020e - deps: fix v8 build on FreeBSD (Fedor Indutny) +* 5e7ebc7 - deps: upgrade v8 to 4.1.0.7 (Ben Noordhuis) +* ea7750b - benchmark: add filter option for benchmark (Yosuke Furukawa) +* 4764eef - doc: fixed punctuation (Brenard Cubacub) +* de224d6 - configure: remove --ninja switch (Ben Noordhuis) +* 48774ec0 - configure: print warning for old compilers (Ben Noordhuis) +* daf9562 - doc: change to iojs from node in the usage message (Jongyeol Choi) +* 3fde649 - build: add tools/gflags to PYTHONPATH (Shigeki Ohtsu) +* 8b22df1 - doc: add python-gflags LICENSE block (Shigeki Ohtsu) +* 6242229 - tools: add python-gflags module (Shigeki Ohtsu) + +## 2015-01-16, Version 1.0.2, @rvagg + +### Notable changes + +* Windows installer fixes +* Bundled node-gyp fixes for Windows +* http_parser v2.4.1 upgrade +* libuv v1.2.1 upgrade + +### Commits + +* 265cb76 - build: add new installer config for OS X (Rod Vagg) +* 8cf6079 - doc: update AUTHORS list (Rod Vagg) +* c80a944 - doc: Add http keepalive behavior to CHANGELOG.md (Isaac Z. Schlueter) +* 9b81c3e - doc: fix author attribution (Tom Hughes) +* fd30eb2 - src: fix jslint errors (Yosuke Furukawa) +* 946eabd - tools: update closure linter to 2.3.17 (Yosuke Furukawa) +* 9e62ae4 - _debug_agent: use `readableObjectMode` option (Vladimir Kurchatkin) +* eec4c81 - doc: fix formatting in LICENSE for RTF generation (Rod Vagg) +* e789103 - doc: fix 404s for syntax highlighting js (Phil Hughes) +* ca039b4 - src: define AI_V4MAPPED for OpenBSD (Aaron Bieber) +* 753fcaa - doc: extend example of http.request by end event (Michal Tehnik) +* 8440cac - src: fix documentation url in help message (Shigeki Ohtsu) +* 24def66 - win,msi: warn that older io.js needs manual uninstall (Bert Belder) +* 59d9361 - win,msi: change UpgradeCode (Bert Belder) +* 5de334c - deps: make node-gyp work again on windows (Bert Belder) +* 07bd05b - deps: update libuv to 1.2.1 (Saúl Ibarra Corretgé) +* e177377 - doc: mention io.js alongside Node in Punycode docs (Mathias Bynens) +* 598efcb - deps: update http_parser to 2.4.1 (Fedor Indutny) +* 3dd7ebb - doc: update cluster entry in CHANGELOG (Ben Noordhuis) +* 0c5de1f - doc: fix double smalloc example (Mathias Buus) -* uv: Upgrade to v1.0.0-rc1 +## 2015-01-14, Version 1.0.1, @rvagg -* http_parser: Upgrade to v2.3.0 +Rebuild due to stale build slave git reflogs for 1.0.0 release -* npm: Upgrade to v2.0.0 +* doc: improve write style consistency (Rui Marinho) +* win,msi: correct doc website link (Bert Belder) -* openssl: Upgrade to v1.0.1i +-------------------------------------- -* v8: Upgrade to 3.26.33 +Below is a summary of the user-facing changes to be found in the io.js v1.0.0 release as compared to the +current _stable_ Node.js release, v0.10.35. At the time of the v1.0.0 release, the latest _unstable_ +Node.js release is v0.11.14 with much progress made towards a v0.11.15 release. The io.js codebase inherits +the majority of the changes found in the v0.11 branch of the [joyent/node](https://github.com/joyent/node) +repository and therefore can be seen as an extension to v0.11. -* Add fast path for simple URL parsing (Gabriel Wicke) +## Summary of changes from Node.js v0.10.35 to io.js v1.0.0 -* Added support for options parameter in console.dir() (Xavi Magrinyà) +### General -* Cluster: fix shared handles on Windows (Alexis Campailla) +- The V8 JavaScript engine bundled with io.js was upgraded dramatically, from version 3.14.5.9 in Node.js v0.10.35 and 3.26.33 in Node.js v0.11.14 to 3.31.74.1 for io.js v1.0.0. This brings along many fixes and performance improvements, as well as additional support for new ES6 language features! For more information on this, check out [the io.js ES6 page](https://iojs.org/es6.html). +- Other bundled technologies were upgraded: + - c-ares: 1.9.0-DEV to 1.10.0-DEV + - http_parser: 1.0 to 2.3 + - libuv: 0.10.30 to 1.2.0 + - npm: 1.4.28 to 2.1.18 + - openssl: 1.0.1j to 1.0.1k + - punycode: 1.2.0 to 1.3.2. +- Performance and stability improvements on all platforms. -* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh) +### buffer -* buffer: construct new buffer from buffer toJSON() output (cjihrig) +https://iojs.org/api/buffer.html -* buffer: improve Buffer constructor (Kang-Hao Kenny) +- Added `buf.writeUIntLE`, `buf.writeUIntBE`, `buf.writeIntLE`, `buf.writeIntBE`, `buf.readUIntLE`, `buf.readUIntBE`, `buf.readIntLE` and `buf.readIntBE` methods that read and write value up to 6 bytes. +- Added `Buffer.compare()` which does a `memcmp()` on two Buffer instances. Instances themselves also have a `compare()`. +- Added `buffer.equals()` that checks equality of Buffers by their contents. +- Added `new Buffer(otherBuffer)` constructor. +- Tweaked `SlowBuffer`'s semantics. +- Updated the output of `buffer.toJSON()` to not be the same as an array. Instead it is an object specifically tagged as a buffer, which can be recovered by passing it to (a new overload of) the `Buffer` constructor. -* build: linking CoreFoundation framework for OSX (Thorsten Lorenz) +### child_process -* child_process: accept uid/gid everywhere (Fedor Indutny) +https://iojs.org/api/child_process.html -* child_process: add path to spawn ENOENT Error (Ryan Cole) +- Added a `shell` option to `child_process.exec`. +- Added synchronous counterparts for the child process functions: `child_process.spawnSync`, `child_process.execSync`, and `child_process.execFileSync`. +- Added the path to any `ENOENT` errors, for easier debugging. -* child_process: copy spawnSync() cwd option to proper buffer (cjihrig) +### console -* child_process: do not access stderr when stdio set to 'ignore' (cjihrig) +https://iojs.org/api/console.html -* child_process: don't throw on EAGAIN (Charles) +- Added an `options` parameter to `console.dir`. -* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis) +### cluster -* child_process: use full path for cmd.exe on Win32 (Ed Morley) +https://iojs.org/api/cluster.html -* cluster: allow multiple calls to setupMaster() (Ryan Graham) +- Updated `cluster` to use round-robin load balancing by default on non-Windows platforms. The scheduling policy is configurable however. +- `--debug` has been made cluster-aware. +- Many bug fixes. -* cluster: centralize removal from workers list. (Julien Gilli) +### crypto -* cluster: enable error/message events using .worker (cjihrig) +https://iojs.org/api/crypto.html -* cluster: include settings object in 'setup' event (Ryan Graham) +- Added support for custom generator values to `DiffieHellman` (defaulting to 2 for backwards compatibility). +- Added support for custom pbkdf2 digest methods. +- Added support for elliptic curve-based Diffie-Hellman. +- Added support for loading and setting the engine for some/all OpenSSL functions. +- Added support for passing in a passphrase for decrypting the signing key to `Sign.sign()`. +- Added support for private key passphrase in every method that accepts it. +- Added support for RSA public/private encryption/decryption functionality. +- Added support for setting and getting of authentication tags and setting additional authentication data when using ciphers such as AES-GCM. -* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham) +### dgram -* cluster: support options in Worker constructor (cjihrig) +https://iojs.org/api/dgram.html -* cluster: test events emit on cluster.worker (Sam Roberts) +- Added support for receiving empty UDP packets. -* console: console.dir() accepts options object (Xavi Magrinyà) +### dns -* crypto: add `honorCipherOrder` argument (Fedor Indutny) +https://iojs.org/api/dns.html -* crypto: allow padding in RSA methods (Fedor Indutny) +- Added `dns.resolveSoa`, `dns.getServers`, and `dns.setServers` methods. +- Added `hostname` on error messages when available. +- Improved error handling consistency. -* crypto: clarify RandomBytes() error msg (Mickael van der Beek) +### events -* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny) +https://iojs.org/api/events.html -* crypto: unsigned value can't be negative (Brian White) +- Added chaining support to `EventEmitter.setMaxListeners`. +- Updated `require('events')` to return the `EventEmitter` constructor, allowing the module to be used like `var EventEmitter = require('events')` instead of `var EventEmitter = require('events').EventEmitter`. -* dgram: remove new keyword from errnoException (Jackson Tian) +### fs -* dns: always set variable family in lookup() (cjihrig) +https://iojs.org/api/fs.html -* dns: include host name in error message if available (Maciej Małecki) +- Added `fs.access`, and deprecated `fs.exists`. Please read the documentation carefully. +- Added more informative errors and method call site details when the `NODE_DEBUG` environment is set to ease debugging. +- Added option to `fs.watch` for recursive sub-directory support (OS X only). +- Fixed missing callbacks errors just being printed instead of thrown. -* dns: introduce lookupService function (Saúl Ibarra Corretgé) +### http -* dns: send lookup c-ares errors to callback (Chris Dickinson) +https://iojs.org/api/http.html -* dns: throw if hostname is not string or falsey (cjihrig) +- Added support for `response.write` and `response.end` to receive a callback to know when the operation completes. +- Added support for 308 status code (see RFC 7238). +- Added `http.METHODS` array, listing the HTTP methods supported by the parser. +- Added `request.flush` method. +- Added `response.getHeader('header')` method that may be used before headers are flushed. +- Added `response.statusMessage` property. +- Added Client Keep-Alive behavior. Set `keepAlive:true` in request options to reuse connections indefinitely. +- Added `rawHeaders` and `rawTrailers` members on incoming message. +- Removed default chunked encoding on `DELETE` and `OPTIONS`. -* events: Output the event that is leaking (Arnout Kazemier) +### os -* fs: close file if fstat() fails in readFile() (cjihrig) +https://iojs.org/api/os.html -* fs: fs.readFile should not throw uncaughtException (Jackson Tian) +- Added MAC addresses, netmasks and scope IDs for IPv6 addresses to `os.networkInterfaces` method output. +- Updated `os.tmpdir` on Windows to use the `%SystemRoot%` or `%WINDIR%` environment variables instead of the hard-coded value of `c:\windows` when determining the temporary directory location. -* http: add 308 status_code, see RFC7238 (Yazhong Liu) +### path -* http: don't default OPTIONS to chunked encoding (Nick Muerdter) +https://iojs.org/api/path.html -* http: fix bailout for writeHead (Alex Kocharin) +- Added `path.isAbsolute` and `path.parse` methods. +- Added `path.win32` and `path.posix` objects that contain platform-specific versions of the various `path` functions. +- Improved `path.join` performance. -* http: remove unused code block (Fedor Indutny) +### process -* http: write() after end() emits an error. (Julien Gilli) +https://iojs.org/api/process.html -* lib, src: add vm.runInDebugContext() (Ben Noordhuis) +- Added `beforeExit` event. +- Added `process.mainModule` and `process.exitCode`. -* lib: noisy deprecation of child_process customFds (Ryan Graham) +### querystring -* module: don't require fs several times (Robert Kowalski) +https://iojs.org/api/querystring.html -* net,dgram: workers can listen on exclusive ports (cjihrig) +- Added the ability to pass custom versions of `encodeURIComponent` and `decodeURIComponent` when stringifying or parsing a querystring. +- Fixed several issues with the formatting of query strings in edge cases. -* net,stream: add isPaused, don't read() when paused (Chris Dickinson) +### smalloc -* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng) +https://iojs.org/api/smalloc.html -* net: add remoteFamily for socket (Jackson Tian) +`smalloc` is a new core module for doing (external) raw memory allocation/deallocation/copying in JavaScript. -* net: don't emit listening if handle is closed (Eli Skeggs) +### streams -* net: don't prefer IPv4 addresses during resolution (cjihrig) +https://iojs.org/api/stream.html -* net: don't throw on net.Server.close() (cjihrig) +The changes to streams are not as drastic as the transition from streams1 to streams2: they are a +refinement of existing ideas, and should make the API slightly less surprising for humans and faster +for computers. As a whole the changes are referred to as "streams3", but the changes should largely go +unnoticed by the majority of stream consumers and implementers. -* net: reset `errorEmitted` on reconnect (Ed Umansky) +#### Readable streams -* node: set names for prototype methods (Trevor Norris) +The distinction between "flowing" and "non-flowing" modes has been refined. Entering "flowing" mode is +no longer an irreversible operation—it is possible to return to "non-flowing" mode from "flowing" mode. +Additionally, the two modes now flow through the same machinery instead of replacing methods. Any time +data is returned as a result of a `.read` call that data will *also* be emitted on the `"data"` event. -* node: support v8 microtask queue (Vladimir Kurchatkin) +As before, adding a listener for the `"readable"` or `"data"` event will start flowing the stream; as +will piping to another stream. -* path: fix slice OOB in trim (Lucio M. Tato) +#### Writable streams -* path: isAbsolute() should always return boolean (Herman Lee) +The ability to "bulk write" to underlying resources has been added to `Writable` streams. For stream +implementers, one can signal that a stream is bulk-writable by specifying a [_writev](https://iojs.org/api/stream.html#stream_writable_writev_chunks_callback) method. +Bulk writes will occur in two situations: -* process: throw TypeError if kill pid not a number (Sam Roberts) +1. When a bulk-writable stream is clearing its backlog of buffered write requests, +2. or if an end user has made use of the new `.cork()` and `.uncork()` API methods. -* querystring: custom encode and decode (fengmk2) +`.cork` and `.uncork` allow the end user to control the buffering behavior of writable streams separate +from exerting backpressure. `.cork` indicates that the stream should accept new writes (up to `highWaterMark`), +while `.uncork` resets that behavior and attempts to bulk-write all buffered writes to the underlying resource. -* querystring: do not add sep for empty array (cjihrig) +The only core stream API that **currently** implements `_writev` is `net.Socket`. -* querystring: remove prepended ? from query field (Ezequiel Rabinovich) +In addition to the bulk-write changes, the performance of repeated small writes to non-bulk-writable streams +(such as `fs.WriteStream`) has been drastically improved. Users piping high volume log streams to disk should +see an improvement. -* readline: fix close event of readline.Interface() (Yazhong Liu) +For a detailed overview of how streams3 interact, [see this diagram](https://cloud.githubusercontent.com/assets/37303/5728694/f9a3e300-9b20-11e4-9e14-a6938b3327f0.png). -* readline: fixes scoping bug (Dan Kaplun) +### timers -* readline: implements keypress buffering (Dan Kaplun) +https://iojs.org/api/timers.html -* repl: fix multi-line input (Fedor Indutny) +- Removed `process.maxTickDepth`, allowing `process.nextTick` to be used recursively without limit. +- Updated `setImmediate` to process the full queue each turn of the event loop, instead of one per queue. -* repl: fix overwrite for this._prompt (Yazhong Liu) +### tls -* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny) +https://iojs.org/api/tls.html -* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin) +- Added `detailed` boolean flag to `getPeerCertificate` to return detailed certificate information (with raw DER bytes). +- Added `renegotiate(options, callback)` method for session renegotiation. +- Added `setMaxSendFragment` method for varying TLS fragment size. +- Added a `dhparam` option for DH ciphers. +- Added a `ticketKeys` option for TLS ticket AES encryption keys setup. +- Added async OCSP-stapling callback. +- Added async session storage events. +- Added async SNI callback. +- Added multi-key server support (for example, ECDSA+RSA server). +- Added optional callback to `checkServerIdentity` for manual certificate validation in user-land. +- Added support for ECDSA/ECDHE cipher. +- Implemented TLS streams in C++, boosting their performance. +- Moved `createCredentials` to `tls` and renamed it to `createSecureContext`. +- Removed SSLv2 and SSLv3 support. -* stream: only end reading on null, not undefined (Jonathan Reem) +### url -* streams: set default hwm properly for Duplex (Andrew Oppenlander) +https://iojs.org/api/url.html -* string_bytes: ucs2 support big endian (Andrew Low) +- Added support for `path` option in `url.format`, which encompasses `pathname`, `query`, and `search`. +- Improved escaping of certain characters. +- Improved parsing speed. -* tls, crypto: add DHE support (Shigeki Ohtsu) +### util -* tls: `checkServerIdentity` option (Trevor Livingston) +https://iojs.org/api/util.html -* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu) +- Added `util.debuglog`. +- Added a plethora of new type-testing methods. See [the docs](https://iojs.org/api/util.html). +- Updated `util.format` to receive several changes: + - `-0` is now displayed as such, instead of as `0`. + - Anything that is `instanceof Error` is now formatted as an error. + - Circular references in JavaScript objects are now handled for the `%j` specifier. + - Custom `inspect` functions are now allowed to return an object. + - Custom `inspect` functions now receive any arguments passed to `util.inspect`. -* tls: better error reporting at cert validation (Fedor Indutny) +## v8 -* tls: support multiple keys/certs (Fedor Indutny) +https://iojs.org/api/v8.html -* tls: throw an error, not string (Jackson Tian) +`v8` is a new core module for interfacing directly with the V8 engine. -* udp: make it possible to receive empty udp packets (Andrius Bentkus) +### vm + +https://iojs.org/api/vm.html + +The `vm` module has been rewritten to work better, based on the excellent [Contextify](https://github.com/brianmcd/contextify) native module. All of the functionality of Contextify is now in core, with improvements! + +- Added `vm.isContext(object)` method to determine whether `object` has been contextified. +- Added `vm.runInDebugContext(code)` method to compile and execute `code` inside the V8 debug context. +- Updated `vm.createContext(sandbox)` to "contextify" the sandbox, making it suitable for use as a global for `vm` scripts, and then return it. It no longer creates a separate context object. +- Updated most `vm` and `vm.Script` methods to accept an `options` object, allowing you to configure a timeout for the script, the error display behavior, and sometimes the filename (for stack traces). +- Updated the supplied sandbox object to be used directly as the global, remove error-prone copying of properties back and forth between the supplied sandbox object and the global that appears inside the scripts run by the `vm` module. + +For more information, see the `vm` documentation linked above. + +### zlib + +https://iojs.org/api/zlib.html + +- Added support for `zlib.flush` to specify a particular flush method (defaulting to `Z_FULL_FLUSH`). +- Added support for `zlib.params` to dynamically update the compression level and strategy when deflating. +- Added synchronous versions of the zlib methods. + +### C++ API Changes + +https://iojs.org/api/addons.html + +In general it is recommended that you use [NAN](https://github.com/rvagg/nan) as a compatibility layer for your addons. This will also help with future changes in the V8 and Node/io.js C++ API. Most of the following changes are already handled by NAN-specific wrappers. + +#### V8 highlights + +- Exposed method signature has changed from `Handle Method(const Arguments& args)` to `void Method(const v8::FunctionCallbackInfo& args)` with the newly introduced `FunctionCallbackInfo` also taking the return value via `args.GetReturnValue().Set(value)` instead of `scope.Close(value)`, `Arguments` has been removed. +- Exposed setter signature has changed from `void Setter(Local property, Local value, const v8::AccessorInfo& args)` `void Setter(Local property, Local value, const v8::PropertyCallbackInfo& args)`. +- Exposed getter signature has changed from `void Getter(Local property, Local value, const v8::AccessorInfo& args)` `void Setter(Local property, Local value, const v8::PropertyCallbackInfo& args)`. +- Exposed property setter signature has changed from `Handle Setter(Local property, Local value, const v8::AccessorInfo& args)` `void Setter(Local property, Local value, const v8::PropertyCallbackInfo& args)`. +- Exposed property getter signature has changed from `Handle Getter(Local property, Local value, const v8::AccessorInfo& args)` `void Setter(Local property, Local value, const v8::PropertyCallbackInfo& args)`. +- Similar changes have been made to property enumerators, property deleters, property query, index getter, index setter, index enumerator, index deleter, index query. +- V8 objects instantiated in C++ now require an `Isolate*` argument as the first argument. In most cases it is OK to simply pass `v8::Isolate::GetCurrent()`, e.g. `Date::New(Isolate::GetCurrent(), time)`, or `String::NewFromUtf8(Isolate::GetCurrent(), "foobar")`. +- `HandleScope scope` now requires an `Isolate*` argument, i.e. `HandleScope scope(isolate)`, in most cases `v8::Isolate::GetCurrent()` is OK. +- Similar changes have been made to `Locker` and `Unlocker`. +- V8 objects that need to "escape" a scope should be enclosed in a `EscapableHandleScope` rather than a `HandleScope` and should be returned with `scope.Escape(value)`. +- Exceptions are now thrown from isolates with `isolate->ThrowException(ExceptionObject)`. +- `Context::GetCurrent()` must now be done on an isolate, e.g. `Isolate::GetCurrent()->GetCurrentContext()`. +- `String::NewSymbol()` has been removed, use plain strings instead. +- `String::New()` has been removed, use `String::NewFromUtf8()` instead. +- `Persistent` objects no longer inherit from `Handle` and cannot be instantiated with another object. Instead, the `Persistent` should simply be declared, e.g. `Persistent handle` and then have a `Local` assigned to it with `handle.Reset(isolate, value)`. To get a `Local` from a `Persistent` you must instantiate it as the argument, i.e. `Local::New(Isolate*, Persistent)`. +#### Node / io.js + +- Updated `node::Buffer::New()` to return a `Handle` directly so you no longer need to fetch the `handle_` property. +- Updated `node::MakeCallback()` to require an `Isolate*` as the first argument. Generally `Isolate::GetCurrent()` will be OK for this. + + +-------------------------------------- + +**The changelog below was inherited from joyent/node prior to the io.js fork.** + + +## 2014.09.24, Version 0.11.14 (Unstable) + +* uv: Upgrade to v1.0.0-rc1 +* http_parser: Upgrade to v2.3.0 +* npm: Upgrade to v2.0.0 +* openssl: Upgrade to v1.0.1i +* v8: Upgrade to 3.26.33 +* Add fast path for simple URL parsing (Gabriel Wicke) +* Added support for options parameter in console.dir() (Xavi Magrinyà) +* Cluster: fix shared handles on Windows (Alexis Campailla) +* buffer: Fix incorrect Buffer.compare behavior (Feross Aboukhadijeh) +* buffer: construct new buffer from buffer toJSON() output (cjihrig) +* buffer: improve Buffer constructor (Kang-Hao Kenny) +* build: linking CoreFoundation framework for OSX (Thorsten Lorenz) +* child_process: accept uid/gid everywhere (Fedor Indutny) +* child_process: add path to spawn ENOENT Error (Ryan Cole) +* child_process: copy spawnSync() cwd option to proper buffer (cjihrig) +* child_process: do not access stderr when stdio set to 'ignore' (cjihrig) +* child_process: don't throw on EAGAIN (Charles) +* child_process: don't throw on EMFILE/ENFILE (Ben Noordhuis) +* child_process: use full path for cmd.exe on Win32 (Ed Morley) +* cluster: allow multiple calls to setupMaster() (Ryan Graham) +* cluster: centralize removal from workers list. (Julien Gilli) +* cluster: enable error/message events using .worker (cjihrig) +* cluster: include settings object in 'setup' event (Ryan Graham) +* cluster: restore v0.10.x setupMaster() behaviour (Ryan Graham) +* cluster: support options in Worker constructor (cjihrig) +* cluster: test events emit on cluster.worker (Sam Roberts) +* console: console.dir() accepts options object (Xavi Magrinyà) +* crypto: add `honorCipherOrder` argument (Fedor Indutny) +* crypto: allow padding in RSA methods (Fedor Indutny) +* crypto: clarify RandomBytes() error msg (Mickael van der Beek) +* crypto: never store pointer to conn in SSL_CTX (Fedor Indutny) +* crypto: unsigned value can't be negative (Brian White) +* dgram: remove new keyword from errnoException (Jackson Tian) +* dns: always set variable family in lookup() (cjihrig) +* dns: include host name in error message if available (Maciej Małecki) +* dns: introduce lookupService function (Saúl Ibarra Corretgé) +* dns: send lookup c-ares errors to callback (Chris Dickinson) +* dns: throw if hostname is not string or falsey (cjihrig) +* events: Output the event that is leaking (Arnout Kazemier) +* fs: close file if fstat() fails in readFile() (cjihrig) +* fs: fs.readFile should not throw uncaughtException (Jackson Tian) +* http: add 308 status_code, see RFC7238 (Yazhong Liu) +* http: don't default OPTIONS to chunked encoding (Nick Muerdter) +* http: fix bailout for writeHead (Alex Kocharin) +* http: remove unused code block (Fedor Indutny) +* http: write() after end() emits an error. (Julien Gilli) +* lib, src: add vm.runInDebugContext() (Ben Noordhuis) +* lib: noisy deprecation of child_process customFds (Ryan Graham) +* module: don't require fs several times (Robert Kowalski) +* net,dgram: workers can listen on exclusive ports (cjihrig) +* net,stream: add isPaused, don't read() when paused (Chris Dickinson) +* net: Ensure consistent binding to IPV6 if address is absent (Raymond Feng) +* net: add remoteFamily for socket (Jackson Tian) +* net: don't emit listening if handle is closed (Eli Skeggs) +* net: don't prefer IPv4 addresses during resolution (cjihrig) +* net: don't throw on net.Server.close() (cjihrig) +* net: reset `errorEmitted` on reconnect (Ed Umansky) +* node: set names for prototype methods (Trevor Norris) +* node: support v8 microtask queue (Vladimir Kurchatkin) +* path: fix slice OOB in trim (Lucio M. Tato) +* path: isAbsolute() should always return boolean (Herman Lee) +* process: throw TypeError if kill pid not a number (Sam Roberts) +* querystring: custom encode and decode (fengmk2) +* querystring: do not add sep for empty array (cjihrig) +* querystring: remove prepended ? from query field (Ezequiel Rabinovich) +* readline: fix close event of readline.Interface() (Yazhong Liu) +* readline: fixes scoping bug (Dan Kaplun) +* readline: implements keypress buffering (Dan Kaplun) +* repl: fix multi-line input (Fedor Indutny) +* repl: fix overwrite for this._prompt (Yazhong Liu) +* repl: proper `setPrompt()` and `multiline` support (Fedor Indutny) +* stream: don't try to finish if buffer is not empty (Vladimir Kurchatkin) +* stream: only end reading on null, not undefined (Jonathan Reem) +* streams: set default hwm properly for Duplex (Andrew Oppenlander) +* string_bytes: ucs2 support big endian (Andrew Low) +* tls, crypto: add DHE support (Shigeki Ohtsu) +* tls: `checkServerIdentity` option (Trevor Livingston) +* tls: add DHE-RSA-AES128-SHA256 to the def ciphers (Shigeki Ohtsu) +* tls: better error reporting at cert validation (Fedor Indutny) +* tls: support multiple keys/certs (Fedor Indutny) +* tls: throw an error, not string (Jackson Tian) +* udp: make it possible to receive empty udp packets (Andrius Bentkus) * url: treat \ the same as / (isaacs) +## 2014.05.01, Version 0.11.13 (Unstable) -2014.05.01, Version 0.11.13 (Unstable), 99c9930ad626e2796af23def7cac19b65c608d18 +https://github.com/iojs/io.js/commit/99c9930ad626e2796af23def7cac19b65c608d18 * v8: upgrade to 3.24.35.22 - * buffer: add compare and equals methods (Sean McArthur) - * buffer: improve {read,write}{U}Int* methods (Nick Apperson) - * buffer: return uint if MSB is 1 in readUInt32 (goussardg) - * buffer: truncate buffer after string decode (Fedor Indutny) - * child_process: fix assertion error in spawnSync (Shigeki Ohtsu) - * crypto: fix memory leak in CipherBase::Final (Fedor Indutny) - * crypto: improve error messages (Ingmar Runge) - * crypto: move `createCredentials` to tls (Fedor Indutny) - * crypto: work around OpenSSL oddness (Fedor Indutny) - * dgram: introduce `reuseAddr` option (Fedor Indutny) - * domain: don't crash on "throw null" (Alex Kocharin) - * events: check if _events is an own property (Vladimir Kurchatkin) - * fs: improve performance of all stat functions (James Pickard) - * fs: return blksize on stats object (Trevor Norris) - * http: add request.flush() method (Ben Noordhuis) - * http: better client "protocol not supported" error (Nathan Rajlich) - * http: use defaultAgent.protocol in protocol check (Nathan Rajlich) - * main: Handle SIGINT properly. (Geir Hauge) - * net: bind to `::` TCP address by default (Fedor Indutny) - * readline: consider newlines for cursor position (Yazhong Liu) - * stream: split `objectMode` for Duplex (Vladimir Kurchatkin) - * tls: `getPeerCertificate(detailed)` (Fedor Indutny) - * tls: do not call SNICallback unless present (Fedor Indutny) - * tls: force readable/writable to `true` (Fedor Indutny) - * tls: support OCSP on client and server (Fedor Indutny) - * util: made util.isArray a direct alias for Array.isArray (Evan Carroll) +## 2014.03.11, Version 0.11.12 (Unstable) -2014.03.11, Version 0.11.12 (Unstable), 7d6b8db40f32e817ff145b7cfe6b3aec3179fba7 +https://github.com/iojs/io.js/commit/7d6b8db40f32e817ff145b7cfe6b3aec3179fba7 * uv: Upgrade to v0.11.22 (Timothy J Fontaine) - * buffer: allow toString to accept Infinity for end (Brian White) - * child_process: add spawnSync/execSync (Bert Belder, Timothy J Fontaine) - * cluster: handle bind errors on Windows (Alexis Campailla) - * contextify: handle infinite recursion errors (Fedor Indutny) - * crypto: allow custom generator for DiffieHellman (Brian White) - * crypto: allow setting add'l authenticated data (Brian White) - * crypto: fix CipherFinal return value check (Brian White) - * crypto: make NewSessionDoneCb public (Fedor Indutny) - * dgram: pass the bytes sent to the send callback (Timothy J Fontaine) - * dns: validate arguments in resolver (Kenan Sulayman) - * dns: verify argument is valid function in resolve (Kenan Sulayman) - * http: avoid duplicate keys in writeHead (David Björklund) - * net: add localPort to connect options (Timothy J Fontaine) - * node: do not print SyntaxError hints to stderr (Fedor Indutny) - * node: invoke `beforeExit` again if loop was active (Fedor Indutny) - * node: make AsyncListenerInst field more explicit (Trevor Norris) - * os: networkInterfaces include scopeid for ipv6 (Xidorn Quan) - * process: allow changing `exitCode` in `on('exit')` (Fedor Indutny) - * readline: fix `line` event, if input emit 'end' (Yazhong Liu) - * src: add tracing.v8.on('gc') statistics hooks (Ben Noordhuis) - * src: add v8.getHeapStatistics() function (Ben Noordhuis) - * src: emit 'beforeExit' event on process object (Ben Noordhuis) - * src: move AsyncListener from process to tracing (Trevor Norris) - * tls: fix crash in SNICallback (Fedor Indutny) - * tls: introduce asynchronous `newSession` (Fedor Indutny) - * util: show meaningful values for boxed primitives (Nathan Rajlich) - * vm: don't copy Proxy object from parent context (Ben Noordhuis) - * windows: make stdout/sterr pipes blocking (Alexis Campailla) - * zlib: add sync versions for convenience methods (Nikolai Vavilov) +## 2014.01.29, Version 0.11.11 (Unstable) -2014.01.29, Version 0.11.11 (Unstable), b46e77421581ea358e221a8a843d057c747f7e90 +https://github.com/iojs/io.js/commit/b46e77421581ea358e221a8a843d057c747f7e90 * v8: Upgrade to 3.22.24.19 - * http_parser: Upgrade to 2.2.1 - * openssl: Upgrade to 1.0.1f - * uv: Upgrade to 0.11.18 - * async-listener: revamp of subsystem (Trevor Norris) - * node: do not ever close stdio (Fedor Indutny) - * http: use writev on chunked encoding (Trevor Norris) - * async_wrap/timers: remove Add/RemoveAsyncListener (Trevor Norris) - * child_process: better error reporting for exec (Fedor Indutny) - * crypto: add newline to cert and key if not present (Fedor Indutny) - * crypto: clear error in GetPeerCertificate (Fedor Indutny) - * crypto: honor default ciphers in client mode (Jacob Hoffman-Andrews) - * crypto: introduce .setEngine(engine, [flags]) (Fedor Indutny) - * crypto: support custom pbkdf2 digest methods (Ben Noordhuis) - * domain: fix off-by-one in Domain.exit() (Ryan Graham) - * http: concatenate duplicate headers by default (Alex Kocharin) - * http: do not emit EOF non-readable socket (Fedor Indutny) - * node: fix argument parsing with -p arg (Alexis Campailla) - * path: improve POSIX path.join() performance (Jo Liss) - * tls: emit `clientError` on early socket close (Fedor Indutny) - * tls: introduce `.setMaxSendFragment(size)` (Fedor Indutny) - * tls: make cert/pfx optional in tls.createServer() (Ben Noordhuis) - * tls: process accumulated input (Fedor Indutny) - * tls: show human-readable error messages (Ben Noordhuis) - * util: handle escaped forward slashes correctly (Tom Gallacher) +## 2013.12.31, Version 0.11.10 (Unstable) -2013.12.31, Version 0.11.10 (Unstable), 66931791f06207d1cdfea5ec1529edf3c94026d3 +https://github.com/iojs/io.js/commit/66931791f06207d1cdfea5ec1529edf3c94026d3 * http_parser: update to 2.2 - * uv: Upgrade to v0.11.17 - * v8: Upgrade to 3.22.24.10 - * buffer: optimize writeInt* methods (Paul Loyd) - * child_process: better error handling (Alexis Campailla) - * cluster: do not synchronously emit 'setup' event (Sam Roberts) - * cluster: restore backwards compatibility and various fixes (Sam Roberts) - * crypto: remove unnecessary OpenSSL_add_all_digests (Yorkie) - * crypto: support GCM authenticated encryption mode. (Ingmar Runge) - * dns: add resolveSoa and 'SOA' rrtype (Tuğrul Topuz) - * events: move EE c'tor guts to EventEmitter.init (Bert Belder) - * http: DELETE shouldn't default to chunked encoding (Lalit Kapoor) - * http: parse the status message in a http response. (Cam Swords) - * node: fix removing AsyncListener in callback (Vladimir Kurchatkin) - * node: follow specification, zero-fill ArrayBuffers (Trevor Norris) - * openssl: use ASM optimized routines (Fedor Indutny) - * process: allow nextTick infinite recursion (Trevor Norris) - * querystring: remove `name` from `stringify()` (Yorkie) - * timers: setImmediate v8 optimization fix (pflannery) - * tls: add serialNumber to getPeerCertificate() (Ben Noordhuis) - * tls: reintroduce socket.encrypted (Fedor Indutny) - * tls: fix handling of asterisk in SNI context (Fedor Indutny) - * util: Format negative zero as '-0' (David Chan) - * vm: fix race condition in timeout (Alexis Campailla) - * windows: fix dns lookup of localhost with ipv6 (Alexis Campailla) +## 2013.11.20, Version 0.11.9 (Unstable) -2013.11.20, Version 0.11.9 (Unstable), dcfd032bdd69dfb38c120e18438d6316ae522edc +https://github.com/iojs/io.js/commit/dcfd032bdd69dfb38c120e18438d6316ae522edc * uv: upgrade to v0.11.15 (Timothy J Fontaine) - * v8: upgrade to 3.22.24.5 (Timothy J Fontaine) - * buffer: remove warning when no encoding is passed (Trevor Norris) - * build: make v8 use random seed for hash tables (Ben Noordhuis) - * crypto: build with shared openssl without NPN (Ben Noordhuis) - * crypto: update root certificates (Ben Noordhuis) - * debugger: pass on v8 debug switches (Ben Noordhuis) - * domain: use AsyncListener API (Trevor Norris) - * fs: add recursive subdirectory support to fs.watch (Nick Simmons) - * fs: make fs.watch() non-recursive by default (Ben Noordhuis) - * http: cleanup freeSockets when socket destroyed (fengmk2) - * http: force socket encoding to be null (isaacs) - * http: make DELETE requests set `req.method` (Nathan Rajlich) - * node: add AsyncListener support (Trevor Norris) - * src: remove global HandleScope that hid memory leaks (Ben Noordhuis) - * tls: add ECDH ciphers support (Erik Dubbelboer) - * tls: do not default to 'localhost' servername (Fedor Indutny) - * tls: more accurate wrapping of connecting socket (Fedor Indutny) +## 2013.10.30, Version 0.11.8 (Unstable) -2013.10.30, Version 0.11.8 (Unstable), f8d86e24f3463c36f7f3f4c3b3ec779e5b6201e1 +https://github.com/iojs/io.js/commit/f8d86e24f3463c36f7f3f4c3b3ec779e5b6201e1 * uv: Upgrade to v0.11.14 - * v8: upgrade 3.21.18.3 - * assert: indicate if exception message is generated (Glen Mailer) - * buffer: add buf.toArrayBuffer() API (Trevor Norris) - * cluster: fix premature 'disconnect' event (Ben Noordhuis) - * crypto: add SPKAC support (Jason Gerfen) - * debugger: count space for line numbers correctly (Alex Kocharin) - * debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis) - * debugger: repeat last command (Alex Kocharin) - -* debugger: show current line, fix for #6150 (Alex Kocharin) - +* debugger: show current line, fix for [#6150](https://github.com/joyent/node/issues/6150) (Alex Kocharin) * dgram: send() can accept strings (Trevor Norris) - * dns: rename domain to hostname (Ben Noordhuis) - * dns: set hostname property on error object (Ben Noordhuis) - * dtrace, mdb_v8: support more string, frame types (Dave Pacheco) - * http: add statusMessage (Patrik Stutz) - * http: expose supported methods (Ben Noordhuis) - * http: provide backpressure for pipeline flood (isaacs) - * process: Add exitCode property (isaacs) - * tls: socket.renegotiate(options, callback) (Fedor Indutny) - * util: format as Error if instanceof Error (Rod Vagg) +## 2013.08.21, Version 0.11.7 (Unstable) -2013.08.21, Version 0.11.7 (Unstable), be52549bfa5311208b5fcdb3ba09210460fa9ceb +https://github.com/iojs/io.js/commit/be52549bfa5311208b5fcdb3ba09210460fa9ceb * uv: upgrade to v0.11.13 - * v8: upgrade to 3.20.17 - * buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine) - * buffer: fix regression for large buffer creation (Trevor Norris) - * buffer: don't throw if slice length too long (Trevor Norris) - * buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis) - * cli: remove --max-stack-size (Ben Noordhuis) - * cli: unknown command line options are errors (Ben Noordhuis) - * child_process: exec accept buffer as an encoding (Seth Fitzsimmons) - * crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis) - * domain: deprecate domain.dispose(). (Forrest L Norvell) - * fs: Expose birthtime on stat objects (isaacs) - * http: Only send connection:keep-alive if necessary (isaacs) - * repl: Catch syntax errors better (isaacs, Nathan Rajlich) - * stream: change default highWaterMark for objectMode to 16 (Mathias Buus) - * stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs) - * util: pass opts to custom inspect functions (Timothy J Fontaine) - * vm: rewritten to behave like Contextify (Domenic Denicola) +## 2013.08.21, Version 0.11.6 (Unstable) -2013.08.21, Version 0.11.6 (Unstable), 04018d4b3938fd30ba14822e79195e4af2be36f6 +https://github.com/iojs/io.js/commit/04018d4b3938fd30ba14822e79195e4af2be36f6 * uv: Upgrade to v0.11.8 - * v8: upgrade v8 to 3.20.14.1 - * build: disable SSLv2 by default (Ben Noordhuis) - * build: don't auto-destroy existing configuration (Ben Noordhuis) - * crypto: add TLS 1.1 and 1.2 to secureProtocol list (Matthias Bartelmeß) - * crypto: fix memory leak in randomBytes() error path (Ben Noordhuis) - * dgram: don't call into js when send cb is omitted (Ben Noordhuis) - * dgram: fix regression in string argument handling (Ben Noordhuis) - * domains: performance improvements (Trevor Norris) - * events: EventEmitter = require('events') (Jake Verbaten) - * http: Add write()/end() callbacks (isaacs) - * http: Consistent 'finish' event semantics (isaacs) - * http: Prefer 'binary' over 'ascii' (isaacs) - * http: Support legacy agent.addRequest API (isaacs) - * http: Write hex/base64 chunks properly (isaacs) - * http: add agent.maxFreeSockets option (isaacs) - * http: provide access to raw headers/trailers (isaacs) - * http: removed headers stay removed (James Halliday) - * http,timers: improve callback performance (Ben Noordhuis) - * net: family option in net.connect (Vsevolod Strukchinsky) - * readline: pause stdin before turning off terminal raw mode (Daniel Chatfield) - * smalloc: allow different external array types (Trevor Norris) - * smalloc: expose ExternalArraySize (Trevor Norris) - * stream: Short-circuit buffer pushes when flowing (isaacs) - * tls: handle errors on socket before releasing it (Fedor Indutny) - * util: fix isPrimitive check (Trevor Norris) - * util: isObject should always return boolean (Trevor Norris) +## 2013.08.06, Version 0.11.5 (Unstable) -2013.08.06, Version 0.11.5 (Unstable), 6f92da2dd106b0c63fde563284f83e08e2a521b5 +https://github.com/iojs/io.js/commit/6f92da2dd106b0c63fde563284f83e08e2a521b5 * v8: upgrade to 3.20.11 - * uv: upgrade to v0.11.7 - * buffer: return offset for end of last write (Trevor Norris) - * build: embed the mdb_v8.so into the binary (Timothy J Fontaine) - * build: fix --without-ssl build (Ben Noordhuis) - * child_process: add 'shell' option to .exec() (Ben Noordhuis) - * dgram: report send errors to cb, don't pass bytes (Ben Noordhuis) - * fs: write strings directly to disk (Trevor Norris) - * https: fix default port (Koichi Kobayashi) - * openssl: use asm for sha, md5, rmd (Fedor Indutny) - * os: add mac address to networkInterfaces() output (Brian White) - * smalloc: introduce smalloc module (Trevor Norris) - * stream: Simplify flowing, passive data listening (streams3) (isaacs) - * tls: asynchronous SNICallback (Fedor Indutny) - * tls: share tls tickets key between cluster workers (Fedor Indutny) - * util: don't throw on circular %j input to format() (Ben Noordhuis) +## 2013.07.12, Version 0.11.4 (Unstable) -2013.07.12, Version 0.11.4 (Unstable), b5b84197ed037918fd1a26e5cb87cce7c812ca55 +https://github.com/iojs/io.js/commit/b5b84197ed037918fd1a26e5cb87cce7c812ca55 * npm: Upgrade to 1.3.4 - * v8: Upgrade to v3.20.2 - * c-ares: Upgrade to piscisaureus/cares@805d153 - * timers: setImmediate process full queue each turn (Ben Noordhuis) - * http: Add agent.get/request methods (isaacs) - * http: Proper KeepAlive behavior (isaacs) - * configure: fix the --without-ssl option (Nathan Rajlich) - * buffer: propagate originating parent (Trevor Norris) - * tls_wrap: return Error not throw for missing cert (Timothy J Fontaine) - * src: enable native v8 typed arrays (Ben Noordhuis) - * stream: objectMode transform should allow falsey values (Jeff Barczewski) - * slab_allocator: remove SlabAllocator (Trevor Norris) - * crypto: fix memory leak in LoadPKCS12 (Fedor Indutny) - * tls: export TLSSocket (Fedor Indutny) - * zlib: allow changing of level and strategy (Brian White) - * zlib: allow custom flush type for flush() (Brian White) +## 2013.06.26, Version 0.11.3 (Unstable) -2013.06.26, Version 0.11.3 (Unstable), 38c0c47bbe280ddc42054418091571e532d82a1e +https://github.com/iojs/io.js/commit/38c0c47bbe280ddc42054418091571e532d82a1e * uv: Upgrade to v0.11.5 - * c-ares: upgrade to 1.10.0 - * v8: upgrade to v3.19.13 - * punycode: update to v1.2.3 (Mathias Bynens) - * debugger: break on uncaught exception (Miroslav Bajtos) - * child_process: emit 'disconnect' asynchronously (Ben Noordhuis) - * dtrace: enable uv's probes if enabled (Timothy J Fontaine) - * dtrace: unify dtrace and systemtap interfaces (Timothy J Fontaine) - * buffer: New API for backing data store (Trevor Norris) - * buffer: return `this` in fill() for chainability (Brian White) - * build: fix include order for building on windows (Timothy J Fontaine) - * build: add android support (Linus Mårtensson) - * readline: strip ctrl chars for prompt width calc (Krzysztof Chrapka) - * tls: introduce TLSSocket based on tls_wrap binding (Fedor Indutny) - * tls: add localAddress and localPort properties (Ben Noordhuis) - * crypto: free excessive memory in NodeBIO (Fedor Indutny) - * process: remove maxTickDepth (Trevor Norris) - * timers: use uv_now instead of Date.now (Timothy J Fontaine) - * util: Add debuglog, deprecate console lookalikes (isaacs) - * module: use path.sep instead of a custom solution (Robert Kowalski) - * http: don't escape request path, reject bad chars (Ben Noordhuis) - * net: emit dns 'lookup' event before connect (Ben Noordhuis) - * dns: add getServers and setServers (Timothy J Fontaine) +## 2013.05.13, Version 0.11.2 (Unstable) -2013.05.13, Version 0.11.2 (Unstable), 5d3dc0e4c3369dfb00b7b13e08936c2e652fa696 +https://github.com/iojs/io.js/commit/5d3dc0e4c3369dfb00b7b13e08936c2e652fa696 * uv: Upgrade to 0.11.2 - * V8: Upgrade to 3.19.0 - * npm: Upgrade to 1.2.21 - * build: Makefile should respect configure --prefix (Timothy J Fontaine) - * cluster: use round-robin load balancing (Ben Noordhuis) - * debugger, cluster: each worker has new debug port (Miroslav Bajtoš) - * debugger: `restart` with custom debug port (Miroslav Bajtoš) - * debugger: breakpoints in scripts not loaded yet (Miroslav Bajtoš) - * event: EventEmitter#setMaxListeners() returns this (Sam Roberts) - * events: add EventEmitter.defaultMaxListeners (Ben Noordhuis) - * install: Support $(PREFIX) install target directory prefix (Olof Johansson) - * os: Include netmask in os.networkInterfaces() (Ben Kelly) - * path: add path.isAbsolute(path) (Ryan Doenges) - * stream: Guarantee ordering of 'finish' event (isaacs) - * streams: introduce .cork/.uncork/._writev (Fedor Indutny) - * vm: add support for timeout argument (Andrew Paprocki) +## 2013.04.19, Version 0.11.1 (Unstable) -2013.04.19, Version 0.11.1 (Unstable), 4babd2b46ebf9fbea2c9946af5cfae25a33b2b22 +https://github.com/iojs/io.js/commit/4babd2b46ebf9fbea2c9946af5cfae25a33b2b22 * V8: upgrade to 3.18.0 - * uv: Upgrade to v0.11.1 - * http: split into multiple separate modules (Timothy J Fontaine) - * http: escape unsafe characters in request path (Ben Noordhuis) - * url: Escape all unwise characters (isaacs) - * build: depend on v8 postmortem-metadata if enabled (Paddy Byers) - * etw: update prototypes to match dtrace provider (Timothy J Fontaine) - * buffer: change output of Buffer.prototype.toJSON() (David Braun) - * dtrace: actually use the _handle.fd value (Timothy J Fontaine) - * dtrace: pass more arguments to probes (Dave Pacheco) - * build: allow building with dtrace on osx (Dave Pacheco) - * zlib: allow passing options to convenience methods (Kyle Robinson Young) +## 2013.03.28, Version 0.11.0 (Unstable) -2013.03.28, Version 0.11.0 (Unstable), bce38b3d74e64fcb7d04a2dd551151da6168cdc5 +https://github.com/iojs/io.js/commit/bce38b3d74e64fcb7d04a2dd551151da6168cdc5 * V8: update to 3.17.13 - * os: use %SystemRoot% or %windir% in os.tmpdir() (Suwon Chae) - * util: fix util.inspect() line width calculation (Marcin Kostrzewa) - * buffer: remove _charsWritten (Trevor Norris) - * fs: uv_[fl]stat now reports subsecond resolution (Timothy J Fontaine) - * fs: Throw if error raised and missing callback (bnoordhuis) - * tls: expose SSL_CTX_set_timeout via tls.createServer (Manav Rathi) - * tls: remove harmful unnecessary bounds checking (Marcel Laverdet) - * buffer: write ascii strings using WriteOneByte (Trevor Norris) - * dtrace: fix generation of v8 constants on freebsd (Fedor Indutny) - * dtrace: x64 ustack helper (Fedor Indutny) - * readline: handle wide characters properly (Nao Iizuka) - * repl: Use a domain to catch async errors safely (isaacs) - * repl: emit 'reset' event when context is reset (Sami Samhuri) - * util: custom `inspect()` method may return an Object (Nathan Rajlich) - * console: `console.dir()` bypasses inspect() methods (Nathan Rajlich) +## 2014.12.22, Version 0.10.35 (Stable) -2014.09.16, Version 0.10.32 (Stable) +* tls: re-add 1024-bit SSL certs removed by f9456a2 (Chris Dickinson) +* timers: don't close interval timers when unrefd (Julien Gilli) +* timers: don't mutate unref list while iterating it (Julien Gilli) -* npm: Update to 1.4.28 +## 2014.12.17, Version 0.10.34 (Stable) -* v8: fix a crash introduced by previous release (Fedor Indutny) +https://github.com/iojs/io.js/commit/52795f8fcc2de77cf997e671ea58614e5e425dfe -* configure: add --openssl-no-asm flag (Fedor Indutny) +* uv: update to v0.10.30 +* zlib: upgrade to v1.2.8 +* child_process: check execFile args is an array (Sam Roberts) +* child_process: check fork args is an array (Sam Roberts) +* crypto: update root certificates (Ben Noordhuis) +* domains: fix issues with abort on uncaught (Julien Gilli) +* timers: Avoid linear scan in _unrefActive. (Julien Gilli) +* timers: fix unref() memory leak (Trevor Norris) +* v8: add api for aborting on uncaught exception (Julien Gilli) +* debugger: fix when using "use strict" (Julien Gilli) -* crypto: use domains for any callback-taking method (Chris Dickinson) +## 2014.10.20, Version 0.10.33 (Stable) -* http: do not send `0\r\n\r\n` in TE HEAD responses (Fedor Indutny) +https://github.com/iojs/io.js/commit/8d045a30e95602b443eb259a5021d33feb4df079 -* querystring: fix unescape override (Tristan Berger) +* openssl: Update to 1.0.1j (Addressing multiple CVEs) +* uv: Update to v0.10.29 +* child_process: properly support optional args (cjihrig) +* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny, + Timothy J Fontaine, Alexis Campailla) + This is a behavior change, by default we will not allow the negotiation to + SSLv2 or SSLv3. If you want this behavior, run Node.js with either + `--enable-ssl2` or `--enable-ssl3` respectively. + This does not change the behavior for users specifically requesting + `SSLv2_method` or `SSLv3_method`. While this behavior is not advised, it is + assumed you know what you're doing since you're specifically asking to use + these methods. + +## 2014.09.16, Version 0.10.32 (Stable) +https://github.com/iojs/io.js/commit/0fe0d121551593c23a565db8397f85f17bb0f00e + +* npm: Update to 1.4.28 +* v8: fix a crash introduced by previous release (Fedor Indutny) +* configure: add --openssl-no-asm flag (Fedor Indutny) +* crypto: use domains for any callback-taking method (Chris Dickinson) +* http: do not send `0\r\n\r\n` in TE HEAD responses (Fedor Indutny) +* querystring: fix unescape override (Tristan Berger) * url: Add support for RFC 3490 separators (Mathias Bynens) +## 2014.08.19, Version 0.10.31 (Stable) -2014.08.19, Version 0.10.31 (Stable), 7fabdc23d843cb705d2d0739e7bbdaaf50aa3292 +https://github.com/iojs/io.js/commit/7fabdc23d843cb705d2d0739e7bbdaaf50aa3292 * v8: backport CVE-2013-6668 - * openssl: Update to v1.0.1i - * npm: Update to v1.4.23 - * cluster: disconnect should not be synchronous (Sam Roberts) - * fs: fix fs.readFileSync fd leak when get RangeError (Jackson Tian) - * stream: fix Readable.wrap objectMode falsy values (James Halliday) - * timers: fix timers with non-integer delay hanging. (Julien Gilli) +## 2014.07.31, Version 0.10.30 (Stable) -2014.07.31, Version 0.10.30 (Stable), bc0ff830aff1e016163d855e86ded5c98b0899e8 +https://github.com/iojs/io.js/commit/bc0ff830aff1e016163d855e86ded5c98b0899e8 * uv: Upgrade to v0.10.28 - * npm: Upgrade to v1.4.21 - * v8: Interrupts must not mask stack overflow. - * Revert "stream: start old-mode read in a next tick" (Fedor Indutny) - * buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny) - * buffer: improve {read,write}{U}Int* methods (Nick Apperson) - * child_process: handle writeUtf8String error (Fedor Indutny) - * deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny) - * deps: cherry-pick eca441b2 from OpenSSL (Fedor Indutny) - * lib: remove and restructure calls to isNaN() (cjihrig) - * module: eliminate double `getenv()` (Maciej Małecki) - * stream2: flush extant data on read of ended stream (Chris Dickinson) - * streams: remove unused require('assert') (Rod Vagg) - * timers: backport f8193ab (Julien Gilli) - * util.h: interface compatibility (Oguz Bastemur) - * zlib: do not crash on write after close (Fedor Indutny) +## 2014.06.05, Version 0.10.29 (Stable) -2014.06.05, Version 0.10.29 (Stable), ce82d6b8474bde7ac7df6d425fb88fb1bcba35bc +https://github.com/iojs/io.js/commit/ce82d6b8474bde7ac7df6d425fb88fb1bcba35bc * openssl: to 1.0.1h (CVE-2014-0224) - * npm: upgrade to 1.4.14 - * utf8: Prevent Node from sending invalid UTF-8 (Felix Geisendörfer) - *NOTE* this introduces a breaking change, previously you could construct invalid UTF-8 and invoke an error in a client that was expecting valid @@ -870,1166 +928,761 @@ environment variable set. * child_process: do not set args before throwing (Greg Sabia Tucker) - * child_process: spawn() does not throw TypeError (Greg Sabia Tucker) - * constants: export O_NONBLOCK (Fedor Indutny) - * crypto: improve memory usage (Alexis Campailla) - * fs: close file if fstat() fails in readFile() (cjihrig) - * lib: name EventEmitter prototype methods (Ben Noordhuis) - * tls: fix performance issue (Alexis Campailla) +## 2014.05.01, Version 0.10.28 (Stable) -2014.05.01, Version 0.10.28 (Stable), b148cbe09d4657766fdb61575ba985734c2ff0a8 +https://github.com/iojs/io.js/commit/b148cbe09d4657766fdb61575ba985734c2ff0a8 * npm: upgrade to v1.4.9 +## 2014.05.01, Version 0.10.27 (Stable) -2014.05.01, Version 0.10.27 (Stable), cb7911f78ae96ef7a540df992cc1359ba9636e86 +https://github.com/iojs/io.js/commit/cb7911f78ae96ef7a540df992cc1359ba9636e86 * npm: upgrade to v1.4.8 - * openssl: upgrade to 1.0.1g - * uv: update to v0.10.27 - * dns: fix certain txt entries (Fedor Indutny) - * assert: Ensure reflexivity of deepEqual (Mike Pennisi) - * child_process: fix deadlock when sending handles (Fedor Indutny) - * child_process: fix sending handle twice (Fedor Indutny) - * crypto: do not lowercase cipher/hash names (Fedor Indutny) - * dtrace: workaround linker bug on FreeBSD (Fedor Indutny) - * http: do not emit EOF non-readable socket (Fedor Indutny) - * http: invoke createConnection when no agent (Nathan Rajlich) - * stream: remove useless check (Brian White) - * timer: don't reschedule timer bucket in a domain (Greg Brail) - * url: treat \ the same as / (isaacs) - * util: format as Error if instanceof Error (Rod Vagg) +## 2014.02.18, Version 0.10.26 (Stable) -2014.02.18, Version 0.10.26 (Stable), cc56c62ed879ad4f93b1fdab3235c43e60f48b7e +https://github.com/iojs/io.js/commit/cc56c62ed879ad4f93b1fdab3235c43e60f48b7e * uv: Upgrade to v0.10.25 (Timothy J Fontaine) - * npm: upgrade to 1.4.3 (isaacs) - * v8: support compiling with VS2013 (Fedor Indutny) - * cares: backport TXT parsing fix (Fedor Indutny) - * crypto: throw on SignFinal failure (Fedor Indutny) - * crypto: update root certificates (Ben Noordhuis) - * debugger: Fix breakpoint not showing after restart (Farid Neshat) - * fs: make unwatchFile() insensitive to path (iamdoron) - * net: do not re-emit stream errors (Fedor Indutny) - * net: make Socket destroy() re-entrance safe (Jun Ma) - * net: reset `endEmitted` on reconnect (Fedor Indutny) - * node: do not close stdio implicitly (Fedor Indutny) - * zlib: avoid assertion in close (Fedor Indutny) +## 2014.01.23, Version 0.10.25 (Stable) -2014.01.23, Version 0.10.25 (Stable), b0e5f195dfce3e2b99f5091373d49f6616682596 +https://github.com/iojs/io.js/commit/b0e5f195dfce3e2b99f5091373d49f6616682596 * uv: Upgrade to v0.10.23 - * npm: Upgrade to v1.3.24 - * v8: Fix enumeration for objects with lots of properties - * child_process: fix spawn() optional arguments (Sam Roberts) - * cluster: report more errors to workers (Fedor Indutny) - * domains: exit() only affects active domains (Ryan Graham) - * src: OnFatalError handler must abort() (Timothy J Fontaine) - * stream: writes may return false but forget to emit drain (Yang Tianyang) +## 2013.12.18, Version 0.10.24 (Stable) -2013.12.18, Version 0.10.24 (Stable), b7fd6bc899ccb629d790c47aee06aba87e535c41 +https://github.com/iojs/io.js/commit/b7fd6bc899ccb629d790c47aee06aba87e535c41 * uv: Upgrade to v0.10.21 - * npm: upgrade to 1.3.21 - * v8: backport fix for CVE-2013-{6639|6640} - * build: unix install node and dep library headers (Timothy J Fontaine) - * cluster, v8: fix --logfile=%p.log (Ben Noordhuis) - * module: only cache package main (Wyatt Preul) +## 2013.12.12, Version 0.10.23 (Stable) -2013.12.12, Version 0.10.23 (Stable), 0462bc23564e7e950a70ae4577a840b04db6c7c6 +https://github.com/iojs/io.js/commit/0462bc23564e7e950a70ae4577a840b04db6c7c6 * uv: Upgrade to v0.10.20 (Timothy J Fontaine) - * npm: Upgrade to 1.3.17 (isaacs) - * gyp: update to 78b26f7 (Timothy J Fontaine) - * build: include postmortem symbols on linux (Timothy J Fontaine) - * crypto: Make Decipher._flush() emit errors. (Kai Groner) - * dgram: fix abort when getting `fd` of closed dgram (Fedor Indutny) - * events: do not accept NaN in setMaxListeners (Fedor Indutny) - * events: avoid calling `once` functions twice (Tim Wood) - * events: fix TypeError in removeAllListeners (Jeremy Martin) - * fs: report correct path when EEXIST (Fedor Indutny) - * process: enforce allowed signals for kill (Sam Roberts) - * tls: emit 'end' on .receivedShutdown (Fedor Indutny) - * tls: fix potential data corruption (Fedor Indutny) - * tls: handle `ssl.start()` errors appropriately (Fedor Indutny) - * tls: reset NPN callbacks after SNI (Fedor Indutny) +## 2013.11.12, Version 0.10.22 (Stable) -2013.11.12, Version 0.10.22 (Stable), cbff8f091c22fb1df6b238c7a1b9145db950fa65 +https://github.com/iojs/io.js/commit/cbff8f091c22fb1df6b238c7a1b9145db950fa65 * npm: Upgrade to 1.3.14 - * uv: Upgrade to v0.10.19 - * child_process: don't assert on stale file descriptor events (Fedor Indutny) - * darwin: Fix "Not Responding" in Mavericks activity monitor (Fedor Indutny) - * debugger: Fix bug in sb() with unnamed script (Maxim Bogushevich) - * repl: do not insert duplicates into completions (Maciej Małecki) - * src: Fix memory leak on closed handles (Timothy J Fontaine) - * tls: prevent stalls by using read(0) (Fedor Indutny) - * v8: use correct timezone information on Solaris (Maciej Małecki) +## 2013.10.18, Version 0.10.21 (Stable) -2013.10.18, Version 0.10.21 (Stable), e2da042844a830fafb8031f6c477eb4f96195210 +https://github.com/iojs/io.js/commit/e2da042844a830fafb8031f6c477eb4f96195210 * uv: Upgrade to v0.10.18 - * crypto: clear errors from verify failure (Timothy J Fontaine) - * dtrace: interpret two byte strings (Dave Pacheco) - * fs: fix fs.truncate() file content zeroing bug (Ben Noordhuis) - * http: provide backpressure for pipeline flood (isaacs) - * tls: fix premature connection termination (Ben Noordhuis) +## 2013.09.30, Version 0.10.20 (Stable) -2013.09.30, Version 0.10.20 (Stable), d7234c8d50a1af73f60d2d3c0cc7eed17429a481 +https://github.com/iojs/io.js/commit/d7234c8d50a1af73f60d2d3c0cc7eed17429a481 * tls: fix sporadic hang and partial reads (Fedor Indutny) - fixes "npm ERR! cb() never called!" +## 2013.09.24, Version 0.10.19 (Stable) -2013.09.24, Version 0.10.19 (Stable), 6b5e6a5a3ec8d994c9aab3b800b9edbf1b287904 +https://github.com/iojs/io.js/commit/6b5e6a5a3ec8d994c9aab3b800b9edbf1b287904 * uv: Upgrade to v0.10.17 - * npm: upgrade to 1.3.11 - * readline: handle input starting with control chars (Eric Schrock) - * configure: add mips-float-abi (soft, hard) option (Andrei Sedoi) - * stream: objectMode transforms allow falsey values (isaacs) - * tls: prevent duplicate values returned from read (Nathan Rajlich) - * tls: NPN protocols are now local to connections (Fedor Indutny) +## 2013.09.04, Version 0.10.18 (Stable) -2013.09.04, Version 0.10.18 (Stable), 67a1f0c52e0708e2596f3f2134b8386d6112561e +https://github.com/iojs/io.js/commit/67a1f0c52e0708e2596f3f2134b8386d6112561e * uv: Upgrade to v0.10.15 - * stream: Don't crash on unset _events property (isaacs) - * stream: Pass 'buffer' encoding with decoded writable chunks (isaacs) +## 2013.08.21, Version 0.10.17 (Stable) -2013.08.21, Version 0.10.17 (Stable), 469a4a5091a677df62be319675056b869c31b35c +https://github.com/iojs/io.js/commit/469a4a5091a677df62be319675056b869c31b35c * uv: Upgrade v0.10.14 - * http_parser: Do not accept PUN/GEM methods as PUT/GET (Chris Dickinson) - * tls: fix assertion when ssl is destroyed at read (Fedor Indutny) - * stream: Throw on 'error' if listeners removed (isaacs) - * dgram: fix assertion on bad send() arguments (Ben Noordhuis) - * readline: pause stdin before turning off terminal raw mode (Daniel Chatfield) +## 2013.08.16, Version 0.10.16 (Stable) -2013.08.16, Version 0.10.16 (Stable), 50b4c905a4425430ae54db4906f88982309e128d +https://github.com/iojs/io.js/commit/50b4c905a4425430ae54db4906f88982309e128d * v8: back-port fix for CVE-2013-2882 - * npm: Upgrade to 1.3.8 - * crypto: fix assert() on malformed hex input (Ben Noordhuis) - * crypto: fix memory leak in randomBytes() error path (Ben Noordhuis) - * events: fix memory leak, don't leak event names (Ben Noordhuis) - * http: Handle hex/base64 encodings properly (isaacs) - * http: improve chunked res.write(buf) performance (Ben Noordhuis) - * stream: Fix double pipe error emit (Eran Hammer) +## 2013.07.25, Version 0.10.15 (Stable) -2013.07.25, Version 0.10.15 (Stable), 2426d65af860bda7be9f0832a99601cc43c6cf63 +https://github.com/iojs/io.js/commit/2426d65af860bda7be9f0832a99601cc43c6cf63 * src: fix process.getuid() return value (Ben Noordhuis) +## 2013.07.25, Version 0.10.14 (Stable) -2013.07.25, Version 0.10.14 (Stable), fdf57f811f9683a4ec49a74dc7226517e32e6c9d +https://github.com/iojs/io.js/commit/fdf57f811f9683a4ec49a74dc7226517e32e6c9d * uv: Upgrade to v0.10.13 - * npm: Upgrade to v1.3.5 - * os: Don't report negative times in cpu info (Ben Noordhuis) - * fs: Handle large UID and GID (Ben Noordhuis) - * url: Fix edge-case when protocol is non-lowercase (Shuan Wang) - * doc: Streams API Doc Rewrite (isaacs) - * node: call MakeDomainCallback in all domain cases (Trevor Norris) - * crypto: fix memory leak in LoadPKCS12 (Fedor Indutny) +## 2013.07.09, Version 0.10.13 (Stable) -2013.07.09, Version 0.10.13 (Stable), e32660a984427d46af6a144983cf7b8045b7299c +https://github.com/iojs/io.js/commit/e32660a984427d46af6a144983cf7b8045b7299c * uv: Upgrade to v0.10.12 - * npm: Upgrade to 1.3.2 - * windows: get proper errno (Ben Noordhuis) - * tls: only wait for finish if we haven't seen it (Timothy J Fontaine) - * http: Dump response when request is aborted (isaacs) - * http: use an unref'd timer to fix delay in exit (Peter Rust) - * zlib: level can be negative (Brian White) - * zlib: allow zero values for level and strategy (Brian White) - * buffer: add comment explaining buffer alignment (Ben Noordhuis) - * string_bytes: properly detect 64bit (Timothy J Fontaine) - * src: fix memory leak in UsingDomains() (Ben Noordhuis) +## 2013.06.18, Version 0.10.12 (Stable) -2013.06.18, Version 0.10.12 (Stable), a088cf4f930d3928c97d239adf950ab43e7794aa +https://github.com/iojs/io.js/commit/a088cf4f930d3928c97d239adf950ab43e7794aa * npm: Upgrade to 1.2.32 - * readline: make `ctrl + L` clear the screen (Yuan Chuan) - * v8: add setVariableValue debugger command (Ben Noordhuis) - * net: Do not destroy socket mid-write (isaacs) - * v8: fix build for mips32r2 architecture (Andrei Sedoi) - * configure: fix cross-compilation host_arch_cc() (Andrei Sedoi) +## 2013.06.13, Version 0.10.11 (Stable) -2013.06.13, Version 0.10.11 (Stable), d9d5bc465450ae5d60da32e9ffcf71c2767f1fad +https://github.com/iojs/io.js/commit/d9d5bc465450ae5d60da32e9ffcf71c2767f1fad * uv: upgrade to 0.10.11 - * npm: Upgrade to 1.2.30 - * openssl: add missing configuration pieces for MIPS (Andrei Sedoi) - * Revert "http: remove bodyHead from 'upgrade' events" (isaacs) - * v8: fix pointer arithmetic undefined behavior (Trevor Norris) - * crypto: fix utf8/utf-8 encoding check (Ben Noordhuis) - * net: Fix busy loop on POLLERR|POLLHUP on older linux kernels (Ben Noordhuis, isaacs) +## 2013.06.04, Version 0.10.10 (Stable) -2013.06.04, Version 0.10.10 (Stable), 25e51c396aa23018603baae2b1d9390f5d9db496 +https://github.com/iojs/io.js/commit/25e51c396aa23018603baae2b1d9390f5d9db496 * uv: Upgrade to 0.10.10 - * npm: Upgrade to 1.2.25 - * url: Properly parse certain oddly formed urls (isaacs) - * stream: unshift('') is a noop (isaacs) +## 2013.05.30, Version 0.10.9 (Stable) -2013.05.30, Version 0.10.9 (Stable), 878ffdbe6a8eac918ef3a7f13925681c3778060b +https://github.com/iojs/io.js/commit/878ffdbe6a8eac918ef3a7f13925681c3778060b * npm: Upgrade to 1.2.24 - * uv: Upgrade to v0.10.9 - * repl: fix JSON.parse error check (Brian White) - * tls: proper .destroySoon (Fedor Indutny) - * tls: invoke write cb only after opposite read end (Fedor Indutny) - * tls: ignore .shutdown() syscall error (Fedor Indutny) +## 2013.05.24, Version 0.10.8 (Stable) -2013.05.24, Version 0.10.8 (Stable), 30d9e9fdd9d4c33d3d95a129d021cd8b5b91eddb +https://github.com/iojs/io.js/commit/30d9e9fdd9d4c33d3d95a129d021cd8b5b91eddb * v8: update to 3.14.5.9 - * uv: upgrade to 0.10.8 - * npm: Upgrade to 1.2.23 - * http: remove bodyHead from 'upgrade' events (Nathan Zadoks) - * http: Return true on empty writes, not false (isaacs) - * http: save roundtrips, convert buffers to strings (Ben Noordhuis) - * configure: respect the --dest-os flag consistently (Nathan Rajlich) - * buffer: throw when writing beyond buffer (Trevor Norris) - * crypto: Clear error after DiffieHellman key errors (isaacs) - * string_bytes: strip padding from base64 strings (Trevor Norris) +## 2013.05.17, Version 0.10.7 (Stable) -2013.05.17, Version 0.10.7 (Stable), d2fdae197ac542f686ee06835d1153dd43b862e5 +https://github.com/iojs/io.js/commit/d2fdae197ac542f686ee06835d1153dd43b862e5 * uv: upgrade to v0.10.7 - * npm: Upgrade to 1.2.21 - * crypto: Don't ignore verify encoding argument (isaacs) - * buffer, crypto: fix default encoding regression (Ben Noordhuis) - * timers: fix setInterval() assert (Ben Noordhuis) +## 2013.05.14, Version 0.10.6 (Stable) -2013.05.14, Version 0.10.6 (Stable), 5deb1672f2b5794f8be19498a425ea4dc0b0711f +https://github.com/iojs/io.js/commit/5deb1672f2b5794f8be19498a425ea4dc0b0711f * module: Deprecate require.extensions (isaacs) - * stream: make Readable.wrap support objectMode, empty streams (Daniel Moore) - * child_process: fix handle delivery (Ben Noordhuis) - * crypto: Fix performance regression (isaacs) - * src: DRY string encoding/decoding (isaacs) +## 2013.04.23, Version 0.10.5 (Stable) -2013.04.23, Version 0.10.5 (Stable), deeaf8fab978e3cadb364e46fb32dafdebe5f095 +https://github.com/iojs/io.js/commit/deeaf8fab978e3cadb364e46fb32dafdebe5f095 * uv: Upgrade to 0.10.5 (isaacs) - * build: added support for Visual Studio 2012 (Miroslav Bajtoš) - * http: Don't try to destroy nonexistent sockets (isaacs) - * crypto: LazyTransform on properties, not methods (isaacs) - * assert: put info in err.message, not err.name (Ryan Doenges) - * dgram: fix no address bind() (Ben Noordhuis) - * handle_wrap: fix NULL pointer dereference (Ben Noordhuis) - * os: fix unlikely buffer overflow in os.type() (Ben Noordhuis) - * stream: Fix unshift() race conditions (isaacs) +## 2013.04.11, Version 0.10.4 (Stable) - - -2013.04.11, Version 0.10.4 (Stable), 9712aa9f76073c30850b20a188b1ed12ffb74d17 +https://github.com/iojs/io.js/commit/9712aa9f76073c30850b20a188b1ed12ffb74d17 * uv: Upgrade to 0.10.4 - * npm: Upgrade to 1.2.18 - * v8: Avoid excessive memory growth in JSON.parse (Fedor Indutny) - * child_process, cluster: fix O(n*m) scan of cmd string (Ben Noordhuis) - * net: fix socket.bytesWritten Buffers support (Fedor Indutny) - * buffer: fix offset checks (Łukasz Walukiewicz) - * stream: call write cb before finish event (isaacs) - * http: Support write(data, 'hex') (isaacs) - * crypto: dh secret should be left-padded (Fedor Indutny) - * process: expose NODE_MODULE_VERSION in process.versions (Rod Vagg) - * crypto: fix constructor call in crypto streams (Andreas Madsen) - * net: account for encoding in .byteLength (Fedor Indutny) - * net: fix buffer iteration in bytesWritten (Fedor Indutny) - * crypto: zero is not an error if writing 0 bytes (Fedor Indutny) - * tls: Re-enable check of CN-ID in cert verification (Tobias Müllerleile) +## 2013.04.03, Version 0.10.3 (Stable) -2013.04.03, Version 0.10.3 (Stable), d4982f6f5e4a9a703127489a553b8d782997ea43 +https://github.com/iojs/io.js/commit/d4982f6f5e4a9a703127489a553b8d782997ea43 * npm: Upgrade to 1.2.17 - * child_process: acknowledge sent handles (Fedor Indutny) - * etw: update prototypes to match dtrace provider (Timothy J Fontaine) - * dtrace: pass more arguments to probes (Dave Pacheco) - * build: allow building with dtrace on osx (Dave Pacheco) - * http: Remove legacy ECONNRESET workaround code (isaacs) - * http: Ensure socket cleanup on client response end (isaacs) - * tls: Destroy socket when encrypted side closes (isaacs) - * repl: isSyntaxError() catches "strict mode" errors (Nathan Rajlich) - * crypto: Pass options to ctor calls (isaacs) - * src: tie process.versions.uv to uv_version_string() (Ben Noordhuis) +## 2013.03.28, Version 0.10.2 (Stable) -2013.03.28, Version 0.10.2 (Stable), 1e0de9c426e07a260bbec2d2196c2d2db8eb8886 +https://github.com/iojs/io.js/commit/1e0de9c426e07a260bbec2d2196c2d2db8eb8886 * npm: Upgrade to 1.2.15 - * uv: Upgrade to 0.10.3 - * tls: handle SSL_ERROR_ZERO_RETURN (Fedor Indutny) - * tls: handle errors before calling C++ methods (Fedor Indutny) - * tls: remove harmful unnecessary bounds checking (Marcel Laverdet) - * crypto: make getCiphers() return non-SSL ciphers (Ben Noordhuis) - * crypto: check randomBytes() size argument (Ben Noordhuis) - * timers: do not calculate Timeout._when property (Alexey Kupershtokh) - * timers: fix off-by-one ms error (Alexey Kupershtokh) - * timers: handle signed int32 overflow in enroll() (Fedor Indutny) - * stream: Fix stall in Transform under very specific conditions (Gil Pedersen) - * stream: Handle late 'readable' event listeners (isaacs) - * stream: Fix early end in Writables on zero-length writes (isaacs) - * domain: fix domain callback from MakeCallback (Trevor Norris) - * child_process: don't emit same handle twice (Ben Noordhuis) - * child_process: fix sending utf-8 to child process (Ben Noordhuis) +## 2013.03.21, Version 0.10.1 (Stable) -2013.03.21, Version 0.10.1 (Stable), c274d1643589bf104122674a8c3fd147527a667d +https://github.com/iojs/io.js/commit/c274d1643589bf104122674a8c3fd147527a667d * npm: upgrade to 1.2.15 - * crypto: Improve performance of non-stream APIs (Fedor Indutny) - * tls: always reset this.ssl.error after handling (Fedor Indutny) - * tls: Prevent mid-stream hangs (Fedor Indutny, isaacs) - * net: improve arbitrary tcp socket support (Ben Noordhuis) - * net: handle 'finish' event only after 'connect' (Fedor Indutny) - * http: Don't hot-path end() for large buffers (isaacs) - * fs: Missing cb errors are deprecated, not a throw (isaacs) - * fs: make write/appendFileSync correctly set file mode (Raymond Feng) - * stream: Return self from readable.wrap (isaacs) - * stream: Never call decoder.end() multiple times (Gil Pedersen) - * windows: enable watching signals with process.on('SIGXYZ') (Bert Belder) - * node: revert removal of MakeCallback (Trevor Norris) - * node: Unwrap without aborting in handle fd getter (isaacs) +## 2013.03.11, Version 0.10.0 (Stable) -2013.03.11, Version 0.10.0 (Stable), 163ca274230fce536afe76c64676c332693ad7c1 +https://github.com/iojs/io.js/commit/163ca274230fce536afe76c64676c332693ad7c1 * npm: Upgrade to 1.2.14 - * core: Append filename properly in dlopen on windows (isaacs) - * zlib: Manage flush flags appropriately (isaacs) - * domains: Handle errors thrown in nested error handlers (isaacs) - * buffer: Strip high bits when converting to ascii (Ben Noordhuis) - * win/msi: Enable modify and repair (Bert Belder) - * win/msi: Add feature selection for various node parts (Bert Belder) - * win/msi: use consistent registry key paths (Bert Belder) - * child_process: support sending dgram socket (Andreas Madsen) - * fs: Raise EISDIR on Windows when calling fs.read/write on a dir (isaacs) - * unix: fix strict aliasing warnings, macro-ify functions (Ben Noordhuis) - * unix: honor UV_THREADPOOL_SIZE environment var (Ben Noordhuis) - * win/tty: fix typo in color attributes enumeration (Bert Belder) - * win/tty: don't touch insert mode or quick edit mode (Bert Belder) +## 2013.03.06, Version 0.9.12 (Unstable) -2013.03.06, Version 0.9.12 (Unstable), 0debf5a82934da805592b6496756cdf27c993abc +https://github.com/iojs/io.js/commit/0debf5a82934da805592b6496756cdf27c993abc * stream: Allow strings in Readable.push/unshift (isaacs) - * stream: Remove bufferSize option (isaacs) - * stream: Increase highWaterMark on large reads (isaacs) - * stream: _write: takes an encoding argument (isaacs) - * stream: _transform: remove output() method, provide encoding (isaacs) - * stream: Don't require read(0) to emit 'readable' event (isaacs) - * node: Add --throw-deprecation (isaacs) - * http: fix multiple timeout events (Eugene Girshov) - * http: More useful setTimeout API on server (isaacs) - * net: use close callback, not process.nextTick (Ben Noordhuis) - * net: Provide better error when writing after FIN (isaacs) - * dns: Support NAPTR queries (Pavel Lang) - * dns: fix ReferenceError in resolve() error path (Xidorn Quan) - * child_process: handle ENOENT correctly on Windows (Scott Blomquist) - * cluster: Rename destroy() to kill(signal=SIGTERM) (isaacs) - * build: define nightly tag external to build system (Timothy J Fontaine) - * build: make msi build work when spaces are present in the path (Bert Belder) - * build: fix msi build issue with WiX 3.7/3.8 (Raymond Feng) - * repl: make compatible with domains (Dave Olszewski) - * events: Code cleanup and performance improvements (Trevor Norris) +## 2013.03.01, Version 0.9.11 (Unstable) -2013.03.01, Version 0.9.11 (Unstable), 83392403b7a9b7782b37c17688938c75010f81ba +https://github.com/iojs/io.js/commit/83392403b7a9b7782b37c17688938c75010f81ba * V8: downgrade to 3.14.5 - * openssl: update to 1.0.1e - * darwin: Make process.title work properly (Ben Noordhuis) - * fs: Support mode/flag options to read/append/writeFile (isaacs) - * stream: _read() no longer takes a callback (isaacs) - * stream: Add stream.unshift(chunk) (isaacs) - * stream: remove lowWaterMark feature (isaacs) - * net: omit superfluous 'connect' event (Ben Noordhuis) - * build, windows: disable SEH (Ben Noordhuis) - * core: remove errno global (Ben Noordhuis) - * core: Remove the nextTick for running the main file (isaacs) - * core: Mark exit() calls with status codes (isaacs) - * core: Fix debug signal handler race condition lock (isaacs) - * crypto: clear error stack (Ben Noordhuis) - * test: optionally set common.PORT via env variable (Timothy J Fontaine) - * path: Throw TypeError on non-string args to path.resolve/join (isaacs, Arianit Uka) - * crypto: fix uninitialized memory access in openssl (Ben Noordhuis) - -2013.02.19, Version 0.9.10 (Unstable) +## 2013.02.19, Version 0.9.10 (Unstable) * V8: Upgrade to 3.15.11.15 - * npm: Upgrade to 1.2.12 - * fs: Change default WriteStream config, increase perf (isaacs) - * process: streamlining tick callback logic (Trevor Norris) - * stream_wrap, udp_wrap: add read-only fd property (Ben Noordhuis) - * buffer: accept negative indices in Buffer#slice() (Ben Noordhuis) - * tls: Cycle data when underlying socket drains (isaacs) - * stream: read(0) should not always trigger _read(n,cb) (isaacs) - * stream: Empty strings/buffers do not signal EOF any longer (isaacs) - * crypto: improve cipher/decipher error messages (Ben Noordhuis) - * net: Respect the 'readable' flag on sockets (isaacs) - * net: don't suppress ECONNRESET (Ben Noordhuis) - * typed arrays: copy Buffer in typed array constructor (Ben Noordhuis) - * typed arrays: make DataView throw on non-ArrayBuffer (Ben Noordhuis) - * windows: MSI installer enhancements (Scott Blomquist, Jim Schubert) +## 2013.02.07, Version 0.9.9 (Unstable) -2013.02.07, Version 0.9.9 (Unstable), 4b9f0d190cd6b22853caeb0e07145a98ce1d1d7f +https://github.com/iojs/io.js/commit/4b9f0d190cd6b22853caeb0e07145a98ce1d1d7f * tls: port CryptoStream to streams2 (Fedor Indutny) - * typed arrays: only share ArrayBuffer backing store (Ben Noordhuis) - * stream: make Writable#end() accept a callback function (Nathan Rajlich) - * buffer: optimize 'hex' handling (Ben Noordhuis) - * dns, cares: don't filter NOTIMP, REFUSED, SERVFAIL (Ben Noordhuis) - * readline: treat bare \r as a line ending (isaacs) - * readline: make \r\n emit one 'line' event (Ben Noordhuis) - * cluster: support datagram sockets (Bert Belder) - * stream: Correct Transform class backpressure (isaacs) - * addon: Pass module object to NODE_MODULE init function (isaacs, Rod Vagg) - * buffer: slow buffer copy compatibility fix (Trevor Norris) - * Add bytesWritten to tls.CryptoStream (Andy Burke) +## 2013.01.24, Version 0.9.8 (Unstable) -2013.01.24, Version 0.9.8 (Unstable), 5f2f8400f665dc32c3e10e7d31d53d756ded9156 +https://github.com/iojs/io.js/commit/5f2f8400f665dc32c3e10e7d31d53d756ded9156 * npm: Upgrade to v1.2.3 - * V8: Upgrade to 3.15.11.10 - * streams: Support objects other than Buffers (Jake Verbaten) - * buffer: remove float write range checks (Trevor Norris) - * http: close connection on 304/204 responses with chunked encoding (Ben Noordhuis) - * build: fix build with dtrace support on FreeBSD (Fedor Indutny) - * console: Support formatting options in trace() (isaacs) - * domain: empty stack on all exceptions (Dave Olszewski) - * unix, windows: make uv_*_bind() error codes consistent (Andrius Bentkus) - * linux: add futimes() fallback (Ben Noordhuis) +## 2013.01.18, Version 0.9.7 (Unstable) -2013.01.18, Version 0.9.7 (Unstable), 9e7bebeb8305edd55735a95955a98fdbe47572e5 +https://github.com/iojs/io.js/commit/9e7bebeb8305edd55735a95955a98fdbe47572e5 * V8: Upgrade to 3.15.11.7 - * npm: Upgrade to 1.2.2 - * punycode: Upgrade to 1.2.0 (Mathias Bynens) - * repl: make built-in modules available by default (Felix Böhm) - * windows: add support for '_Total' perf counters (Scott Blomquist) - * cluster: make --prof work for workers (Ben Noordhuis) - * child_process: do not keep list of sent sockets (Fedor Indutny) - * tls: Follow RFC6125 more strictly (Fedor Indutny) - * buffer: floating point read/write improvements (Trevor Norris) - * TypedArrays: Improve dataview perf without endian param (Dean McNamee) - * module: assert require() called with a non-empty string (Felix Böhm, James Campos) - * stdio: Set readable/writable flags properly (isaacs) - * stream: Properly handle large reads from push-streams (isaacs) +## 2013.01.11, Version 0.9.6 (Unstable) -2013.01.11, Version 0.9.6 (Unstable), 9313fdc71ca8335d5e3a391c103230ee6219b3e2 +https://github.com/iojs/io.js/commit/9313fdc71ca8335d5e3a391c103230ee6219b3e2 * V8: update to 3.15.11.5 - * node: remove ev-emul.h (Ben Noordhuis) - * path: make basename and extname ignore trailing slashes (Bert Belder) - * typed arrays: fix sunos signed/unsigned char issue (Ben Noordhuis) - * child_process: Fix {stdio:'inherit'} regression (Ben Noordhuis) - * child_process: Fix pipe() from child stdio streams (Maciej Małecki) - * child_process: make fork() execPath configurable (Bradley Meck) - * stream: Add readable.push(chunk) method (isaacs) - * dtrace: x64 ustack helper (Fedor Indutny) - * repl: fix floating point number parsing (Nirk Niggler) - * repl: allow overriding builtins (Ben Noordhuis) - * net: add localAddress and localPort to Socket (James Hight) - * fs: make pool size coincide with ReadStream bufferSize (Shigeki Ohtsu) - * typed arrays: implement load and store swizzling (Dean McNamee) - * windows: fix perfctr crash on XP and 2003 (Scott Blomquist) - * dgram: fix double implicit bind error (Ben Noordhuis) +## 2012.12.30, Version 0.9.5 (Unstable) -2012.12.30, Version 0.9.5 (Unstable), 01994e8119c24f2284bac0779b32acb49c95bee7 +https://github.com/iojs/io.js/commit/01994e8119c24f2284bac0779b32acb49c95bee7 * assert: improve support for new execution contexts (lukebayes) - * domain: use camelCase instead of snake_case (isaacs) - * domain: Do not use uncaughtException handler (isaacs) - * fs: make 'end' work with ReadStream without 'start' (Ben Noordhuis) - * https: optimize createConnection() (Ryunosuke SATO) - * buffer: speed up base64 encoding by 20% (Ben Noordhuis) - * doc: Colorize API stabilitity index headers in docs (Luke Arduini) - * net: socket.readyState corrections (bentaber) - * http: Performance enhancements for http under streams2 (isaacs) - * stream: fix to emit end event on http.ClientResponse (Shigeki Ohtsu) - * stream: fix event handler leak in readstream pipe and unpipe (Andreas Madsen) - * build: Support ./configure --tag switch (Maciej Małecki) - * repl: don't touch `require.cache` (Nathan Rajlich) - * node: Emit 'exit' event when exiting for an uncaught exception (isaacs) +## 2012.12.21, Version 0.9.4 (Unstable) -2012.12.21, Version 0.9.4 (Unstable), d86d83c75f6343b5368bb7bd328b4466a035e1d4 +https://github.com/iojs/io.js/commit/d86d83c75f6343b5368bb7bd328b4466a035e1d4 * streams: Update all streaming interfaces to use new classes (isaacs) - * node: remove idle gc (Ben Noordhuis) - * http: protect against response splitting attacks (Bert Belder) - * fs: Raise error when null bytes detected in paths (isaacs) - * fs: fix 'object is not a function' callback errors (Ben Noordhuis) - * fs: add autoClose=true option to fs.createReadStream (Farid Neshat) - * process: add getgroups(), setgroups(), initgroups() (Ben Noordhuis) - * openssl: optimized asm code on x86 and x64 (Bert Belder) - * crypto: fix leak in GetPeerCertificate (Fedor Indutny) - * add systemtap support (Jan Wynholds) - * windows: add ETW and PerfCounters support (Scott Blomquist) - * windows: fix normalization of UNC paths (Bert Belder) - * crypto: fix ssl error handling (Sergey Kholodilov) - * node: remove eio-emul.h (Ben Noordhuis) - * os: add os.endianness() function (Nathan Rajlich) - * readline: don't emit "line" events with a trailing '\n' char (Nathan Rajlich) - * build: add configure option to generate xcode build files (Timothy J Fontaine) - * build: allow linking against system libuv, cares, http_parser (Stephen Gallagher) - * typed arrays: add slice() support to ArrayBuffer (Anthony Pesch) - * debugger: exit and kill child on SIGTERM or SIGHUP (Fedor Indutny) - * url: url.format escapes delimiters in path and query (J. Lee Coltrane) +## 2012.10.24, Version 0.9.3 (Unstable) -2012.10.24, Version 0.9.3 (Unstable), 1ed4c6776e4f52956918b70565502e0f8869829d +https://github.com/iojs/io.js/commit/1ed4c6776e4f52956918b70565502e0f8869829d * V8: Upgrade to 3.13.7.4 - * crypto: Default to buffers instead of binary strings (isaacs, Fedor Indutny) - * crypto: add getHashes() and getCiphers() (Ben Noordhuis) - * unix: add custom thread pool, remove libeio (Ben Noordhuis) - * util: make `inspect()` accept an "options" argument (Nathan Rajlich) - * https: fix renegotation attack protection (Ben Noordhuis) - * cluster: make 'listening' handler see actual port (Aaditya Bhatia) - * windows: use USERPROFILE to get the user's home dir (Bert Belder) - * path: add platform specific path delimiter (Paul Serby) - * http: add response.headersSent property (Pavel Lang) - * child_process: make .fork()'d child auto-exit (Ben Noordhuis) - * events: add 'removeListener' event (Ben Noordhuis) - * string_decoder: Add 'end' method, do base64 properly (isaacs) - * buffer: include encoding value in exception when invalid (Ricky Ng-Adam) - * http: make http.ServerResponse no longer emit 'end' (isaacs) - * streams: fix pipe is destructed by 'end' from destination (koichik) +## 2012.09.17, Version 0.9.2 (Unstable) -2012.09.17, Version 0.9.2 (Unstable), 6e2055889091a424fbb5c500bc3ab9c05d1c28b4 +https://github.com/iojs/io.js/commit/6e2055889091a424fbb5c500bc3ab9c05d1c28b4 * http_parser: upgrade to ad3b631 - * openssl: upgrade 1.0.1c - * darwin: use FSEvents to watch directory changes (Fedor Indutny) - * unix: support missing API on NetBSD (Shigeki Ohtsu) - * unix: fix EMFILE busy loop (Ben Noordhuis) - * windows: un-break writable tty handles (Bert Belder) - * windows: map WSAESHUTDOWN to UV_EPIPE (Bert Belder) - * windows: make spawn with custom environment work again (Bert Belder) - * windows: map ERROR_DIRECTORY to UV_ENOENT (Bert Belder) - * tls, https: validate server certificate by default (Ben Noordhuis) - * tls, https: throw exception on missing key/cert (Ben Noordhuis) - * tls: async session storage (Fedor Indutny) - * installer: don't install header files (Ben Noordhuis) - * buffer: implement Buffer.prototype.toJSON() (Nathan Rajlich) - * buffer: added support for writing NaN and Infinity (koichik) - * http: make http.ServerResponse emit 'end' (Ben Noordhuis) - * build: ./configure --ninja (Ben Noordhuis, Timothy J Fontaine) - * installer: fix --without-npm (Ben Noordhuis) - * cli: make -p equivalent to -pe (Ben Noordhuis) - * url: Go much faster by using Url class (isaacs) +## 2012.08.28, Version 0.9.1 (Unstable) -2012.08.28, Version 0.9.1 (Unstable), e6ce259d2caf338fec991c2dd447de763ce99ab7 +https://github.com/iojs/io.js/commit/e6ce259d2caf338fec991c2dd447de763ce99ab7 * buffer: Add Buffer.isEncoding(enc) to test for valid encoding values (isaacs) - * Raise UV_ECANCELED on premature close. (Ben Noordhuis) - * Remove c-ares from libuv, move to a top-level node dependency (Bert Belder) - * ref/unref for all HandleWraps, timers, servers, and sockets (Timothy J Fontaine) - * addon: remove node-waf, superseded by node-gyp (Ben Noordhuis) - * child_process: emit error on exec failure (Ben Noordhuis) - * cluster: do not use internal server API (Andreas Madsen) - * constants: add O_DIRECT (Ian Babrou) - * crypto: add sync interface to crypto.pbkdf2() (Ben Noordhuis) - * darwin: emulate fdatasync() (Fedor Indutny) - * dgram: make .bind() always asynchronous (Ben Noordhuis) - * events: Make emitter.listeners() side-effect free (isaacs, Joe Andaverde) - * fs: Throw early on invalid encoding args (isaacs) - * fs: fix naming of truncate/ftruncate functions (isaacs) - * http: bubble up parser errors to ClientRequest (Brian White) - * linux: improve cpuinfo parser on ARM and MIPS (Ben Noordhuis) - * net: add support for IPv6 addresses ending in :: (Josh Erickson) - * net: support Server.listen(Pipe) (Andreas Madsen) - * node: don't scan add-on for "init" symbol (Ben Noordhuis) - * remove process.uvCounters() (Ben Noordhuis) - * repl: console writes to repl rather than process stdio (Nathan Rajlich) - * timers: implement setImmediate (Timothy J Fontaine) - * tls: fix segfault in pummel/test-tls-ci-reneg-attack (Ben Noordhuis) - * tools: Move gyp addon tools to node-gyp (Nathan Rajlich) - * unix: preliminary signal handler support (Ben Noordhuis) - * unix: remove dependency on ev_child (Ben Noordhuis) - * unix: work around darwin bug, don't poll() on pipe (Fedor Indutny) - * util: Formally deprecate util.pump() (Ben Noordhuis) - * windows: make active and closing handle state independent (Bert Belder) - * windows: report spawn errors to the exit callback (Bert Belder) - * windows: signal handling support with uv_signal_t (Bert Belder) +## 2012.07.20, Version 0.9.0 (Unstable) -2012.07.20, Version 0.9.0 (Unstable), f9b237f478c372fd55e4590d7399dcd8f25f3603 +https://github.com/iojs/io.js/commit/f9b237f478c372fd55e4590d7399dcd8f25f3603 * punycode: update to v1.1.1 (Mathias Bynens) - * c-ares: upgrade to 1.9.0 (Saúl Ibarra Corretgé) - * dns: ignore rogue DNS servers reported by windows (Saúl Ibarra Corretgé) - * unix: speed up uv_async_send() (Ben Noordhuis) - * darwin: get cpu model correctly on mac (Xidorn Quan) - * nextTick: Handle tick callbacks before any other I/O (isaacs) - * Enable color customization of `util.inspect` (Pavel Lang) - * tls: Speed and memory improvements (Fedor Indutny) - * readline: Use one history item for reentered line (Vladimir Beloborodov) +* Fix [#3521](https://github.com/joyent/node/issues/3521) Make process.env more like a regular Object (isaacs) -* Fix #3521 Make process.env more like a regular Object (isaacs) +## 2013.06.13, Version 0.8.25 (maintenance) - -2013.06.13, Version 0.8.25 (maintenance), 0b9bdb2bc7e1c872f0ea4713517fda22a4b0b202 +https://github.com/iojs/io.js/commit/0b9bdb2bc7e1c872f0ea4713517fda22a4b0b202 * npm: Upgrade to 1.2.30 - * child_process: fix handle delivery (Ben Noordhuis) +## 2013.06.04, Version 0.8.24 (maintenance) -2013.06.04, Version 0.8.24 (maintenance), c1a1ab067721ea17ef7b05ec5c68b01321017f05 +https://github.com/iojs/io.js/commit/c1a1ab067721ea17ef7b05ec5c68b01321017f05 * npm: Upgrade to v1.2.24 - * url: Properly parse certain oddly formed urls (isaacs) - * http: Don't try to destroy nonexistent sockets (isaacs) - * handle_wrap: fix NULL pointer dereference (Ben Noordhuis) +## 2013.04.09, Version 0.8.23 (maintenance) -2013.04.09, Version 0.8.23 (maintenance), c67f8d0500fe15637a623eb759d2ad7eb9fb3b0b +https://github.com/iojs/io.js/commit/c67f8d0500fe15637a623eb759d2ad7eb9fb3b0b * npm: Upgrade to v1.2.18 - * http: Avoid EE warning on ECONNREFUSED handling (isaacs) - * tls: Re-enable check of CN-ID in cert verification (Tobias Müllerleile) - * child_process: fix sending utf-8 to child process (Ben Noordhuis) - * crypto: check key type in GetPeerCertificate() (Ben Noordhuis) - * win/openssl: mark assembled object files as seh safe (Bert Belder) - * windows/msi: fix msi build issue with WiX 3.7/3.8 (Raymond Feng) +## 2013.03.07, Version 0.8.22 (Stable) -2013.03.07, Version 0.8.22 (Stable), 67a4cb4fe8c2346e30ffb83f7178e205cc2dab33 +https://github.com/iojs/io.js/commit/67a4cb4fe8c2346e30ffb83f7178e205cc2dab33 * npm: Update to 1.2.14 - * cluster: propagate bind errors (Ben Noordhuis) - * crypto: don't assert when calling Cipher#final() twice (Ben Noordhuis) - * build, windows: disable SEH (Ben Noordhuis) +## 2013.02.25, Version 0.8.21 (Stable) -2013.02.25, Version 0.8.21 (Stable), 530d8c05d4c546146f18e5ba811d7eb3b7b7c0c5 +https://github.com/iojs/io.js/commit/530d8c05d4c546146f18e5ba811d7eb3b7b7c0c5 * http: Do not free the wrong parser on socket close (isaacs) - * http: Handle hangup writes more gently (isaacs) - * zlib: fix assert on bad input (Ben Noordhuis) - * test: add TAP output to the test runner (Timothy J Fontaine) - * unix: Handle EINPROGRESS from domain sockets (Ben Noordhuis) +## 2013.02.15, Version 0.8.20 (Stable) -2013.02.15, Version 0.8.20 (Stable), e10c75579b536581ddd7ae4e2c3bf8a9d550d343 +https://github.com/iojs/io.js/commit/e10c75579b536581ddd7ae4e2c3bf8a9d550d343 * npm: Upgrade to v1.2.11 - * http: Do not let Agent hand out destroyed sockets (isaacs) - * http: Raise hangup error on destroyed socket write (isaacs) - * http: protect against response splitting attacks (Bert Belder) +## 2013.02.06, Version 0.8.19 (Stable) -2013.02.06, Version 0.8.19 (Stable), 53978bdf420622ff0121c63c0338c9e7c2e60869 +https://github.com/iojs/io.js/commit/53978bdf420622ff0121c63c0338c9e7c2e60869 * npm: Upgrade to v1.2.10 - * zlib: pass object size hint to V8 (Ben Noordhuis) - * zlib: reduce memory consumption, release early (Ben Noordhuis) - * buffer: slow buffer copy compatibility fix (Trevor Norris) - * zlib: don't assert on malformed dictionary (Ben Noordhuis) - * zlib: don't assert on missing dictionary (Ben Noordhuis) - * windows: better ipv6 support (Bert Belder) - * windows: add error mappings related to unsupported protocols (Bert Belder) - * windows: map ERROR_DIRECTORY to UV_ENOENT (Bert Belder) +## 2013.01.18, Version 0.8.18 (Stable) -2013.01.18, Version 0.8.18 (Stable), 2c4eef0d972838c51999d32c0d251857a713dc18 +https://github.com/iojs/io.js/commit/2c4eef0d972838c51999d32c0d251857a713dc18 * npm: Upgrade to v1.2.2 - * dns: make error message match errno (Dan Milon) - * tls: follow RFC6125 more stricly (Fedor Indutny) - * buffer: reject negative SlowBuffer offsets (Ben Noordhuis) - * install: add simplejson fallback (Chris Dent) - * http: fix "Cannot call method 'emit' of null" (Ben Noordhuis) +## 2013.01.09, Version 0.8.17 (Stable) -2013.01.09, Version 0.8.17 (Stable), c50c33e9397d7a0a8717e8ce7530572907c054ad +https://github.com/iojs/io.js/commit/c50c33e9397d7a0a8717e8ce7530572907c054ad * npm: Upgrade to v1.2.0 - peerDependencies (Domenic Denicola) @@ -2037,689 +1690,440 @@ - Faster installs from github user/project shorthands (Nathan Zadoks) * typed arrays: fix 32 bit size/index overflow (Ben Noordhuis) - * http: Improve performance of single-packet responses (Ben Noordhuis) - * install: fix openbsd man page location (Ben Noordhuis) - * http: bubble up parser errors to ClientRequest (Brian White) +## 2012.12.13, Version 0.8.16 (Stable) -2012.12.13, Version 0.8.16 (Stable), 1c9c6277d5cfcaaac8569c0c8f7daa64292048a9 +https://github.com/iojs/io.js/commit/1c9c6277d5cfcaaac8569c0c8f7daa64292048a9 * npm: Upgrade to 1.1.69 - * fs: fix WriteStream/ReadStream fd leaks (Ben Noordhuis) - * crypto: fix leak in GetPeerCertificate (Fedor Indutny) - * buffer: Don't double-negate numeric buffer arg (Trevor Norris) - * net: More accurate IP address validation and IPv6 dotted notation. (Joshua Erickson) +## 2012.11.26, Version 0.8.15 (Stable) -2012.11.26, Version 0.8.15 (Stable), fdf91afb494a7a2fff2913d817f589c191a2c88f +https://github.com/iojs/io.js/commit/fdf91afb494a7a2fff2913d817f589c191a2c88f * npm: Upgrade to 1.1.66 (isaacs) - * linux: use /proc/cpuinfo for CPU frequency (Ben Noordhuis) - * windows: map WSAESHUTDOWN to UV_EPIPE (Ben Noordhuis) - * windows: map ERROR_GEN_FAILURE to UV_EIO (Bert Belder) - * unix: do not set environ unless one is provided (Charlie McConnell) - * domains: don't crash if domain is set to null (Bert Belder) - * windows: fix the x64 debug build (Bert Belder) - * net, tls: fix connect() resource leak (Ben Noordhuis) +## 2012.10.25, Version 0.8.14 (Stable) -2012.10.25, Version 0.8.14 (Stable), b00527fcf05c3d9f/b5d5d790f9472906a59fe218 +https://github.com/iojs/io.js/commit/b00527fcf05c3d9f https://github.com/iojs/io.js/commit/b5d5d790f9472906a59fe218 * events: Don't clobber pre-existing _events obj in EE ctor (isaacs) +## 2012.10.25, Version 0.8.13 (Stable) -2012.10.25, Version 0.8.13 (Stable), ff4c974873f9a7cc6a5b042eb9b6389bb8dde6d6 +https://github.com/iojs/io.js/commit/ff4c974873f9a7cc6a5b042eb9b6389bb8dde6d6 * V8: Upgrade to 3.11.10.25 - * npm: Upgrade to 1.1.65 - * url: parse hostnames that start with - or _ (Ben Noordhuis) - * repl: Fix Windows 8 terminal issue (Bert Belder) - * typed arrays: use signed char for signed int8s (Aaron Jacobs) - * crypto: fix bugs in DiffieHellman (Ben Noordhuis) - * configure: turn on VFPv3 on ARMv7 (Ben Noordhuis) - * Re-enable OpenSSL UI for entering passphrases via tty (Ben Noordhuis) - * repl: ensure each REPL instance gets its own "context" (Nathan Rajlich) +## 2012.10.12, Version 0.8.12 (Stable) -2012.10.12, Version 0.8.12 (Stable), 38c72d4e29574dec5205bcf23c2a85efe65331a4 +https://github.com/iojs/io.js/commit/38c72d4e29574dec5205bcf23c2a85efe65331a4 * npm: Upgrade to 1.1.63 - * crypto: Reduce stability index to 2-Unstable (isaacs) - * windows: fix handle leak in uv_fs_utime (Bert Belder) - * windows: fix application crashed popup in debug version (Bert Belder) - * buffer: report proper retained size in profiler (Ben Noordhuis) - * buffer: fix byteLength with UTF-16LE (koichik) - * repl: make "end of input" JSON.parse() errors throw in the REPL (Nathan Rajlich) - * repl: make invalid RegExp modifiers throw in the REPL (Nathan Rajlich) - * http: handle multiple Proxy-Authenticate values (Willi Eggeling) +## 2012.09.27, Version 0.8.11 (Stable) -2012.09.27, Version 0.8.11 (Stable), e1f39468fa580c1e4cb15fac621f87944ee625dc +https://github.com/iojs/io.js/commit/e1f39468fa580c1e4cb15fac621f87944ee625dc * fs: Fix stat() size reporting for large files (Ben Noordhuis) +## 2012.09.25, Version 0.8.10 (Stable) -2012.09.25, Version 0.8.10 (Stable), 0bc273da4fcaa79b209ed755ad249a3e7be626a6 +https://github.com/iojs/io.js/commit/0bc273da4fcaa79b209ed755ad249a3e7be626a6 * npm: Upgrade to 1.1.62 - * repl: make invalid RegExps throw in the REPL (Nathan Rajlich) - * v8: loosen artificial mmap constraint (Bryan Cantrill) - * process: fix setuid() and setgid() error reporting (Ben Noordhuis) - * domain: Properly exit() on domain disposal (isaacs) - * fs: fix watchFile() missing deletion events (Ben Noordhuis) - * fs: fix assert in fs.watch() (Ben Noordhuis) - * fs: don't segfault on deeply recursive stat() (Ben Noordhuis) - * http: Remove timeout handler when data arrives (Frédéric Germain) - * http: make the client "res" object gets the same domain as "req" (Nathan Rajlich) - * windows: don't blow up when an invalid FD is used (Bert Belder) - * unix: map EDQUOT to UV_ENOSPC (Charlie McConnell) - * linux: improve /proc/cpuinfo parser (Ben Noordhuis) - * win/tty: reset background brightness when color is set to default (Bert Belder) - * unix: put child process stdio fds in blocking mode (Ben Noordhuis) - * unix: fix EMFILE busy loop (Ben Noordhuis) - * sunos: don't set TCP_KEEPALIVE (Ben Noordhuis) - * tls: Use slab allocator for memory management (Fedor Indutny) - * openssl: Use optimized assembly code for x86 and x64 (Bert Belder) +## 2012.09.11, Version 0.8.9 (Stable) -2012.09.11, Version 0.8.9 (Stable), b88c3902b241cf934e75443b934f2033ad3915b1 +https://github.com/iojs/io.js/commit/b88c3902b241cf934e75443b934f2033ad3915b1 * v8: upgrade to 3.11.10.22 - * GYP: upgrade to r1477 - * npm: Upgrade to 1.1.61 - * npm: Don't create world-writable files (isaacs) - * windows: fix single-accept mode for shared server sockets (Bert Belder) - * windows: fix uninitialized memory access in uv_update_time() (Bert Belder) - * windows: don't throw when a signal handler is attached (Bert Belder) - * unix: fix memory leak in udp (Ben Noordhuis) - * unix: map errno ESPIPE (Ben Noordhuis) - * unix, windows: fix memory corruption in fs-poll.c (Ben Noordhuis) - * sunos: fix os.cpus() on x86_64 (Ben Noordhuis) - * child process: fix processes with IPC channel don't emit 'close' (Bert Belder) - * build: add a "--dest-os" option to force a gyp "flavor" (Nathan Rajlich) - * build: set `process.platform` to "sunos" on SunOS (Nathan Rajlich) - * build: fix `make -j` fails after `make clean` (Bearice Ren) - * build: fix openssl configuration for "arm" builds (Nathan Rajlich) - * tls: support unix domain socket/named pipe in tls.connect (Shigeki Ohtsu) - * https: make https.get() accept a URL (koichik) - * http: respect HTTP/1.0 TE header (Ben Noordhuis) - * crypto, tls: Domainify setSNICallback, pbkdf2, randomBytes (Ben Noordhuis) - * stream.pipe: Don't call destroy() unless it's a function (isaacs) +## 2012.08.22, Version 0.8.8 (Stable) -2012.08.22, Version 0.8.8 (Stable), a299c97bbc701f4d460e91214d7bfe7a9589d361 +https://github.com/iojs/io.js/commit/a299c97bbc701f4d460e91214d7bfe7a9589d361 * V8: upgrade to 3.11.10.19 - * npm: upgrade to 1.1.59 - * windows: fix uninitialized memory access in uv_update_time() (Bert Belder) - * unix, windows: fix memory corruption in fs-poll.c (Ben Noordhuis) - * unix: fix integer overflow in uv_hrtime (Tim Holy) - * sunos: fix uv_cpu_info() on x86_64 (Ben Noordhuis) - * tls: update default cipher list (Ben Noordhuis) - * unix: Fix llvm and older gcc duplicate symbol warnings (Bert Belder) - * fs: fix use after free in stat watcher (Ben Noordhuis) - * build: Fix using manually compiled gcc on OS X (Nathan Rajlich) - * windows: make junctions work again (Bert Belder) +## 2012.08.15, Version 0.8.7 (Stable) -2012.08.15, Version 0.8.7 (Stable), f640c5d35cba96634cd8176a525a1d876e361a61 +https://github.com/iojs/io.js/commit/f640c5d35cba96634cd8176a525a1d876e361a61 * npm: Upgrade to 1.1.49 - * website: download page (Golo Roden) - * crypto: fix uninitialized memory access in openssl (Ben Noordhuis) - * buffer, crypto: fix buffer decoding (Ben Noordhuis) - * build: compile with -fno-tree-vrp when gcc >= 4.0 (Ben Noordhuis) - * tls: handle multiple CN fields when verifying cert (Ben Noordhuis) - * doc: remove unused util from child_process (Kyle Robinson Young) - * build: rework -fvisibility=hidden detection (Ben Noordhuis) - * windows: don't duplicate invalid stdio handles (Bert Belder) - * windows: fix typos in process-stdio.c (Bert Belder) +## 2012.08.07, Version 0.8.6 (Stable) -2012.08.07, Version 0.8.6 (Stable), 0544a586ca6b6b900a42e164033dbf350765700a +https://github.com/iojs/io.js/commit/0544a586ca6b6b900a42e164033dbf350765700a * npm: Upgrade to v1.1.48 - * Add 'make binary' to build binary tarballs for all Unixes (Nathan Rajlich) - * zlib: Emit 'close' on destroy(). (Dominic Tarr) - * child_process: Fix stdout=null when stdio=['pipe'] (Tyler Neylon) - * installer: prevent ETXTBSY errors (Ben Noordhuis) - * installer: honor --without-npm, default install path (Ben Noordhuis) - * net: make pause work with connecting sockets (Bert Belder) - * installer: fix cross-compile installs (Ben Noordhuis) - * net: fix .listen({fd:0}) (Ben Noordhuis) - * windows: map WSANO_DATA to UV_ENOENT (Bert Belder) +## 2012.08.02, Version 0.8.5 (Stable) -2012.08.02, Version 0.8.5 (Stable), 9b86a4453f0c76f2707a75c0b2343aba33ec63bc +https://github.com/iojs/io.js/commit/9b86a4453f0c76f2707a75c0b2343aba33ec63bc * node: tag Encode and friends NODE_EXTERN (Ben Noordhuis) - * fs: fix ReadStream / WriteStream missing callback (Gil Pedersen) - * fs: fix readFileSync("/proc/cpuinfo") regression (Ben Noordhuis) - * installer: don't assume bash is installed (Ben Noordhuis) - * Report errors properly from --eval and stdin (isaacs) - * assert: fix throws() throws an error without message property (koichik) - * cluster: fix libuv assert in net.listen() (Ben Noordhuis) - * build: always link sunos builds with libumem (Trent Mick) - * build: improve armv7 / hard-float detection (Adam Malcontenti-Wilson) - * https: Use host header as effective servername (isaacs) - * sunos: work around OS bug to prevent fs.watch() from spinning (Bryan Cantrill) - * linux: fix 'two watchers, one path' segfault (Ben Noordhuis) - * windows: fix memory leaks in many fs functions (Bert Belder) - * windows: don't allow directories to be opened for writing/appending (Bert Belder) - * windows: make fork() work even when not all stdio handles are valid (Bert Belder) - * windows: make unlink() not remove mount points, and improve performance (Bert Belder) - * build: Sign pkg installer for OS X (isaacs) +## 2012.07.25, Version 0.8.4 (Stable) -2012.07.25, Version 0.8.4 (Stable), f98562fcd7d1cab573ca4dc1612157d6999befd4 +https://github.com/iojs/io.js/commit/f98562fcd7d1cab573ca4dc1612157d6999befd4 * V8: Upgrade to 3.11.10.17 - * npm: Upgrade to 1.1.45 - * net: fix Socket({ fd: 42 }) api (Ben Noordhuis) - * readline: Remove event listeners on close (isaacs) - * windows: correctly prep long path for fs.exists(Sync) (Bert Belder) - * debugger: wake up the event loop when a debugger command is dispatched (Peter Rybin) - * tls: verify server's identity (Fedor Indutny) - * net: ignore socket.setTimeout(Infinity or NaN) (Fedor Indutny) +## 2012.07.19, Version 0.8.3 (Stable) -2012.07.19, Version 0.8.3 (Stable), 60bf2d6cb33e4ce55604f73889ab840a9de8bdab +https://github.com/iojs/io.js/commit/60bf2d6cb33e4ce55604f73889ab840a9de8bdab * V8: upgrade to 3.11.10.15 - * npm: Upgrade to 1.1.43 - * net: fix net.Server.listen({fd:x}) error reporting (Ben Noordhuis) - * net: fix bogus errno reporting (Ben Noordhuis) - * build: Move npm shebang logic into an npm script (isaacs) - * build: fix add-on loading on freebsd (Ben Noordhuis) - * build: disable unsafe optimizations (Ben Noordhuis) - * build: fix spurious mksnapshot crashes for good (Ben Noordhuis) - * build: speed up genv8constants (Dave Pacheco) - * fs: make unwatchFile() remove a specific listener (Ben Noordhuis) - * domain: Remove first arg from intercepted fn (Toshihiro Nakamura) - * domain: Fix memory leak on error (isaacs) - * events: Fix memory leak from removeAllListeners (Nathan Rajlich) - * zlib: Fix memory leak in Unzip class. (isaacs) - * crypto: Fix memory leak in DecipherUpdate() (Ben Noordhuis) +## 2012.07.09, Version 0.8.2 (Stable) -2012.07.09, Version 0.8.2 (Stable), cc6084b9ac5cf1d4fe5e7165b71e8fc05d11be1f +https://github.com/iojs/io.js/commit/cc6084b9ac5cf1d4fe5e7165b71e8fc05d11be1f * npm: Upgrade to 1.1.36 - * readline: don't use Function#call() (Nathan Rajlich) - * Code cleanup to pass 'use strict' (Jonas Westerlund) - * module: add filename to require() json errors (TJ Holowaychuk) - * readline: fix for unicode prompts (Tim Macfarlane) - * timers: fix handling of large timeouts (Ben Noordhuis) - * repl: fix passing an empty line inserting "undefined" into the buffer (Nathan Rajlich) - * repl: fix crashes when buffering command (Maciej Małecki) - * build: rename strict_aliasing to node_no_strict_aliasing (Ben Noordhuis) - * build: disable -fstrict-aliasing for any gcc < 4.6.0 (Ben Noordhuis) - * build: detect cc version with -dumpversion (Ben Noordhuis) - * build: handle output of localized gcc or clang (Ben Noordhuis) - * unix: fix memory corruption in freebsd.c (Ben Noordhuis) - * unix: fix 'zero handles, one request' busy loop (Ben Noordhuis) - * unix: fix busy loop on unexpected tcp message (Ben Noordhuis) - * unix: fix EINPROGRESS busy loop (Ben Noordhuis) +## 2012.06.29, Version 0.8.1 (stable) -2012.06.29, Version 0.8.1 (stable), 2134aa3d5c622fc3c3b02ccb713fcde0e0df479a +https://github.com/iojs/io.js/commit/2134aa3d5c622fc3c3b02ccb713fcde0e0df479a * V8: upgrade to v3.11.10.12 - * npm: upgrade to v1.1.33 - Support for parallel use of the cache folder - Retry on registry timeouts or network failures (Trent Mick) - Reduce 'engines' failures to a warning - Use new zsh completion if aviailable (Jeremy Cantrell) -* Fix #3577 Un-break require('sys') - +* Fix [#3577](https://github.com/joyent/node/issues/3577) Un-break require('sys') * util: speed up formatting of large arrays/objects (Ben Noordhuis) - * windows: make fs.realpath(Sync) work with UNC paths (Bert Belder) - * build: fix --shared-v8 option (Ben Noordhuis) - * doc: `detached` is a boolean (Andreas Madsen) - * build: use proper python interpreter (Ben Noordhuis) - * build: expand ~ in `./configure --prefix=~/a/b/c` (Ben Noordhuis) - * build: handle CC env var with spaces (Gabriel de Perthuis) - * build: fix V8 build when compiling with gcc 4.5 (Ben Noordhuis) - * build: fix --shared-v8 option (Ben Noordhuis) - * windows msi: Fix icon issue which caused huge file size (Bert Belder) - * unix: assume that dlopen() may clobber dlerror() (Ben Noordhuis) - * sunos: fix memory corruption bugs (Ben Noordhuis) - * windows: better (f)utimes and (f)stat (Bert Belder) +## 2012.06.25, Version 0.8.0 (stable) -2012.06.25, Version 0.8.0 (stable), 8b8a7a7f9b41e74e1e810d0330738ad06fc302ec +https://github.com/iojs/io.js/commit/8b8a7a7f9b41e74e1e810d0330738ad06fc302ec * V8: upgrade to v3.11.10.10 - * npm: Upgrade to 1.1.32 - * Deprecate iowatcher (Ben Noordhuis) - * windows: update icon (Bert Belder) - * http: Hush 'MUST NOT have a body' warnings to debug() (isaacs) - * Move blog.nodejs.org content into repository (isaacs) - -* Fix #3503: stdin: resume() on pipe(dest) (isaacs) - +* Fix [#3503](https://github.com/joyent/node/issues/3503): stdin: resume() on pipe(dest) (isaacs) * crypto: fix error reporting in SetKey() (Fedor Indutny) - * Add --no-deprecation and --trace-deprecation command-line flags (isaacs) - * fs: fix fs.watchFile() (Ben Noordhuis) - * fs: Fix fs.readfile() on pipes (isaacs) - * Rename GYP variable node_use_system_openssl to be consistent (Ryan Dahl) +## 2012.06.19, Version 0.7.12 (unstable) -2012.06.19, Version 0.7.12 (unstable), a72120190a8ffdbcd3d6ad2a2e6ceecd2087111e +https://github.com/iojs/io.js/commit/a72120190a8ffdbcd3d6ad2a2e6ceecd2087111e * npm: Upgrade to 1.1.30 - Improved 'npm init' - Fix the 'cb never called' error from 'oudated' and 'update' - Add --save-bundle|-B config - - Fix isaacs/npm#2465: Make npm script and windows shims cygwin-aware - - Fix isaacs/npm#2452 Use --save(-dev|-optional) in npm rm + - Fix isaacs/npm[#2465](https://github.com/joyent/node/issues/2465): Make npm script and windows shims cygwin-aware + - Fix isaacs/npm[#2452](https://github.com/joyent/node/issues/2452) Use --save(-dev|-optional) in npm rm - `logstream` option to replace removed `logfd` (Rod Vagg) - Read default descriptions from README.md files * Shims to support deprecated ev_* and eio_* methods (Ben Noordhuis) - -* #3118 net.Socket: Delay pause/resume until after connect (isaacs) - -* #3465 Add ./configure --no-ifaddrs flag (isaacs) - +* [#3118](https://github.com/joyent/node/issues/3118) net.Socket: Delay pause/resume until after connect (isaacs) +* [#3465](https://github.com/joyent/node/issues/3465) Add ./configure --no-ifaddrs flag (isaacs) * child_process: add .stdin stream to forks (Fedor Indutny) - * build: fix `make install DESTDIR=/path` (Ben Noordhuis) - * tls: fix off-by-one error in renegotiation check (Ben Noordhuis) - * crypto: Fix diffie-hellman key generation UTF-8 errors (Fedor Indutny) - * node: change the constructor name of process from EventEmitter to process (Andreas Madsen) - * net: Prevent property access throws during close (Reid Burke) - * querystring: improved speed and code cleanup (Felix Böhm) - * sunos: fix assertion errors breaking fs.watch() (Fedor Indutny) - * unix: stat: detect sub-second changes (Ben Noordhuis) - * add stat() based file watcher (Ben Noordhuis) +## 2012.06.15, Version 0.7.11 (unstable) -2012.06.15, Version 0.7.11 (unstable), 5cfe0b86d5be266ef51bbba369c39e412ee51944 +https://github.com/iojs/io.js/commit/5cfe0b86d5be266ef51bbba369c39e412ee51944 * V8: Upgrade to v3.11.10 - * npm: Upgrade to 1.1.26 - * doc: Improve cross-linking in API docs markdown (Ben Kelly) - -* Fix #3425: removeAllListeners should delete array (Reid Burke) - +* Fix [#3425](https://github.com/joyent/node/issues/3425): removeAllListeners should delete array (Reid Burke) * cluster: don't silently drop messages when the write queue gets big (Bert Belder) - * Add Buffer.concat method (isaacs) - * windows: make symlinks tolerant to forward slashes (Bert Belder) - * build: Add node.d and node.1 to installer (isaacs) - * cluster: rename worker.unqiueID to worker.id (Andreas Madsen) - * Windows: Enable ETW events on Windows for existing DTrace probes. (Igor Zinkovsky) - * test: bundle node-weak in test/gc so that it doesn't need to be downloaded (Nathan Rajlich) - * Make many tests pass on Windows (Bert Belder) - -* Fix #3388 Support listening on file descriptors (isaacs) - -* Fix #3407 Add os.tmpDir() (isaacs) - +* Fix [#3388](https://github.com/joyent/node/issues/3388) Support listening on file descriptors (isaacs) +* Fix [#3407](https://github.com/joyent/node/issues/3407) Add os.tmpDir() (isaacs) * Unbreak the snapshotted build on Windows (Bert Belder) - * Clean up child_process.kill throws (Bert Belder) - * crypto: make cipher/decipher accept buffer args (Ben Noordhuis) +## 2012.06.11, Version 0.7.10 (unstable) -2012.06.11, Version 0.7.10 (unstable), 12a32a48a30182621b3f8e9b9695d1946b53c131 +https://github.com/iojs/io.js/commit/12a32a48a30182621b3f8e9b9695d1946b53c131 * Roll V8 back to 3.9.24.31 - * build: x64 target should always pass -m64 (Robert Mustacchi) - * add NODE_EXTERN to node::Start (Joel Brandt) - * repl: Warn about running npm commands (isaacs) - * slab_allocator: fix crash in dtor if V8 is dead (Ben Noordhuis) - * slab_allocator: fix leak of Persistent handles (Shigeki Ohtsu) - * windows/msi: add node.js prompt to startmenu (Jeroen Janssen) - * windows/msi: fix adding node to PATH (Jeroen Janssen) - * windows/msi: add start menu links when installing (Jeroen Janssen) - * windows: don't install x64 version into the 'program files (x86)' folder (Matt Gollob) - -* domain: Fix #3379 domain.intercept no longer passes error arg to cb (Marc Harter) - +* domain: Fix [#3379](https://github.com/joyent/node/issues/3379) domain.intercept no longer passes error arg to cb (Marc Harter) * fs: make callbacks run in global context (Ben Noordhuis) - * fs: enable fs.realpath on windows (isaacs) - * child_process: expose UV_PROCESS_DETACHED as options.detached (Charlie McConnell) - * child_process: new stdio API for .spawn() method (Fedor Indutny) - * child_process: spawn().ref() and spawn().unref() (Fedor Indutny) - * Upgrade npm to 1.1.25 - Enable npm link on windows - Properly remove sh-shim on Windows - Abstract out registry client and logger +## 2012.05.28, Version 0.7.9 (unstable) -2012.05.28, Version 0.7.9 (unstable), 782277f11a753ded831439ed826448c06fc0f356 +https://github.com/iojs/io.js/commit/782277f11a753ded831439ed826448c06fc0f356 * Upgrade V8 to 3.11.1 - * Upgrade npm to 1.1.23 - * uv: rework reference counting scheme (Ben Noordhuis) - * uv: add interface for joining external event loops (Bert Belder) - * repl, readline: Handle Ctrl+Z and SIGCONT better (Nathan Rajlich) - * fs: 64bit offsets for fs calls (Igor Zinkovsky) - * fs: add sync open flags 'rs' and 'rs+' (Kevin Bowman) - * windows: enable creating directory junctions with fs.symlink (Igor Zinkovsky, Bert Belder) - * windows: fix fs.lstat to properly detect symlinks. (Igor Zinkovsky) - -* Fix #3270 Escape url.parse delims (isaacs) - +* Fix [#3270](https://github.com/joyent/node/issues/3270) Escape url.parse delims (isaacs) * http: make http.get() accept a URL (Adam Malcontenti-Wilson) - * Cleanup vm module memory leakage (Marcel Laverdet) - * Optimize writing strings with Socket.write (Bert Belder) - * add support for CESU-8 and UTF-16LE encodings (koichik) - * path: add path.sep to get the path separator. (Yi, EungJun) - * net, http: add backlog parameter to .listen() (Erik Dubbelboer) - * debugger: support mirroring Date objects (Fedor Indutny) - * addon: add AtExit() function (Ben Noordhuis) - * net: signal localAddress bind failure in connect (Brian Schroeder) - * util: handle non-string return value in .inspect() (Alex Kocharin) +## 2012.04.18, Version 0.7.8 (unstable) -2012.04.18, Version 0.7.8 (unstable), c2b47097c0b483552efc1947c6766fa1128600b6 +https://github.com/iojs/io.js/commit/c2b47097c0b483552efc1947c6766fa1128600b6 * Upgrade V8 to 3.9.24.9 - * Upgrade OpenSSL to 1.0.0f - * Upgrade npm to 1.1.18 - * Show licenses in Binary installers - * Domains (isaacs) - * readline: rename "end" to "close" (Nathan Rajlich) - * tcp: make getsockname() return address family as string (Shigeki Ohtsu) - * http, https: fix .setTimeout() (ssuda) - * os: add cross platform EOL character (Mustansir Golawala) - * typed arrays: unexport SizeOfArrayElementForType() (Aaron Jacobs) - * net: honor 'enable' flag in .setNoDelay() (Ben Noordhuis) - * child_process: emit error when .kill fails (Andreas Madsen) - * gyp: fix 'argument list too long' build error (Ben Noordhuis) - * fs.WriteStream: Handle modifications to fs.open (isaacs) - * repl, readline: Handle newlines better (Nathan Rajlich, Nathan Friedly) - * build: target OSX 10.5 when building on darwin (Nathan Rajlich) - -* Fix #3052 Handle errors properly in zlib (isaacs) - +* Fix [#3052](https://github.com/joyent/node/issues/3052) Handle errors properly in zlib (isaacs) * build: add support for DTrace and postmortem (Dave Pacheco) - * core: add reusable Slab allocator (Ben Noordhuis) +## 2012.03.30, Version 0.7.7 (unstable) -2012.03.30, Version 0.7.7 (unstable), 5cda2542fdb086f9fe5de889bea435a65e377dea +https://github.com/iojs/io.js/commit/5cda2542fdb086f9fe5de889bea435a65e377dea * Upgrade V8 to 3.9.24.7 - * Upgrade npm to 1.1.15 - * Handle Emoji characters properly (Erik Corry, Bert Belder) - * readline: migrate ansi/vt100 logic from tty to readline (Nathan Rajlich) - * readline: Fix multiline handling (Alex Kocharin) - * add a -i/--interactive flag to force the REPL (Nathan Rajlich) - * debugger: add breakOnException command (Fedor Indutny) - * cluster: kill workers when master dies (Andreas Madsen) - * cluster: add graceful disconnect support (Andreas Madsen) - * child_process: Separate 'close' event from 'exit' (Charlie McConnell) - * typed arrays: add Uint8ClampedArray (Mikael Bourges-Sevenier) - * buffer: Fix byte alignment issues (Ben Noordhuis, Erik Lundin) - * tls: fix CryptoStream.setKeepAlive() (Shigeki Ohtsu) - * Expose http parse error codes (Felix Geisendörfer) - * events: don't delete the listeners array (Ben Noordhuis, Nathan Rajlich) - * process: add process.config to view node's ./configure settings (Nathan Rajlich) - * process: process.execArgv to see node's arguments (Micheil Smith) - * process: fix process.title setter (Ben Noordhuis) - * timers: handle negative or non-numeric timeout values (Ben Noordhuis) +## 2012.03.13, Version 0.7.6 (unstable) -2012.03.13, Version 0.7.6 (unstable), f06abda6f58e517349d1b63a2cbf5a8d04a03505 +https://github.com/iojs/io.js/commit/f06abda6f58e517349d1b63a2cbf5a8d04a03505 * Upgrade v8 to 3.9.17 - * Upgrade npm to 1.1.8 - Add support for os/cpu fields in package.json (Adam Blackburn) - Automatically node-gyp packages containing a binding.gyp @@ -2728,337 +2132,224 @@ - Handle cases where an optionalDependency fails to build * events: newListener emit correct fn when using 'once' (Roly Fentanes) - * url: Ignore empty port component (Łukasz Walukiewicz) - * module: replace 'children' array (isaacs) - * tls: parse multiple values of a key in ssl certificate (Sambasiva Suda) - * cluster: support passing of named pipes (Ben Noordhuis) - * Windows: include syscall in fs errors (Bert Belder) - -* http: #2888 Emit end event only once (Igor Zinkovsky) - +* http: [#2888](https://github.com/joyent/node/issues/2888) Emit end event only once (Igor Zinkovsky) * readline: add multiline support (Rlidwka) - * process: add `process.hrtime()` (Nathan Rajlich) - * net, http, https: add localAddress option (Dmitry Nizovtsev) - * addon improvements (Nathan Rajlich) - * build improvements (Ben Noordhuis, Sadique Ali, T.C. Hollingsworth, Nathan Rajlich) - * add support for "SEARCH" request methods (Nathan Rajlich) - * expose the zlib and http_parser version in process.versions (Nathan Rajlich) +## 2012.02.23, Version 0.7.5 (unstable) -2012.02.23, Version 0.7.5 (unstable), d384b8b0d2ab7f05465f0a3e15fe20b4e25b5f86 +https://github.com/iojs/io.js/commit/d384b8b0d2ab7f05465f0a3e15fe20b4e25b5f86 * startup speed improvements (Maciej Małecki) - * crypto: add function getDiffieHellman() (Tomasz Buchert) - * buffer: support decoding of URL-safe base64 (Ben Noordhuis) - * Make QueryString.parse() even faster (Brian White) - * url: decode url entities in auth section (Ben Noordhuis) - * http: support PURGE request method (Ben Noordhuis) - * http: Generate Date headers on responses (Mark Nottingham) - -* Fix #2762: Add callback to close function. (Mikeal Rogers) - +* Fix [#2762](https://github.com/joyent/node/issues/2762): Add callback to close function. (Mikeal Rogers) * dgram: fix out-of-bound memory read (Ben Noordhuis) - * repl: add automatic loading of built-in libs (Brandon Benvie) - * repl: remove double calls where possible (Fedor Indutny) - -* Readline improvements. Related: #2737 #2756 (Colton Baker) - +* Readline improvements. Related: [#2737](https://github.com/joyent/node/issues/2737) [#2756](https://github.com/joyent/node/issues/2756) (Colton Baker) * build: disable -fomit-frame-pointer on solaris (Dave Pacheco) - * build: arch detection improvements (Nathan Rajlich) - * build: Make a fat binary for the OS X `make pkg`. (Nathan Rajlich) - * jslint src/ and lib/ on 'make test' (isaacs) +## 2012.02.14, Version 0.7.4 (unstable) - -2012.02.14, Version 0.7.4 (unstable), de21de920cf93ec40736ada3792a7f85f3eadeda +https://github.com/iojs/io.js/commit/de21de920cf93ec40736ada3792a7f85f3eadeda * Upgrade V8 to 3.9.5 - * Upgrade npm to 1.1.1 - * build: Detect host_arch better (Karl Skomski) - * debugger: export `debug_port` to `process` (Fedor Indutny) - * api docs: CSS bug fixes (isaacs) - * build: use -fPIC for native addons on UNIX (Nathan Rajlich) - * Re-add top-level v8::Locker (Marcel Laverdet) - * Move images out of the dist tarballs (isaacs) - * libuv: Remove uv_export and uv_import (Ben Noordhuis) - * build: Support x64 build on Windows (Igor Zinkovsky) +## 2012.02.07, Version 0.7.3 (unstable) -2012.02.07, Version 0.7.3 (unstable), 99059aad8d654acda4abcfaa68df182b50f2ec90 +https://github.com/iojs/io.js/commit/99059aad8d654acda4abcfaa68df182b50f2ec90 * Upgrade V8 to 3.9.2 - * Revert support for isolates. (Ben Noordhuis) - * cluster: Cleanup docs, event handling, and process.disconnect (Andreas Madsen) - * gyp_addon: link with node.lib on Windows (Nathan Rajlich) - * http: fix case where http-parser is freed twice (koichik) - * Windows: disable RTTI and exceptions (Bert Belder) +## 2012.02.01, Version 0.7.2 (unstable) -2012.02.01, Version 0.7.2 (unstable), ec79acb3a6166e30f0bf271fbbfda1fb575b3321 +https://github.com/iojs/io.js/commit/ec79acb3a6166e30f0bf271fbbfda1fb575b3321 * Update V8 to 3.8.9 - * Support for sharing streams across Isolates (Igor Zinkovsky) - -* #2636 - Fix case where http_parsers are freed too early (koichik) - +* [#2636](https://github.com/joyent/node/issues/2636) - Fix case where http_parsers are freed too early (koichik) * url: Support for IPv6 addresses in URLs (Łukasz Walukiewicz) - * child_process: Add disconnect() method to child processes (Andreas Madsen) - * fs: add O_EXCL support, exclusive open file (Ben Noordhuis) - * fs: more specific error messages (Tj Holowaychuk) - * tty: emit 'unknown' key event if key sequence not found (Dan VerWeire, Nathan Rajlich) - * build: compile release build too if BUILDTYPE=Debug (Ben Noordhuis) - * module: fix --debug-brk on symlinked scripts (Fedor Indutny) - * zlib: fix `Failed to set dictionary` issue (Fedor Indutny) - * waf: predict target arch for OS X (Fedor Indutny) +## 2012.01.23, Version 0.7.1 (unstable) -2012.01.23, Version 0.7.1 (unstable), a74354735ab5d5b0fa35a1e4ff7e653757d2069b +https://github.com/iojs/io.js/commit/a74354735ab5d5b0fa35a1e4ff7e653757d2069b * Update V8 to 3.8.8 - * Install node-waf by default (Fedor Indutny) - * crypto: Add ability to turn off PKCS padding (Ingmar Runge) - * v8: implement VirtualMemory class on SunOS (Ben Noordhuis) - * Add cluster.setupMaster (Andreas Madsen) - * move `path.exists*` to `fs.exists*` (Maciej Małecki) - * typed arrays: set class name (Ben Noordhuis) - * libuv bug fixes (Igor Zinkovsky, Ben Noordhuis, Dan VerWeire) +## 2012.01.16, Version 0.7.0 (unstable) -2012.01.16, Version 0.7.0 (unstable), 9cc55dca6f67a6096c858b841c677b0593404321 +https://github.com/iojs/io.js/commit/9cc55dca6f67a6096c858b841c677b0593404321 * Upgrade V8 to 3.8.6 - * Use GYP build system on unix (Ben Noordhuis) - * Experimenetal isolates support (Ben Noordhuis) - * Improvements to Cluster API (Andreas Madsen) - * Use isolates for internal debugger (Fedor Indutny) - * Bug fixes +## 2012.07.10 Version 0.6.20 (maintenance) -2012.07.10 Version 0.6.20 (maintenance), 952e513379169ec1b40909d1db056e9bf4294899 +https://github.com/iojs/io.js/commit/952e513379169ec1b40909d1db056e9bf4294899 * npm: Upgrade to 1.1.37 (isaacs) - * benchmark: Backport improvements made in master (isaacs) - * build: always link with -lz (Trent Mick) - * core: use proper #include directives (Ben Noordhuis) - * cluster: don't silently drop messages when the write queue gets big (Bert Belder) - * windows: don't print error when GetConsoleTitleW returns an empty string (Bert Belder) +## 2012.06.06 Version 0.6.19 (stable) -2012.06.06 Version 0.6.19 (stable), debf552ed2d4a53957446e82ff3c52a8182d5ff4 +https://github.com/iojs/io.js/commit/debf552ed2d4a53957446e82ff3c52a8182d5ff4 * npm: upgrade to 1.1.24 - * fs: no end emit after createReadStream.pause() (Andreas Madsen) - * vm: cleanup module memory leakage (Marcel Laverdet) - * unix: fix loop starvation under high network load (Ben Noordhuis) - * unix: remove abort() in ev_unref() (Ben Noordhuis) - * windows/tty: never report error after forcibly aborting line-buffered read (Bert Belder) - * windows: skip GetFileAttributes call when opening a file (Bert Belder) +## 2012.05.15 Version 0.6.18 (stable) -2012.05.15 Version 0.6.18 (stable), 4bc1d395de6abed2cf1e4d0b7b3a1480a21c368f +https://github.com/iojs/io.js/commit/4bc1d395de6abed2cf1e4d0b7b3a1480a21c368f * windows: skip GetFileAttributes call when opening a file (Bert Belder) - * crypto: add PKCS12/PFX support (Sambasiva Suda) - -* #3240: child_process: delete NODE_CHANNEL_FD from env in spawn (Ben Noordhuis) - +* [#3240](https://github.com/joyent/node/issues/3240): child_process: delete NODE_CHANNEL_FD from env in spawn (Ben Noordhuis) * windows: add test for path.normalize with UNC paths (Bert Belder) - * windows: make path.normalize convert all slashes to backslashes (Bert Belder) - * fs: Automatically close FSWatcher on error (Bert Belder) - -* #3258: fs.ReadStream.pause() emits duplicate data event (koichik) - +* [#3258](https://github.com/joyent/node/issues/3258): fs.ReadStream.pause() emits duplicate data event (koichik) * pipe_wrap: don't assert() on pipe accept errors (Ben Noordhuis) - * Better exception output for module load and process.nextTick (Felix Geisendörfer) - * zlib: fix error reporting (Ben Noordhuis) - * http: Don't destroy on timeout (isaacs) +* [#3231](https://github.com/joyent/node/issues/3231): http: Don't try to emit error on a null'ed req object (isaacs) +* [#3236](https://github.com/joyent/node/issues/3236): http: Refactor ClientRequest.onSocket (isaacs) -* #3231: http: Don't try to emit error on a null'ed req object (isaacs) - -* #3236: http: Refactor ClientRequest.onSocket (isaacs) - +## 2012.05.04 Version 0.6.17 (stable) -2012.05.04 Version 0.6.17 (stable), 4ced23deaf36493f4303a18f6fdce768c58becc0 +https://github.com/iojs/io.js/commit/4ced23deaf36493f4303a18f6fdce768c58becc0 * Upgrade npm to 1.1.21 - * uv: Add support for EROFS errors (Ben Noordhuis, Maciej Małecki) - * uv: Add support for EIO and ENOSPC errors (Fedor Indutny) - * windows: Add support for EXDEV errors (Bert Belder) - * http: Fix client memory leaks (isaacs, Vincent Voyer) - * fs: fix file descriptor leak in sync functions (Ben Noordhuis) - * fs: fix ReadStream / WriteStream double close bug (Ben Noordhuis) +## 2012.04.30 Version 0.6.16 (stable) -2012.04.30 Version 0.6.16 (stable), a1d193963ddc80a27da5da01b59751e14e33d1d6 +https://github.com/iojs/io.js/commit/a1d193963ddc80a27da5da01b59751e14e33d1d6 * Upgrade V8 to 3.6.6.25 - * Upgrade npm to 1.1.19 - * Windows: add mappings for UV_ENOENT (Bert Belder) - * linux: add IN_MOVE_SELF to inotify event mask (Ben Noordhuis) - * unix: call pipe handle connection cb on accept() error (Ben Noordhuis) - * unix: handle EWOULDBLOCK (Ben Noordhuis) - * map EWOULDBLOCK to UV_EAGAIN (Ben Noordhuis) - * Map ENOMEM to UV_ENOMEM (isaacs) - * Child process: support the `gid` and `uid` options (Bert Belder) - * test: cluster: add worker death event test (Ben Noordhuis) - * typo in node_http_parser (isaacs) - * http_parser: Eat CRLF between requests, even on connection:close. (Ben Noordhuis) - * don't check return value of unsetenv (Ben Noordhuis) +## 2012.04.09 Version 0.6.15 (stable) -2012.04.09 Version 0.6.15 (stable), f160a45b254e591eb33716311c92be533c6d86c4 +https://github.com/iojs/io.js/commit/f160a45b254e591eb33716311c92be533c6d86c4 * Update npm to 1.1.16 - * Show licenses in binary installers. - * unix: add uv_fs_read64, uv_fs_write64 and uv_fs_ftruncate64 (Ben Noordhuis) - * add 64bit offset fs functions (Igor Zinkovsky) - * windows: don't report ENOTSOCK when attempting to bind an udp handle twice (Bert Belder) - * windows: backport pipe-connect-to-file fixes from master (Bert Belder) - * windows: never call fs event callbacks after closing the watcher (Bert Belder) - * fs.readFile: don't make the callback before the fd is closed (Bert Belder) - * windows: use 64bit offsets for uv_fs apis (Igor Zinkovsky) +* Fix [#2061](https://github.com/joyent/node/issues/2061): segmentation fault on OS X due to stat size mismatch (Ben Noordhuis) -* Fix #2061: segmentation fault on OS X due to stat size mismatch (Ben Noordhuis) +## 2012.03.22 Version 0.6.14 (stable) - -2012.03.22 Version 0.6.14 (stable), e513ffef7549a56a5af728e1f0c2c0c8f290518a +https://github.com/iojs/io.js/commit/e513ffef7549a56a5af728e1f0c2c0c8f290518a * net: don't crash when queued write fails (Igor Zinkovsky) - * sunos: fix EMFILE on process.memoryUsage() (Bryan Cantrill) - * crypto: fix compile-time error with openssl 0.9.7e (Ben Noordhuis) - * unix: ignore ECONNABORTED errors from accept() (Ben Noordhuis) - * Add UV_ENOSPC and mappings to it (Bert Belder) - * http-parser: Fix response body is not read (koichik) - * Upgrade npm to 1.1.12 - upgrade node-gyp to 0.3.7 - work around AV-locked directories on Windows - - Fix isaacs/npm#2293 Don't try to 'uninstall' / + - Fix isaacs/npm[#2293](https://github.com/joyent/node/issues/2293) Don't try to 'uninstall' / - Exclude symbolic links from packages. - - Fix isaacs/npm#2275 Spurious 'unresolvable cycle' error. + - Fix isaacs/npm[#2275](https://github.com/joyent/node/issues/2275) Spurious 'unresolvable cycle' error. - Exclude/include dot files as if they were normal files +## 2012.03.15 Version 0.6.13 (stable) -2012.03.15 Version 0.6.13 (stable), 9f7f86b534f8556290eb8cad915984ff4ca54996 +https://github.com/iojs/io.js/commit/9f7f86b534f8556290eb8cad915984ff4ca54996 * Windows: Many libuv test fixes (Bert Belder) - * Windows: avoid uv_guess_handle crash in when fd < 0 (Bert Belder) - * Map EBUSY and ENOTEMPTY errors (Bert Belder) - * Windows: include syscall in fs errors (Bert Belder) - * Fix fs.watch ENOSYS on Linux kernel version mismatch (Ben Noordhuis) - * Update npm to 1.1.9 - upgrade node-gyp to 0.3.5 (Nathan Rajlich) - - Fix isaacs/npm#2249 Add cache-max and cache-min configs + - Fix isaacs/npm[#2249](https://github.com/joyent/node/issues/2249) Add cache-max and cache-min configs - Properly redirect across https/http registry requests - log config usage if undefined key in set function (Kris Windham) - Add support for os/cpu fields in package.json (Adam Blackburn) @@ -3067,37 +2358,24 @@ - Never create un-listable directories - Handle cases where an optionalDependency fails to build +## 2012.03.02 Version 0.6.12 (stable) -2012.03.02 Version 0.6.12 (stable), 48a2d34cfe6b7e1c9d15202a4ef5e3c82d1fba35 +https://github.com/iojs/io.js/commit/48a2d34cfe6b7e1c9d15202a4ef5e3c82d1fba35 * Upgrade V8 to 3.6.6.24 - * dtrace ustack helper improvements (Dave Pacheco) - * API Documentation refactor (isaacs) - -* #2827 net: fix race write() before and after connect() (koichik) - -* #2554 #2567 throw if fs args for 'start' or 'end' are strings (AJ ONeal) - +* [#2827](https://github.com/joyent/node/issues/2827) net: fix race write() before and after connect() (koichik) +* [#2554](https://github.com/joyent/node/issues/2554) [#2567](https://github.com/joyent/node/issues/2567) throw if fs args for 'start' or 'end' are strings (AJ ONeal) * punycode: Update to v1.0.0 (Mathias Bynens) - * Make a fat binary for the OS X pkg (isaacs) - * Fix hang on accessing process.stdin (isaacs) - * repl: make tab completion work on non-objects (Nathan Rajlich) - * Fix fs.watch on OS X (Ben Noordhuis) - -* Fix #2515 nested setTimeouts cause premature process exit (Ben Noordhuis) - +* Fix [#2515](https://github.com/joyent/node/issues/2515) nested setTimeouts cause premature process exit (Ben Noordhuis) * windows: fix time conversion in stat (Igor Zinkovsky) - * windows: fs: handle EOF in read (Brandon Philips) - * windows: avoid IOCP short-circuit on non-ifs lsps (Igor Zinkovsky) - * Upgrade npm to 1.1.4 (isaacs) - windows fixes - Bundle nested bundleDependencies properly @@ -3107,343 +2385,229 @@ - don't run make clean on rebuild - support HTTPS-over-HTTP proxy tunneling +## 2012.02.17 Version 0.6.11 (stable) -2012.02.17 Version 0.6.11 (stable), 1eb1fe32250fc88cb5b0a97cddf3e02be02e3f4a +https://github.com/iojs/io.js/commit/1eb1fe32250fc88cb5b0a97cddf3e02be02e3f4a * http: allow multiple WebSocket RFC6455 headers (Einar Otto Stangvik) - * http: allow multiple WWW-Authenticate headers (Ben Noordhuis) - * windows: support unicode argv and environment variables (Bert Belder) - * tls: mitigate session renegotiation attacks (Ben Noordhuis) - * tcp, pipe: don't assert on uv_accept() errors (Ben Noordhuis) - * tls: Allow establishing secure connection on the existing socket (koichik) - * dgram: handle close of dgram socket before DNS lookup completes (Seth Fitzsimmons) - * windows: Support half-duplex pipes (Igor Zinkovsky) - * build: disable omit-frame-pointer on solaris systems (Dave Pacheco) - * debugger: fix --debug-brk (Ben Noordhuis) - * net: fix large file downloads failing (koichik) - * fs: fix ReadStream failure to read from existing fd (Christopher Jeffrey) - * net: destroy socket on DNS error (Stefan Rusu) - * dtrace: add missing translator (Dave Pacheco) - * unix: don't flush tty on switch to raw mode (Ben Noordhuis) - * windows: reset brightness when reverting to default text color (Bert Belder) - * npm: update to 1.1.1 - Update which, fstream, mkdirp, request, and rimraf - - Fix #2123 Set path properly for lifecycle scripts on windows - - Mark the root as seen, so we don't recurse into it. Fixes #1838. (Martin Cooper) + - Fix [#2123](https://github.com/joyent/node/issues/2123) Set path properly for lifecycle scripts on windows + - Mark the root as seen, so we don't recurse into it. Fixes [#1838](https://github.com/joyent/node/issues/1838). (Martin Cooper) +## 2012.02.02, Version 0.6.10 (stable) -2012.02.02, Version 0.6.10 (stable), 051908e023f87894fa68f5b64d0b99a19a7db01e +https://github.com/iojs/io.js/commit/051908e023f87894fa68f5b64d0b99a19a7db01e * Update V8 to 3.6.6.20 - * Add npm msysgit bash shim to msi installer (isaacs) - * buffers: fix intermittent out of bounds error (Ben Noordhuis) - * buffers: honor length argument in base64 decoder (Ben Noordhuis) - * windows: Fix path.exists regression (Bert Belder) - * Make QueryString.parse run faster (Philip Tellis) - * http: avoid freeing http-parser objects too early (koichik) - * timers: add v0.4 compatibility hack (Ben Noordhuis) - * Proper EPERM error code support (Igor Zinkovsky, Brandon Philips) - * dgram: Implement udp multicast methods on windows (Bert Belder) +## 2012.01.27, Version 0.6.9 (stable) -2012.01.27, Version 0.6.9 (stable), f19e20d33f57c4d2853aaea7d2724d44f3b0012f +https://github.com/iojs/io.js/commit/f19e20d33f57c4d2853aaea7d2724d44f3b0012f * dgram: Bring back missing functionality for Unix (Dan VerWeire, Roman Shtylman, Ben Noordhuis) - Note: Windows UDP support not yet complete. * http: Fix parser memory leak (koichik) - -* zlib: Fix #2365 crashes on invalid input (Nicolas LaCasse) - +* zlib: Fix [#2365](https://github.com/joyent/node/issues/2365) crashes on invalid input (Nicolas LaCasse) * module: fix --debug-brk on symlinked scripts (Fedor Indutny) - * Documentation Restyling (Matthew Fitzsimmons) - * Update npm to 1.1.0-3 (isaacs) - * Windows: fix regression in stat() calls to C:\ (Bert Belder) +## 2012.01.19, Version 0.6.8 (stable) -2012.01.19, Version 0.6.8 (stable), d18cebaf8a7ac701dabd71a3aa4eb0571db6a645 +https://github.com/iojs/io.js/commit/d18cebaf8a7ac701dabd71a3aa4eb0571db6a645 * Update V8 to 3.6.6.19 - * Numeric key hash collision fix for V8 (Erik Corry, Fedor Indutny) - * Add missing TTY key translations for F1-F5 on Windows (Brandon Benvie) - * path.extname bugfix with . and .. paths (Bert Belder) - * cluster: don't always kill the master on uncaughtException (Ben Noordhuis) - * Update npm to 1.1.0-2 (isaacs) - * typed arrays: set class name (Ben Noordhuis) - * zlib binding cleanup (isaacs, Bert Belder) - * dgram: use slab memory allocator (Michael Bernstein) +* fix segfault [#2473](https://github.com/joyent/node/issues/2473) +* [#2521](https://github.com/joyent/node/issues/2521) 60% improvement in fs.stat on Windows (Igor Zinkovsky) -* fix segfault #2473 - -* #2521 60% improvement in fs.stat on Windows (Igor Zinkovsky) - +## 2012.01.06, Version 0.6.7 (stable) -2012.01.06, Version 0.6.7 (stable), d5a189acef14a851287ee555f7a39431fe276e1c +https://github.com/iojs/io.js/commit/d5a189acef14a851287ee555f7a39431fe276e1c * V8 hash collision fix (Breaks MIPS) (Bert Belder, Erik Corry) - * Upgrade V8 to 3.6.6.15 - * Upgrade npm to 1.1.0-beta-10 (isaacs) - * many doc updates (Ben Noordhuis, Jeremy Martin, koichik, Dave Irvine, Seong-Rak Choi, Shannen, Adam Malcontenti-Wilson, koichik) * Fix segfault in node_http_parser.cc - * dgram, timers: fix memory leaks (Ben Noordhuis, Yoshihiro Kikuchi) - * repl: fix repl.start not passing the `ignoreUndefined` arg (Damon Oehlman) - -* #1980: Socket.pause null reference when called on a closed Stream (koichik) - -* #2263: XMLHttpRequest piped in a writable file stream hang (koichik) - -* #2069: http resource leak (koichik) - +* [#1980](https://github.com/joyent/node/issues/1980): Socket.pause null reference when called on a closed Stream (koichik) +* [#2263](https://github.com/joyent/node/issues/2263): XMLHttpRequest piped in a writable file stream hang (koichik) +* [#2069](https://github.com/joyent/node/issues/2069): http resource leak (koichik) * buffer.readInt global pollution fix (Phil Sung) - * timers: fix performance regression (Ben Noordhuis) - -* #2308, #2246: node swallows openssl error on request (koichik) - -* #2114: timers: remove _idleTimeout from item in .unenroll() (James Hartig) - -* #2379: debugger: Request backtrace w/o refs (Fedor Indutny) - +* [#2308](https://github.com/joyent/node/issues/2308), [#2246](https://github.com/joyent/node/issues/2246): node swallows openssl error on request (koichik) +* [#2114](https://github.com/joyent/node/issues/2114): timers: remove _idleTimeout from item in .unenroll() (James Hartig) +* [#2379](https://github.com/joyent/node/issues/2379): debugger: Request backtrace w/o refs (Fedor Indutny) * simple DTrace ustack helper (Dave Pacheco) - * crypto: rewrite HexDecode without snprintf (Roman Shtylman) - * crypto: don't ignore DH init errors (Ben Noordhuis) +## 2011.12.14, Version 0.6.6 (stable) -2011.12.14, Version 0.6.6 (stable), 9a059ea69e1f6ebd8899246682d8ca257610b8ab +https://github.com/iojs/io.js/commit/9a059ea69e1f6ebd8899246682d8ca257610b8ab * npm update to 1.1.0-beta-4 (Isaac Z. Schlueter) - * cli: fix output of --help (Ben Noordhuis) - * new website - * pause/resume semantics for stdin (Isaac Z. Schlueter) - * Travis CI integration (Maciej Małecki) - * child_process: Fix bug regarding closed stdin (Ben Noordhuis) - * Enable upgrades in MSI. (Igor Zinkovsky) - * net: Fixes memory leak (Ben Noordhuis) - * fs: handle fractional or NaN ReadStream buffer size (Ben Noordhuis) - * crypto: fix memory leaks in PBKDF2 error path (Ben Noordhuis) +## 2011.12.04, Version 0.6.5 (stable) -2011.12.04, Version 0.6.5 (stable), 6cc94db653a2739ab28e33b2d6a63c51bd986a9f +https://github.com/iojs/io.js/commit/6cc94db653a2739ab28e33b2d6a63c51bd986a9f * npm workaround Windows antivirus software (isaacs) - * Upgrade V8 to 3.6.6.11 +## 2011.12.02, Version 0.6.4 (stable) -2011.12.02, Version 0.6.4 (stable), 9170077f13e5e5475b23d1d3c2e7f69bfe139727 +https://github.com/iojs/io.js/commit/9170077f13e5e5475b23d1d3c2e7f69bfe139727 * doc improvements (Kyle Young, Tim Oxley, Roman Shtylman, Mathias Bynens) - * upgrade bundled npm (Isaac Schlueter) - * polish Windows installer (Igor Zinkovsky, Isaac Schlueter) - * punycode: upgrade to v0.2.1 (Mathias Bynens) - * build: add –without-npm flag to configure script - * sys: deprecate module some more, print stack trace if NODE_DEBUG=sys - * cli: add -p switch, prints result of –eval +* [#1997](https://github.com/joyent/node/issues/1997): fix Blowfish ECB encryption and decryption (Ingmar Runge) +* [#2223](https://github.com/joyent/node/issues/2223): fix socket ‘close’ event being emitted twice +* [#2224](https://github.com/joyent/node/issues/2224): fix RSS memory usage > 4 GB reporting (Russ Bradberry) +* [#2225](https://github.com/joyent/node/issues/2225): fix util.inspect() object stringification bug (Nathan Rajlich) -* #1997: fix Blowfish ECB encryption and decryption (Ingmar Runge) - -* #2223: fix socket ‘close’ event being emitted twice - -* #2224: fix RSS memory usage > 4 GB reporting (Russ Bradberry) - -* #2225: fix util.inspect() object stringification bug (Nathan Rajlich) - +## 2011.11.25, Version 0.6.3 (stable) -2011.11.25, Version 0.6.3 (stable), b159c6d62e5756d3f8847419d29c6959ea288b56 +https://github.com/iojs/io.js/commit/b159c6d62e5756d3f8847419d29c6959ea288b56 -* #2083 Land NPM in Node. It is included in packages/installers and installed +* [#2083](https://github.com/joyent/node/issues/2083) Land NPM in Node. It is included in packages/installers and installed on `make install`. -* #2076 Add logos to windows installer. - -* #1711 Correctly handle http requests without headers. (Ben Noordhuis, +* [#2076](https://github.com/joyent/node/issues/2076) Add logos to windows installer. +* [#1711](https://github.com/joyent/node/issues/1711) Correctly handle http requests without headers. (Ben Noordhuis, Felix Geisendörfer) * TLS: expose more openssl SSL context options and constants. (Ben Noordhuis) - -* #2177 Windows: don't kill UDP socket when a packet fails to reach its +* [#2177](https://github.com/joyent/node/issues/2177) Windows: don't kill UDP socket when a packet fails to reach its destination. (Bert Belder) * Windows: support paths longer than 260 characters. (Igor Zinkovsky) - * Windows: correctly resolve drive-relative paths. (Bert Belder) +* [#2166](https://github.com/joyent/node/issues/2166) Don't leave file descriptor open after lchmod. (Isaac Schlueter) +* [#2084](https://github.com/joyent/node/issues/2084) Add OS X .pkg build script to make file. +* [#2160](https://github.com/joyent/node/issues/2160) Documentation improvements. (Ben Noordhuis) -* #2166 Don't leave file descriptor open after lchmod. (Isaac Schlueter) - -* #2084 Add OS X .pkg build script to make file. +## 2011.11.18, Version 0.6.2 (stable) -* #2160 Documentation improvements. (Ben Noordhuis) - - -2011.11.18, Version 0.6.2 (stable), a4402f0b2e410b19375a1d5c5fb7fe7f66f3c7f8 +https://github.com/iojs/io.js/commit/a4402f0b2e410b19375a1d5c5fb7fe7f66f3c7f8 * doc improvements (Artur Adib, Trevor Burnham, Ryan Emery, Trent Mick) - * timers: remember extra setTimeout() arguments when timeout==0 - * punycode: use Mathias Bynens's punycode library, it's more compliant - * repl: improved tab completion (Ryan Emery) - * buffer: fix range checks in .writeInt() functions (Lukasz Walukiewicz) - * tls: make cipher list configurable - * addons: make Buffer and ObjectWrap visible to Windows add-ons (Bert Belder) - -* crypto: add PKCS#1 a.k.a RSA public key verification support - +* crypto: add PKCS[#1](https://github.com/joyent/node/issues/1) a.k.a RSA public key verification support * windows: fix stdout writes when redirected to nul - * sunos: fix build on Solaris and Illumos - * Upgrade V8 to 3.6.6.8 +## 2011.11.11, Version 0.6.1 (stable) -2011.11.11, Version 0.6.1 (stable), 170f2addb2dd0c625bc4a6d461e89a31ad68b79b +https://github.com/iojs/io.js/commit/170f2addb2dd0c625bc4a6d461e89a31ad68b79b * doc improvements (Eric Lovett, Ben Noordhuis, Scott Anderson, Yoji SHIDARA) - * crypto: make thread-safe (Ben Noordhuis) - * fix process.kill error object - * debugger: correctly handle source with multi-byte characters (Shigeki Ohtsu) - * make stdout and stderr non-destroyable (Igor Zinkovsky) - * fs: don't close uninitialized fs.watch handle (Ben Noordhuis) - -* #2026 fix man page install on BSDs (Ben Noordhuis) - -* #2040 fix unrecognized errno assert in uv_err_name - -* #2043 fs: mkdir() should call callback if mode is omitted - -* #2045 fs: fix fs.realpath on windows to return on error (Benjamin Pasero) - -* #2047 minor cluster improvements - -* #2052 readline get window columns correctly - +* [#2026](https://github.com/joyent/node/issues/2026) fix man page install on BSDs (Ben Noordhuis) +* [#2040](https://github.com/joyent/node/issues/2040) fix unrecognized errno assert in uv_err_name +* [#2043](https://github.com/joyent/node/issues/2043) fs: mkdir() should call callback if mode is omitted +* [#2045](https://github.com/joyent/node/issues/2045) fs: fix fs.realpath on windows to return on error (Benjamin Pasero) +* [#2047](https://github.com/joyent/node/issues/2047) minor cluster improvements +* [#2052](https://github.com/joyent/node/issues/2052) readline get window columns correctly * Upgrade V8 to 3.6.6.7 +## 2011.11.04, Version 0.6.0 (stable) -2011.11.04, Version 0.6.0 (stable), 865b077819a9271a29f982faaef99dc635b57fbc +https://github.com/iojs/io.js/commit/865b077819a9271a29f982faaef99dc635b57fbc * print undefined on undefined values in REPL (Nathan Rajlich) - * doc improvements (koichik, seebees, bnoordhuis, Maciej Małecki, Jacob Kragh) * support native addon loading in windows (Bert Belder) - * rename getNetworkInterfaces() to networkInterfaces() (bnoordhuis) - * add pending accepts knob for windows (igorzi) - * http.request(url.parse(x)) (seebees) - -* #1929 zlib Respond to 'resume' events properly (isaacs) - +* [#1929](https://github.com/joyent/node/issues/1929) zlib Respond to 'resume' events properly (isaacs) * stream.pipe: Remove resume and pause events - * test fixes for windows (igorzi) - * build system improvements (bnoordhuis) - -* #1936 tls: does not emit 'end' from EncryptedStream (koichik) - -* #758 tls: add address(), remoteAddress/remotePort - -* #1399 http: emit Error object after .abort() (bnoordhuis) - -* #1999 fs: make mkdir() default to 0777 permissions (bnoordhuis) - -* #2001 fix pipe error codes - -* #2002 Socket.write should reset timeout timer - +* [#1936](https://github.com/joyent/node/issues/1936) tls: does not emit 'end' from EncryptedStream (koichik) +* [#758](https://github.com/joyent/node/issues/758) tls: add address(), remoteAddress/remotePort +* [#1399](https://github.com/joyent/node/issues/1399) http: emit Error object after .abort() (bnoordhuis) +* [#1999](https://github.com/joyent/node/issues/1999) fs: make mkdir() default to 0777 permissions (bnoordhuis) +* [#2001](https://github.com/joyent/node/issues/2001) fix pipe error codes +* [#2002](https://github.com/joyent/node/issues/2002) Socket.write should reset timeout timer * stdout and stderr are blocking when associated with file too. - * remote debugger support on windows (Bert Belder) - * convenience methods for zlib (Matt Robenolt) - * process.kill support on windows (igorzi) - * process.uptime() support on windows (igorzi) - * Return IPv4 addresses before IPv6 addresses from getaddrinfo - * util.inspect improvements (Nathan Rajlich) - * cluster module api changes - * Downgrade V8 to 3.6.6.6 +## 2011.10.21, Version 0.5.10 (unstable) -2011.10.21, Version 0.5.10 (unstable), 220e61c1f65bf4db09699fcf6399c0809c0bc446 +https://github.com/iojs/io.js/commit/220e61c1f65bf4db09699fcf6399c0809c0bc446 * Remove cmake build system, support for Cygwin, legacy code base, process.ENV, process.ARGV, process.memoryUsage().vsize, os.openOSHandle @@ -3452,253 +2616,181 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Performance improvements (Daniel Ennis, Bert Belder, Ben Noordhuis) - * Long process.title support (Ben Noordhuis) - * net: register net.Server callback only once (Simen Brekken) - * net: fix connect queue bugs (Ben Noordhuis) - * debugger: fix backtrace err handling (Fedor Indutny) - * Use getaddrinfo instead of c-ares for dns.lookup - * Emit 'end' from crypto streams on close - -* #1902 buffer: use NO_NULL_TERMINATION flag (koichik) - -* #1907 http: Added support for HTTP PATCH verb (Thomas Parslow) - -* #1644 add GetCPUInfo on windows (Karl Skomski) - -* #1484, #1834, #1482, #771 Don't use a separate context for the repl. +* [#1902](https://github.com/joyent/node/issues/1902) buffer: use NO_NULL_TERMINATION flag (koichik) +* [#1907](https://github.com/joyent/node/issues/1907) http: Added support for HTTP PATCH verb (Thomas Parslow) +* [#1644](https://github.com/joyent/node/issues/1644) add GetCPUInfo on windows (Karl Skomski) +* [#1484](https://github.com/joyent/node/issues/1484), [#1834](https://github.com/joyent/node/issues/1834), [#1482](https://github.com/joyent/node/issues/1482), [#771](https://github.com/joyent/node/issues/771) Don't use a separate context for the repl. (isaacs) -* #1882 zlib Update 'availOutBefore' value, and test (isaacs) - -* #1888 child_process.fork: don't modify args (koichik) - -* #1516 tls: requestCert unusable with Firefox and Chrome (koichik) - -* #1467 tls: The TLS API is inconsistent with the TCP API (koichik) - -* #1894 net: fix error handling in listen() (koichik) - -* #1860 console.error now goes through uv_tty_t - +* [#1882](https://github.com/joyent/node/issues/1882) zlib Update 'availOutBefore' value, and test (isaacs) +* [#1888](https://github.com/joyent/node/issues/1888) child_process.fork: don't modify args (koichik) +* [#1516](https://github.com/joyent/node/issues/1516) tls: requestCert unusable with Firefox and Chrome (koichik) +* [#1467](https://github.com/joyent/node/issues/1467) tls: The TLS API is inconsistent with the TCP API (koichik) +* [#1894](https://github.com/joyent/node/issues/1894) net: fix error handling in listen() (koichik) +* [#1860](https://github.com/joyent/node/issues/1860) console.error now goes through uv_tty_t * Upgrade V8 to 3.7.0 - * Upgrade GYP to r1081 +## 2011.10.10, Version 0.5.9 (unstable) -2011.10.10, Version 0.5.9 (unstable), 3bd9b08fb125b606f97a4079b147accfdeebb07d +https://github.com/iojs/io.js/commit/3bd9b08fb125b606f97a4079b147accfdeebb07d * fs.watch interface backed by kqueue, inotify, and ReadDirectoryChangesW (Igor Zinkovsky, Ben Noordhuis) * add dns.resolveTxt (Christian Tellnes) - * Remove legacy http library (Ben Noordhuis) - * child_process.fork returns and works on Windows. Allows passing handles. (Igor Zinkovsky, Bert Belder) -* #1774 Lint and clean up for --harmony_block_scoping (Tyler Larson, Colton +* [#1774](https://github.com/joyent/node/issues/1774) Lint and clean up for --harmony_block_scoping (Tyler Larson, Colton Baker) -* #1813 Fix ctrl+c on Windows (Bert Belder) - -* #1844 unbreak --use-legacy (Ben Noordhuis) - +* [#1813](https://github.com/joyent/node/issues/1813) Fix ctrl+c on Windows (Bert Belder) +* [#1844](https://github.com/joyent/node/issues/1844) unbreak --use-legacy (Ben Noordhuis) * process.stderr now goes through libuv. Both process.stdout and process.stderr are blocking when referencing a TTY. * net_uv performance improvements (Ben Noordhuis, Bert Belder) +## 2011.09.30, Version 0.5.8 (unstable) -2011.09.30, Version 0.5.8 (unstable), 7cc17a0cea1d25188c103745a7d0c24375e3a609 +https://github.com/iojs/io.js/commit/7cc17a0cea1d25188c103745a7d0c24375e3a609 * zlib bindings (isaacs) - * Windows supports TTY ANSI escape codes (Bert Belder) - * Debugger improvements (Fedor Indutny) - * crypto: look up SSL errors with ERR_print_errors() (Ben Noordhuis) - * dns callbacks go through MakeCallback now - * Raise an error when a malformed package.json file is found. (Ben Leslie) - * buffers: handle bad length argument in constructor (Ben Noordhuis) - -* #1726, unref process.stdout - +* [#1726](https://github.com/joyent/node/issues/1726), unref process.stdout * Doc improvements (Ben Noordhuis, Fedor Indutny, koichik) - * Upgrade libuv to fe18438 +## 2011.09.16, Version 0.5.7 (unstable) -2011.09.16, Version 0.5.7 (unstable), 558241166c4f3c516e5a448e676db0b57119212f +https://github.com/iojs/io.js/commit/558241166c4f3c516e5a448e676db0b57119212f * Upgrade V8 to 3.6.4 - * Improve Windows compatibility - * Documentation improvements - * Debugger and REPL improvements (Fedor Indutny) - * Add legacy API support: net.Stream(fd), process.stdout.writable, process.stdout.fd * Fix mkdir EEXIST handling (isaacs) - * Use net_uv instead of net_legacy for stdio - * Do not load readline from util.inspect - -* #1673 Fix bug related to V8 context with accessors (Fedor Indutny) - -* #1634 util: Fix inspection for Error (koichik) - -* #1645 fs: Add positioned file writing feature to fs.WriteStream (Thomas +* [#1673](https://github.com/joyent/node/issues/1673) Fix bug related to V8 context with accessors (Fedor Indutny) +* [#1634](https://github.com/joyent/node/issues/1634) util: Fix inspection for Error (koichik) +* [#1645](https://github.com/joyent/node/issues/1645) fs: Add positioned file writing feature to fs.WriteStream (Thomas Shinnick) -* #1637 fs: Unguarded fs.watchFile cache statWatchers checking fixed (Thomas +* [#1637](https://github.com/joyent/node/issues/1637) fs: Unguarded fs.watchFile cache statWatchers checking fixed (Thomas Shinnick) -* #1695 Forward customFds to ChildProcess.spawn - -* #1707 Fix hasOwnProperty security problem in querystring (isaacs) - -* #1719 Drain OpenSSL error queue +* [#1695](https://github.com/joyent/node/issues/1695) Forward customFds to ChildProcess.spawn +* [#1707](https://github.com/joyent/node/issues/1707) Fix hasOwnProperty security problem in querystring (isaacs) +* [#1719](https://github.com/joyent/node/issues/1719) Drain OpenSSL error queue +## 2011.09.08, Version 0.5.6 (unstable) -2011.09.08, Version 0.5.6 (unstable), b49bec55806574a47403771bce1ee379c2b09ca2 +https://github.com/iojs/io.js/commit/b49bec55806574a47403771bce1ee379c2b09ca2 -* #345, #1635, #1648 Documentation improvements (Thomas Shinnick, +* [#345](https://github.com/joyent/node/issues/345), [#1635](https://github.com/joyent/node/issues/1635), [#1648](https://github.com/joyent/node/issues/1648) Documentation improvements (Thomas Shinnick, Abimanyu Raja, AJ ONeal, Koichi Kobayashi, Michael Jackson, Logan Smyth, Ben Noordhuis) -* #650 Improve path parsing on windows (Bert Belder) - -* #752 Remove headers sent check in OutgoingMessage.getHeader() +* [#650](https://github.com/joyent/node/issues/650) Improve path parsing on windows (Bert Belder) +* [#752](https://github.com/joyent/node/issues/752) Remove headers sent check in OutgoingMessage.getHeader() (Peter Lyons) -* #1236, #1438, #1506, #1513, #1621, #1640, #1647 Libuv-related bugs fixed +* [#1236](https://github.com/joyent/node/issues/1236), [#1438](https://github.com/joyent/node/issues/1438), [#1506](https://github.com/joyent/node/issues/1506), [#1513](https://github.com/joyent/node/issues/1513), [#1621](https://github.com/joyent/node/issues/1621), [#1640](https://github.com/joyent/node/issues/1640), [#1647](https://github.com/joyent/node/issues/1647) Libuv-related bugs fixed (Jorge Chamorro Bieling, Peter Bright, Luis Lavena, Igor Zinkovsky) -* #1296, #1612 crypto: Fix BIO's usage. (Koichi Kobayashi) - -* #1345 Correctly set socket.remoteAddress with libuv backend (Bert Belder) - -* #1429 Don't clobber quick edit mode on windows (Peter Bright) - -* #1503 Make libuv backend default on unix, override with `node --use-legacy` - -* #1565 Fix fs.stat for paths ending with \ on windows (Igor Zinkovsky) - -* #1568 Fix x509 certificate subject parsing (Koichi Kobayashi) - -* #1586 Make socket write encoding case-insensitive (Koichi Kobayashi) - -* #1591, #1656, #1657 Implement fs in libuv, remove libeio and pthread-win32 +* [#1296](https://github.com/joyent/node/issues/1296), [#1612](https://github.com/joyent/node/issues/1612) crypto: Fix BIO's usage. (Koichi Kobayashi) +* [#1345](https://github.com/joyent/node/issues/1345) Correctly set socket.remoteAddress with libuv backend (Bert Belder) +* [#1429](https://github.com/joyent/node/issues/1429) Don't clobber quick edit mode on windows (Peter Bright) +* [#1503](https://github.com/joyent/node/issues/1503) Make libuv backend default on unix, override with `node --use-legacy` +* [#1565](https://github.com/joyent/node/issues/1565) Fix fs.stat for paths ending with \ on windows (Igor Zinkovsky) +* [#1568](https://github.com/joyent/node/issues/1568) Fix x509 certificate subject parsing (Koichi Kobayashi) +* [#1586](https://github.com/joyent/node/issues/1586) Make socket write encoding case-insensitive (Koichi Kobayashi) +* [#1591](https://github.com/joyent/node/issues/1591), [#1656](https://github.com/joyent/node/issues/1656), [#1657](https://github.com/joyent/node/issues/1657) Implement fs in libuv, remove libeio and pthread-win32 dependency on windows (Igor Zinkovsky, Ben Noordhuis, Ryan Dahl, Isaac Schlueter) -* #1592 Don't load-time link against CreateSymbolicLink on windows +* [#1592](https://github.com/joyent/node/issues/1592) Don't load-time link against CreateSymbolicLink on windows (Peter Bright) -* #1601 Improve API consistency when dealing with the socket underlying a HTTP +* [#1601](https://github.com/joyent/node/issues/1601) Improve API consistency when dealing with the socket underlying a HTTP client request (Mikeal Rogers) -* #1610 Remove DigiNotar CA from trusted list (Isaac Schlueter) - -* #1617 Added some win32 os functions (Karl Skomski) - -* #1624 avoid buffer overrun with 'binary' encoding (Koichi Kobayashi) - -* #1633 make Buffer.write() always set _charsWritten (Koichi Kobayashi) - -* #1644 Windows: set executables to be console programs (Peter Bright) - -* #1651 improve inspection for sparse array (Koichi Kobayashi) - -* #1672 set .code='ECONNRESET' on socket hang up errors (Ben Noordhuis) - +* [#1610](https://github.com/joyent/node/issues/1610) Remove DigiNotar CA from trusted list (Isaac Schlueter) +* [#1617](https://github.com/joyent/node/issues/1617) Added some win32 os functions (Karl Skomski) +* [#1624](https://github.com/joyent/node/issues/1624) avoid buffer overrun with 'binary' encoding (Koichi Kobayashi) +* [#1633](https://github.com/joyent/node/issues/1633) make Buffer.write() always set _charsWritten (Koichi Kobayashi) +* [#1644](https://github.com/joyent/node/issues/1644) Windows: set executables to be console programs (Peter Bright) +* [#1651](https://github.com/joyent/node/issues/1651) improve inspection for sparse array (Koichi Kobayashi) +* [#1672](https://github.com/joyent/node/issues/1672) set .code='ECONNRESET' on socket hang up errors (Ben Noordhuis) * Add test case for foaf+ssl client certificate (Niclas Hoyer) - * Added RPATH environment variable to override run-time library paths (Ashok Mudukutore) * Added TLS client-side session resumption support (Sean Cunningham) - * Added additional properties to getPeerCertificate (Nathan Rixham, Niclas Hoyer) * Don't eval repl command twice when an error is thrown (Nathan Rajlich) - * Improve util.isDate() (Nathan Rajlich) - * Improvements in libuv backend and bindings, upgrade libuv to bd6066cb349a9b3a1b0d87b146ddaee06db31d10 * Show warning when using lib/sys.js (Maciej Malecki) - * Support plus sign in url protocol (Maciej Malecki) - * Upgrade V8 to 3.6.2 +## 2011.08.26, Version 0.5.5 (unstable) -2011.08.26, Version 0.5.5 (unstable), d2d53d4bb262f517a227cc178a1648094ba54c20 +https://github.com/iojs/io.js/commit/d2d53d4bb262f517a227cc178a1648094ba54c20 * typed arrays, implementation from Plesk - * fix IP multicast on SunOS - * fix DNS lookup order: IPv4 first, IPv6 second (--use-uv only) - * remove support for UNIX datagram sockets (--use-uv only) - * UDP support for Windows (Bert Belder) - -* #1572 improve tab completion for objects in the REPL (Nathan Rajlich) - -* #1563 fix buffer overflow in child_process module (reported by Dean McNamee) - -* #1546 fix performance regression in http module (reported by Brian Geffon) - -* #1491 add PBKDF2 crypto support (Glen Low) - -* #1447 remove deprecated http.cat() function (Mikeal Rogers) - -* #1140 fix incorrect dispatch of vm.runInContext's filename argument +* [#1572](https://github.com/joyent/node/issues/1572) improve tab completion for objects in the REPL (Nathan Rajlich) +* [#1563](https://github.com/joyent/node/issues/1563) fix buffer overflow in child_process module (reported by Dean McNamee) +* [#1546](https://github.com/joyent/node/issues/1546) fix performance regression in http module (reported by Brian Geffon) +* [#1491](https://github.com/joyent/node/issues/1491) add PBKDF2 crypto support (Glen Low) +* [#1447](https://github.com/joyent/node/issues/1447) remove deprecated http.cat() function (Mikeal Rogers) +* [#1140](https://github.com/joyent/node/issues/1140) fix incorrect dispatch of vm.runInContext's filename argument (Antranig Basman) -* #1140 document vm.runInContext() and vm.createContext() (Antranig Basman) - -* #1428 fix os.freemem() on 64 bits freebsd (Artem Zaytsev) - -* #1164 make all DNS lookups async, fixes uncatchable exceptions +* [#1140](https://github.com/joyent/node/issues/1140) document vm.runInContext() and vm.createContext() (Antranig Basman) +* [#1428](https://github.com/joyent/node/issues/1428) fix os.freemem() on 64 bits freebsd (Artem Zaytsev) +* [#1164](https://github.com/joyent/node/issues/1164) make all DNS lookups async, fixes uncatchable exceptions (Koichi Kobayashi) * fix incorrect ssl shutdown check (Tom Hughes) - * various cmake fixes (Tom Hughes) - * improved documentation (Koichi Kobayashi, Logan Smyth, Fedor Indutny, Mikeal Rogers, Maciej Małecki, Antranig Basman, Mickaël Delahaye) * upgrade libuv to commit 835782a - * upgrade V8 to 3.5.8 +## 2011.08.12, Version 0.5.4 (unstable) -2011.08.12, Version 0.5.4 (unstable), cfba1f59224ff8602c3fe9145181cad4c6df89a9 +https://github.com/iojs/io.js/commit/cfba1f59224ff8602c3fe9145181cad4c6df89a9 * libuv/Windows compatibility improvements - * Build on Microsoft Visual Studio via GYP. Use generate-projects.bat in the to build sln files. (Peter Bright, Igor Zinkovsky) @@ -3706,127 +2798,91 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) --use-http1 * Fixes https host header default port handling. (Mikeal Rogers) - -* #1440 strip byte order marker when loading *.js and *.json files +* [#1440](https://github.com/joyent/node/issues/1440) strip byte order marker when loading *.js and *.json files (Ben Noordhuis) -* #1434 Improve util.format() compatibility with browser. (Koichi Kobayashi) - +* [#1434](https://github.com/joyent/node/issues/1434) Improve util.format() compatibility with browser. (Koichi Kobayashi) * Provide unchecked uint entry points for integer Buffer.read/writeInt methods. (Robert Mustacchi) * CMake improvements (Tom Huges) - * Upgrade V8 to 3.5.4. +## 2011.08.01, Version 0.5.3 (unstable) -2011.08.01, Version 0.5.3 (unstable), 4585330afef44ddfb6a4054bd9b0f190b352628b +https://github.com/iojs/io.js/commit/4585330afef44ddfb6a4054bd9b0f190b352628b * Fix crypto encryption/decryption with Base64. (SAWADA Tadashi) - -* #243 Add an optional length argument to Buffer.write() (koichik) - -* #657 convert nonbuffer data to string in fs.writeFile/Sync +* [#243](https://github.com/joyent/node/issues/243) Add an optional length argument to Buffer.write() (koichik) +* [#657](https://github.com/joyent/node/issues/657) convert nonbuffer data to string in fs.writeFile/Sync (Daniel Pihlström) * Add process.features, remove process.useUV (Ben Noordhuis) - -* #324 Fix crypto hmac to accept binary keys + add test cases from rfc 2202 +* [#324](https://github.com/joyent/node/issues/324) Fix crypto hmac to accept binary keys + add test cases from rfc 2202 and 4231 (Stefan Bühler) * Add Socket::bytesRead, Socket::bytesWritten (Alexander Uvarov) - -* #572 Don't print result of --eval in CLI (Ben Noordhuis) - -* #1223 Fix http.ClientRequest crashes if end() was called twice (koichik) - -* #1383 Emit 'close' after all connections have closed (Felix Geisendörfer) - +* [#572](https://github.com/joyent/node/issues/572) Don't print result of --eval in CLI (Ben Noordhuis) +* [#1223](https://github.com/joyent/node/issues/1223) Fix http.ClientRequest crashes if end() was called twice (koichik) +* [#1383](https://github.com/joyent/node/issues/1383) Emit 'close' after all connections have closed (Felix Geisendörfer) * Add sprintf-like util.format() function (Ben Noordhuis) - * Add support for TLS SNI (Fedor Indutny) - * New http agent implementation. Off by default the command line flag --use-http2 will enable it. "make test-http2" will run the tests for the new implementation. (Mikeal Rogers) * Revert AMD compatibility. (isaacs) - * Windows: improvements, child_process support. - * Remove pkg-config file. - * Fix startup time regressions. - * doc improvements +## 2011.07.22, Version 0.5.2 (unstable) -2011.07.22, Version 0.5.2 (unstable), 08ffce1a00dde1199174b390a64a90b60768ddf5 +https://github.com/iojs/io.js/commit/08ffce1a00dde1199174b390a64a90b60768ddf5 * libuv improvements; named pipe support - -* #1242 check for SSL_COMP_get_compression_methods() (Ben Noordhuis) - -* #1348 remove require.paths (isaacs) - -* #1349 Delimit NODE_PATH with ; on Windows (isaacs) - -* #1335 Remove EventEmitter from C++ - -* #1357 Load json files with require() (isaacs) - -* #1374 fix setting ServerResponse.statusCode in writeHead (Trent Mick) - +* [#1242](https://github.com/joyent/node/issues/1242) check for SSL_COMP_get_compression_methods() (Ben Noordhuis) +* [#1348](https://github.com/joyent/node/issues/1348) remove require.paths (isaacs) +* [#1349](https://github.com/joyent/node/issues/1349) Delimit NODE_PATH with ; on Windows (isaacs) +* [#1335](https://github.com/joyent/node/issues/1335) Remove EventEmitter from C++ +* [#1357](https://github.com/joyent/node/issues/1357) Load json files with require() (isaacs) +* [#1374](https://github.com/joyent/node/issues/1374) fix setting ServerResponse.statusCode in writeHead (Trent Mick) * Fixed: GC was being run too often. - * Upgrade V8 to 3.4.14 - * doc improvements +## 2011.07.14, Version 0.5.1 (unstable) -2011.07.14, Version 0.5.1 (unstable), f8bfa54d0fa509f9242637bef2869a1b1e842ec8 +https://github.com/iojs/io.js/commit/f8bfa54d0fa509f9242637bef2869a1b1e842ec8 -* #1233 Fix os.totalmem on FreeBSD amd64 (Artem Zaytsev) - -* #1149 IDNA and Punycode support in url.parse +* [#1233](https://github.com/joyent/node/issues/1233) Fix os.totalmem on FreeBSD amd64 (Artem Zaytsev) +* [#1149](https://github.com/joyent/node/issues/1149) IDNA and Punycode support in url.parse (Jeremy Selier, Ben Noordhuis, isaacs) * Export $CC and $CXX to uv and V8's build systems - * Include pthread-win32 static libraries in build (Igor Zinkovsky) - -* #1199, #1094 Fix fs can't handle large file on 64bit platform (koichik) - -* #1281 Make require a public member of module (isaacs) - -* #1303 Stream.pipe returns the destination (Elijah Insua) - -* #1229 Addons should not -DEV_MULTIPLICITY=0 (Brian White) - +* [#1199](https://github.com/joyent/node/issues/1199), [#1094](https://github.com/joyent/node/issues/1094) Fix fs can't handle large file on 64bit platform (koichik) +* [#1281](https://github.com/joyent/node/issues/1281) Make require a public member of module (isaacs) +* [#1303](https://github.com/joyent/node/issues/1303) Stream.pipe returns the destination (Elijah Insua) +* [#1229](https://github.com/joyent/node/issues/1229) Addons should not -DEV_MULTIPLICITY=0 (Brian White) * libuv backend improvements - * Upgrade V8 to 3.4.10 +## 2011.07.05, Version 0.5.0 (unstable) -2011.07.05, Version 0.5.0 (unstable), ae7ed8482ea7e53c59acbdf3cf0e0a0ae9d792cd +https://github.com/iojs/io.js/commit/ae7ed8482ea7e53c59acbdf3cf0e0a0ae9d792cd * New non-default libuv backend to support IOCP on Windows. Use --use-uv to enable. * deprecate http.cat - * docs improved. - * add child_process.fork - * add fs.utimes() and fs.futimes() support (Ben Noordhuis) - * add process.uptime() (Tom Huges) - * add path.relative (Tony Huang) - * add os.getNetworkInterfaces() - * add remoteAddress and remotePort for client TCP connections (Brian White) @@ -3834,511 +2890,360 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) SSL_OP_CRYPTOPRO_TLSEXT_BUG to TLS (Theo Schlossnagle) * add process.arch (Nathan Rajlich) - * add reading/writing of floats and doubles from/to buffers (Brian White) - * Allow script to be read from stdin - -* #477 add Buffer::fill method to do memset (Konstantin Käfer) - -* #573 Diffie-Hellman support to crypto module (Håvard Stranden) - -* #695 add 'hex' encoding to buffer (isaacs) - -* #851 Update how REPLServer uses contexts (Ben Weaver) - -* #853 add fs.lchow, fs.lchmod, fs.fchmod, fs.fchown (isaacs) - -* #889 Allow to remove all EventEmitter listeners at once +* [#477](https://github.com/joyent/node/issues/477) add Buffer::fill method to do memset (Konstantin Käfer) +* [#573](https://github.com/joyent/node/issues/573) Diffie-Hellman support to crypto module (Håvard Stranden) +* [#695](https://github.com/joyent/node/issues/695) add 'hex' encoding to buffer (isaacs) +* [#851](https://github.com/joyent/node/issues/851) Update how REPLServer uses contexts (Ben Weaver) +* [#853](https://github.com/joyent/node/issues/853) add fs.lchow, fs.lchmod, fs.fchmod, fs.fchown (isaacs) +* [#889](https://github.com/joyent/node/issues/889) Allow to remove all EventEmitter listeners at once (Felix Geisendörfer) -* #926 OpenSSL NPN support (Fedor Indutny) - -* #955 Change ^C handling in REPL (isaacs) - -* #979 add support for Unix Domain Sockets to HTTP (Mark Cavage) - -* #1173 #1170 add AMD, asynchronous module definition (isaacs) - +* [#926](https://github.com/joyent/node/issues/926) OpenSSL NPN support (Fedor Indutny) +* [#955](https://github.com/joyent/node/issues/955) Change ^C handling in REPL (isaacs) +* [#979](https://github.com/joyent/node/issues/979) add support for Unix Domain Sockets to HTTP (Mark Cavage) +* [#1173](https://github.com/joyent/node/issues/1173) [#1170](https://github.com/joyent/node/issues/1170) add AMD, asynchronous module definition (isaacs) * DTrace probes: support X-Forwarded-For (Dave Pacheco) +## 2011.09.15, Version 0.4.12 (stable) -2011.09.15, Version 0.4.12 (stable), 771ba34ca7b839add2ef96879e1ffc684813cf7c +https://github.com/iojs/io.js/commit/771ba34ca7b839add2ef96879e1ffc684813cf7c * Improve docs - -* #1563 overflow in ChildProcess custom_fd. - -* #1569, parse error on multi-line HTTP headers. (Ben Noordhuis) - -* #1586 net: Socket write encoding case sensitivity (koichik) - -* #1610 Remove DigiNotar CA from trusted list (isaacs) - -* #1624 buffer: Avoid overrun with 'binary' encoding. (koichik) - -* #1633 buffer: write() should always set _charsWritten. (koichik) - -* #1707 hasOwnProperty usage security hole in querystring (isaacs) - -* #1719 Drain OpenSSL error queue - +* [#1563](https://github.com/joyent/node/issues/1563) overflow in ChildProcess custom_fd. +* [#1569](https://github.com/joyent/node/issues/1569), parse error on multi-line HTTP headers. (Ben Noordhuis) +* [#1586](https://github.com/joyent/node/issues/1586) net: Socket write encoding case sensitivity (koichik) +* [#1610](https://github.com/joyent/node/issues/1610) Remove DigiNotar CA from trusted list (isaacs) +* [#1624](https://github.com/joyent/node/issues/1624) buffer: Avoid overrun with 'binary' encoding. (koichik) +* [#1633](https://github.com/joyent/node/issues/1633) buffer: write() should always set _charsWritten. (koichik) +* [#1707](https://github.com/joyent/node/issues/1707) hasOwnProperty usage security hole in querystring (isaacs) +* [#1719](https://github.com/joyent/node/issues/1719) Drain OpenSSL error queue * Fix error reporting in net.Server.listen +## 2011.08.17, Version 0.4.11 (stable) -2011.08.17, Version 0.4.11 (stable), a745d19ce7d1c0e3778371af4f0346be70cf2c8e +https://github.com/iojs/io.js/commit/a745d19ce7d1c0e3778371af4f0346be70cf2c8e -* #738 Fix crypto encryption/decryption with Base64. (SAWADA Tadashi) - -* #1202 net.createConnection defer DNS lookup error events to next tick +* [#738](https://github.com/joyent/node/issues/738) Fix crypto encryption/decryption with Base64. (SAWADA Tadashi) +* [#1202](https://github.com/joyent/node/issues/1202) net.createConnection defer DNS lookup error events to next tick (Ben Noordhuis) -* #1374 fix setting ServerResponse.statusCode in writeHead (Trent Mick) - -* #1417 Fix http.ClientRequest crashes if end() was called twice - -* #1497 querystring: Replace 'in' test with 'hasOwnProperty' (isaacs) - -* #1546 http perf improvement - +* [#1374](https://github.com/joyent/node/issues/1374) fix setting ServerResponse.statusCode in writeHead (Trent Mick) +* [#1417](https://github.com/joyent/node/issues/1417) Fix http.ClientRequest crashes if end() was called twice +* [#1497](https://github.com/joyent/node/issues/1497) querystring: Replace 'in' test with 'hasOwnProperty' (isaacs) +* [#1546](https://github.com/joyent/node/issues/1546) http perf improvement * fix memleak in libeio (Tom Hughes) - * cmake improvements (Tom Hughes) - * node_net.cc: fix incorrect sizeof() (Tom Hughes) - * Windows/cygwin: no more GetConsoleTitleW errors on XP (Bert Belder) - * Doc improvments (koichik, Logan Smyth, Ben Noordhuis, Arnout Kazemier) +## 2011.07.19, Version 0.4.10 (stable) -2011.07.19, Version 0.4.10 (stable), 1b8dd65d6e3b82b6863ef38835cc436c5d30c1d5 - -* #394 Fix Buffer drops last null character in UTF-8 - -* #829 Backport r8577 from V8 (Ben Noordhuis) - -* #877 Don't wait for HTTP Agent socket pool to establish connections. - -* #915 Find kqueue on FreeBSD correctly (Brett Kiefer) - -* #1085 HTTP: Fix race in abort/dispatch code (Stefan Rusu) - -* #1274 debugger improvement (Yoshihiro Kikuchi) - -* #1291 Properly respond to HEAD during end(body) hot path (Reid Burke) - -* #1304 TLS: Fix race in abort/connection code (Stefan Rusu) - -* #1360 Allow _ in url hostnames. +https://github.com/iojs/io.js/commit/1b8dd65d6e3b82b6863ef38835cc436c5d30c1d5 +* [#394](https://github.com/joyent/node/issues/394) Fix Buffer drops last null character in UTF-8 +* [#829](https://github.com/joyent/node/issues/829) Backport r8577 from V8 (Ben Noordhuis) +* [#877](https://github.com/joyent/node/issues/877) Don't wait for HTTP Agent socket pool to establish connections. +* [#915](https://github.com/joyent/node/issues/915) Find kqueue on FreeBSD correctly (Brett Kiefer) +* [#1085](https://github.com/joyent/node/issues/1085) HTTP: Fix race in abort/dispatch code (Stefan Rusu) +* [#1274](https://github.com/joyent/node/issues/1274) debugger improvement (Yoshihiro Kikuchi) +* [#1291](https://github.com/joyent/node/issues/1291) Properly respond to HEAD during end(body) hot path (Reid Burke) +* [#1304](https://github.com/joyent/node/issues/1304) TLS: Fix race in abort/connection code (Stefan Rusu) +* [#1360](https://github.com/joyent/node/issues/1360) Allow _ in url hostnames. * Revert 37d529f8 - unbreaks debugger command parsing. - * Bring back global execScript - * Doc improvements +## 2011.06.29, Version 0.4.9 (stable) -2011.06.29, Version 0.4.9 (stable), de44eafd7854d06cd85006f509b7051e8540589b +https://github.com/iojs/io.js/commit/de44eafd7854d06cd85006f509b7051e8540589b * Improve documentation - -* #1095 error handling bug in stream.pipe() (Felix Geisendörfer) - -* #1097 Fix a few leaks in node_crypto.cc (Ben Noordhuis) - -* #562 #1078 Parse file:// urls properly (Ryan Petrello) - -* #880 Option to disable SSLv2 (Jérémy Lal) - -* #1087 Disabling SSL compression disabled with early OpenSSLs. - -* #1144 debugger: don't allow users to input non-valid commands +* [#1095](https://github.com/joyent/node/issues/1095) error handling bug in stream.pipe() (Felix Geisendörfer) +* [#1097](https://github.com/joyent/node/issues/1097) Fix a few leaks in node_crypto.cc (Ben Noordhuis) +* [#562](https://github.com/joyent/node/issues/562) [#1078](https://github.com/joyent/node/issues/1078) Parse file:// urls properly (Ryan Petrello) +* [#880](https://github.com/joyent/node/issues/880) Option to disable SSLv2 (Jérémy Lal) +* [#1087](https://github.com/joyent/node/issues/1087) Disabling SSL compression disabled with early OpenSSLs. +* [#1144](https://github.com/joyent/node/issues/1144) debugger: don't allow users to input non-valid commands (Siddharth Mahendraker) * Perf improvement for util.inherits - -* #1166 Support for signature verification with RSA/DSA public keys +* [#1166](https://github.com/joyent/node/issues/1166) Support for signature verification with RSA/DSA public keys (Mark Cavage) -* #1177 Remove node_modules lookup optimization to better support +* [#1177](https://github.com/joyent/node/issues/1177) Remove node_modules lookup optimization to better support nested project structures (Mathias Buus) -* #1203 Add missing scope.Close to fs.sendfileSync - -* #1187 Support multiple 'link' headers - -* #1196 Fix -e/--eval can't load module from node_modules (Koichi Kobayashi) - +* [#1203](https://github.com/joyent/node/issues/1203) Add missing scope.Close to fs.sendfileSync +* [#1187](https://github.com/joyent/node/issues/1187) Support multiple 'link' headers +* [#1196](https://github.com/joyent/node/issues/1196) Fix -e/--eval can't load module from node_modules (Koichi Kobayashi) * Upgrade V8 to 3.1.8.25, upgrade http-parser. +## 2011.05.20, Version 0.4.8 (stable) -2011.05.20, Version 0.4.8 (stable), 7dd22c26e4365698dc3efddf138c4d399cb912c8 - -* #974 Properly report traceless errors (isaacs) - -* #983 Better JSON.parse error detection in REPL (isaacs) - -* #836 Agent socket errors bubble up to req only if req exists - -* #1041 Fix event listener leak check timing (koichik) +https://github.com/iojs/io.js/commit/7dd22c26e4365698dc3efddf138c4d399cb912c8 -* #1038 Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR" +* [#974](https://github.com/joyent/node/issues/974) Properly report traceless errors (isaacs) +* [#983](https://github.com/joyent/node/issues/983) Better JSON.parse error detection in REPL (isaacs) +* [#836](https://github.com/joyent/node/issues/836) Agent socket errors bubble up to req only if req exists +* [#1041](https://github.com/joyent/node/issues/1041) Fix event listener leak check timing (koichik) +* [#1038](https://github.com/joyent/node/issues/1038) Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR" (koichik) -* #1073 Share SSL context between server connections (Fedor Indutny) - +* [#1073](https://github.com/joyent/node/issues/1073) Share SSL context between server connections (Fedor Indutny) * Disable compression with OpenSSL. Improves memory perf. - * Implement os.totalmem() and os.freemem() for SunOS (Alexandre Marangone) - * Fix a special characters in URL regression (isaacs) - * Fix idle timeouts in HTTPS (Felix Geisendörfer) - * SlowBuffer.write() with 'ucs2' throws ReferenceError. (koichik) - * http.ServerRequest 'close' sometimes gets an error argument (Felix Geisendörfer) * Doc improvements - * cleartextstream.destroy() should close(2) the socket. Previously was being mapped to a shutdown(2) syscall. * No longer compile out asserts and debug statements in normal build. - * Debugger improvements. - * Upgrade V8 to 3.1.8.16. +## 2011.04.22, Version 0.4.7 (stable) -2011.04.22, Version 0.4.7 (stable), c85455a954411b38232e79752d4abb61bb75031b - -* Don't emit error on ECONNRESET from read() #670 +https://github.com/iojs/io.js/commit/c85455a954411b38232e79752d4abb61bb75031b -* Fix: Multiple pipes to the same stream were broken #929 +* Don't emit error on ECONNRESET from read() [#670](https://github.com/joyent/node/issues/670) +* Fix: Multiple pipes to the same stream were broken [#929](https://github.com/joyent/node/issues/929) (Felix Geisendörfer) -* URL parsing/formatting corrections #954 (isaacs) - +* URL parsing/formatting corrections [#954](https://github.com/joyent/node/issues/954) (isaacs) * make it possible to do repl.start('', stream) (Wade Simmons) - * Add os.loadavg for SunOS (Robert Mustacchi) - -* Fix timeouts with floating point numbers #897 (Jorge Chamorro Bieling) - +* Fix timeouts with floating point numbers [#897](https://github.com/joyent/node/issues/897) (Jorge Chamorro Bieling) * Improve docs. +## 2011.04.13, Version 0.4.6 (stable) -2011.04.13, Version 0.4.6 (stable), 58002d56bc79410c5ff397fc0e1ffec0665db38a - -* Don't error on ENOTCONN from shutdown() #670 +https://github.com/iojs/io.js/commit/58002d56bc79410c5ff397fc0e1ffec0665db38a +* Don't error on ENOTCONN from shutdown() [#670](https://github.com/joyent/node/issues/670) * Auto completion of built-in debugger suggests prefix match rather than partial match. (koichik) -* circular reference in vm modules. #822 (Jakub Lekstan) - -* http response.readable should be false after 'end' #867 (Abe Fettig) - +* circular reference in vm modules. [#822](https://github.com/joyent/node/issues/822) (Jakub Lekstan) +* http response.readable should be false after 'end' [#867](https://github.com/joyent/node/issues/867) (Abe Fettig) * Implement os.cpus() and os.uptime() on Solaris (Scott McWhirter) - -* fs.ReadStream: Allow omission of end option for range reads #801 +* fs.ReadStream: Allow omission of end option for range reads [#801](https://github.com/joyent/node/issues/801) (Felix Geisendörfer) * Buffer.write() with UCS-2 should not be write partial char - #916 (koichik) + [#916](https://github.com/joyent/node/issues/916) (koichik) * Pass secureProtocol through on tls.Server creation (Theo Schlossnagle) - * TLS use RC4-SHA by default - -* Don't strangely drop out of event loop on HTTPS client uploads #892 - +* Don't strangely drop out of event loop on HTTPS client uploads [#892](https://github.com/joyent/node/issues/892) * Doc improvements - * Upgrade v8 to 3.1.8.10 +## 2011.04.01, Version 0.4.5 (stable) -2011.04.01, Version 0.4.5 (stable), 787a343b588de26784fef97f953420b53a6e1d73 +https://github.com/iojs/io.js/commit/787a343b588de26784fef97f953420b53a6e1d73 * Fix listener leak in stream.pipe() (Mikeal Rogers) - * Retain buffers in fs.read/write() GH-814 (Jorge Chamorro Bieling) - * TLS performance improvements - * SlowBuffer.prototype.slice bug GH-843 - * process.stderr.write should return true - * Immediate pause/resume race condition GH-535 (isaacs) - * Set default host header properly GH-721 (isaacs) - * Upgrade V8 to 3.1.8.8 +## 2011.03.26, Version 0.4.4 (stable) -2011.03.26, Version 0.4.4 (stable), 25122b986a90ba0982697b7abcb0158c302a1019 +https://github.com/iojs/io.js/commit/25122b986a90ba0982697b7abcb0158c302a1019 * CryptoStream.end shouldn't throw if not writable GH-820 - * Drop out if connection destroyed before connect() GH-819 - * expose https.Agent - * Correctly setsid in tty.open GH-815 - * Bug fix for failed buffer construction - * Added support for removing .once listeners (GH-806) - * Upgrade V8 to 3.1.8.5 +## 2011.03.18, Version 0.4.3 (stable) -2011.03.18, Version 0.4.3 (stable), c095ce1a1b41ca015758a713283bf1f0bd41e4c4 +https://github.com/iojs/io.js/commit/c095ce1a1b41ca015758a713283bf1f0bd41e4c4 * Don't decrease server connection counter again if destroy() is called more than once GH-431 (Andreas Reich, Anders Conbere) * Documentation improvements (koichik) - * Fix bug with setMaxListeners GH-682 - * Start up memory footprint improvement. (Tom Hughes) - * Solaris improvements. - * Buffer::Length(Buffer*) should not invoke itself recursively GH-759 (Ben Noordhuis) * TLS: Advertise support for client certs GH-774 (Theo Schlossnagle) - * HTTP Agent bugs: GH-787, GH-784, GH-803. - * Don't call GetMemoryUsage every 5 seconds. - * Upgrade V8 to 3.1.8.3 +## 2011.03.02, Version 0.4.2 (stable) -2011.03.02, Version 0.4.2 (stable), 39280e1b5731f3fcd8cc42ad41b86cdfdcb6d58b +https://github.com/iojs/io.js/commit/39280e1b5731f3fcd8cc42ad41b86cdfdcb6d58b * Improve docs. - * Fix process.on edge case with signal event (Alexis Sellier) - * Pragma HTTP header comma separation - * In addition to 'aborted' emit 'close' from incoming requests (Felix Geisendörfer) * Fix memleak in vm.runInNewContext - * Do not cache modules that throw exceptions (Felix Geisendörfer) - * Build system changes for libnode (Aria Stewart) - * Read up the prototype of the 'env' object. (Nathan Rajlich) - * Add 'close' and 'aborted' events to Agent responses - * http: fix missing 'drain' events (Russell Haering) - * Fix process.stdout.end() throws ENOTSOCK error. (Koichi Kobayashi) - * REPL bug fixes (isaacs) - * node_modules folders should be highest priority (isaacs) - * URL parse more safely (isaacs) - * Expose errno with a string for dns/cares (Felix Geisendörfer) - * Fix tty.setWindowSize - * spawn: setuid after chdir (isaacs) - * SIGUSR1 should break the VM without delay - * Upgrade V8 to 3.1.8. +## 2011.02.19, Version 0.4.1 (stable) -2011.02.19, Version 0.4.1 (stable), e8aef84191bc2c1ba2bcaa54f30aabde7f03769b +https://github.com/iojs/io.js/commit/e8aef84191bc2c1ba2bcaa54f30aabde7f03769b * Fixed field merging with progressive fields on writeHead() (TJ Holowaychuk) * Make the repl respect node_modules folders (isaacs) - * Fix for DNS fail in HTTP request (Richard Rodger) - * Default to port 80 for http.request and http.get. - * Improve V8 support for Cygwin (Bert Belder) - * Fix fs.open param parsing. (Felix Geisendörfer) - * Fixed null signal. - * Fix various HTTP and HTTPS bugs - * cmake improvements (Tom Hughes) - * Fix: TLS sockets should not be writable after 'end' - * Fix os.cpus() on cygwin (Brian White) - * MinGW: OpenSSL support (Bert Belder) - * Upgrade V8 to 3.1.5, libev to 4.4. +## 2011.02.10, Version 0.4.0 (stable) -2011.02.10, Version 0.4.0 (stable), eb155ea6f6a6aa341aa8c731dca8da545c6a4008 +https://github.com/iojs/io.js/commit/eb155ea6f6a6aa341aa8c731dca8da545c6a4008 * require() improvements (isaacs) - understand package.json (isaacs) - look for 'node_modules' dir * cmake fixes (Daniel Gröber) - * http: fix buffer writes to outgoing messages (Russell Haering) - * Expose UCS-2 Encoding (Konstantin Käfer) - * Support strings for octal modes (isaacs) - * Support array-ish args to Buffer ctor (isaacs) - * cygwin and mingw improvements (Bert Belder) - * TLS improvements - * Fewer syscalls during require (Bert Belder, isaacs) - * More DTrace probes (Bryan Cantrill, Robert Mustacchi) - * 'pipe' event on pipe() (Mikeal Rogers) - * CRL support in TLS (Theo Schlossnagle) - * HTTP header manipulation methods (Tim Caswell, Charlie Robbins) - * Upgrade V8 to 3.1.2 +## 2011.02.04, Version 0.3.8 (unstable) -2011.02.04, Version 0.3.8 (unstable), 9493b7563bff31525b4080df5aeef09747782d5e +https://github.com/iojs/io.js/commit/9493b7563bff31525b4080df5aeef09747782d5e * Add req.abort() for client side requests. - * Add exception.code for easy testing: Example: if (err.code == 'EADDRINUSE'); * Add process.stderr. - * require.main is the main module. (Isaac Schlueter) - * dgram: setMulticastTTL, setMulticastLoopback and addMembership. (Joe Walnes) * Fix throttling in TLS connections - * Add socket.bufferSize - * MinGW improvements (Bert Belder) - * Upgrade V8 to 3.1.1 -2011.01.27, Version 0.3.7 (unstable), d8579c6afdbe868de6dffa8db78bbe4ba2d03e0e +## 2011.01.27, Version 0.3.7 (unstable) -* Expose agent in http and https client. (Mikeal Rogers) +https://github.com/iojs/io.js/commit/d8579c6afdbe868de6dffa8db78bbe4ba2d03e0e +* Expose agent in http and https client. (Mikeal Rogers) * Fix bug in http request's end method. (Ali Farhadi) - * MinGW: better net support (Bert Belder) - * fs.open should set FD_CLOEXEC - * DTrace probes (Bryan Cantrill) - * REPL fixes and improvements (isaacs, Bert Belder) - * Fix many bugs with legacy http.Client interface - * Deprecate process.assert. Use require('assert').ok - * Add callback parameter to socket.setTimeout(). (Ali Farhadi) - * Fixing bug in http request default encoding (Ali Farhadi) - * require: A module ID with a trailing slash must be a dir. (isaacs) * Add ext_key_usage to getPeerCertificate (Greg Hughes) - * Error when child_process.exec hits maxBuffer. - * Fix option parsing in tls.connect() - * Upgrade to V8 3.0.10 +## 2011.01.21, Version 0.3.6 (unstable) -2011.01.21, Version 0.3.6 (unstable), bb3e71466e5240626d9d21cf791fe43e87d90011 +https://github.com/iojs/io.js/commit/bb3e71466e5240626d9d21cf791fe43e87d90011 * REPL and other improvements on MinGW (Bert Belder) - * listen/bind errors should close net.Server - * New HTTP and HTTPS client APIs - * Upgrade V8 to 3.0.9 +## 2011.01.16, Version 0.3.5 (unstable) -2011.01.16, Version 0.3.5 (unstable), b622bc6305e3c675e0edfcdbaa387d849ad0bba0 +https://github.com/iojs/io.js/commit/b622bc6305e3c675e0edfcdbaa387d849ad0bba0 * Built-in debugger improvements. - * Add setsid, setuid, setgid options to child_process.spawn (Isaac Schlueter) * tty module improvements. - * Upgrade libev to 4.3, libeio to latest, c-ares to 1.7.4 - * Allow third party hooks before main module load. (See 496be457b6a2bc5b01ec13644b9c9783976159b2) * Don't stat() on cached modules. (Felix Geisendörfer) +## 2011.01.08, Version 0.3.4 (unstable) -2011.01.08, Version 0.3.4 (unstable), 73f53e12e4a5b9ef7dbb4792bd5f8ad403094441 +https://github.com/iojs/io.js/commit/73f53e12e4a5b9ef7dbb4792bd5f8ad403094441 * Primordial mingw build (Bert Belder) - * HTTPS server - * Built in debugger 'node debug script.js' - * realpath files during module load (Mihai Călin Bazon) - * Rename net.Stream to net.Socket (existing name will continue to be supported) * Fix process.platform +## 2011.01.02, Version 0.3.3 (unstable) -2011.01.02, Version 0.3.3 (unstable), 57544ba1c54c7d0da890317deeb73076350c5647 +https://github.com/iojs/io.js/commit/57544ba1c54c7d0da890317deeb73076350c5647 * TLS improvements. - * url.parse(url, true) defaults query field to {} (Jeremy Martin) - * Upgrade V8 to 3.0.4 - * Handle ECONNABORT properly (Theo Schlossnagle) - * Fix memory leaks (Tom Hughes) - * Add os.cpus(), os.freemem(), os.totalmem(), os.loadavg() and other functions for OSX, Linux, and Cygwin. (Brian White) @@ -4346,27 +3251,21 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) evaluated. * Use process.stdin instead of process.openStdin(). - * Disable TLS tests when node doesn't have OpenSSL. +## 2010.12.16, Version 0.3.2 (unstable) -2010.12.16, Version 0.3.2 (unstable), 4bb914bde9f3c2d6de00853353b6b8fc9c66143a +https://github.com/iojs/io.js/commit/4bb914bde9f3c2d6de00853353b6b8fc9c66143a * Rip out the old (broken) TLS implementation introduce new tested implementation and API. See docs. HTTPS not supported in this release. * Introduce 'os' and 'tty' modules. - * Callback parameters for socket.write() and socket.connect(). - * Support CNAME lookups in DNS module. (Ben Noordhuis) - * cmake support (Tom Hughes) - * 'make lint' - * oprofile support (./configure --oprofile) - * Lots of bug fixes, including: - Memory leak in ChildProcess:Spawn(). (Tom Hughes) - buffer.slice(0, 0) @@ -4378,50 +3277,36 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Brian White) * Deprecate process.compile, process.ENV - * Upgrade V8 to 3.0.3, upgrade http-parser. +## 2010.11.16, Version 0.3.1 (unstable) -2010.11.16, Version 0.3.1 (unstable), ce9a54aa1fbf709dd30316af8a2f14d83150e947 +https://github.com/iojs/io.js/commit/ce9a54aa1fbf709dd30316af8a2f14d83150e947 * TLS improvements (Paul Querna) - Centralize error handling in SecureStream - Add SecurePair for handling of a ssl/tls stream. * New documentation organization (Micheil Smith) - * allowHalfOpen TCP connections disabled by default. - * Add C++ API for constructing fast buffer from string - * Move idle timers into its own module - * Gracefully handle EMFILE and server.maxConnections - * make "node --eval" eval in the global scope. (Jorge Chamorro Bieling) * Let exit listeners know the exit code (isaacs) - * Handle cyclic links smarter in fs.realpath (isaacs) - * Remove node-repl (just use 'node' without args) - * Rewrite libeio After callback to use req->result instead of req->errorno for error checking (Micheil Smith) * Remove warning about deprecating 'sys' - too aggressive - * Make writes to process.env update the real environment. (Ben Noordhuis) - * Set FD_CLOEXEC flag on stdio FDs before spawning. (Guillaume Tuton) - * Move ev_loop out of javascript - * Switch \n with \r\n for all strings printed out. - * Added support for cross compilation (Rasmus Andersson) - * Add --profile flag to configure script, enables gprof profiling. (Ben Noordhuis) @@ -4434,45 +3319,30 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) - Update url.resolve() to use new path.join behavior. * API: Move process.binding('evals') to require('vm') - * Fix V8 build on Cygwin (Bert Belder) - * Add ref to buffer during fs.write and fs.read - * Fix segfault on test-crypto - * Upgrade http-parser to latest and V8 to 2.5.3 +## 2010.10.23, Version 0.3.0 (unstable) -2010.10.23, Version 0.3.0 (unstable) 1582cfebd6719b2d2373547994b3dca5c8c569c0 +https://github.com/iojs/io.js/commit/1582cfebd6719b2d2373547994b3dca5c8c569c0 * Bugfix: Do not spin on accept() with EMFILE - * Improvements to readline.js (Trent Mick, Johan Euphrosine, Brian White) - * Safe constructors (missing 'new' doesn't segfault) - * Fix process.nextTick so thrown errors don't confuse it. (Benjamin Thomas) * Allow Strings for ports on net.Server.listen (Bradley Meck) - * fs bugfixes (Tj Holowaychuk, Tobie Langel, Marco Rogers, isaacs) - * http bug fixes (Fedor Indutny, Mikeal Rogers) - * Faster buffers; breaks C++ API (Tim-Smart, Stéphan Kochen) - * crypto, tls improvements (Paul Querna) - * Add lfs flags to node addon script - * Simpler querystring parsing; breaks API (Peter Griess) - * HTTP trailers (Mark Nottingham) - * http 100-continue support (Mark Nottingham) - * Module system simplifications (Herbert Vojčík, isaacs, Tim-Smart) - remove require.async - remove registerExtension, add .extensions @@ -4481,96 +3351,69 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) - require looks in node_modules folders * Add --eval command line option (TJ Holowaychuk) - * Commas last in sys.inspect - * Constants moved from process object to require('constants') - * Fix parsing of linux memory (Vitali Lovich) - * inspect shows function names (Jorge Chamorro Bieling) - * uncaughtException corner cases (Felix Geisendörfer) - * TCP clients now buffer writes before connection - * Rename sys module to 'util' (Micheil Smith) - * Properly set stdio handlers to blocking on SIGTERM and SIGINT (Tom Hughes) * Add destroy methods to HTTP messages - * base64 improvements (isaacs, Jorge Chamorro Bieling) - * API for defining REPL commands (Sami Samhuri) - * child_process.exec timeout fix (Aaron Heckmann) - * Upgrade V8 to 2.5.1, Libev to 4.00, libeio, http-parser +## 2010.08.20, Version 0.2.0 -2010.08.20, Version 0.2.0, 9283e134e558900ba89d9a33c18a9bdedab07cb9 +https://github.com/iojs/io.js/commit/9283e134e558900ba89d9a33c18a9bdedab07cb9 * process.title support for FreeBSD, Macintosh, Linux - * Fix OpenSSL 100% CPU usage on error (Illarionov Oleg) - * Implement net.Server.maxConnections. - * Fix process.platform, add process.version. - * Add --without-snapshot configure option. - * Readline REPL improvements (Trent Mick) - * Bug fixes. - * Upgrade V8 to 2.3.8 +## 2010.08.13, Version 0.1.104 -2010.08.13, Version 0.1.104, b14dd49222687c12f3e8eac597cff4f2674f84e8 +https://github.com/iojs/io.js/commit/b14dd49222687c12f3e8eac597cff4f2674f84e8 * Various bug fixes (console, querystring, require) - * Set cwd for child processes (Bert Belder) - * Tab completion for readline (Trent Mick) - * process.title getter/setter for OSX, Linux, Cygwin. (Rasmus Andersson, Bert Belder) * Upgrade V8 to 2.3.6 +## 2010.08.04, Version 0.1.103 -2010.08.04, Version 0.1.103, 0b925d075d359d03426f0b32bb58a5e05825b4ea +https://github.com/iojs/io.js/commit/0b925d075d359d03426f0b32bb58a5e05825b4ea * Implement keep-alive for http.Client (Mikeal Rogers) - * base64 fixes. (Ben Noordhuis) - * Fix --debug-brk (Danny Coates) - * Don't let path.normalize get above the root. (Isaac Schlueter) - * Allow signals to be used with process.on in addition to process.addListener. (Brian White) * Globalize the Buffer object - * Use kqueue on recent macintosh builds - * Fix addrlen for unix_dgram sockets (Benjamin Kramer) - * Fix stats.isDirectory() and friends (Benjamin Kramer) - * Upgrade http-parser, V8 to 2.3.5 +## 2010.07.25, Version 0.1.102 -2010.07.25, Version 0.1.102, 2a4568c85f33869c75ff43ccd30f0ec188b43eab +https://github.com/iojs/io.js/commit/2a4568c85f33869c75ff43ccd30f0ec188b43eab * base64 encoding for Buffers. - * Buffer support for Cipher, Decipher, Hmac, Sign and Verify (Andrew Naylor) @@ -4578,79 +3421,62 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Chandra Sekar) * Fix Buffer.toString() on 0-length slices. (Peter Griess) - * Cache modules based on filename rather than ID (Isaac Schlueter) - * querystring improvments (Jan Kassens, Micheil Smith) - * Support DEL in the REPL. (Jérémy Lal) - * Upgrade http-parser, upgrade V8 to 2.3.2 +## 2010.07.16, Version 0.1.101 -2010.07.16, Version 0.1.101, 0174ceb6b24caa0bdfc523934c56af9600fa9b58 +https://github.com/iojs/io.js/commit/0174ceb6b24caa0bdfc523934c56af9600fa9b58 * Added env to child_process.exec (Сергей Крыжановский) - * Allow modules to optionally be loaded in separate contexts with env var NODE_MODULE_CONTEXTS=1. * setTTL and setBroadcast for dgram (Matt Ranney) - * Use execPath for default NODE_PATH, not installPrefix (Isaac Schlueter) * Support of console.dir + console.assert (Jerome Etienne) - * on() as alias to addListener() - * Use javascript port of Ronn to build docs (Jérémy Lal) - * Upgrade V8 to 2.3.0 +## 2010.07.03, Version 0.1.100 -2010.07.03, Version 0.1.100, a6b8586e947f9c3ced180fe68c233d0c252add8b +https://github.com/iojs/io.js/commit/a6b8586e947f9c3ced180fe68c233d0c252add8b * process.execPath (Marshall Culpepper) - * sys.pump (Mikeal Rogers) - * Remove ini and mjsunit libraries. - * Introduce console.log() and friends. - * Switch order of arguments for Buffer.write (Blake Mizerany) - * On overlapping buffers use memmove (Matt Ranney) - * Resolve .local domains with getaddrinfo() - * Upgrade http-parser, V8 to 2.2.21 +## 2010.06.21, Version 0.1.99 -2010.06.21, Version 0.1.99, a620b7298f68f68a855306437a3b60b650d61d78 +https://github.com/iojs/io.js/commit/a620b7298f68f68a855306437a3b60b650d61d78 * Datagram sockets (Paul Querna) - * fs.writeFile could not handle utf8 (Felix Geisendörfer) and now accepts Buffers (Aaron Heckmann) * Fix crypto memory leaks. - * A replacement for decodeURIComponent that doesn't throw. (Isaac Schlueter) * Only concatenate some incoming HTTP headers. (Peter Griess) - * Upgrade V8 to 2.2.18 +## 2010.06.11, Version 0.1.98 -2010.06.11, Version 0.1.98, 10d8adb08933d1d4cea60192c2a31c56d896733d +https://github.com/iojs/io.js/commit/10d8adb08933d1d4cea60192c2a31c56d896733d * Port to Windows/Cygwin (Raffaele Sena) - * File descriptor passing on unix sockets. (Peter Griess) - * Simple, builtin readline library. REPL is now entered by executing "node" without arguments. @@ -4659,35 +3485,28 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Upgrade V8 to 2.2.16, http-parser fixes, upgrade c-ares to 1.7.3. +## 2010.05.29, Version 0.1.97 -2010.05.29, Version 0.1.97, 0c1aa36835fa6a3557843dcbc6ed6714d353a783 +https://github.com/iojs/io.js/commit/0c1aa36835fa6a3557843dcbc6ed6714d353a783 * HTTP throttling: outgoing messages emit 'drain' and write() returns false when send buffer is full. * API: readFileSync without encoding argument now returns a Buffer - * Improve Buffer C++ API; addons now compile with debugging symbols. - * Improvements to path.extname() and REPL; add fs.chown(). - * fs.ReadStream now emits buffers, fs.readFileSync returns buffers. - * Bugfix: parsing HTTP responses to HEAD requests. - * Port to OpenBSD. - * Upgrade V8 to 2.2.12, libeio, http-parser. +## 2010.05.21, Version 0.1.96 -2010.05.21, Version 0.1.96, 9514a4d5476225e8c8310ce5acae2857033bcaaa +https://github.com/iojs/io.js/commit/9514a4d5476225e8c8310ce5acae2857033bcaaa * Thrown errors in http and socket call back get bubbled up. - * Add fs.fsync (Andrew Johnston) - * Bugfix: signal unregistering (Jonas Pfenniger) - * Added better error messages for async and sync fs calls with paths (TJ Holowaychuk) @@ -4695,62 +3514,45 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Felix Geisendörfer) * Fix errno reporting in DNS exceptions. - * Support buffers in fs.WriteStream.write. - * Bugfix: Safely decode a utf8 streams that are broken on a multbyte character (http and net). (Felix Geisendörfer) * Make Buffer's C++ constructor public. - * Deprecate sys.p() - * FIX path.dirname('/tmp') => '/'. (Jonathan Rentzsch) +## 2010.05.13, Version 0.1.95 -2010.05.13, Version 0.1.95, 0914d33842976c2c870df06573b68f9192a1fb7a +https://github.com/iojs/io.js/commit/0914d33842976c2c870df06573b68f9192a1fb7a * Change GC idle notify so that it runs alongside setInterval - * Install node_buffer.h on make install - * fs.readFile returns Buffer by default (Tim Caswell) - * Fix error reporting in child_process callbacks - * Better logic for testing if an argument is a port - * Improve error reporting (single line "node.js:176:9" errors) - * Bugfix: Some http responses being truncated (appeared in 0.1.94) - * Fix long standing net idle timeout bugs. Enable 2 minute timeout by default in HTTP servers. * Add fs.fstat (Ben Noordhuis) - * Upgrade to V8 2.2.9 +## 2010.05.06, Version 0.1.94 -2010.05.06, Version 0.1.94, f711d5343b29d1e72e87107315708e40951a7826 +https://github.com/iojs/io.js/commit/f711d5343b29d1e72e87107315708e40951a7826 * Look in /usr/local/lib/node for modules, so that there's a way to install modules globally (Issac Schlueter) * SSL improvements (Rhys Jones, Paulo Matias) - * Added c-ares headers for linux-arm (Jonathan Knezek) - * Add symbols to release build - * HTTP upgrade improvements, docs (Micheil Smith) - * HTTP server emits 'clientError' instead of printing message - * Bugfix: Don't emit 'error' twice from http.Client - * Bugfix: Ignore SIGPIPE - * Bugfix: destroy() instead of end() http connection at end of pipeline @@ -4759,18 +3561,17 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Upgrade V8 to 2.2.8 +## 2010.04.29, Version 0.1.93 -2010.04.29, Version 0.1.93, 557ba6bd97bad3afe0f9bd3ac07efac0a39978c1 +https://github.com/iojs/io.js/commit/557ba6bd97bad3afe0f9bd3ac07efac0a39978c1 * Fixed no 'end' event on long chunked HTTP messages https://github.com/joyent/node/issues/77 * Remove legacy modules http_old and tcp_old - * Support DNS MX queries (Jérémy Lal) * Fix large socket write (tlb@tlb.org) - * Fix child process exit codes (Felix Geisendörfer) * Allow callers to disable PHP/Rails style parameter munging in @@ -4778,46 +3579,43 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Upgrade V8 to 2.2.6 +## 2010.04.23, Version 0.1.92 -2010.04.23, Version 0.1.92, caa828a242f39b6158084ef4376355161c14fe34 +https://github.com/iojs/io.js/commit/caa828a242f39b6158084ef4376355161c14fe34 * OpenSSL support. Still undocumented (see tests). (Rhys Jones) - * API: Unhandled 'error' events throw. * Script class with eval-function-family in binding('evals') plus tests. (Herbert Vojcik) * stream.setKeepAlive (Julian Lamb) - * Bugfix: Force no body on http 204 and 304 * Upgrade Waf to 1.5.16, V8 to 2.2.4.2 +## 2010.04.15, Version 0.1.91 -2010.04.15, Version 0.1.91, 311d7dee19034ff1c6bc9098c36973b8d687eaba +https://github.com/iojs/io.js/commit/311d7dee19034ff1c6bc9098c36973b8d687eaba * Add incoming.httpVersion - * Object.prototype problem with C-Ares binding * REPL can be run from multiple different streams. (Matt Ranney) - * After V8 heap is compact, don't use a timer every 2 seconds. * Improve nextTick implementation. - * Add primative support for Upgrading HTTP connections. (See commit log for docs 760bba5) * Add timeout and maxBuffer options to child_process.exec - * Fix bugs. * Upgrade V8 to 2.2.3.1 +## 2010.04.09, Version 0.1.90 -2010.04.09, Version 0.1.90, 07e64d45ffa1856e824c4fa6afd0442ba61d6fd8 +https://github.com/iojs/io.js/commit/07e64d45ffa1856e824c4fa6afd0442ba61d6fd8 * Merge writing of networking system (net2) - New Buffer object for binary data. @@ -4827,57 +3625,51 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) - Legacy modules can be accessed at 'http_old' and 'tcp_old' * Replace udns with c-ares. (Krishna Rajendran) - * New documentation system using Markdown and Ronn (Tim Caswell, Micheil Smith) * Better idle-time GC - * Countless small bug fixes. * Upgrade V8 to 2.2.X, WAF 1.5.15 +## 2010.03.19, Version 0.1.33 -2010.03.19, Version 0.1.33, 618296ef571e873976f608d91a3d6b9e65fe8284 +https://github.com/iojs/io.js/commit/618296ef571e873976f608d91a3d6b9e65fe8284 * Include lib/ directory in node executable. Compile on demand. - * evalcx clean ups (Isaac Z. Schlueter, Tim-Smart) * Various fixes, clean ups - * V8 upgraded to 2.1.5 +## 2010.03.12, Version 0.1.32 -2010.03.12, Version 0.1.32, 61c801413544a50000faa7f58376e9b33ba6254f +https://github.com/iojs/io.js/commit/61c801413544a50000faa7f58376e9b33ba6254f * Optimize event emitter for single listener - * Add process.evalcx, require.registerExtension (Tim Smart) * Replace --cflags with --vars - * Fix bugs in fs.create*Stream (Felix Geisendörfer) * Deprecate process.mixin, process.unloop - * Remove the 'Error: (no message)' exceptions, print stack trace instead * INI parser bug fixes (Isaac Schlueter) - * FreeBSD fixes (Vanilla Hsu) * Upgrade to V8 2.1.3, WAF 1.5.14a, libev +## 2010.03.05, Version 0.1.31 -2010.03.05, Version 0.1.31, 39b63dfe1737d46a8c8818c92773ef181fd174b3 +https://github.com/iojs/io.js/commit/39b63dfe1737d46a8c8818c92773ef181fd174b3 * API: - Move process.watchFile into fs module - Move process.inherits to sys * Improve Solaris port - * tcp.Connection.prototype.write now returns boolean to indicate if argument was flushed to the kernel buffer. @@ -4885,62 +3677,51 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Rasmus Andersson) * Add setgid,getgid (James Duncan) - * Improve sys.inspect (Benjamin Thomas) * Allow passing env to child process (Isaac Schlueter) - * fs.createWriteStream, fs.createReadStream (Felix Geisendörfer) * Add INI parser (Rob Ellis) - * Bugfix: fs.readFile handling encoding (Jacek Becela) * Upgrade V8 to 2.1.2 +## 2010.02.22, Version 0.1.30 -2010.02.22, Version 0.1.30, bb0d1e65e1671aaeb21fac186b066701da0bc33b +https://github.com/iojs/io.js/commit/bb0d1e65e1671aaeb21fac186b066701da0bc33b * Major API Changes - - Promises removed. See http://groups.google.com/group/nodejs/msg/426f3071f3eec16b http://groups.google.com/group/nodejs/msg/df199d233ff17efa The API for fs was - fs.readdir("/usr").addCallback(function (files) { puts("/usr files: " + files); }); - It is now - fs.readdir("/usr", function (err, files) { if (err) throw err; puts("/usr files: " + files); }); - - Synchronous fs operations exposed, use with care. - - tcp.Connection.prototype.readPause() and readResume() renamed to pause() and resume() - - http.ServerResponse.prototype.sendHeader() renamed to writeHeader(). Now accepts reasonPhrase. * Compact garbage on idle. - * Configurable debug ports, and --debug-brk (Zoran Tomicic) * Better command line option parsing (Jeremy Ashkenas) - * Add fs.chmod (Micheil Smith), fs.lstat (Isaac Z. Schlueter) * Fixes to process.mixin (Rasmus Andersson, Benjamin Thomas) - * Upgrade V8 to 2.1.1 +## 2010.02.17, Version 0.1.29 -2010.02.17, Version 0.1.29, 87d5e5b316a4276bcf881f176971c1a237dcdc7a +https://github.com/iojs/io.js/commit/87d5e5b316a4276bcf881f176971c1a237dcdc7a * Major API Changes - Remove 'file' module @@ -4963,11 +3744,9 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (tj@vision-media.ca) * sys.inspect(Date) now shows the date value (Mark Hansen) - * Calculate page size with getpagesize for armel (Jérémy Lal) * Bugfix: stderr flushing. - * Bugfix: Promise late chain (Yuichiro MASUI) * Bugfix: wait() on fired promises @@ -4980,30 +3759,27 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Bugfix: Throw from connection.connect if resolving. (Reported by James Golick) +## 2010.02.09, Version 0.1.28 -2010.02.09, Version 0.1.28, 49de41ef463292988ddacfb01a20543b963d9669 +https://github.com/iojs/io.js/commit/49de41ef463292988ddacfb01a20543b963d9669 * Use Google's jsmin.py which can be used for evil. - * Add posix.truncate() * Throw errors from server.listen() - * stdio bugfix (test by Mikeal Rogers) * Module system refactor (Felix Geisendörfer, Blaine Cook) - * Add process.setuid(), getuid() (Michael Carter) * sys.inspect refactor (Tim Caswell) - * Multipart library rewrite (isaacs) +## 2010.02.03, Version 0.1.27 -2010.02.03, Version 0.1.27, 0cfa789cc530848725a8cb5595224e78ae7b9dd0 +https://github.com/iojs/io.js/commit/0cfa789cc530848725a8cb5595224e78ae7b9dd0 * Implemented __dirname (Felix Geisendörfer) - * Downcase process.ARGV, process.ENV, GLOBAL (now process.argv, process.env, global) @@ -5011,7 +3787,6 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Felix Geisendörfer, Jonas Pfenniger) * Make assert.AssertionError instance of Error - * Removed inline require call for querystring (self@cloudhead.net) @@ -5019,29 +3794,25 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Blaine Cook) * Bugfix: HTTP client automatically reconnecting - * Adding OS X .dmg build scripts. (Standa Opichal) * Bugfix: ObjectWrap memory leak - * Bugfix: Multipart handle Content-Type headers with charset (Felix Geisendörfer) * Upgrade http-parser to fix header overflow attack. - * Upgrade V8 to 2.1.0 * Various other bug fixes, performance improvements. +## 2010.01.20, Version 0.1.26 -2010.01.20, Version 0.1.26, da00413196e432247346d9e587f8c78ce5ceb087 +https://github.com/iojs/io.js/commit/da00413196e432247346d9e587f8c78ce5ceb087 * Bugfix, HTTP eof causing crash (Ben Williamson) - * Better error message on SyntaxError * API: Move Promise and EventEmitter into 'events' module - * API: Add process.nextTick() * Allow optional params to setTimeout, setInterval @@ -5053,124 +3824,110 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) - Make unhandled Promise errors throw an exception * Upgrade V8 to 2.0.6.1 - * Solaris port (Erich Ocean) +## 2010.01.09, Version 0.1.25 -2010.01.09, Version 0.1.25, 39ca93549af91575ca9d4cbafd1e170fbcef3dfa +https://github.com/iojs/io.js/commit/39ca93549af91575ca9d4cbafd1e170fbcef3dfa * sys.inspect() improvements (Tim Caswell) - * path module improvements (isaacs, Benjamin Thomas) * API: request.uri -> request.url It is no longer an object, but a string. The 'url' module was addded to parse that string. That is, node no longer parses the request URL automatically. - require('url').parse(request.url) - is roughly equivlent to the old request.uri object. (isaacs) * Bugfix: Several libeio related race conditions. - * Better errors for multipart library (Felix Geisendörfer) * Bugfix: Update node-waf version to 1.5.10 - * getmem for freebsd (Vanilla Hsu) +## 2009.12.31, Version 0.1.24 -2009.12.31, Version 0.1.24, 642c2773a7eb2034f597af1cd404b9e086b59632 +https://github.com/iojs/io.js/commit/642c2773a7eb2034f597af1cd404b9e086b59632 * Bugfix: don't chunk responses to HTTP/1.0 clients, even if they send Connection: Keep-Alive (e.g. wget) * Bugfix: libeio race condition - * Bugfix: Don't segfault on unknown http method * Simplify exception reporting - * Upgrade V8 to 2.0.5.4 +## 2009.12.22, Version 0.1.23 -2009.12.22, Version 0.1.23, f91e347eeeeac1a8bd6a7b462df0321b60f3affc +https://github.com/iojs/io.js/commit/f91e347eeeeac1a8bd6a7b462df0321b60f3affc * Bugfix: require("../blah") issues (isaacs) - * Bugfix: posix.cat (Jonas Pfenniger) * Do not pause request for multipart parsing (Felix Geisendörfer) +## 2009.12.19, Version 0.1.22 -2009.12.19, Version 0.1.22, a2d809fe902f6c4102dba8f2e3e9551aad137c0f +https://github.com/iojs/io.js/commit/a2d809fe902f6c4102dba8f2e3e9551aad137c0f * Bugfix: child modules get wrong id with "index.js" (isaacs) - * Bugfix: require("../foo") cycles (isaacs) * Bugfix: require() should throw error if module does. - * New URI parser stolen from Narwhal (isaacs) * Bugfix: correctly check kqueue and epoll. (Rasmus Andersson) - * Upgrade WAF to 1.5.10 * Bugfix: posix.statSync() was crashing - * Statically define string symbols for performance improvement * Bugfix: ARGV[0] weirdness - * Added superCtor to ctor.super_ instead superCtor.prototype. (Johan Dahlberg) * http-parser supports webdav methods - * API: http.Client.prototype.request() (Christopher Lenz) +## 2009.12.06, Version 0.1.21 -2009.12.06, Version 0.1.21, c6affb64f96a403a14d20035e7fbd6d0ce089db5 +https://github.com/iojs/io.js/commit/c6affb64f96a403a14d20035e7fbd6d0ce089db5 * Feature: Add HTTP client TLS support (Rhys Jones) - * Bugfix: use --jobs=1 with WAF * Bugfix: Don't use chunked encoding for 1.0 requests - * Bugfix: Duplicated header weren't handled correctly * Improve sys.inspect (Xavier Shay) - * Upgrade v8 to 2.0.3 * Use CommonJS assert API (Felix Geisendörfer, Karl Guertin) +## 2009.11.28, Version 0.1.20 -2009.11.28, Version 0.1.20, aa42c6790da8ed2cd2b72051c07f6251fe1724d8 +https://github.com/iojs/io.js/commit/aa42c6790da8ed2cd2b72051c07f6251fe1724d8 * Add gnutls version to configure script - * Add V8 heap info to process.memoryUsage() * process.watchFile callback has 2 arguments with the stat object (choonkeat@gmail.com) +## 2009.11.28, Version 0.1.19 -2009.11.28, Version 0.1.19, 633d6be328708055897b72327b88ac88e158935f +https://github.com/iojs/io.js/commit/633d6be328708055897b72327b88ac88e158935f * Feature: Initial TLS support for TCP servers and clients. (Rhys Jones) * Add options to process.watchFile() - * Add process.umask() (Friedemann Altrock) * Bugfix: only detach timers when active. - * Bugfix: lib/file.js write(), shouldn't always emit errors or success (onne@onnlucky.com) @@ -5181,21 +3938,19 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) (Reported by Elliott Cable) * Improvements to Multipart parser (Felix Geisendörfer) - * New HTTP parser * Upgrade v8 to 2.0.2 +## 2009.11.17, Version 0.1.18 -2009.11.17, Version 0.1.18, 027829d2853a14490e6de9fc5f7094652d045ab8 +https://github.com/iojs/io.js/commit/027829d2853a14490e6de9fc5f7094652d045ab8 * Feature: process.watchFile() process.unwatchFile() - * Feature: "uncaughtException" event on process (Felix Geisendörfer) * Feature: 'drain' event to tcp.Connection - * Bugfix: Promise.timeout() blocked the event loop (Felix Geisendörfer) @@ -5206,23 +3961,23 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) event (Johan Sørensen) * Add EventEmitter.removeListener (frodenius@gmail.com) - * Format JSON for inspecting objects (Felix Geisendörfer) * Upgrade libev to latest CVS +## 2009.11.07, Version 0.1.17 -2009.11.07, Version 0.1.17, d1f69ef35dac810530df8249d523add168e09f03 +https://github.com/iojs/io.js/commit/d1f69ef35dac810530df8249d523add168e09f03 * Feature: process.chdir() (Brandon Beacher) - * Revert http parser upgrade. (b893859c34f05db5c45f416949ebc0eee665cca6) Broke keep-alive. * API: rename process.inherits to sys.inherits +## 2009.11.03, Version 0.1.16 -2009.11.03, Version 0.1.16, 726865af7bbafe58435986f4a193ff11c84e4bfe +https://github.com/iojs/io.js/commit/726865af7bbafe58435986f4a193ff11c84e4bfe * API: Use CommonJS-style module requiring - require("/sys.js") becomes require("sys") @@ -5235,81 +3990,69 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) - Move node.dns into module "dns" - Move node.fs into module "posix" - process is no longer the global object. GLOBAL is. - For more information on the API changes see: http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/6 http://thread.gmane.org/gmane.comp.lang.javascript.nodejs/14 * Feature: process.platform, process.memoryUsage() - * Feature: promise.cancel() (Felix Geisendörfer) * Upgrade V8 to 1.3.18 +## 2009.10.28, Version 0.1.15 -2009.10.28, Version 0.1.15, eca2de73ed786b935507fd1c6faccd8df9938fd3 +https://github.com/iojs/io.js/commit/eca2de73ed786b935507fd1c6faccd8df9938fd3 * Many build system fixes (esp. for OSX users) - * Feature: promise.timeout() (Felix Geisendörfer) * Feature: Added external interface for signal handlers, process.pid, and process.kill() (Brandon Beacher) * API: Rename node.libraryPaths to require.paths - * Bugfix: 'data' event for stdio should emit a string * Large file support - * Upgrade http_parser * Upgrade v8 to 1.3.16 +## 2009.10.09, Version 0.1.14 -2009.10.09, Version 0.1.14, b12c809bb84d1265b6a4d970a5b54ee8a4890513 +https://github.com/iojs/io.js/commit/b12c809bb84d1265b6a4d970a5b54ee8a4890513 * Feature: Improved addon builds with node-waf - * Feature: node.SignalHandler (Brandon Beacher) * Feature: Enable V8 debugging (but still need to make a debugger) - * API: Rename library /utils.js to /sys.js * Clean up Node's build system - * Don't use parseUri for HTTP server * Remove node.pc - * Don't use /bin/sh to create child process except with exec() * API: Add __module to reference current module - * API: Remove include() add node.mixin() * Normalize http headers; "Content-Length" becomes "content-length" - * Upgrade V8 to 1.3.15 +## 2009.09.30, Version 0.1.13 -2009.09.30, Version 0.1.13, 58493bb05b3da3dc8051fabc0bdea9e575c1a107 +https://github.com/iojs/io.js/commit/58493bb05b3da3dc8051fabc0bdea9e575c1a107 * Feature: Multipart stream parser (Felix Geisendörfer) - * API: Move node.puts(), node.exec() and others to /utils.js * API: Move http, tcp libraries to /http.js and /tcp.js - * API: Rename node.exit() to process.exit() * Bugfix: require() and include() should work in callbacks. - * Pass the Host header in http.cat calls * Add warning when coroutine stack size grows too large. - * Enhance repl library (Ray Morgan) * Bugfix: build script for @@ -5320,47 +4063,42 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Add read() and write() to /file.js to read and write whole files at once. +## 2009.09.24, Version 0.1.12 -2009.09.24, Version 0.1.12, 2f56ccb45e87510de712f56705598b3b4e3548ec +https://github.com/iojs/io.js/commit/2f56ccb45e87510de712f56705598b3b4e3548ec * Feature: System modules, node.libraryPaths - * API: Remove "raw" encoding, rename "raws" to "binary". * API: Added connection.setNoDElay() to disable Nagle algo. - * Decrease default TCP server backlog to 128 * Bugfix: memory leak involving node.fs.* methods. - * Upgrade v8 to 1.3.13 +## 2009.09.18, Version 0.1.11 -2009.09.18, Version 0.1.11, 5ddc4f5d0c002bac0ae3d62fc0dc58f0d2d83ec4 +https://github.com/iojs/io.js/commit/5ddc4f5d0c002bac0ae3d62fc0dc58f0d2d83ec4 * API: default to utf8 encoding for node.fs.cat() - * API: add node.exec() * API: node.fs.read() takes a normal encoding parameter. - * API: Change arguments of emit(), emitSuccess(), emitError() * Bugfix: node.fs.write() was stack allocating buffer. - * Bugfix: ReportException shouldn't forget the top frame. * Improve buffering for HTTP outgoing messages - * Fix and reenable x64 macintosh build. * Upgrade v8 to 1.3.11 +## 2009.09.11, Version 0.1.10 -2009.09.11, Version 0.1.10, 12bb0d46ce761e3d00a27170e63b40408c15b558 +https://github.com/iojs/io.js/commit/12bb0d46ce761e3d00a27170e63b40408c15b558 * Feature: raw string encoding "raws" - * Feature: access to environ through "ENV" * Feature: add isDirectory, isFile, isSocket, ... methods @@ -5373,45 +4111,41 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) args from program args. * Add man page. - * Add node-repl * Upgrade v8 to 1.3.10 -2009.09.05, Version 0.1.9, d029764bb32058389ecb31ed54a5d24d2915ad4c +## 2009.09.05, Version 0.1.9 - * Bugfix: Compile on Snow Leopard. +https://github.com/iojs/io.js/commit/d029764bb32058389ecb31ed54a5d24d2915ad4c + * Bugfix: Compile on Snow Leopard. * Bugfix: Malformed URIs raising exceptions. +## 2009.09.04, Version 0.1.8 -2009.09.04, Version 0.1.8, e6d712a937b61567e81b15085edba863be16ba96 +https://github.com/iojs/io.js/commit/e6d712a937b61567e81b15085edba863be16ba96 * Feature: External modules - * Feature: setTimeout() for node.tcp.Connection * Feature: add node.cwd(), node.fs.readdir(), node.fs.mkdir() - * Bugfix: promise.wait() releasing out of order. * Bugfix: Asyncly do getaddrinfo() on Apple. - * Disable useless evcom error messages. * Better stack traces. - * Built natively on x64. * Upgrade v8 to 1.3.9 +## 2009.08.27, Version 0.1.7 -2009.08.27, Version 0.1.7, f7acef9acf8ba8433d697ad5ed99d2e857387e4b +https://github.com/iojs/io.js/commit/f7acef9acf8ba8433d697ad5ed99d2e857387e4b * Feature: global 'process' object. Emits "exit". - * Feature: promise.wait() * Feature: node.stdio - * Feature: EventEmitters emit "newListener" when listeners are added @@ -5419,114 +4153,101 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) headers. * API: Remove buffered file object (node.File) - * API: require(), include() are synchronous. (Uses continuations.) * API: Deprecate onLoad and onExit. - * API: Rename node.Process to node.ChildProcess * Refactor node.Process to take advantage of evcom_reader/writer. - * Upgrade v8 to 1.3.7 +## 2009.08.22, Version 0.1.6 -2009.08.22, Version 0.1.6, 9c97b1db3099d61cd292aa59ec2227a619f3a7ab +https://github.com/iojs/io.js/commit/9c97b1db3099d61cd292aa59ec2227a619f3a7ab * Bugfix: Ignore SIGPIPE. +## 2009.08.21, Version 0.1.5 -2009.08.21, Version 0.1.5, b0fd3e281cb5f7cd8d3a26bd2b89e1b59998e5ed +https://github.com/iojs/io.js/commit/b0fd3e281cb5f7cd8d3a26bd2b89e1b59998e5ed * Bugfix: Buggy connections could crash node.js. Now check connection before sending data every time (Kevin van Zonneveld) * Bugfix: stdin fd (0) being ignored by node.File. (Abe Fettig) - * API: Remove connnection.fullClose() * API: Return the EventEmitter from addListener for chaining. - * API: tcp.Connection "disconnect" event renamed to "close" * Upgrade evcom Upgrade v8 to 1.3.6 +## 2009.08.13, Version 0.1.4 -2009.08.13, Version 0.1.4, 0f888ed6de153f68c17005211d7e0f960a5e34f3 +https://github.com/iojs/io.js/commit/0f888ed6de153f68c17005211d7e0f960a5e34f3 * Major refactor to evcom. - * Enable test-tcp-many-clients. * Add -m32 gcc flag to udns. - * Add connection.readPause() and connection.readResume() Add IncomingMessage.prototype.pause() and resume(). * Fix http benchmark. Wasn't correctly dispatching. - * Bugfix: response.setBodyEncoding("ascii") not working. * Bugfix: Negative ints in HTTP's on_body and node.fs.read() - * Upgrade v8 to 1.3.4 Upgrade libev to 3.8 Upgrade http_parser to v0.2 +## 2009.08.06, Version 0.1.3 -2009.08.06, Version 0.1.3, 695f0296e35b30cf8322fd1bd934810403cca9f3 +https://github.com/iojs/io.js/commit/695f0296e35b30cf8322fd1bd934810403cca9f3 * Upgrade v8 to 1.3.2 - * Bugfix: node.http.ServerRequest.setBodyEncoding('ascii') not working * Bugfix: node.encodeUtf8 was broken. (Connor Dunn) - * Add ranlib to udns Makefile. * Upgrade evcom - fix accepting too many connections issue. - * Initial support for shebang * Add simple command line switches - * Add node.version API +## 2009.08.01, Version 0.1.2 -2009.08.01, Version 0.1.2, 025a34244d1cea94d6d40ad7bf92671cb909a96c +https://github.com/iojs/io.js/commit/025a34244d1cea94d6d40ad7bf92671cb909a96c * Add DNS API - * node.tcp.Server's backlog option is now an argument to listen() * Upgrade V8 to 1.3.1 - * Bugfix: Default to chunked for client requests without Content-Length. * Bugfix: Line numbers in stack traces. - * Bugfix: negative integers in raw encoding stream * Bugfix: node.fs.File was not passing args to promise callbacks. +## 2009.07.27, Version 0.1.1 -2009.07.27, Version 0.1.1, 77d407df2826b20e9177c26c0d2bb4481e497937 +https://github.com/iojs/io.js/commit/77d407df2826b20e9177c26c0d2bb4481e497937 * Simplify and clean up ObjectWrap. - * Upgrade liboi (which is now called evcom) Upgrade libev to 3.7 Upgrade V8 to 1.2.14 * Array.prototype.encodeUtf8 renamed to node.encodeUtf8(array) - * Move EventEmitter.prototype.emit() completely into C++. * Bugfix: Fix memory leak in event emitters. http://groups.google.com/group/nodejs/browse_thread/thread/a8d1dfc2fd57a6d1 * Bugfix: Had problems reading scripts with non-ascii characters. - * Bugfix: Fix Detach() in node::Server * Bugfix: Sockets not properly reattached if reconnected during @@ -5536,87 +4257,79 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs) on_connect. * Add 'close' event to node.tcp.Server - * Simplify and clean up http.js. (Takes more advantage of event infrastructure.) * Add benchmark scripts. Run with "make benchmark". +## 2009.06.30, Version 0.1.0 -2009.06.30, Version 0.1.0, 0fe44d52fe75f151bceb59534394658aae6ac328 +https://github.com/iojs/io.js/commit/0fe44d52fe75f151bceb59534394658aae6ac328 * Update documentation, use asciidoc. - * EventEmitter and Promise interfaces. (Breaks previous API.) * Remove node.Process constructor in favor of node.createProcess - * Add -m32 flags for compiling on x64 platforms. (Thanks to András Bártházi) * Upgrade v8 to 1.2.10 and libev to 3.6 - * Bugfix: Timer::RepeatSetter wasn't working. * Bugfix: Spawning many processes in a loop (reported by Felix Geisendörfer) +## 2009.06.24, Version 0.0.6 -2009.06.24, Version 0.0.6, fbe0be19ebfb422d8fa20ea5204c1713e9214d5f +https://github.com/iojs/io.js/commit/fbe0be19ebfb422d8fa20ea5204c1713e9214d5f * Load modules via HTTP URLs (Urban Hafner) - * Bugfix: Add HTTPConnection->size() and HTTPServer->size() * New node.Process API - * Clean up build tools, use v8's test runner. * Use ev_unref() instead of starting/stopping the eio thread pool watcher. +## 2009.06.18, Version 0.0.5 -2009.06.18, Version 0.0.5, 3a2b41de74b6c343b8464a68eff04c4bfd9aebea +https://github.com/iojs/io.js/commit/3a2b41de74b6c343b8464a68eff04c4bfd9aebea * Support for IPv6 - * Remove namespace node.constants * Upgrade v8 to 1.2.8.1 - * Accept ports as strings in the TCP client and server. * Bugfix: HTTP Client race - * Bugfix: freeaddrinfo() wasn't getting called after getaddrinfo() for TCP servers * Add "opening" to TCP client readyState - * Add remoteAddress to TCP client * Add global print() function. +## 2009.06.13, Version 0.0.4 -2009.06.13, Version 0.0.4, 916b9ca715b229b0703f0ed6c2fc065410fb189c +https://github.com/iojs/io.js/commit/916b9ca715b229b0703f0ed6c2fc065410fb189c * Add interrupt() method to server-side HTTP requests. - * Bugfix: onBodyComplete was not getting called on server-side HTTP +## 2009.06.11, Version 0.0.3 -2009.06.11, Version 0.0.3, 6e0dfe50006ae4f5dac987f055e0c9338662f40a +https://github.com/iojs/io.js/commit/6e0dfe50006ae4f5dac987f055e0c9338662f40a * Many bug fixes including the problem with http.Client on macintosh * Upgrades v8 to 1.2.7 - * Adds onExit hook * Guard against buffer overflow in http parser - * require() and include() now need the ".js" extension * http.Client uses identity transfer encoding by default. diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md new file mode 100644 index 00000000000000..351bf55978b37d --- /dev/null +++ b/COLLABORATOR_GUIDE.md @@ -0,0 +1,214 @@ +# io.js Collaborator Guide + +**Contents** + +* Issues and Pull Requests +* Accepting Modifications + - Involving the TC +* Landing Pull Requests + - Technical HOWTO + +This document contains information for Collaborators of the io.js +project regarding maintaining the code, documentation and issues. + +Collaborators should be familiar with the guidelines for new +contributors in [CONTRIBUTING.md](./CONTRIBUTING.md) and also +understand the project governance model as outlined in +[GOVERNANCE.md](./GOVERNANCE.md). + +## Issues and Pull Requests + +Courtesy should always be shown to individuals submitting issues and +pull requests to the io.js project. + +Collaborators should feel free to take full responsibility for +managing issues and pull requests they feel qualified to handle, as +long as this is done while being mindful of these guidelines, the +opinions of other Collaborators and guidance of the TC. + +Collaborators may **close** any issue or pull request they believe is +not relevant for the future of the io.js project. Where this is +unclear, the issue should be left open for several days to allow for +additional discussion. Where this does not yield input from io.js +Collaborators or additional evidence that the issue has relevance, the +issue may be closed. Remember that issues can always be re-opened if +necessary. + +## Accepting Modifications + +All modifications to the the io.js code and documentation should be +performed via GitHub pull requests, including modifications by +Collaborators and TC members. + +All pull requests must be reviewed and accepted by a Collaborator with +sufficient expertise who is able to take full responsibility for the +change. In the case of pull requests proposed by an existing +Collaborator, an additional Collaborator is required for sign-off. + +In some cases, it may be necessary to summon a qualified Collaborator +to a pull request for review by @-mention. + +If you are unsure about the modification and are not prepared to take +full responsibility for the change, defer to another Collaborator. + +Before landing pull requests, sufficient time should be left for input +from other Collaborators. Leave at least 48 hours during the week and +72 hours over weekends to account for international time differences +and work schedules. Trivial changes (e.g. those which fix minor bugs +or improve performance without affecting API or causing other +wide-reaching impact) may be landed after a shorter delay. + +Where there is no disagreement amongst Collaborators, a pull request +may be landed given appropriate review. Where there is discussion +amongst Collaborators, consensus should be sought if possible. The +lack of consensus may indicate the need to elevate discussion to the +TC for resolution (see below). + +All bugfixes require a test case which demonstrates the defect. The +test should *fail* before the change, and *pass* after the change. + +### Involving the TC + +Collaborators may opt to elevate pull requests or issues to the TC for +discussion by assigning the ***tc-agenda*** tag. This should be done +where a pull request: + +- has a significant impact on the codebase, +- is inherently controversial; or +- has failed to reach consensus amongst the Collaborators who are + actively participating in the discussion. + +The TC should serve as the final arbiter where required. + +## Landing Pull Requests + +Always modify the original commit message to include additional meta +information regarding the change process: + +- A `Reviewed-By: Name ` line for yourself and any + other Collaborators who have reviewed the change. +- A `PR-URL:` line that references the full GitHub URL of the original + pull request being merged so it's easy to trace a commit back to the + conversation that lead up to that change. +- A `Fixes: X` line, where _X_ is either includes the full GitHub URL + for an issue, and/or the hash and commit message if the commit fixes + a bug in a previous commit. Multiple `Fixes:` lines may be added if + appropriate. + +See the commit log for examples such as +[this one](https://github.com/iojs/io.js/commit/b636ba8186) if unsure +exactly how to format your commit messages. + +Additionally: + +- Double check PR's to make sure the person's _full name_ and email + address are correct before merging. +- Except when updating dependencies, all commits should be self + contained. Meaning, every commit should pass all tests. This makes + it much easier when bisecting to find a breaking change. + +### Technical HOWTO + +_Optional:_ ensure that you are not in a borked `am`/`rebase` state + +```text +$ git am --abort +$ git rebase --abort +``` + +Checkout proper target branch + +```text +$ git checkout v1.x +``` + +Update the tree + +```text +$ git fetch origin +$ git merge --ff-only origin/v1.x +``` + +Apply external patches + +```text +$ curl https://github.com/iojs/io.js/pull/xxx.patch | git am --whitespace=fix +``` + +Check and re-review the changes + +```text +$ git diff origin/v1.x +``` + +Check number of commits and commit messages + +```text +$ git log origin/v1.x...v1.x +``` + +If there are multiple commits that relate to the same feature or +one with a feature and separate with a test for that feature - +you'll need to squash them (or strictly speaking `fixup`). + +```text +$ git rebase -i origin/v1.x +``` + +This will open a screen like this (in the default shell editor): + +```text +pick 6928fc1 crypto: add feature A +pick 8120c4c add test for feature A +pick 51759dc feature B +pick 7d6f433 test for feature B + +# Rebase f9456a2..7d6f433 onto f9456a2 +# +# Commands: +# p, pick = use commit +# r, reword = use commit, but edit the commit message +# e, edit = use commit, but stop for amending +# s, squash = use commit, but meld into previous commit +# f, fixup = like "squash", but discard this commit's log message +# x, exec = run command (the rest of the line) using shell +# +# These lines can be re-ordered; they are executed from top to bottom. +# +# If you remove a line here THAT COMMIT WILL BE LOST. +# +# However, if you remove everything, the rebase will be aborted. +# +# Note that empty commits are commented out +``` + +Replace a couple of `pick`s with `fixup` to squash them into a +previous commit: + +```text +pick 6928fc1 crypto: add feature A +fixup 8120c4c add test for feature A +pick 51759dc feature B +fixup 7d6f433 test for feature B +``` + +Replace `pick` with `reword` to change the commit message: + +```text +reword 6928fc1 crypto: add feature A +fixup 8120c4c add test for feature A +reword 51759dc feature B +fixup 7d6f433 test for feature B +``` + +Save the file and close the editor, you'll be asked to enter new +commit message for that commit, and everything else should go +smoothly. Note that this is a good moment to fix incorrect commit +logs, ensure that they are properly formatted, and add `Reviewed-By` +line. + +Time to push it: + +```text +$ git push origin v1.x +``` \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99b9c5ed0d438f..aeb19491fc5cb7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,77 +1,87 @@ -# CONTRIBUTING +# Contributing to io.js -## ISSUE CONTRIBUTIONS +## Issue Contributions When opening new issues or commenting on existing issues on this repository please make sure discussions are related to concrete technical issues with the -`iojs` software. +io.js software. Discussion of non-technical topics including subjects like intellectual property, trademark and high level project questions should move to the -[node-forward discussion repository][] instead. +[node-forward discussions repository](https://github.com/node-forward/discussions) +instead. -## CODE CONTRIBUTIONS +## Code Contributions -The io.js project welcomes new contributors. This document will guide you -through the process. +The io.js project has an open governance model and welcomes new contributors. +Individuals making significant and valuable contributions are made +_Collaborators_ and given commit-access to the project. See the +[GOVERNANCE.md](./GOVERNANCE.md) document for more information about how this +works. +This document will guide you through the contribution process. -### FORK +### Step 1: Fork -Fork the project [on GitHub](https://github.com/iojs/io.js) and check out -your copy. +Fork the project [on GitHub](https://github.com/iojs/io.js) and check out your +copy locally. -```sh +```text $ git clone git@github.com:username/io.js.git $ cd io.js $ git remote add upstream git://github.com/iojs/io.js.git ``` +#### Which branch? + Now decide if you want your feature or bug fix to go into the master branch or the stable branch. As a rule of thumb, bug fixes go into the stable branch while new features go into the master branch. The stable branch is effectively frozen; patches that change the io.js -API/ABI or affect the run-time behavior of applications get rejected. +API/ABI or affect the run-time behavior of applications get rejected. The +current stable branch is set as the default branch on GitHub. + +#### Respect the stability index The rules for the master branch are less strict; consult the -[stability index page][] for details. +[stability index](./doc/api/documentation.markdown#stability-index) for details. In a nutshell, modules are at varying levels of API stability. Bug fixes are -always welcome but API or behavioral changes to modules at stability level 3 +always welcome but API or behavioral changes to modules at stability level 3 and up are off-limits. -io.js has several bundled dependencies in the deps/ and the tools/ +#### Dependencies + +io.js has several bundled dependencies in the *deps/* and the *tools/* directories that are not part of the project proper. Any changes to files in those directories or its subdirectories should be sent to their respective projects. Do not send your patch to us, we cannot accept it. -In case of doubt, open an issue in the [issue tracker][], post your question -to the [node.js mailing list][] or contact one of the [project maintainers][] -on [IRC][]. - -Especially do so if you plan to work on something big. Nothing is more +In case of doubt, open an issue in the +[issue tracker](https://github.com/iojs/io.js/issues/) or contact one of the +[project Collaborators](https://github.com/iojs/io.js/#Current-Project-Team-Members) +([IRC](http://webchat.freenode.net/?channels=io.js) is often the best medium.)Especially do so if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision -does not align with that of a project maintainer. +does not align with the project team. -### BRANCH +### Step 2: Branch -Okay, so you have decided on the proper branch. Create a feature branch -and start hacking: +Create a feature branch and start hacking: -```sh -$ git checkout -b my-feature-branch -t origin/v0.12 +```text +$ git checkout -b my-feature-branch -t origin/v1.x ``` -(Where v0.12 is the latest stable branch as of this writing.) +(Where `v1.x` is the latest stable branch as of this writing.) -### COMMIT +### Step 3: Commit Make sure git knows your name and email address: -```sh +```text $ git config --global user.name "J. Random User" $ git config --global user.email "j.random.user@example.com" ``` @@ -85,14 +95,14 @@ changed and why. Follow these guidelines when writing one: 2. Keep the second line blank. 3. Wrap all other lines at 72 columns. -A good commit log looks like this: +A good commit log can look something like this: ``` subsystem: explaining the commit in one line Body of commit message is a few lines of text, explaining things in more detail, possibly giving some background about the issue -being fixed, etc etc. +being fixed, etc. etc. The body of the commit message can be several paragraphs, and please do proper word-wrap and keep columns shorter than about @@ -107,23 +117,23 @@ Check the output of `git log --oneline files_that_you_changed` to find out what subsystem (or subsystems) your changes touch. -### REBASE +### Step 4: Rebase Use `git rebase` (not `git merge`) to sync your work from time to time. -```sh +```text $ git fetch upstream -$ git rebase upstream/v0.12 # or upstream/master +$ git rebase upstream/v1.x # or upstream/master ``` -### TEST +### Step 5: Test -Bug fixes and features should come with tests. Add your tests in the +Bug fixes and features **should come with tests**. Add your tests in the test/simple/ directory. Look at other tests to see how they should be structured (license boilerplate, common includes, etc.). -```sh +```text $ make jslint test ``` @@ -133,25 +143,25 @@ patches that fail either check. If you are updating tests and just want to run a single test to check it, you can use this syntax to run it exactly as the test harness would: -``` -python tools/test.py -v --mode=release simple/test-stream2-transform +```text +$ python tools/test.py -v --mode=release simple/test-stream2-transform ``` You can run tests directly with node: -``` -node ./test/simple/test-streams2-transform.js +```text +$ node ./test/simple/test-streams2-transform.js ``` -### PUSH +### Step 6: Push -```sh +```text $ git push origin my-feature-branch ``` -Go to https://github.com/username/io.js and select your feature branch. Click -the 'Pull Request' button and fill out the form. +Go to https://github.com/yourusername/io.js and select your feature branch. +Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. If there are comments to address, apply your changes in a separate commit and push that to your @@ -159,278 +169,62 @@ feature branch. Post a comment in the pull request afterwards; GitHub does not send out notifications when you add commits. -[stability index page]: https://github.com/joyent/node/blob/master/doc/api/documentation.markdown -[issue tracker]: https://github.com/joyent/node/issues -[node.js mailing list]: http://groups.google.com/group/nodejs -[IRC]: http://webchat.freenode.net/?channels=io.js -[project maintainers]: https://github.com/joyent/node/wiki/Project-Organization -[node-forward discussion repository]: https://github.com/node-forward/discussions/issues - -# Contribution Policy - -Individuals making significant and valuable contributions are given -commit-access to the project. These individuals are identified by the -Technical Committee (TC) and discussed during the weekly TC meeting. - -If you make a significant contribution and are not considered for -commit-access log an issue and it will be brought up in the next TC -meeting. - -Internal pull-requests to solicit feedback are required for any other -non-trivial contribution but left to the discretion of the -contributor. - -Pull requests may be approved by any committer with sufficient -expertise to take full responsibility for the change, according to the -"Landing Patches" protocol described below. - -## Landing Patches - -- All bugfixes require a test case which demonstrates the defect. The - test should *fail* before the change, and *pass* after the change. -- Trivial changes (ie, those which fix bugs or improve performance - without affecting API or causing other wide-reaching impact) may be - landed immediately after review by a committer who did not write the - code, provided that no other committers object to the change. -- If you are unsure, or if you are the author, have someone else - review the change. -- For significant changes wait a full 48 hours (72 hours if it spans a - weekend) before merging so that active contributors who are - distributed throughout the world have a chance to weigh in. -- Controversial changes and **very** significant changes should not be - merged until they have been discussed by the TC which will make any - final decisions. -- Always include the `Reviewed-by: Your Name ` in the - commit message. -- In commit messages also include `Fixes:` that either includes the - **full url** (e.g. `https://github.com/iojs/io.js/issues/...`), - and/or the hash and commit message if the commit fixes a bug in a - previous commit. -- PR's should include their full `PR-URL:` so it's easy to trace a - commit back to the conversation that lead up to that change. -- Double check PR's to make sure the person's **full name** and email - address are correct before merging. -- Except when updating dependencies, all commits should be self - contained. Meaning, every commit should pass all tests. This makes - it much easier when bisecting to find a breaking change. - -### Direct instruction - -(Optional) Ensure that you are not in a borked `am`/`rebase` state - -```sh -git am --abort -git rebase --abort -``` - -Checkout proper target branch - -```sh -git checkout v0.12 -``` - -Update the tree - -```sh -git fetch origin -git merge --ff-only origin/v0.12 -``` - -Apply external patches - -```sh -curl https://github.com/iojs/io.js/pull/xxx.patch | git am --whitespace=fix -``` - -Check and re-review the changes - -```sh -git diff origin/v0.12 -``` - -Check number of commits and commit messages - -```sh -git log origin/v0.12...v0.12 -``` - -If there are multiple commits that relate to the same feature or -one with a feature and separate with a test for that feature - -you'll need to squash them (or strictly speaking `fixup`). - -```sh -git rebase -i origin/v0.12 -``` - -This will open a screen like this (in the default shell editor): - -```sh -pick 6928fc1 crypto: add feature A -pick 8120c4c add test for feature A -pick 51759dc feature B -pick 7d6f433 test for feature B - -# Rebase f9456a2..7d6f433 onto f9456a2 -# -# Commands: -# p, pick = use commit -# r, reword = use commit, but edit the commit message -# e, edit = use commit, but stop for amending -# s, squash = use commit, but meld into previous commit -# f, fixup = like "squash", but discard this commit's log message -# x, exec = run command (the rest of the line) using shell -# -# These lines can be re-ordered; they are executed from top to bottom. -# -# If you remove a line here THAT COMMIT WILL BE LOST. -# -# However, if you remove everything, the rebase will be aborted. -# -# Note that empty commits are commented out -``` - -Replace a couple of `pick`s with `fixup` to squash them into a previous commit: - -```sh -pick 6928fc1 crypto: add feature A -fixup 8120c4c add test for feature A -pick 51759dc feature B -fixup 7d6f433 test for feature B -``` - -Replace `pick` with `reword` to change the commit message: - -```sh -reword 6928fc1 crypto: add feature A -fixup 8120c4c add test for feature A -reword 51759dc feature B -fixup 7d6f433 test for feature B -``` - -Save the file and close the editor, you'll be asked to enter new commit message -for that commit, and everything else should go smoothly. Note that this is a -good moment to fix incorrect commit logs, ensure that they are properly -formatted, and add `Reviewed-By` line. - -Time to push it: - -```sh -git push origin v0.12 -``` - -# Governance - -This repository is jointly governed by a technical committee, commonly -referred to as the "TC." - -The TC has final authority over this project including: - -* Technical direction -* Project governance and process (including this policy) -* Contribution policy -* GitHub repository hosting -* Conduct guidelines - -## Membership - -Initial membership invitations to the TC were given to individuals who -had been active contributors to io.js, and who have significant -experience with the management of the io.js project. Membership is -expected to evolve over time according to the needs of the project. - -Current membership is: - -``` -Ben Noordhuis (@bnoordhuis) -Bert Belder (@piscisaureus) -Fedor Indutny (@indutny) -Isaac Z. Schlueter (@isaacs) -Nathan Rajlich (@TooTallNate) -TJ Fontaine (@tjfontaine) -Trevor Norris (@trevnorris) -``` - -TC seats are not time-limited. There is no fixed size of the TC. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. - -There is no specific set of requirements or qualifications for TC -membership beyond these rules. - -The TC may add contributors to the TC by unanimous consensus. - -A TC member may be removed from the TC by voluntary resignation, or by -unanimous consensus of all other TC members. - -Changes to TC membership should be posted in the agenda, and may be -suggested as any other agenda item (see "TC Meetings" below). - -If an addition or removal is proposed during a meeting, and the full -TC is not in attendance to participate, then the addition or removal -is added to the agenda for the subsequent meeting. This is to ensure -that all members are given the opportunity to participate in all -membership decisions. If a TC member is unable to attend a meeting -where a planned membership decision is being made, then their consent -is assumed. - -No more than 1/3 of the TC members may be affiliated with the same -employer. If removal or resignation of a TC member, or a change of -employment by a TC member, creates a situation where more than 1/3 of -the TC membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more TC -members affiliated with the over-represented employer(s). - -## TC Meetings - -The TC meets weekly on a Google hangout. The meeting is run by a -designated moderator, currently `Mikeal Rogers (@mikeal)`. Each -meeting should be published to Youtube. - -Items are added to the TC agenda which are considered contentious or -are modifications of governance, contribution policy, TC membership, -or release process. The intention of the agenda is not to approve or -review all patches, that should happen continuously on GitHub (see -"Contribution Policy"). - -Any community member or contributor can ask that something be added to -the next meeting's agenda by logging a GitHub Issue. Any TC member or -the moderator can add the item to the agenda by a simple +1. The -moderator and the TC cannot veto or remove items. - -Prior to each TC meeting the moderator will email the Agenda to the -TC. TC members can add any items they like to the agenda at the -beginning of each meeting. The moderator and the TC cannot veto or -remove items. - -TC may invite persons or representatives from certain projects to -participate in a non-voting capacity. These invitees currently are: - -* A representative from [build](https://github.com/node-forward/build) - chosen by that project. - -The moderator is responsible for summarizing the discussion of each -agenda item and send it as a pull request after the meeting. - -## Consensus Seeking Process - -The TC follows a [Consensus -Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) -decision making model. - -When an agenda item has appeared to reach a consensus the moderator -will ask "Does anyone object?" as a final call for dissent from the -consensus. - -If an agenda item cannot reach a consensus a TC member can call for -either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be seconded by a majority of the TC -or else the discussion will continue. Simple majority wins. - -Note that changes to TC membership require unanimous consensus. See -"Membership" above. - -## Caine's requirements +## Developer's Certificate of Origin 1.0 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license indicated + in the file; or +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source license + and I have the right under that license to submit that work with + modifications, whether created in whole or in part by me, under the + same open source license (unless I am permitted to submit under a + different license), as indicated in the file; or +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified it. + + +## Code of Conduct + +This Code of Conduct is adapted from [Rust's wonderful +CoC](https://github.com/rust-lang/rust/wiki/Note-development-policy#conduct). + +* We are committed to providing a friendly, safe and welcoming + environment for all, regardless of gender, sexual orientation, + disability, ethnicity, religion, or similar personal characteristic. +* Please avoid using overtly sexual nicknames or other nicknames that + might detract from a friendly, safe and welcoming environment for + all. +* Please be kind and courteous. There's no need to be mean or rude. +* Respect that people have differences of opinion and that every + design or implementation choice carries a trade-off and numerous + costs. There is seldom a right answer. +* Please keep unstructured critique to a minimum. If you have solid + ideas you want to experiment with, make a fork and see how it works. +* We will exclude you from interaction if you insult, demean or harass + anyone. That is not welcome behaviour. We interpret the term + "harassment" as including the definition in the [Citizen Code of + Conduct](http://citizencodeofconduct.org/); if you have any lack of + clarity about what might be included in that concept, please read + their definition. In particular, we don't tolerate behavior that + excludes people in socially marginalized groups. +* Private harassment is also unacceptable. No matter who you are, if + you feel you have been or are being harassed or made uncomfortable + by a community member, please contact one of the channel ops or any + of the TC members immediately with a capture (log, photo, email) of + the harassment if possible. Whether you're a regular contributor or + a newcomer, we care about making this community a safe place for you + and we've got your back. +* Likewise any spamming, trolling, flaming, baiting or other + attention-stealing behaviour is not welcome. +* Avoid the use of personal pronouns in code comments or + documentation. There is no need to address persons when explaining + code (e.g. "When the developer") + + +## Caine's Requirements Hello! diff --git a/GOVERNANCE.md b/GOVERNANCE.md new file mode 100644 index 00000000000000..f9d4afe463f1c5 --- /dev/null +++ b/GOVERNANCE.md @@ -0,0 +1,146 @@ +# io.js Project Governance + +## Technical Committee + +The io.js project is jointly governed by a Technical Committee (TC) +which is responsible for high-level guidance of the project. + +The TC has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +Initial membership invitations to the TC were given to individuals who +had been active contributors to io.js, and who have significant +experience with the management of the io.js project. Membership is +expected to evolve over time according to the needs of the project. + +For the current list of TC members, see the project +[README.md](./README.md#current-project-team-members). + +## Collaborators + +The [iojs/io.js](https://github.com/iojs/io.js) GitHub repository is +maintained by the TC and additional Collaborators who are added by the +TC on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the TC and their addition as +Collaborators is discussed during the weekly TC meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a TC member directly and it +will be brought up in the next TC meeting. + +Modifications of the contents of the iojs/io.js repository are made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +TC for discussion by assigning the ***tc-agenda*** tag to a pull +request or issue. The TC should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#current-project-team-members). + +A guide for Collaborators is maintained in +[COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md). + +## TC Membership + +TC seats are not time-limited. There is no fixed size of the TC. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for TC +membership beyond these rules. + +The TC may add additional members to the TC by unanimous consensus. + +A TC member may be removed from the TC by voluntary resignation, or by +unanimous consensus of all other TC members. + +Changes to TC membership should be posted in the agenda, and may be +suggested as any other agenda item (see "TC Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +TC is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a TC member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the TC members may be affiliated with the same +employer. If removal or resignation of a TC member, or a change of +employment by a TC member, creates a situation where more than 1/3 of +the TC membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more TC +members affiliated with the over-represented employer(s). + +## TC Meetings + +The TC meets weekly on a Google Hangout On Air. The meeting is run by +a designated moderator approved by the TC. Each meeting should be +published to YouTube. + +Items are added to the TC agenda which are considered contentious or +are modifications of governance, contribution policy, TC membership, +or release process. + +The intention of the agenda is not to approve or review all patches, +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +TC member or the moderator can add the item to the agenda by adding +the ***tc-agenda*** tag to the issue. + +Prior to each TC meeting the moderator will share the Agenda with +members of the TC. TC members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the TC +cannot veto or remove items. + +The TC may invite persons or representatives from certain projects to +participate in a non-voting capacity. These invitees currently are: + +* A representative from [build](https://github.com/node-forward/build) + chosen by that project. + +The moderator is responsible for summarizing the discussion of each +agenda item and send it as a pull request after the meeting. + +## Consensus Seeking Process + +The TC follows a +[Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a TC member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the TC +or else the discussion will continue. Simple majority wins. + +Note that changes to TC membership require unanimous consensus. See +"TC Membership" above. diff --git a/LICENSE b/LICENSE index 75027399dfb1b1..ad5711eb5f8da1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,31 @@ -Node's license follows: +io.js is licensed for use as follows: -==== +""" +Copyright io.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. +""" + +This license applies to parts of io.js originating from the +https://github.com/joyent/node repository: + +""" 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 @@ -20,11 +44,12 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" -==== +The io.js license applies to all parts of io.js that are not externally +maintained libraries. -This license applies to all parts of Node that are not externally -maintained libraries. The externally maintained libraries used by Node are: +The externally maintained libraries used by io.js are: - V8, located at deps/v8. V8's license follows: """ @@ -221,6 +246,38 @@ maintained libraries. The externally maintained libraries used by Node are: # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ +- python-gflags is located at tools/gflags. Its license follows: + """ + # Copyright (c) 2006, Google Inc. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are + # met: + # + # * Redistributions of source code must retain the above copyright + # notice, this list of conditions and the following disclaimer. + # * Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following disclaimer + # in the documentation and/or other materials provided with the + # distribution. + # * Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ + - tools/cpplint.py is a C++ linter. Its license follows: """ # Copyright (c) 2009 Google Inc. All rights reserved. @@ -294,9 +351,9 @@ maintained libraries. The externally maintained libraries used by Node are: - Zlib at deps/zlib. zlib's license follows: """ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.4, March 14th, 2010 + version 1.2.8, April 28th, 2013 - Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -314,9 +371,8 @@ maintained libraries. The externally maintained libraries used by Node are: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. - Jean-loup Gailly - Mark Adler - + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu */ """ @@ -556,7 +612,7 @@ maintained libraries. The externally maintained libraries used by Node are: included for use in the npm website and documentation, used with permission. - This program uses several Node modules contained in the node_modules/ + This program uses several io.js modules contained in the node_modules/ subdirectory, according to the terms of their respective licenses. """ diff --git a/Makefile b/Makefile index b4360326c35512..6c8636013f8924 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ BUILDTYPE ?= Release PYTHON ?= python -NINJA ?= ninja DESTDIR ?= SIGN ?= PREFIX ?= /usr/local @@ -11,21 +10,15 @@ PREFIX ?= /usr/local EXEEXT := $(shell $(PYTHON) -c \ "import sys; print('.exe' if sys.platform == 'win32' else '')") -NODE ?= ./node$(EXEEXT) -NODE_EXE = node$(EXEEXT) -NODE_G_EXE = node_g$(EXEEXT) +NODE ?= ./iojs$(EXEEXT) +NODE_EXE = iojs$(EXEEXT) +NODE_G_EXE = iojs_g$(EXEEXT) # Default to verbose builds. # To do quiet/pretty builds, run `make V=` to set V to an empty string, # or set the V environment variable to an empty string. V ?= 1 -ifeq ($(USE_NINJA),1) -ifneq ($(V),) -NINJA := $(NINJA) -v -endif -endif - # BUILDTYPE=Debug builds both release and debug builds. If you want to compile # just the debug build, run `make -C out BUILDTYPE=Debug` instead. ifeq ($(BUILDTYPE),Release) @@ -38,15 +31,6 @@ endif # to check for changes. .PHONY: $(NODE_EXE) $(NODE_G_EXE) -ifeq ($(USE_NINJA),1) -$(NODE_EXE): config.gypi - $(NINJA) -C out/Release/ - ln -fs out/Release/$(NODE_EXE) $@ - -$(NODE_G_EXE): config.gypi - $(NINJA) -C out/Debug/ - ln -fs out/Debug/$(NODE_EXE) $@ -else $(NODE_EXE): config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Release V=$(V) ln -fs out/Release/$(NODE_EXE) $@ @@ -54,15 +38,9 @@ $(NODE_EXE): config.gypi out/Makefile $(NODE_G_EXE): config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Debug V=$(V) ln -fs out/Debug/$(NODE_EXE) $@ -endif out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi -ifeq ($(USE_NINJA),1) - touch out/Makefile - $(PYTHON) tools/gyp_node.py -f ninja -else $(PYTHON) tools/gyp_node.py -f make -endif config.gypi: configure if [ -f $@ ]; then @@ -84,10 +62,12 @@ clean: distclean: -rm -rf out - -rm -f config.gypi + -rm -f config.gypi icu_config.gypi -rm -f config.mk -rm -rf $(NODE_EXE) $(NODE_G_EXE) blog.html email.md -rm -rf node_modules + -rm -rf deps/icu + -rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp test: all $(PYTHON) tools/test.py --mode=release message parallel sequential -J @@ -97,25 +77,20 @@ test: all test-parallel: all $(PYTHON) tools/test.py --mode=release parallel -J -test-http1: all - $(PYTHON) tools/test.py --mode=release --use-http1 sequential parallel message - test-valgrind: all $(PYTHON) tools/test.py --mode=release --valgrind sequential parallel message -test/gc/node_modules/weak/build/Release/weakref.node: - @if [ ! -f $(NODE_EXE) ]; then make all; fi +test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE) ./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ --directory="$(shell pwd)/test/gc/node_modules/weak" \ --nodedir="$(shell pwd)" -build-addons: - @if [ ! -f node ]; then make all; fi +build-addons: $(NODE_EXE) rm -rf test/addons/doc-*/ - ./node tools/doc/addon-verify.js + ./$(NODE_EXE) tools/doc/addon-verify.js $(foreach dir, \ $(sort $(dir $(wildcard test/addons/*/*.gyp))), \ - ./node deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ + ./$(NODE_EXE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \ --directory="$(shell pwd)/$(dir)" \ --nodedir="$(shell pwd)" && ) echo "build done" @@ -126,14 +101,13 @@ test-build: all build-addons test-all: test-build test/gc/node_modules/weak/build/Release/weakref.node $(PYTHON) tools/test.py --mode=debug,release - make test-npm - -test-all-http1: test-build - $(PYTHON) tools/test.py --mode=debug,release --use-http1 test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind +test-ci: test-build + $(PYTHON) tools/test.py -J parallel sequential message addons + test-release: test-build $(PYTHON) tools/test.py --mode=release @@ -161,7 +135,7 @@ test-npm: $(NODE_EXE) cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \ npm_config_prefix="$(shell pwd)/npm-prefix" \ npm_config_tmp="$(shell pwd)/npm-tmp" \ - ../../$(NODE_EXE) cli.js install + ../../$(NODE_EXE) cli.js install --ignore-scripts cd deps/npm ; npm_config_cache="$(shell pwd)/npm-cache" \ npm_config_prefix="$(shell pwd)/npm-prefix" \ npm_config_tmp="$(shell pwd)/npm-tmp" \ @@ -191,11 +165,7 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*))) -website_files = \ - out/doc/sh_main.js \ - out/doc/sh_javascript.min.js - -doc: $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/ out/doc/changelog.html $(NODE_EXE) +doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE) $(apidoc_dirs): mkdir -p $@ @@ -203,7 +173,7 @@ $(apidoc_dirs): out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/ cp $< $@ -out/doc/changelog.html: ChangeLog doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh $(NODE_EXE) +out/doc/changelog.html: CHANGELOG.md doc/changelog-head.html doc/changelog-foot.html tools/build-changelog.sh $(NODE_EXE) bash tools/build-changelog.sh out/doc/%: doc/% @@ -215,23 +185,13 @@ out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE) out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE) out/Release/$(NODE_EXE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@ -email.md: ChangeLog tools/email-footer.md +email.md: CHANGELOG.md tools/email-footer.md bash tools/changelog-head.sh | sed 's|^\* #|* \\#|g' > $@ cat tools/email-footer.md | sed -e 's|__VERSION__|'$(VERSION)'|g' >> $@ blog.html: email.md cat $< | ./$(NODE_EXE) tools/doc/node_modules/.bin/marked > $@ -website-upload: doc - rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/ - ssh node@nodejs.org '\ - rm -f ~/web/nodejs.org/dist/latest &&\ - ln -s $(VERSION) ~/web/nodejs.org/dist/latest &&\ - rm -f ~/web/nodejs.org/docs/latest &&\ - ln -s $(VERSION) ~/web/nodejs.org/docs/latest &&\ - rm -f ~/web/nodejs.org/dist/node-latest.tar.gz &&\ - ln -s $(VERSION)/node-$(VERSION).tar.gz ~/web/nodejs.org/dist/node-latest.tar.gz' - docopen: out/doc/api/all.html -google-chrome out/doc/api/all.html @@ -240,8 +200,10 @@ docclean: RAWVER=$(shell $(PYTHON) tools/getnodeversion.py) VERSION=v$(RAWVER) +FULLVERSION=$(VERSION) RELEASE=$(shell $(PYTHON) tools/getnodeisrelease.py) PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]') +NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/') ifeq ($(findstring x86_64,$(shell uname -m)),x86_64) DESTCPU ?= x64 else @@ -256,20 +218,21 @@ else ARCH=x86 endif endif -TARNAME=node-$(VERSION) ifdef NIGHTLY TAG = nightly-$(NIGHTLY) -TARNAME=node-$(VERSION)-$(TAG) +FULLVERSION=$(VERSION)-$(TAG) endif -TARBALL=$(TARNAME).tar.gz +TARNAME=iojs-$(FULLVERSION) +TARBALL=$(TARNAME).tar BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) -BINARYTAR=$(BINARYNAME).tar.gz +BINARYTAR=$(BINARYNAME).tar +XZ=$(shell which xz > /dev/null 2>&1; echo $$?) PKG=out/$(TARNAME).pkg packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -PKGSRC=nodejs-$(DESTCPU)-$(RAWVER).tgz +PKGSRC=iojs-$(DESTCPU)-$(RAWVER).tgz ifdef NIGHTLY -PKGSRC=nodejs-$(DESTCPU)-$(RAWVER)-$(TAG).tgz +PKGSRC=iojs-$(DESTCPU)-$(RAWVER)-$(TAG).tgz endif dist: doc $(TARBALL) $(PKG) @@ -309,12 +272,13 @@ $(PKG): release-only $(PYTHON) ./configure --without-snapshot --dest-cpu=x64 --tag=$(TAG) $(MAKE) install V=$(V) DESTDIR=$(PKGDIR) SIGN="$(APP_SIGN)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh - lipo $(PKGDIR)/32/usr/local/bin/node \ - $(PKGDIR)/usr/local/bin/node \ - -output $(PKGDIR)/usr/local/bin/node-universal \ + lipo $(PKGDIR)/32/usr/local/bin/iojs \ + $(PKGDIR)/usr/local/bin/iojs \ + -output $(PKGDIR)/usr/local/bin/iojs-universal \ -create - mv $(PKGDIR)/usr/local/bin/node-universal $(PKGDIR)/usr/local/bin/node + mv $(PKGDIR)/usr/local/bin/iojs-universal $(PKGDIR)/usr/local/bin/iojs rm -rf $(PKGDIR)/32 + cat tools/osx-pkg.pmdoc/index.xml.tmpl | sed -e 's|__iojsversion__|'$(FULLVERSION)'|g' | sed -e 's|__npmversion__|'$(NPMVERSION)'|g' > tools/osx-pkg.pmdoc/index.xml $(packagemaker) \ --id "org.nodejs.Node" \ --doc tools/osx-pkg.pmdoc \ @@ -324,14 +288,19 @@ $(PKG): release-only $(TARBALL): release-only $(NODE_EXE) doc git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf - mkdir -p $(TARNAME)/doc/api - cp doc/node.1 $(TARNAME)/doc/node.1 + cp doc/iojs.1 $(TARNAME)/doc/iojs.1 cp -r out/doc/api/* $(TARNAME)/doc/api/ rm -rf $(TARNAME)/deps/v8/test # too big rm -rf $(TARNAME)/doc/images # too big + rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused find $(TARNAME)/ -type l | xargs rm # annoying on windows tar -cf $(TARNAME).tar $(TARNAME) rm -rf $(TARNAME) - gzip -f -9 $(TARNAME).tar + gzip -c -f -9 $(TARNAME).tar > $(TARNAME).tar.gz +ifeq ($(XZ), 0) + xz -c -f -9 $(TARNAME).tar > $(TARNAME).tar.xz +endif + rm $(TARNAME).tar tar: $(TARBALL) @@ -342,10 +311,14 @@ $(BINARYTAR): release-only $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1 cp README.md $(BINARYNAME) cp LICENSE $(BINARYNAME) - cp ChangeLog $(BINARYNAME) + cp CHANGELOG.md $(BINARYNAME) tar -cf $(BINARYNAME).tar $(BINARYNAME) rm -rf $(BINARYNAME) - gzip -f -9 $(BINARYNAME).tar + gzip -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.gz +ifeq ($(XZ), 0) + xz -c -f -9 $(BINARYNAME).tar > $(BINARYNAME).tar.xz +endif + rm $(BINARYNAME).tar binary: $(BINARYTAR) @@ -362,11 +335,6 @@ $(PKGSRC): release-only pkgsrc: $(PKGSRC) -dist-upload: $(TARBALL) $(PKG) - ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION) - scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL) - scp $(PKG) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARNAME).pkg - wrkclean: $(MAKE) -C tools/wrk/ clean rm tools/wrk/wrk @@ -413,10 +381,10 @@ bench-idle: ./$(NODE_EXE) benchmark/idle_clients.js & jslintfix: - PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js + PYTHONPATH=tools/closure_linter/:tools/gflags/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js jslint: - PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js + PYTHONPATH=tools/closure_linter/:tools/gflags/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js CPPLINT_EXCLUDE ?= CPPLINT_EXCLUDE += src/node_dtrace.cc diff --git a/README.md b/README.md index abc8adf85ba536..3cf63dcce001b8 100644 --- a/README.md +++ b/README.md @@ -4,21 +4,24 @@ io.js This repository began as a GitHub fork of [joyent/node](https://github.com/joyent/node). + io.js contributions, releases, and contributorship are under an -[open governance model](./CONTRIBUTING.md#governance). +[open governance model](./GOVERNANCE.md). We intend to land, with increasing regularity, releases which are -compatible with the npm ecosystem that has been built to date for node.js. +compatible with the npm ecosystem that has been built to date for Node.js. -### Is it io.js or IO.js or iojs or IOjs or iOjS? +## Is it io.js or IO.js or iojs or IOjs or iOjS? The official name is **io.js**, which should never be capitalized, especially not at the start of a sentence, unless it is being displayed in a location that is customarily all-caps (such as -the title of man pages.) +the title of man pages). + +## To build: -### To build: +### Unix / Macintosh -Prerequisites (Unix only): +Prerequisites: * `gcc` and `g++` 4.8 or newer, or * `clang` and `clang++` 3.3 or newer @@ -26,118 +29,186 @@ Prerequisites (Unix only): * GNU Make 3.81 or newer * libexecinfo (FreeBSD and OpenBSD only) -Unix/Macintosh: - -```sh -./configure -make -make install +```text +$ ./configure +$ make +$ [sudo] make install ``` -If your python binary is in a non-standard location or has a +If your Python binary is in a non-standard location or has a non-standard name, run the following instead: -```sh -export PYTHON=/path/to/python -$PYTHON ./configure -make -make install +```text +$ export PYTHON=/path/to/python +$ $PYTHON ./configure +$ make +$ [sudo] make install ``` -Prerequisites (Windows only): +To run the tests: -* Python 2.6 or 2.7 +```text +$ make test +``` + +To build the documentation: + +```text +$ make doc +``` + +To read the documentation: + +```text +$ man doc/iojs.1 +``` + +### Windows + +Prerequisites: + +* [Python 2.6 or 2.7](https://www.python.org/downloads/) * Visual Studio 2013 for Windows Desktop, or * Visual Studio Express 2013 for Windows Desktop +* Basic Unix tools required for some tests, + [Git for Windows](http://git-scm.com/download/win) includes Git Bash + and tools which can be included in the global `PATH`. -Windows: +```text +> vcbuild nosign +``` -```sh -vcbuild nosign +To run the tests: + +```text +> vcbuild test ``` -You can download pre-built binaries for various operating systems from -[http://nodejs.org/download/](http://nodejs.org/download/). The Windows -and OS X installers will prompt you for the location in which to install. -The tarballs are self-contained; you can extract them to a local directory -with: +### `Intl` (ECMA-402) support: + +[Intl](https://github.com/joyent/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: -```sh -tar xzf /path/to/node---.tar.gz +```text +$ ./configure --with-intl=small-icu --download=all ``` -Or system-wide with: +Windows: -```sh -cd /usr/local && tar --strip-components 1 -xzf \ - /path/to/node---.tar.gz +```text +> vcbuild small-icu download-all ``` -### To run the tests: +The `small-icu` mode builds with English-only data. You can add full +data at runtime. + +*Note:* more docs are on +[the joyent/node wiki](https://github.com/joyent/node/wiki/Intl). + +#### Build with full ICU support (all locales supported by ICU): -Unix/Macintosh: +With the `--download=all`, this may download ICU if you don't have an +ICU in `deps/icu`. -```sh -make test +Unix / Macintosh: + +```text +$ ./configure --with-intl=full-icu --download=all ``` Windows: -```sh -vcbuild test +```text +> vcbuild full-icu download-all ``` -### To build the documentation: +#### Build with no Intl support `:-(` -```sh -make doc -``` +The `Intl` object will not be available. This is the default at +present, so this option is not normally needed. -### To read the documentation: +Unix / Macintosh: -```sh -man doc/node.1 +```text +$ ./configure --with-intl=none ``` -### To build `Intl` (ECMA-402) support: +Windows: -*Note:* more docs, including how to reduce disk footprint, are on -[the wiki](https://github.com/joyent/node/wiki/Intl). +```text +> vcbuild intl-none +``` -#### Use existing installed ICU (Unix/Macintosh only): +#### Use existing installed ICU (Unix / Macintosh only): -```sh -pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu +```text +$ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu ``` -#### Build ICU from source: +#### Build with a specific ICU: + +You can find other ICU releases at +[the ICU homepage](http://icu-project.org/download). +Download the file named something like `icu4c-**##.#**-src.tgz` (or +`.zip`). -First: Unpack latest ICU - [icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`) - as `deps/icu` (You'll have: `deps/icu/source/...`) +Unix / Macintosh -Unix/Macintosh: +```text +# from an already-unpacked ICU: +$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu -```sh -./configure --with-intl=full-icu +# from a local ICU tarball +$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz + +# from a tarball URL +$ ./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz ``` -Windows: +Windows + +First unpack latest ICU to `deps/icu` +[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`) +as `deps/icu` (You'll have: `deps/icu/source/...`) + +```text +> vcbuild full-icu +``` + +## Resources for Newcomers + +* [CONTRIBUTING.md](./CONTRIBUTING.md) +* [GOVERNANCE.md](./GOVERNANCE.md) +* IRC: + [#io.js on Freenode.net](http://webchat.freenode.net?channels=io.js&uio=d4) +* [iojs/io.js on Gitter](https://gitter.im/iojs/io.js) + + + +## Current Project Team Members + +The io.js project team comprises a group of core collaborators and a sub-group +that forms the _Technical Committee_ (TC) which governs the project. For more +information about the governance of the io.js project, see +[GOVERNANCE.md](./GOVERNANCE.md). + +* **Isaac Z. Schlueter** ([@isaacs](https://github.com/isaacs)) <i@izs.me> (Technical Committee) +* **Ben Noordhuis** ([@bnoordhuis](https://github.com/bnoordhuis)) <info@bnoordhuis.nl> (Technical Committee) +* **Bert Belder** ([@piscisaureus](https://github.com/piscisaureus)) <bertbelder@gmail.com> (Technical Committee) +* **Fedor Indutny** ([@indutny](https://github.com/indutny)) <fedor.indutny@gmail.com> (Technical Committee) +* **Trevor Norris** ([@trevnorris](https://github.com/trevnorris)) <trev.norris@gmail.com> (Technical Committee) +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> (Technical Committee) +* **Colin Ihrig** ([@cjihrig](https://github.com/cjihrig)) <cjihrig@gmail.com> (Technical Committee) +* **Mikeal Rogers** ([@mikeal](https://github.com/mikeal)) <mikeal.rogers@gmail.com> +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> -```sh -vcbuild full-icu -``` - -Resources for Newcomers ---- - - [The Wiki](https://github.com/joyent/node/wiki) - - [nodejs.org](http://nodejs.org/) - - [how to install node.js and npm (node package manager)](http://www.joyent.com/blog/installing-node-and-npm/) - - [list of modules](https://github.com/joyent/node/wiki/modules) - - [searching the npm registry](http://npmjs.org/) - - [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node) - - [node.js mailing list](http://groups.google.com/group/nodejs) - - irc chatroom, [#io.js on freenode.net](http://webchat.freenode.net?channels=io.js&uio=d4) - - [community](https://github.com/joyent/node/wiki/Community) - - [contributing](https://github.com/joyent/node/wiki/Contributing) - - [big list of all the helpful wiki pages](https://github.com/joyent/node/wiki/_pages) +Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in +maintaining the io.js project. diff --git a/benchmark/README.md b/benchmark/README.md index 695f0eac7fab78..95ade9840d354a 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -1,7 +1,7 @@ -# Node.js core benchmark tests +# io.js core benchmark tests This folder contains benchmark tests to measure the performance for certain -Node.js APIs. +io.js APIs. ## How to run tests @@ -10,7 +10,7 @@ There are two ways to run benchmark tests: 1. Run all tests of a given type, for example, buffers ```sh -node benchmark/common.js buffers +iojs benchmark/common.js buffers ``` The above command will find all scripts under `buffers` directory and require @@ -70,7 +70,7 @@ buffers/buffer-read.js noAssert=false buffer=fast type=UInt16BE millions=1: 244. 2. Run an individual test, for example, buffer-slice.js ```sh -node benchmark/buffers/buffer-read.js +iojs benchmark/buffers/buffer-read.js ``` The output: ``` diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index 3dcc13b6b6703b..cb520be2a621eb 100644 --- a/benchmark/buffers/buffer-base64-encode.js +++ b/benchmark/buffers/buffer-base64-encode.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var bench = common.createBenchmark(main, {}); diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index cb3ceb7e9ff887..b02e8a74030042 100644 --- a/benchmark/buffers/buffer-compare.js +++ b/benchmark/buffers/buffer-compare.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js new file mode 100644 index 00000000000000..103fbe10e94a85 --- /dev/null +++ b/benchmark/buffers/buffer-iterate.js @@ -0,0 +1,43 @@ +var SlowBuffer = require('buffer').SlowBuffer; +var common = require('../common.js'); +var assert = require('assert'); + +var bench = common.createBenchmark(main, { + size: [16, 512, 1024, 4096, 16386], + type: ['fast', 'slow'], + method: ['for', 'forOf'], + n: [1e3] +}); + +function main(conf) { + var len = +conf.size; + var clazz = conf.type === 'fast' ? Buffer : SlowBuffer; + var buffer = new clazz(len); + buffer.fill(0); + + if (conf.method === 'for') + benchFor(buffer, conf.n); + else + benchForOf(buffer, conf.n); +} + + +function benchFor(buffer, n) { + bench.start(); + + for (var k = 0; k < n; k++) + for (var i = 0; i < buffer.length; i++) + assert(buffer[i] === 0); + + bench.end(n); +} + +function benchForOf(buffer, n) { + bench.start(); + + for (var k = 0; k < n; k++) + for (var b of buffer) + assert(b === 0); + + bench.end(n); +} diff --git a/benchmark/common.js b/benchmark/common.js index 7d1730c373d8ae..a6a1d87af84f9e 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -7,8 +7,9 @@ exports.PORT = process.env.PORT || 12346; // If this is the main module, then run the benchmarks if (module === require.main) { var type = process.argv[2]; + var testFilter = process.argv[3]; if (!type) { - console.error('usage:\n ./node benchmark/common.js '); + console.error('usage:\n ./iojs benchmark/common.js [testFilter]'); process.exit(1); } @@ -17,6 +18,19 @@ if (module === require.main) { var tests = fs.readdirSync(dir); var spawn = require('child_process').spawn; + if (testFilter) { + var filteredTests = tests.filter(function(item){ + if (item.lastIndexOf(testFilter) >= 0) { + return item; + } + }); + if (filteredTests.length === 0) { + console.error(`${testFilter} is not found in \n ${tests.join(' \n')}`); + return; + } + tests = filteredTests; + } + runBenchmarks(); } diff --git a/benchmark/http-flamegraph.sh b/benchmark/http-flamegraph.sh index 7df0c1575f511d..5dc41b541bdafb 100644 --- a/benchmark/http-flamegraph.sh +++ b/benchmark/http-flamegraph.sh @@ -1,7 +1,7 @@ #!/bin/bash cd "$(dirname "$(dirname $0)")" -node=${NODE:-./node} +node=${NODE:-./iojs} name=${NAME:-stacks} @@ -22,7 +22,7 @@ fi ulimit -n 100000 $node benchmark/http_simple.js & nodepid=$! -echo "node pid = $nodepid" +echo "iojs pid = $nodepid" sleep 1 # has to stay alive until dtrace exits @@ -62,7 +62,7 @@ echo 'Turn the stacks into a svg' stackvis dtrace flamegraph-svg < "$name".src > "$name".raw.svg echo 'Prune tiny stacks out of the graph' -node -e ' +iojs -e ' var infile = process.argv[1]; var outfile = process.argv[2]; var output = ""; diff --git a/benchmark/http.sh b/benchmark/http.sh index 9a844a900438fe..63fc02e973093f 100755 --- a/benchmark/http.sh +++ b/benchmark/http.sh @@ -24,7 +24,7 @@ if [ "$k" = "no" ]; then else k="-k" fi -node=${NODE:-./node} +node=${NODE:-./iojs} $node benchmark/http_simple.js & npid=$! diff --git a/benchmark/http_bench.js b/benchmark/http_bench.js index 842b942f16fcd2..0541667760a774 100644 --- a/benchmark/http_bench.js +++ b/benchmark/http_bench.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var spawn = require('child_process').spawn; var cluster = require('cluster'); var http = require('http'); diff --git a/benchmark/http_simple_bench.sh b/benchmark/http_simple_bench.sh index 6948227974908a..2066047b9e37fc 100755 --- a/benchmark/http_simple_bench.sh +++ b/benchmark/http_simple_bench.sh @@ -14,7 +14,7 @@ if [ ! -d benchmark/ ]; then fi if [ $SERVER == "127.0.0.1" ]; then - ./node benchmark/http_simple.js & + ./iojs benchmark/http_simple.js & node_pid=$! sleep 1 fi diff --git a/benchmark/misc/module-loader.js b/benchmark/misc/module-loader.js index 00a9369650d103..e53bc4d801164b 100644 --- a/benchmark/misc/module-loader.js +++ b/benchmark/misc/module-loader.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var fs = require('fs'); var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/misc/next-tick-depth.js b/benchmark/misc/next-tick-depth.js index b8ae27879ecfba..8a2c8e0a6ae148 100644 --- a/benchmark/misc/next-tick-depth.js +++ b/benchmark/misc/next-tick-depth.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var bench = common.createBenchmark(main, { millions: [2] diff --git a/benchmark/misc/v8-bench.js b/benchmark/misc/v8-bench.js index 8bf49f3f611804..0eb95aa9e2b2bc 100644 --- a/benchmark/misc/v8-bench.js +++ b/benchmark/misc/v8-bench.js @@ -10,9 +10,13 @@ global.print = function(s) { console.log('misc/v8_bench.js %s', s); }; -global.load = function (x) { - var source = fs.readFileSync(path.join(dir, x), 'utf8'); - vm.runInThisContext(source, x); -} +global.load = function(filename) { + var source = fs.readFileSync(path.join(dir, filename), 'utf8'); + // deps/v8/benchmarks/regexp.js breaks console.log() because it clobbers + // the RegExp global, Restore the original when the script is done. + var $RegExp = global.RegExp; + vm.runInThisContext(source, { filename: filename }); + global.RegExp = $RegExp; +}; load('run.js'); diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 3bbf082a41dbd9..0039313f5235ad 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -14,6 +14,8 @@ var bench = common.createBenchmark(main, { }); var TCP = process.binding('tcp_wrap').TCP; +var TCPConnectWrap = process.binding('tcp_wrap').TCPConnectWrap; +var WriteWrap = process.binding('stream_wrap').WriteWrap; var PORT = common.PORT; var dur; @@ -91,7 +93,7 @@ function client() { } var clientHandle = new TCP(); - var connectReq = {}; + var connectReq = new TCPConnectWrap(); var err = clientHandle.connect(connectReq, '127.0.0.1', PORT); if (err) @@ -108,7 +110,8 @@ function client() { }; function write() { - var writeReq = { oncomplete: afterWrite }; + var writeReq = new WriteWrap(); + writeReq.oncomplete = afterWrite; var err; switch (type) { case 'buf': diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index bda683985d4a31..1504d11db5fa53 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -14,6 +14,8 @@ var bench = common.createBenchmark(main, { }); var TCP = process.binding('tcp_wrap').TCP; +var TCPConnectWrap = process.binding('tcp_wrap').TCPConnectWrap; +var WriteWrap = process.binding('stream_wrap').WriteWrap; var PORT = common.PORT; var dur; @@ -51,14 +53,15 @@ function server() { if (nread < 0) fail(nread, 'read'); - var writeReq = { async: false }; + var writeReq = new WriteWrap(); + writeReq.async = false; err = clientHandle.writeBuffer(writeReq, buffer); if (err) fail(err, 'write'); - writeReq.oncomplete = function(status, handle, req) { - if (status) + writeReq.oncomplete = function(status, handle, req, err) { + if (err) fail(err, 'write'); }; }; @@ -88,7 +91,7 @@ function client() { } var clientHandle = new TCP(); - var connectReq = {}; + var connectReq = new TCPConnectWrap(); var err = clientHandle.connect(connectReq, '127.0.0.1', PORT); var bytes = 0; @@ -121,7 +124,8 @@ function client() { }; function write() { - var writeReq = { oncomplete: afterWrite }; + var writeReq = new WriteWrap(); + writeReq.oncomplete = afterWrite; var err; switch (type) { case 'buf': diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index 500be1b72bb349..502586c2a05e29 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -14,6 +14,8 @@ var bench = common.createBenchmark(main, { }); var TCP = process.binding('tcp_wrap').TCP; +var TCPConnectWrap = process.binding('tcp_wrap').TCPConnectWrap; +var WriteWrap = process.binding('stream_wrap').WriteWrap; var PORT = common.PORT; var dur; @@ -68,7 +70,9 @@ function server() { write(); function write() { - var writeReq = { async: false, oncomplete: afterWrite }; + var writeReq = new WriteWrap(); + writeReq.async = false; + writeReq.oncomplete = afterWrite; var err; switch (type) { case 'buf': @@ -91,7 +95,7 @@ function server() { } } - function afterWrite(err, handle, req) { + function afterWrite(status, handle, req, err) { if (err) fail(err, 'write'); @@ -105,7 +109,7 @@ function server() { function client() { var clientHandle = new TCP(); - var connectReq = {}; + var connectReq = new TCPConnectWrap(); var err = clientHandle.connect(connectReq, '127.0.0.1', PORT); if (err) diff --git a/benchmark/plot.R b/benchmark/plot.R index 1f902eddfe6090..288e8bd5a48fc5 100755 --- a/benchmark/plot.R +++ b/benchmark/plot.R @@ -52,7 +52,7 @@ ab.load <- function (filename, name) { filename <- args[0:1] -data <- ab.load(filename, "node") +data <- ab.load(filename, "iojs") # histogram diff --git a/common.gypi b/common.gypi index fd436a5bce1089..e323fc3a6c4dc5 100644 --- a/common.gypi +++ b/common.gypi @@ -20,14 +20,17 @@ # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, - # Enable V8's post-mortem debugging only on unix flavors. + # Don't bake anything extra into the snapshot. + 'v8_use_external_startup_data%': 0, + + # Disable V8's post-mortem debugging; frequently broken and hardly used. + 'v8_postmortem_support%': 'false', + 'conditions': [ ['OS == "win"', { 'os_posix': 0, - 'v8_postmortem_support': 'false' }, { 'os_posix': 1, - 'v8_postmortem_support': 'true' }], ['GENERATOR == "ninja" or OS== "mac"', { 'OBJ_DIR': '<(PRODUCT_DIR)/obj', @@ -102,7 +105,6 @@ 'EnableFunctionLevelLinking': 'true', 'EnableIntrinsicFunctions': 'true', 'RuntimeTypeInfo': 'false', - 'ExceptionHandling': '0', 'AdditionalOptions': [ '/MP', # compile across multiple CPUs ], @@ -131,7 +133,7 @@ 'DebugInformationFormat': 3, # Generate a PDB 'WarningLevel': 3, 'BufferSecurityCheck': 'true', - 'ExceptionHandling': 1, # /EHsc + 'ExceptionHandling': 0, # /EHsc 'SuppressStartupBanner': 'true', 'WarnAsError': 'false', }, @@ -139,8 +141,21 @@ }, 'VCLinkerTool': { 'conditions': [ + ['target_arch=="ia32"', { + 'TargetMachine' : 1, # /MACHINE:X86 + 'target_conditions': [ + ['_type=="executable"', { + 'AdditionalOptions': [ '/SubSystem:Console,"5.01"' ], + }], + ], + }], ['target_arch=="x64"', { - 'TargetMachine' : 17 # /MACHINE:X64 + 'TargetMachine' : 17, # /MACHINE:AMD64 + 'target_conditions': [ + ['_type=="executable"', { + 'AdditionalOptions': [ '/SubSystem:Console,"5.02"' ], + }], + ], }], ], 'GenerateDebugInformation': 'true', @@ -148,11 +163,6 @@ 'DataExecutionPrevention': 2, # enable DEP 'AllowIsolation': 'true', 'SuppressStartupBanner': 'true', - 'target_conditions': [ - ['_type=="executable"', { - 'SubSystem': 1, # console executable - }], - ], }, }, 'msvs_disabled_warnings': [4351, 4355, 4800], @@ -177,6 +187,8 @@ # ... or that C implementations shouldn't use # POSIX names '_CRT_NONSTDC_NO_DEPRECATE', + # Make sure the STL doesn't try to use exceptions + '_HAS_EXCEPTIONS=0', 'BUILDING_V8_SHARED=1', 'BUILDING_UV_SHARED=1', ], diff --git a/configure b/configure index f863118d4e655d..5fe87b60fcd7a5 100755 --- a/configure +++ b/configure @@ -6,13 +6,21 @@ import re import shlex import subprocess import sys +import shutil +import string +import textwrap CC = os.environ.get('CC', 'cc') +CXX = os.environ.get('CXX', 'c++') root_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp', 'pylib')) from gyp.common import GetFlavor +# imports in tools/configure.d +sys.path.insert(0, os.path.join(root_dir, 'tools', 'configure.d')) +import nodedownload + # parse our options parser = optparse.OptionParser() @@ -44,11 +52,6 @@ parser.add_option('--gdb', dest='gdb', help='add gdb support') -parser.add_option('--ninja', - action='store_true', - dest='use_ninja', - help='generate files for the ninja build system') - parser.add_option('--no-ifaddrs', action='store_true', dest='no_ifaddrs', @@ -216,26 +219,36 @@ parser.add_option('--with-etw', dest='with_etw', help='build with ETW (default is true on Windows)') +parser.add_option('--download', + action='store', + dest='download_list', + help=nodedownload.help()) + parser.add_option('--with-icu-path', action='store', dest='with_icu_path', help='Path to icu.gyp (ICU i18n, Chromium version only.)') +parser.add_option('--with-icu-locales', + action='store', + dest='with_icu_locales', + help='Comma-separated list of locales for "small-icu". Default: "root,en". "root" is assumed.') + parser.add_option('--with-intl', action='store', dest='with_intl', help='Intl mode: none, full-icu, small-icu (default is none)') +parser.add_option('--with-icu-source', + action='store', + dest='with_icu_source', + help='Intl mode: optional local path to icu/ dir, or path/URL of icu source archive.') + parser.add_option('--with-perfctr', action='store_true', dest='with_perfctr', help='build with performance counters (default is true on Windows)') -parser.add_option('--with-sslv2', - action='store_true', - dest='with_sslv2', - help='enable SSL v2') - parser.add_option('--without-dtrace', action='store_true', dest='without_dtrace', @@ -274,6 +287,8 @@ parser.add_option('--xcode', (options, args) = parser.parse_args() +# set up auto-download list +auto_downloads = nodedownload.parse(options.download_list) def b(value): """Returns the string 'true' if value is truthy, 'false' otherwise.""" @@ -297,6 +312,52 @@ def pkg_config(pkg): return (libs, cflags) +def try_check_compiler(cc, lang): + try: + proc = subprocess.Popen(shlex.split(cc) + ['-E', '-P', '-x', lang, '-'], + stdin=subprocess.PIPE, stdout=subprocess.PIPE) + except OSError: + return (False, False, '', '') + + proc.stdin.write('__clang__ __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ ' + '__clang_major__ __clang_minor__ __clang_patchlevel__') + + values = (proc.communicate()[0].split() + ['0'] * 7)[0:7] + is_clang = values[0] == '1' + gcc_version = '%s.%s.%s' % tuple(values[1:1+3]) + clang_version = '%s.%s.%s' % tuple(values[4:4+3]) + + return (True, is_clang, clang_version, gcc_version) + + +# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes +# the version check more by accident than anything else but a more rigorous +# check involves checking the build number against a whitelist. I'm not +# quite prepared to go that far yet. +def check_compiler(): + if sys.platform == 'win32': + return + + def warn(msg): + prefix = '\033[1m\033[91mWARNING\033[0m' if os.isatty(1) else 'WARNING' + print('%s: %s' % (prefix, msg)) + + ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++') + if not ok: + warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX) + elif clang_version < '3.4.0' if is_clang else gcc_version < '4.8.0': + warn('C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=%s)' % CXX) + + ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c') + if not ok: + warn('failed to autodetect C compiler version (CC=%s)' % CC) + elif not is_clang and gcc_version < '4.2.0': + # clang 3.2 is a little white lie because any clang version will probably + # do for the C bits. However, we might as well encourage people to upgrade + # to a version that is not completely ancient. + warn('C compiler too old, need gcc 4.2 or clang 3.2 (CC=%s)' % CC) + + def cc_macros(): """Checks predefined macros using the CC command.""" @@ -418,6 +479,10 @@ def configure_arm(o): o['variables']['arm_thumb'] = 0 # -marm o['variables']['arm_float_abi'] = arm_float_abi + # Print warning when snapshot is enabled and building on armv6 + if is_arch_armv6() and not options.without_snapshot: + print '\033[1;33mWarning!! When building on ARMv6 use --without-snapshot\033[1;m' + def configure_node(o): if options.dest_os == 'android': @@ -565,11 +630,6 @@ def configure_openssl(o): if options.without_ssl: return - # OpenSSL uses `#ifndef OPENSSL_NO_SSL2` checks so only define the - # macro when we want to _disable_ SSL2. - if not options.with_sslv2: - o['defines'] += ['OPENSSL_NO_SSL2=1'] - if options.shared_openssl: (libs, cflags) = pkg_config('openssl') or ('-lssl -lcrypto', '') @@ -632,6 +692,35 @@ def glob_to_var(dir_base, dir_sub): return list def configure_intl(o): + icus = [ + { + 'url': 'http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.zip', + # from https://ssl.icu-project.org/files/icu4c/54.1/icu4c-src-54_1.md5: + 'md5': '6b89d60e2f0e140898ae4d7f72323bca', + }, + ] + def icu_download(path): + # download ICU, if needed + for icu in icus: + url = icu['url'] + md5 = icu['md5'] + local = url.split('/')[-1] + targetfile = os.path.join(root_dir, 'deps', local) + if not os.path.isfile(targetfile): + if nodedownload.candownload(auto_downloads, "icu"): + nodedownload.retrievefile(url, targetfile) + else: + print ' Re-using existing %s' % targetfile + if os.path.isfile(targetfile): + sys.stdout.write(' Checking file integrity with MD5:\r') + gotmd5 = nodedownload.md5sum(targetfile) + print ' MD5: %s %s' % (gotmd5, targetfile) + if (md5 == gotmd5): + return targetfile + else: + print ' Expected: %s *MISMATCH*' % md5 + print '\n ** Corrupted ZIP? Delete %s to retry download.\n' % targetfile + return None icu_config = { 'variables': {} } @@ -643,11 +732,11 @@ def configure_intl(o): write(icu_config_name, do_not_edit + pprint.pformat(icu_config, indent=2) + '\n') - # small ICU is off by default. # always set icu_small, node.gyp depends on it being defined. o['variables']['icu_small'] = b(False) with_intl = options.with_intl + with_icu_source = options.with_icu_source have_icu_path = bool(options.with_icu_path) if have_icu_path and with_intl: print 'Error: Cannot specify both --with-icu-path and --with-intl' @@ -659,6 +748,13 @@ def configure_intl(o): o['variables']['icu_gyp_path'] = options.with_icu_path return # --with-intl= + # set the default + if with_intl is None: + with_intl = 'none' # The default mode of Intl + # sanity check localelist + if options.with_icu_locales and (with_intl != 'small-icu'): + print 'Error: --with-icu-locales only makes sense with --with-intl=small-icu' + sys.exit(1) if with_intl == 'none' or with_intl is None: o['variables']['v8_enable_i18n_support'] = 0 return # no Intl @@ -666,6 +762,12 @@ def configure_intl(o): # small ICU (English only) o['variables']['v8_enable_i18n_support'] = 1 o['variables']['icu_small'] = b(True) + with_icu_locales = options.with_icu_locales + if not with_icu_locales: + with_icu_locales = 'root,en' + locs = set(with_icu_locales.split(',')) + locs.add('root') # must have root + o['variables']['icu_locales'] = string.join(locs,',') elif with_intl == 'full-icu': # full ICU o['variables']['v8_enable_i18n_support'] = 1 @@ -689,20 +791,77 @@ def configure_intl(o): # Note: non-ICU implementations could use other 'with_intl' # values. + # this is just the 'deps' dir. Used for unpacking. + icu_parent_path = os.path.join(root_dir, 'deps') + + # The full path to the ICU source directory. + icu_full_path = os.path.join(icu_parent_path, 'icu') + + # icu-tmp is used to download and unpack the ICU tarball. + icu_tmp_path = os.path.join(icu_parent_path, 'icu-tmp') + + # --with-icu-source processing + # first, check that they didn't pass --with-icu-source=deps/icu + if with_icu_source and os.path.abspath(icu_full_path) == os.path.abspath(with_icu_source): + print 'Ignoring redundant --with-icu-source=%s' % (with_icu_source) + with_icu_source = None + # if with_icu_source is still set, try to use it. + if with_icu_source: + if os.path.isdir(icu_full_path): + print 'Deleting old ICU source: %s' % (icu_full_path) + shutil.rmtree(icu_full_path) + # now, what path was given? + if os.path.isdir(with_icu_source): + # it's a path. Copy it. + print '%s -> %s' % (with_icu_source, icu_full_path) + shutil.copytree(with_icu_source, icu_full_path) + else: + # could be file or URL. + # Set up temporary area + if os.path.isdir(icu_tmp_path): + shutil.rmtree(icu_tmp_path) + os.mkdir(icu_tmp_path) + icu_tarball = None + if os.path.isfile(with_icu_source): + # it's a file. Try to unpack it. + icu_tarball = with_icu_source + else: + # Can we download it? + local = os.path.join(icu_tmp_path, with_icu_source.split('/')[-1]) # local part + icu_tarball = nodedownload.retrievefile(with_icu_source, local) + # continue with "icu_tarball" + nodedownload.unpack(icu_tarball, icu_tmp_path) + # Did it unpack correctly? Should contain 'icu' + tmp_icu = os.path.join(icu_tmp_path, 'icu') + if os.path.isdir(tmp_icu): + os.rename(tmp_icu, icu_full_path) + shutil.rmtree(icu_tmp_path) + else: + print ' Error: --with-icu-source=%s did not result in an "icu" dir.' % with_icu_source + shutil.rmtree(icu_tmp_path) + sys.exit(1) + # ICU mode. (icu-generic.gyp) - byteorder = sys.byteorder o['variables']['icu_gyp_path'] = 'tools/icu/icu-generic.gyp' # ICU source dir relative to root - icu_full_path = os.path.join(root_dir, 'deps/icu') o['variables']['icu_path'] = icu_full_path if not os.path.isdir(icu_full_path): - print 'Error: ICU path is not a directory: %s' % (icu_full_path) + print '* ECMA-402 (Intl) support didn\'t find ICU in %s..' % (icu_full_path) + # can we download (or find) a zipfile? + localzip = icu_download(icu_full_path) + if localzip: + nodedownload.unpack(localzip, icu_parent_path) + if not os.path.isdir(icu_full_path): + print ' Cannot build Intl without ICU in %s.' % (icu_full_path) + print ' (Fix, or disable with "--with-intl=none" )' sys.exit(1) + else: + print '* Using ICU in %s' % (icu_full_path) # Now, what version of ICU is it? We just need the "major", such as 54. # uvernum.h contains it as a #define. uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h') if not os.path.isfile(uvernum_h): - print 'Error: could not load %s - is ICU installed?' % uvernum_h + print ' Error: could not load %s - is ICU installed?' % uvernum_h sys.exit(1) icu_ver_major = None matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*' @@ -712,7 +871,7 @@ def configure_intl(o): if m: icu_ver_major = m.group(1) if not icu_ver_major: - print 'Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h + print ' Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h sys.exit(1) icu_endianness = sys.byteorder[0]; # TODO(srl295): EBCDIC should be 'e' o['variables']['icu_ver_major'] = icu_ver_major @@ -739,8 +898,8 @@ def configure_intl(o): # this is the icudt*.dat file which node will be using (platform endianness) o['variables']['icu_data_file'] = icu_data_file if not os.path.isfile(icu_data_path): - print 'Error: ICU prebuilt data file %s does not exist.' % icu_data_path - print 'See the README.md.' + print ' Error: ICU prebuilt data file %s does not exist.' % icu_data_path + print ' See the README.md.' # .. and we're not about to build it from .gyp! sys.exit(1) # map from variable name to subdirs @@ -765,6 +924,9 @@ def configure_intl(o): pprint.pformat(icu_config, indent=2) + '\n') return # end of configure_intl +# Print a warning when the compiler is too old. +check_compiler() + # determine the "flavor" (operating system) we're building for, # leveraging gyp's GetFlavor function flavor_params = {} @@ -798,14 +960,13 @@ output = { 'variables': variables, 'target_defaults': output } -pprint.pprint(output, indent=2) +print textwrap.fill(str(output), 78) write('config.gypi', do_not_edit + pprint.pformat(output, indent=2) + '\n') config = { 'BUILDTYPE': 'Debug' if options.debug else 'Release', - 'USE_NINJA': str(int(options.use_ninja or 0)), 'USE_XCODE': str(int(options.use_xcode or 0)), 'PYTHON': sys.executable, } @@ -820,9 +981,7 @@ write('config.mk', gyp_args = [sys.executable, 'tools/gyp_node.py', '--no-parallel'] -if options.use_ninja: - gyp_args += ['-f', 'ninja-' + flavor] -elif options.use_xcode: +if options.use_xcode: gyp_args += ['-f', 'xcode'] elif flavor == 'win' and sys.platform != 'msys': gyp_args += ['-f', 'msvs', '-G', 'msvs_version=auto'] diff --git a/deps/cares/src/ares_library_init.c b/deps/cares/src/ares_library_init.c index 770e7c23560fb9..9114f62614b9b1 100644 --- a/deps/cares/src/ares_library_init.c +++ b/deps/cares/src/ares_library_init.c @@ -45,7 +45,7 @@ static int ares_win32_init(void) #ifdef USE_WINSOCK hnd_iphlpapi = 0; - hnd_iphlpapi = LoadLibrary("iphlpapi.dll"); + hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll"); if (!hnd_iphlpapi) return ARES_ELOADIPHLPAPI; @@ -73,7 +73,7 @@ static int ares_win32_init(void) */ hnd_advapi32 = 0; - hnd_advapi32 = LoadLibrary("advapi32.dll"); + hnd_advapi32 = LoadLibraryW(L"advapi32.dll"); if (hnd_advapi32) { ares_fpSystemFunction036 = (fpSystemFunction036_t) diff --git a/deps/http_parser/.gitignore b/deps/http_parser/.gitignore index 594f3047f4716e..32cb51b2d3f6f6 100644 --- a/deps/http_parser/.gitignore +++ b/deps/http_parser/.gitignore @@ -5,6 +5,7 @@ tags test test_g test_fast +bench url_parser parsertrace parsertrace_g diff --git a/deps/http_parser/.mailmap b/deps/http_parser/.mailmap index 75a187c5685746..278d1412637240 100644 --- a/deps/http_parser/.mailmap +++ b/deps/http_parser/.mailmap @@ -5,3 +5,4 @@ Salman Haq Simon Zimmermann Thomas LE ROUX LE ROUX Thomas Thomas LE ROUX Thomas LE ROUX +Fedor Indutny diff --git a/deps/http_parser/.travis.yml b/deps/http_parser/.travis.yml index ae85af020a8280..4b038e6e62d638 100644 --- a/deps/http_parser/.travis.yml +++ b/deps/http_parser/.travis.yml @@ -10,4 +10,4 @@ script: notifications: email: false irc: - - "irc.freenode.net#libuv" + - "irc.freenode.net#node-ci" diff --git a/deps/http_parser/AUTHORS b/deps/http_parser/AUTHORS index 51b53b12537210..29cdbb16d309af 100644 --- a/deps/http_parser/AUTHORS +++ b/deps/http_parser/AUTHORS @@ -39,12 +39,25 @@ BogDan Vatra Peter Faiman Corey Richardson Tóth Tamás -Patrik Stutz Cam Swords Chris Dickinson Uli Köhler Charlie Somerville +Patrik Stutz Fedor Indutny runner Alexis Campailla David Wragg +Vinnie Falco +Alex Butum +Rex Feng +Alex Kocharin +Mark Koopman +Helge Heß +Alexis La Goutte +George Miroshnykov +Maciej Małecki +Marc O'Morain +Jeff Pinner +Timothy J Fontaine +Akagi201 diff --git a/deps/http_parser/CONTRIBUTIONS b/deps/http_parser/CONTRIBUTIONS deleted file mode 100644 index 11ba31e4b990e3..00000000000000 --- a/deps/http_parser/CONTRIBUTIONS +++ /dev/null @@ -1,4 +0,0 @@ -Contributors must agree to the Contributor License Agreement before patches -can be accepted. - -http://spreadsheets2.google.com/viewform?hl=en&formkey=dDJXOGUwbzlYaWM4cHN1MERwQS1CSnc6MQ diff --git a/deps/http_parser/Makefile b/deps/http_parser/Makefile index 3ce463b88bf242..3600503bd082ba 100644 --- a/deps/http_parser/Makefile +++ b/deps/http_parser/Makefile @@ -19,20 +19,25 @@ # IN THE SOFTWARE. PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') -SONAME ?= libhttp_parser.so.2.3 +SONAME ?= libhttp_parser.so.2.4.1 CC?=gcc AR?=ar +CPPFLAGS ?= +LDFLAGS ?= + CPPFLAGS += -I. CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1 CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA) CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0 CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA) +CPPFLAGS_BENCH = $(CPPFLAGS_FAST) CFLAGS += -Wall -Wextra -Werror CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA) CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA) +CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter CFLAGS_LIB = $(CFLAGS_FAST) -fPIC LDFLAGS_LIB = $(LDFLAGS) -shared @@ -61,6 +66,12 @@ test_fast: http_parser.o test.o http_parser.h test.o: test.c http_parser.h Makefile $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@ +bench: http_parser.o bench.o + $(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@ + +bench.o: bench.c http_parser.h Makefile + $(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@ + http_parser.o: http_parser.c http_parser.h Makefile $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c diff --git a/deps/http_parser/README.md b/deps/http_parser/README.md index 0bf5d359aca912..7c54dd42d087c3 100644 --- a/deps/http_parser/README.md +++ b/deps/http_parser/README.md @@ -61,7 +61,7 @@ if (recved < 0) { } /* Start up / continue the parser. - * Note we pass recved==0 to signal that EOF has been recieved. + * Note we pass recved==0 to signal that EOF has been received. */ nparsed = http_parser_execute(parser, &settings, buf, recved); @@ -75,7 +75,7 @@ if (parser->upgrade) { HTTP needs to know where the end of the stream is. For example, sometimes servers send responses without Content-Length and expect the client to consume input (for the body) until EOF. To tell http_parser about EOF, give -`0` as the forth parameter to `http_parser_execute()`. Callbacks and errors +`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors can still be encountered during an EOF, so one must still be prepared to receive them. @@ -110,7 +110,7 @@ followed by non-HTTP data. information the Web Socket protocol.) To support this, the parser will treat this as a normal HTTP message without a -body. Issuing both on_headers_complete and on_message_complete callbacks. However +body, issuing both on_headers_complete and on_message_complete callbacks. However http_parser_execute() will stop parsing at the end of the headers and return. The user is expected to check if `parser->upgrade` has been set to 1 after @@ -131,7 +131,7 @@ There are two types of callbacks: * notification `typedef int (*http_cb) (http_parser*);` Callbacks: on_message_begin, on_headers_complete, on_message_complete. * data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);` - Callbacks: (requests only) on_uri, + Callbacks: (requests only) on_url, (common) on_header_field, on_header_value, on_body; Callbacks must return 0 on success. Returning a non-zero value indicates @@ -145,7 +145,7 @@ buffer to avoid copying memory around if this fits your application. Reading headers may be a tricky task if you read/parse headers partially. Basically, you need to remember whether last header callback was field or value -and apply following logic: +and apply the following logic: (on_header_field and on_header_value shortened to on_h_*) ------------------------ ------------ -------------------------------------------- diff --git a/deps/http_parser/bench.c b/deps/http_parser/bench.c new file mode 100644 index 00000000000000..5b452fa1cdb6e6 --- /dev/null +++ b/deps/http_parser/bench.c @@ -0,0 +1,111 @@ +/* Copyright Fedor Indutny. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ +#include "http_parser.h" +#include +#include +#include +#include + +static const char data[] = + "POST /joyent/http-parser HTTP/1.1\r\n" + "Host: github.com\r\n" + "DNT: 1\r\n" + "Accept-Encoding: gzip, deflate, sdch\r\n" + "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n" + "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) " + "AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/39.0.2171.65 Safari/537.36\r\n" + "Accept: text/html,application/xhtml+xml,application/xml;q=0.9," + "image/webp,*/*;q=0.8\r\n" + "Referer: https://github.com/joyent/http-parser\r\n" + "Connection: keep-alive\r\n" + "Transfer-Encoding: chunked\r\n" + "Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n"; +static const size_t data_len = sizeof(data) - 1; + +static int on_info(http_parser* p) { + return 0; +} + + +static int on_data(http_parser* p, const char *at, size_t length) { + return 0; +} + +static http_parser_settings settings = { + .on_message_begin = on_info, + .on_headers_complete = on_info, + .on_message_complete = on_info, + .on_header_field = on_data, + .on_header_value = on_data, + .on_url = on_data, + .on_status = on_data, + .on_body = on_data +}; + +int bench(int iter_count, int silent) { + struct http_parser parser; + int i; + int err; + struct timeval start; + struct timeval end; + float rps; + + if (!silent) { + err = gettimeofday(&start, NULL); + assert(err == 0); + } + + for (i = 0; i < iter_count; i++) { + size_t parsed; + http_parser_init(&parser, HTTP_REQUEST); + + parsed = http_parser_execute(&parser, &settings, data, data_len); + assert(parsed == data_len); + } + + if (!silent) { + err = gettimeofday(&end, NULL); + assert(err == 0); + + fprintf(stdout, "Benchmark result:\n"); + + rps = (float) (end.tv_sec - start.tv_sec) + + (end.tv_usec - start.tv_usec) * 1e-6f; + fprintf(stdout, "Took %f seconds to run\n", rps); + + rps = (float) iter_count / rps; + fprintf(stdout, "%f req/sec\n", rps); + fflush(stdout); + } + + return 0; +} + +int main(int argc, char** argv) { + if (argc == 2 && strcmp(argv[1], "infinite") == 0) { + for (;;) + bench(5000000, 1); + return 0; + } else { + return bench(5000000, 0); + } +} diff --git a/deps/http_parser/contrib/parsertrace.c b/deps/http_parser/contrib/parsertrace.c index c9bc71ec017e7c..e7153680f467de 100644 --- a/deps/http_parser/contrib/parsertrace.c +++ b/deps/http_parser/contrib/parsertrace.c @@ -111,14 +111,14 @@ int main(int argc, char* argv[]) { FILE* file = fopen(filename, "r"); if (file == NULL) { perror("fopen"); - return EXIT_FAILURE; + goto fail; } fseek(file, 0, SEEK_END); long file_length = ftell(file); if (file_length == -1) { perror("ftell"); - return EXIT_FAILURE; + goto fail; } fseek(file, 0, SEEK_SET); @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) { if (fread(data, 1, file_length, file) != (size_t)file_length) { fprintf(stderr, "couldn't read entire file\n"); free(data); - return EXIT_FAILURE; + goto fail; } http_parser_settings settings; @@ -149,8 +149,12 @@ int main(int argc, char* argv[]) { "Error: %s (%s)\n", http_errno_description(HTTP_PARSER_ERRNO(&parser)), http_errno_name(HTTP_PARSER_ERRNO(&parser))); - return EXIT_FAILURE; + goto fail; } return EXIT_SUCCESS; + +fail: + fclose(file); + return EXIT_FAILURE; } diff --git a/deps/http_parser/http_parser.c b/deps/http_parser/http_parser.c index 70cc9bd37b2da6..3e114c02ca14c4 100644 --- a/deps/http_parser/http_parser.c +++ b/deps/http_parser/http_parser.c @@ -56,19 +56,41 @@ do { \ parser->http_errno = (e); \ } while(0) +#define CURRENT_STATE() p_state +#define UPDATE_STATE(V) p_state = (enum state) (V); +#define RETURN(V) \ +do { \ + parser->state = CURRENT_STATE(); \ + return (V); \ +} while (0); +#define REEXECUTE() \ + --p; \ + break; + + +#ifdef __GNUC__ +# define LIKELY(X) __builtin_expect(!!(X), 1) +# define UNLIKELY(X) __builtin_expect(!!(X), 0) +#else +# define LIKELY(X) (X) +# define UNLIKELY(X) (X) +#endif + /* Run the notify callback FOR, returning ER if it fails */ #define CALLBACK_NOTIFY_(FOR, ER) \ do { \ assert(HTTP_PARSER_ERRNO(parser) == HPE_OK); \ \ - if (settings->on_##FOR) { \ - if (0 != settings->on_##FOR(parser)) { \ + if (LIKELY(settings->on_##FOR)) { \ + parser->state = CURRENT_STATE(); \ + if (UNLIKELY(0 != settings->on_##FOR(parser))) { \ SET_ERRNO(HPE_CB_##FOR); \ } \ + UPDATE_STATE(parser->state); \ \ /* We either errored above or got paused; get out */ \ - if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { \ + if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) { \ return (ER); \ } \ } \ @@ -86,13 +108,16 @@ do { \ assert(HTTP_PARSER_ERRNO(parser) == HPE_OK); \ \ if (FOR##_mark) { \ - if (settings->on_##FOR) { \ - if (0 != settings->on_##FOR(parser, FOR##_mark, (LEN))) { \ + if (LIKELY(settings->on_##FOR)) { \ + parser->state = CURRENT_STATE(); \ + if (UNLIKELY(0 != \ + settings->on_##FOR(parser, FOR##_mark, (LEN)))) { \ SET_ERRNO(HPE_CB_##FOR); \ } \ + UPDATE_STATE(parser->state); \ \ /* We either errored above or got paused; get out */ \ - if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { \ + if (UNLIKELY(HTTP_PARSER_ERRNO(parser) != HPE_OK)) { \ return (ER); \ } \ } \ @@ -116,6 +141,26 @@ do { \ } \ } while (0) +/* Don't allow the total size of the HTTP headers (including the status + * line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect + * embedders against denial-of-service attacks where the attacker feeds + * us a never-ending header that the embedder keeps buffering. + * + * This check is arguably the responsibility of embedders but we're doing + * it on the embedder's behalf because most won't bother and this way we + * make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger + * than any reasonable request or response so this should never affect + * day-to-day operation. + */ +#define COUNT_HEADER_SIZE(V) \ +do { \ + parser->nread += (V); \ + if (UNLIKELY(parser->nread > (HTTP_MAX_HEADER_SIZE))) { \ + SET_ERRNO(HPE_HEADER_OVERFLOW); \ + goto error; \ + } \ +} while (0) + #define PROXY_CONNECTION "proxy-connection" #define CONNECTION "connection" @@ -334,12 +379,16 @@ enum header_states , h_upgrade , h_matching_transfer_encoding_chunked + , h_matching_connection_token_start , h_matching_connection_keep_alive , h_matching_connection_close + , h_matching_connection_upgrade + , h_matching_connection_token , h_transfer_encoding_chunked , h_connection_keep_alive , h_connection_close + , h_connection_upgrade }; enum http_host_state @@ -371,6 +420,8 @@ enum http_host_state (c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \ (c) == '$' || (c) == ',') +#define STRICT_TOKEN(c) (tokens[(unsigned char)c]) + #if HTTP_PARSER_STRICT #define TOKEN(c) (tokens[(unsigned char)c]) #define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c)) @@ -586,6 +637,7 @@ size_t http_parser_execute (http_parser *parser, const char *url_mark = 0; const char *body_mark = 0; const char *status_mark = 0; + enum state p_state = (enum state) parser->state; /* We're in an error state. Don't bother doing anything. */ if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { @@ -593,7 +645,7 @@ size_t http_parser_execute (http_parser *parser, } if (len == 0) { - switch (parser->state) { + switch (CURRENT_STATE()) { case s_body_identity_eof: /* Use of CALLBACK_NOTIFY() here would erroneously return 1 byte read if * we got paused. @@ -614,11 +666,11 @@ size_t http_parser_execute (http_parser *parser, } - if (parser->state == s_header_field) + if (CURRENT_STATE() == s_header_field) header_field_mark = data; - if (parser->state == s_header_value) + if (CURRENT_STATE() == s_header_value) header_value_mark = data; - switch (parser->state) { + switch (CURRENT_STATE()) { case s_req_path: case s_req_schema: case s_req_schema_slash: @@ -635,38 +687,23 @@ size_t http_parser_execute (http_parser *parser, case s_res_status: status_mark = data; break; + default: + break; } for (p=data; p != data + len; p++) { ch = *p; - if (PARSING_HEADER(parser->state)) { - ++parser->nread; - /* Don't allow the total size of the HTTP headers (including the status - * line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect - * embedders against denial-of-service attacks where the attacker feeds - * us a never-ending header that the embedder keeps buffering. - * - * This check is arguably the responsibility of embedders but we're doing - * it on the embedder's behalf because most won't bother and this way we - * make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger - * than any reasonable request or response so this should never affect - * day-to-day operation. - */ - if (parser->nread > HTTP_MAX_HEADER_SIZE) { - SET_ERRNO(HPE_HEADER_OVERFLOW); - goto error; - } - } + if (PARSING_HEADER(CURRENT_STATE())) + COUNT_HEADER_SIZE(1); - reexecute_byte: - switch (parser->state) { + switch (CURRENT_STATE()) { case s_dead: /* this state is used after a 'Connection: close' message * the parser will error out if it reads another message */ - if (ch == CR || ch == LF) + if (LIKELY(ch == CR || ch == LF)) break; SET_ERRNO(HPE_CLOSED_CONNECTION); @@ -680,13 +717,13 @@ size_t http_parser_execute (http_parser *parser, parser->content_length = ULLONG_MAX; if (ch == 'H') { - parser->state = s_res_or_resp_H; + UPDATE_STATE(s_res_or_resp_H); CALLBACK_NOTIFY(message_begin); } else { parser->type = HTTP_REQUEST; - parser->state = s_start_req; - goto reexecute_byte; + UPDATE_STATE(s_start_req); + REEXECUTE(); } break; @@ -695,9 +732,9 @@ size_t http_parser_execute (http_parser *parser, case s_res_or_resp_H: if (ch == 'T') { parser->type = HTTP_RESPONSE; - parser->state = s_res_HT; + UPDATE_STATE(s_res_HT); } else { - if (ch != 'E') { + if (UNLIKELY(ch != 'E')) { SET_ERRNO(HPE_INVALID_CONSTANT); goto error; } @@ -705,7 +742,7 @@ size_t http_parser_execute (http_parser *parser, parser->type = HTTP_REQUEST; parser->method = HTTP_HEAD; parser->index = 2; - parser->state = s_req_method; + UPDATE_STATE(s_req_method); } break; @@ -716,7 +753,7 @@ size_t http_parser_execute (http_parser *parser, switch (ch) { case 'H': - parser->state = s_res_H; + UPDATE_STATE(s_res_H); break; case CR: @@ -734,39 +771,39 @@ size_t http_parser_execute (http_parser *parser, case s_res_H: STRICT_CHECK(ch != 'T'); - parser->state = s_res_HT; + UPDATE_STATE(s_res_HT); break; case s_res_HT: STRICT_CHECK(ch != 'T'); - parser->state = s_res_HTT; + UPDATE_STATE(s_res_HTT); break; case s_res_HTT: STRICT_CHECK(ch != 'P'); - parser->state = s_res_HTTP; + UPDATE_STATE(s_res_HTTP); break; case s_res_HTTP: STRICT_CHECK(ch != '/'); - parser->state = s_res_first_http_major; + UPDATE_STATE(s_res_first_http_major); break; case s_res_first_http_major: - if (ch < '0' || ch > '9') { + if (UNLIKELY(ch < '0' || ch > '9')) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } parser->http_major = ch - '0'; - parser->state = s_res_http_major; + UPDATE_STATE(s_res_http_major); break; /* major HTTP version or dot */ case s_res_http_major: { if (ch == '.') { - parser->state = s_res_first_http_minor; + UPDATE_STATE(s_res_first_http_minor); break; } @@ -778,7 +815,7 @@ size_t http_parser_execute (http_parser *parser, parser->http_major *= 10; parser->http_major += ch - '0'; - if (parser->http_major > 999) { + if (UNLIKELY(parser->http_major > 999)) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -788,24 +825,24 @@ size_t http_parser_execute (http_parser *parser, /* first digit of minor HTTP version */ case s_res_first_http_minor: - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } parser->http_minor = ch - '0'; - parser->state = s_res_http_minor; + UPDATE_STATE(s_res_http_minor); break; /* minor HTTP version or end of request line */ case s_res_http_minor: { if (ch == ' ') { - parser->state = s_res_first_status_code; + UPDATE_STATE(s_res_first_status_code); break; } - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -813,7 +850,7 @@ size_t http_parser_execute (http_parser *parser, parser->http_minor *= 10; parser->http_minor += ch - '0'; - if (parser->http_minor > 999) { + if (UNLIKELY(parser->http_minor > 999)) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -832,7 +869,7 @@ size_t http_parser_execute (http_parser *parser, goto error; } parser->status_code = ch - '0'; - parser->state = s_res_status_code; + UPDATE_STATE(s_res_status_code); break; } @@ -841,13 +878,13 @@ size_t http_parser_execute (http_parser *parser, if (!IS_NUM(ch)) { switch (ch) { case ' ': - parser->state = s_res_status_start; + UPDATE_STATE(s_res_status_start); break; case CR: - parser->state = s_res_line_almost_done; + UPDATE_STATE(s_res_line_almost_done); break; case LF: - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); break; default: SET_ERRNO(HPE_INVALID_STATUS); @@ -859,7 +896,7 @@ size_t http_parser_execute (http_parser *parser, parser->status_code *= 10; parser->status_code += ch - '0'; - if (parser->status_code > 999) { + if (UNLIKELY(parser->status_code > 999)) { SET_ERRNO(HPE_INVALID_STATUS); goto error; } @@ -870,30 +907,30 @@ size_t http_parser_execute (http_parser *parser, case s_res_status_start: { if (ch == CR) { - parser->state = s_res_line_almost_done; + UPDATE_STATE(s_res_line_almost_done); break; } if (ch == LF) { - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); break; } MARK(status); - parser->state = s_res_status; + UPDATE_STATE(s_res_status); parser->index = 0; break; } case s_res_status: if (ch == CR) { - parser->state = s_res_line_almost_done; + UPDATE_STATE(s_res_line_almost_done); CALLBACK_DATA(status); break; } if (ch == LF) { - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); CALLBACK_DATA(status); break; } @@ -902,7 +939,7 @@ size_t http_parser_execute (http_parser *parser, case s_res_line_almost_done: STRICT_CHECK(ch != LF); - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); break; case s_start_req: @@ -912,7 +949,7 @@ size_t http_parser_execute (http_parser *parser, parser->flags = 0; parser->content_length = ULLONG_MAX; - if (!IS_ALPHA(ch)) { + if (UNLIKELY(!IS_ALPHA(ch))) { SET_ERRNO(HPE_INVALID_METHOD); goto error; } @@ -925,7 +962,7 @@ size_t http_parser_execute (http_parser *parser, case 'G': parser->method = HTTP_GET; break; case 'H': parser->method = HTTP_HEAD; break; case 'L': parser->method = HTTP_LOCK; break; - case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break; + case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break; case 'N': parser->method = HTTP_NOTIFY; break; case 'O': parser->method = HTTP_OPTIONS; break; case 'P': parser->method = HTTP_POST; @@ -939,7 +976,7 @@ size_t http_parser_execute (http_parser *parser, SET_ERRNO(HPE_INVALID_METHOD); goto error; } - parser->state = s_req_method; + UPDATE_STATE(s_req_method); CALLBACK_NOTIFY(message_begin); @@ -949,14 +986,14 @@ size_t http_parser_execute (http_parser *parser, case s_req_method: { const char *matcher; - if (ch == '\0') { + if (UNLIKELY(ch == '\0')) { SET_ERRNO(HPE_INVALID_METHOD); goto error; } matcher = method_strings[parser->method]; if (ch == ' ' && matcher[parser->index] == '\0') { - parser->state = s_req_spaces_before_url; + UPDATE_STATE(s_req_spaces_before_url); } else if (ch == matcher[parser->index]) { ; /* nada */ } else if (parser->method == HTTP_CONNECT) { @@ -977,6 +1014,8 @@ size_t http_parser_execute (http_parser *parser, parser->method = HTTP_MSEARCH; } else if (parser->index == 2 && ch == 'A') { parser->method = HTTP_MKACTIVITY; + } else if (parser->index == 3 && ch == 'A') { + parser->method = HTTP_MKCALENDAR; } else { SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -1035,11 +1074,11 @@ size_t http_parser_execute (http_parser *parser, MARK(url); if (parser->method == HTTP_CONNECT) { - parser->state = s_req_server_start; + UPDATE_STATE(s_req_server_start); } - parser->state = parse_url_char((enum state)parser->state, ch); - if (parser->state == s_dead) { + UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); + if (UNLIKELY(CURRENT_STATE() == s_dead)) { SET_ERRNO(HPE_INVALID_URL); goto error; } @@ -1060,8 +1099,8 @@ size_t http_parser_execute (http_parser *parser, SET_ERRNO(HPE_INVALID_URL); goto error; default: - parser->state = parse_url_char((enum state)parser->state, ch); - if (parser->state == s_dead) { + UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); + if (UNLIKELY(CURRENT_STATE() == s_dead)) { SET_ERRNO(HPE_INVALID_URL); goto error; } @@ -1080,21 +1119,21 @@ size_t http_parser_execute (http_parser *parser, { switch (ch) { case ' ': - parser->state = s_req_http_start; + UPDATE_STATE(s_req_http_start); CALLBACK_DATA(url); break; case CR: case LF: parser->http_major = 0; parser->http_minor = 9; - parser->state = (ch == CR) ? + UPDATE_STATE((ch == CR) ? s_req_line_almost_done : - s_header_field_start; + s_header_field_start); CALLBACK_DATA(url); break; default: - parser->state = parse_url_char((enum state)parser->state, ch); - if (parser->state == s_dead) { + UPDATE_STATE(parse_url_char(CURRENT_STATE(), ch)); + if (UNLIKELY(CURRENT_STATE() == s_dead)) { SET_ERRNO(HPE_INVALID_URL); goto error; } @@ -1105,7 +1144,7 @@ size_t http_parser_execute (http_parser *parser, case s_req_http_start: switch (ch) { case 'H': - parser->state = s_req_http_H; + UPDATE_STATE(s_req_http_H); break; case ' ': break; @@ -1117,44 +1156,44 @@ size_t http_parser_execute (http_parser *parser, case s_req_http_H: STRICT_CHECK(ch != 'T'); - parser->state = s_req_http_HT; + UPDATE_STATE(s_req_http_HT); break; case s_req_http_HT: STRICT_CHECK(ch != 'T'); - parser->state = s_req_http_HTT; + UPDATE_STATE(s_req_http_HTT); break; case s_req_http_HTT: STRICT_CHECK(ch != 'P'); - parser->state = s_req_http_HTTP; + UPDATE_STATE(s_req_http_HTTP); break; case s_req_http_HTTP: STRICT_CHECK(ch != '/'); - parser->state = s_req_first_http_major; + UPDATE_STATE(s_req_first_http_major); break; /* first digit of major HTTP version */ case s_req_first_http_major: - if (ch < '1' || ch > '9') { + if (UNLIKELY(ch < '1' || ch > '9')) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } parser->http_major = ch - '0'; - parser->state = s_req_http_major; + UPDATE_STATE(s_req_http_major); break; /* major HTTP version or dot */ case s_req_http_major: { if (ch == '.') { - parser->state = s_req_first_http_minor; + UPDATE_STATE(s_req_first_http_minor); break; } - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -1162,7 +1201,7 @@ size_t http_parser_execute (http_parser *parser, parser->http_major *= 10; parser->http_major += ch - '0'; - if (parser->http_major > 999) { + if (UNLIKELY(parser->http_major > 999)) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -1172,31 +1211,31 @@ size_t http_parser_execute (http_parser *parser, /* first digit of minor HTTP version */ case s_req_first_http_minor: - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } parser->http_minor = ch - '0'; - parser->state = s_req_http_minor; + UPDATE_STATE(s_req_http_minor); break; /* minor HTTP version or end of request line */ case s_req_http_minor: { if (ch == CR) { - parser->state = s_req_line_almost_done; + UPDATE_STATE(s_req_line_almost_done); break; } if (ch == LF) { - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); break; } /* XXX allow spaces after digit? */ - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -1204,7 +1243,7 @@ size_t http_parser_execute (http_parser *parser, parser->http_minor *= 10; parser->http_minor += ch - '0'; - if (parser->http_minor > 999) { + if (UNLIKELY(parser->http_minor > 999)) { SET_ERRNO(HPE_INVALID_VERSION); goto error; } @@ -1215,32 +1254,32 @@ size_t http_parser_execute (http_parser *parser, /* end of request line */ case s_req_line_almost_done: { - if (ch != LF) { + if (UNLIKELY(ch != LF)) { SET_ERRNO(HPE_LF_EXPECTED); goto error; } - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); break; } case s_header_field_start: { if (ch == CR) { - parser->state = s_headers_almost_done; + UPDATE_STATE(s_headers_almost_done); break; } if (ch == LF) { /* they might be just sending \n instead of \r\n so this would be * the second \n to denote the end of headers*/ - parser->state = s_headers_almost_done; - goto reexecute_byte; + UPDATE_STATE(s_headers_almost_done); + REEXECUTE(); } c = TOKEN(ch); - if (!c) { + if (UNLIKELY(!c)) { SET_ERRNO(HPE_INVALID_HEADER_TOKEN); goto error; } @@ -1248,7 +1287,7 @@ size_t http_parser_execute (http_parser *parser, MARK(header_field); parser->index = 0; - parser->state = s_header_field; + UPDATE_STATE(s_header_field); switch (c) { case 'c': @@ -1276,9 +1315,14 @@ size_t http_parser_execute (http_parser *parser, case s_header_field: { - c = TOKEN(ch); + const char* start = p; + for (; p != data + len; p++) { + ch = *p; + c = TOKEN(ch); + + if (!c) + break; - if (c) { switch (parser->header_state) { case h_general: break; @@ -1379,23 +1423,17 @@ size_t http_parser_execute (http_parser *parser, assert(0 && "Unknown header_state"); break; } - break; } - if (ch == ':') { - parser->state = s_header_value_discard_ws; - CALLBACK_DATA(header_field); - break; - } + COUNT_HEADER_SIZE(p - start); - if (ch == CR) { - parser->state = s_header_almost_done; - CALLBACK_DATA(header_field); + if (p == data + len) { + --p; break; } - if (ch == LF) { - parser->state = s_header_field_start; + if (ch == ':') { + UPDATE_STATE(s_header_value_discard_ws); CALLBACK_DATA(header_field); break; } @@ -1408,12 +1446,12 @@ size_t http_parser_execute (http_parser *parser, if (ch == ' ' || ch == '\t') break; if (ch == CR) { - parser->state = s_header_value_discard_ws_almost_done; + UPDATE_STATE(s_header_value_discard_ws_almost_done); break; } if (ch == LF) { - parser->state = s_header_value_discard_lws; + UPDATE_STATE(s_header_value_discard_lws); break; } @@ -1423,7 +1461,7 @@ size_t http_parser_execute (http_parser *parser, { MARK(header_value); - parser->state = s_header_value; + UPDATE_STATE(s_header_value); parser->index = 0; c = LOWER(ch); @@ -1444,7 +1482,7 @@ size_t http_parser_execute (http_parser *parser, break; case h_content_length: - if (!IS_NUM(ch)) { + if (UNLIKELY(!IS_NUM(ch))) { SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); goto error; } @@ -1459,11 +1497,17 @@ size_t http_parser_execute (http_parser *parser, /* looking for 'Connection: close' */ } else if (c == 'c') { parser->header_state = h_matching_connection_close; + } else if (c == 'u') { + parser->header_state = h_matching_connection_upgrade; } else { - parser->header_state = h_general; + parser->header_state = h_matching_connection_token; } break; + /* Multi-value `Connection` header */ + case h_matching_connection_token_start: + break; + default: parser->header_state = h_general; break; @@ -1473,98 +1517,185 @@ size_t http_parser_execute (http_parser *parser, case s_header_value: { + const char* start = p; + enum header_states h_state = (enum header_states) parser->header_state; + for (; p != data + len; p++) { + ch = *p; + if (ch == CR) { + UPDATE_STATE(s_header_almost_done); + parser->header_state = h_state; + CALLBACK_DATA(header_value); + break; + } - if (ch == CR) { - parser->state = s_header_almost_done; - CALLBACK_DATA(header_value); - break; - } + if (ch == LF) { + UPDATE_STATE(s_header_almost_done); + COUNT_HEADER_SIZE(p - start); + parser->header_state = h_state; + CALLBACK_DATA_NOADVANCE(header_value); + REEXECUTE(); + } - if (ch == LF) { - parser->state = s_header_almost_done; - CALLBACK_DATA_NOADVANCE(header_value); - goto reexecute_byte; - } + c = LOWER(ch); - c = LOWER(ch); + switch (h_state) { + case h_general: + { + const char* p_cr; + const char* p_lf; + size_t limit = data + len - p; + + limit = MIN(limit, HTTP_MAX_HEADER_SIZE); + + p_cr = (const char*) memchr(p, CR, limit); + p_lf = (const char*) memchr(p, LF, limit); + if (p_cr != NULL) { + if (p_lf != NULL && p_cr >= p_lf) + p = p_lf; + else + p = p_cr; + } else if (UNLIKELY(p_lf != NULL)) { + p = p_lf; + } else { + p = data + len; + } + --p; - switch (parser->header_state) { - case h_general: - break; + break; + } - case h_connection: - case h_transfer_encoding: - assert(0 && "Shouldn't get here."); - break; + case h_connection: + case h_transfer_encoding: + assert(0 && "Shouldn't get here."); + break; - case h_content_length: - { - uint64_t t; + case h_content_length: + { + uint64_t t; - if (ch == ' ') break; + if (ch == ' ') break; - if (!IS_NUM(ch)) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - goto error; - } + if (UNLIKELY(!IS_NUM(ch))) { + SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); + parser->header_state = h_state; + goto error; + } - t = parser->content_length; - t *= 10; - t += ch - '0'; + t = parser->content_length; + t *= 10; + t += ch - '0'; - /* Overflow? Test against a conservative limit for simplicity. */ - if ((ULLONG_MAX - 10) / 10 < parser->content_length) { - SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); - goto error; + /* Overflow? Test against a conservative limit for simplicity. */ + if (UNLIKELY((ULLONG_MAX - 10) / 10 < parser->content_length)) { + SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); + parser->header_state = h_state; + goto error; + } + + parser->content_length = t; + break; } - parser->content_length = t; - break; - } + /* Transfer-Encoding: chunked */ + case h_matching_transfer_encoding_chunked: + parser->index++; + if (parser->index > sizeof(CHUNKED)-1 + || c != CHUNKED[parser->index]) { + h_state = h_general; + } else if (parser->index == sizeof(CHUNKED)-2) { + h_state = h_transfer_encoding_chunked; + } + break; - /* Transfer-Encoding: chunked */ - case h_matching_transfer_encoding_chunked: - parser->index++; - if (parser->index > sizeof(CHUNKED)-1 - || c != CHUNKED[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(CHUNKED)-2) { - parser->header_state = h_transfer_encoding_chunked; - } - break; + case h_matching_connection_token_start: + /* looking for 'Connection: keep-alive' */ + if (c == 'k') { + h_state = h_matching_connection_keep_alive; + /* looking for 'Connection: close' */ + } else if (c == 'c') { + h_state = h_matching_connection_close; + } else if (c == 'u') { + h_state = h_matching_connection_upgrade; + } else if (STRICT_TOKEN(c)) { + h_state = h_matching_connection_token; + } else { + h_state = h_general; + } + break; - /* looking for 'Connection: keep-alive' */ - case h_matching_connection_keep_alive: - parser->index++; - if (parser->index > sizeof(KEEP_ALIVE)-1 - || c != KEEP_ALIVE[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(KEEP_ALIVE)-2) { - parser->header_state = h_connection_keep_alive; - } - break; + /* looking for 'Connection: keep-alive' */ + case h_matching_connection_keep_alive: + parser->index++; + if (parser->index > sizeof(KEEP_ALIVE)-1 + || c != KEEP_ALIVE[parser->index]) { + h_state = h_matching_connection_token; + } else if (parser->index == sizeof(KEEP_ALIVE)-2) { + h_state = h_connection_keep_alive; + } + break; - /* looking for 'Connection: close' */ - case h_matching_connection_close: - parser->index++; - if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) { - parser->header_state = h_general; - } else if (parser->index == sizeof(CLOSE)-2) { - parser->header_state = h_connection_close; - } - break; + /* looking for 'Connection: close' */ + case h_matching_connection_close: + parser->index++; + if (parser->index > sizeof(CLOSE)-1 || c != CLOSE[parser->index]) { + h_state = h_matching_connection_token; + } else if (parser->index == sizeof(CLOSE)-2) { + h_state = h_connection_close; + } + break; - case h_transfer_encoding_chunked: - case h_connection_keep_alive: - case h_connection_close: - if (ch != ' ') parser->header_state = h_general; - break; + /* looking for 'Connection: upgrade' */ + case h_matching_connection_upgrade: + parser->index++; + if (parser->index > sizeof(UPGRADE) - 1 || + c != UPGRADE[parser->index]) { + h_state = h_matching_connection_token; + } else if (parser->index == sizeof(UPGRADE)-2) { + h_state = h_connection_upgrade; + } + break; - default: - parser->state = s_header_value; - parser->header_state = h_general; - break; + case h_matching_connection_token: + if (ch == ',') { + h_state = h_matching_connection_token_start; + parser->index = 0; + } + break; + + case h_transfer_encoding_chunked: + if (ch != ' ') h_state = h_general; + break; + + case h_connection_keep_alive: + case h_connection_close: + case h_connection_upgrade: + if (ch == ',') { + if (h_state == h_connection_keep_alive) { + parser->flags |= F_CONNECTION_KEEP_ALIVE; + } else if (h_state == h_connection_close) { + parser->flags |= F_CONNECTION_CLOSE; + } else if (h_state == h_connection_upgrade) { + parser->flags |= F_CONNECTION_UPGRADE; + } + h_state = h_matching_connection_token_start; + parser->index = 0; + } else if (ch != ' ') { + h_state = h_matching_connection_token; + } + break; + + default: + UPDATE_STATE(s_header_value); + h_state = h_general; + break; + } } + parser->header_state = h_state; + + COUNT_HEADER_SIZE(p - start); + + if (p == data + len) + --p; break; } @@ -1572,15 +1703,15 @@ size_t http_parser_execute (http_parser *parser, { STRICT_CHECK(ch != LF); - parser->state = s_header_value_lws; + UPDATE_STATE(s_header_value_lws); break; } case s_header_value_lws: { if (ch == ' ' || ch == '\t') { - parser->state = s_header_value_start; - goto reexecute_byte; + UPDATE_STATE(s_header_value_start); + REEXECUTE(); } /* finished the header */ @@ -1594,32 +1725,52 @@ size_t http_parser_execute (http_parser *parser, case h_transfer_encoding_chunked: parser->flags |= F_CHUNKED; break; + case h_connection_upgrade: + parser->flags |= F_CONNECTION_UPGRADE; + break; default: break; } - parser->state = s_header_field_start; - goto reexecute_byte; + UPDATE_STATE(s_header_field_start); + REEXECUTE(); } case s_header_value_discard_ws_almost_done: { STRICT_CHECK(ch != LF); - parser->state = s_header_value_discard_lws; + UPDATE_STATE(s_header_value_discard_lws); break; } case s_header_value_discard_lws: { if (ch == ' ' || ch == '\t') { - parser->state = s_header_value_discard_ws; + UPDATE_STATE(s_header_value_discard_ws); break; } else { + switch (parser->header_state) { + case h_connection_keep_alive: + parser->flags |= F_CONNECTION_KEEP_ALIVE; + break; + case h_connection_close: + parser->flags |= F_CONNECTION_CLOSE; + break; + case h_connection_upgrade: + parser->flags |= F_CONNECTION_UPGRADE; + break; + case h_transfer_encoding_chunked: + parser->flags |= F_CHUNKED; + break; + default: + break; + } + /* header value was empty */ MARK(header_value); - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); CALLBACK_DATA_NOADVANCE(header_value); - goto reexecute_byte; + REEXECUTE(); } } @@ -1629,16 +1780,18 @@ size_t http_parser_execute (http_parser *parser, if (parser->flags & F_TRAILING) { /* End of a chunked request */ - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); break; } - parser->state = s_headers_done; + UPDATE_STATE(s_headers_done); /* Set this here so that on_headers_complete() callbacks can see it */ parser->upgrade = - (parser->flags & F_UPGRADE || parser->method == HTTP_CONNECT); + ((parser->flags & (F_UPGRADE | F_CONNECTION_UPGRADE)) == + (F_UPGRADE | F_CONNECTION_UPGRADE) || + parser->method == HTTP_CONNECT); /* Here we call the headers_complete callback. This is somewhat * different than other callbacks because if the user returns 1, we @@ -1660,15 +1813,15 @@ size_t http_parser_execute (http_parser *parser, default: SET_ERRNO(HPE_CB_headers_complete); - return p - data; /* Error */ + RETURN(p - data); /* Error */ } } if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { - return p - data; + RETURN(p - data); } - goto reexecute_byte; + REEXECUTE(); } case s_headers_done: @@ -1679,34 +1832,34 @@ size_t http_parser_execute (http_parser *parser, /* Exit, the rest of the connect is in a different protocol. */ if (parser->upgrade) { - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); - return (p - data) + 1; + RETURN((p - data) + 1); } if (parser->flags & F_SKIPBODY) { - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); } else if (parser->flags & F_CHUNKED) { /* chunked encoding - ignore Content-Length header */ - parser->state = s_chunk_size_start; + UPDATE_STATE(s_chunk_size_start); } else { if (parser->content_length == 0) { /* Content-Length header given but zero: Content-Length: 0\r\n */ - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); } else if (parser->content_length != ULLONG_MAX) { /* Content-Length header given and non-zero */ - parser->state = s_body_identity; + UPDATE_STATE(s_body_identity); } else { if (parser->type == HTTP_REQUEST || !http_message_needs_eof(parser)) { /* Assume content-length 0 - read the next */ - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); } else { /* Read body until EOF */ - parser->state = s_body_identity_eof; + UPDATE_STATE(s_body_identity_eof); } } } @@ -1732,7 +1885,7 @@ size_t http_parser_execute (http_parser *parser, p += to_read - 1; if (parser->content_length == 0) { - parser->state = s_message_done; + UPDATE_STATE(s_message_done); /* Mimic CALLBACK_DATA_NOADVANCE() but with one extra byte. * @@ -1744,7 +1897,7 @@ size_t http_parser_execute (http_parser *parser, * important for applications, but let's keep it for now. */ CALLBACK_DATA_(body, p - body_mark + 1, p - data); - goto reexecute_byte; + REEXECUTE(); } break; @@ -1758,7 +1911,7 @@ size_t http_parser_execute (http_parser *parser, break; case s_message_done: - parser->state = NEW_MESSAGE(); + UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); break; @@ -1768,13 +1921,13 @@ size_t http_parser_execute (http_parser *parser, assert(parser->flags & F_CHUNKED); unhex_val = unhex[(unsigned char)ch]; - if (unhex_val == -1) { + if (UNLIKELY(unhex_val == -1)) { SET_ERRNO(HPE_INVALID_CHUNK_SIZE); goto error; } parser->content_length = unhex_val; - parser->state = s_chunk_size; + UPDATE_STATE(s_chunk_size); break; } @@ -1785,7 +1938,7 @@ size_t http_parser_execute (http_parser *parser, assert(parser->flags & F_CHUNKED); if (ch == CR) { - parser->state = s_chunk_size_almost_done; + UPDATE_STATE(s_chunk_size_almost_done); break; } @@ -1793,7 +1946,7 @@ size_t http_parser_execute (http_parser *parser, if (unhex_val == -1) { if (ch == ';' || ch == ' ') { - parser->state = s_chunk_parameters; + UPDATE_STATE(s_chunk_parameters); break; } @@ -1806,7 +1959,7 @@ size_t http_parser_execute (http_parser *parser, t += unhex_val; /* Overflow? Test against a conservative limit for simplicity. */ - if ((ULLONG_MAX - 16) / 16 < parser->content_length) { + if (UNLIKELY((ULLONG_MAX - 16) / 16 < parser->content_length)) { SET_ERRNO(HPE_INVALID_CONTENT_LENGTH); goto error; } @@ -1820,7 +1973,7 @@ size_t http_parser_execute (http_parser *parser, assert(parser->flags & F_CHUNKED); /* just ignore this shit. TODO check for overflow */ if (ch == CR) { - parser->state = s_chunk_size_almost_done; + UPDATE_STATE(s_chunk_size_almost_done); break; } break; @@ -1835,9 +1988,9 @@ size_t http_parser_execute (http_parser *parser, if (parser->content_length == 0) { parser->flags |= F_TRAILING; - parser->state = s_header_field_start; + UPDATE_STATE(s_header_field_start); } else { - parser->state = s_chunk_data; + UPDATE_STATE(s_chunk_data); } break; } @@ -1859,7 +2012,7 @@ size_t http_parser_execute (http_parser *parser, p += to_read - 1; if (parser->content_length == 0) { - parser->state = s_chunk_data_almost_done; + UPDATE_STATE(s_chunk_data_almost_done); } break; @@ -1869,7 +2022,7 @@ size_t http_parser_execute (http_parser *parser, assert(parser->flags & F_CHUNKED); assert(parser->content_length == 0); STRICT_CHECK(ch != CR); - parser->state = s_chunk_data_done; + UPDATE_STATE(s_chunk_data_done); CALLBACK_DATA(body); break; @@ -1877,7 +2030,7 @@ size_t http_parser_execute (http_parser *parser, assert(parser->flags & F_CHUNKED); STRICT_CHECK(ch != LF); parser->nread = 0; - parser->state = s_chunk_size_start; + UPDATE_STATE(s_chunk_size_start); break; default: @@ -1909,14 +2062,14 @@ size_t http_parser_execute (http_parser *parser, CALLBACK_DATA_NOADVANCE(body); CALLBACK_DATA_NOADVANCE(status); - return len; + RETURN(len); error: if (HTTP_PARSER_ERRNO(parser) == HPE_OK) { SET_ERRNO(HPE_UNKNOWN); } - return (p - data); + RETURN(p - data); } @@ -2142,7 +2295,7 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect, u->port = u->field_set = 0; s = is_connect ? s_req_server_start : s_req_spaces_before_url; - uf = old_uf = UF_MAX; + old_uf = UF_MAX; for (p = buf; p < buf + buflen; p++) { s = parse_url_char(s, *p); diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index ec61a1287f37fc..640ffa0ac32e60 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -26,8 +26,8 @@ extern "C" { /* Also update SONAME in the Makefile whenever you change these. */ #define HTTP_PARSER_VERSION_MAJOR 2 -#define HTTP_PARSER_VERSION_MINOR 3 -#define HTTP_PARSER_VERSION_PATCH 0 +#define HTTP_PARSER_VERSION_MINOR 4 +#define HTTP_PARSER_VERSION_PATCH 1 #include #if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) @@ -52,9 +52,16 @@ typedef unsigned __int64 uint64_t; # define HTTP_PARSER_STRICT 1 #endif -/* Maximium header size allowed */ -#define HTTP_MAX_HEADER_SIZE (80*1024) - +/* Maximium header size allowed. If the macro is not defined + * before including this header then the default is used. To + * change the maximum header size, define the macro in the build + * environment (e.g. -DHTTP_MAX_HEADER_SIZE=). To remove + * the effective limit on the size of the header, define the macro + * to a very large number (e.g. -DHTTP_MAX_HEADER_SIZE=0x7fffffff) + */ +#ifndef HTTP_MAX_HEADER_SIZE +# define HTTP_MAX_HEADER_SIZE (80*1024) +#endif typedef struct http_parser http_parser; typedef struct http_parser_settings http_parser_settings; @@ -69,7 +76,7 @@ typedef struct http_parser_settings http_parser_settings; * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: * chunked' headers that indicate the presence of a body. * - * http_data_cb does not return data chunks. It will be call arbitrarally + * http_data_cb does not return data chunks. It will be called arbitrarily * many times for each string. E.G. you might get 10 callbacks for "on_url" * each providing just a few characters more data. */ @@ -110,6 +117,8 @@ typedef int (*http_cb) (http_parser*); /* RFC-5789 */ \ XX(24, PATCH, PATCH) \ XX(25, PURGE, PURGE) \ + /* CalDAV */ \ + XX(26, MKCALENDAR, MKCALENDAR) \ enum http_method { @@ -127,9 +136,10 @@ enum flags { F_CHUNKED = 1 << 0 , F_CONNECTION_KEEP_ALIVE = 1 << 1 , F_CONNECTION_CLOSE = 1 << 2 - , F_TRAILING = 1 << 3 - , F_UPGRADE = 1 << 4 - , F_SKIPBODY = 1 << 5 + , F_CONNECTION_UPGRADE = 1 << 3 + , F_TRAILING = 1 << 4 + , F_UPGRADE = 1 << 5 + , F_SKIPBODY = 1 << 6 }; @@ -271,13 +281,15 @@ struct http_parser_url { * unsigned major = (version >> 16) & 255; * unsigned minor = (version >> 8) & 255; * unsigned patch = version & 255; - * printf("http_parser v%u.%u.%u\n", major, minor, version); + * printf("http_parser v%u.%u.%u\n", major, minor, patch); */ unsigned long http_parser_version(void); void http_parser_init(http_parser *parser, enum http_parser_type type); +/* Executes the parser. Returns number of parsed bytes. Sets + * `parser->http_errno` on error. */ size_t http_parser_execute(http_parser *parser, const http_parser_settings *settings, const char *data, diff --git a/deps/http_parser/test.c b/deps/http_parser/test.c index 9799dc6d346dd7..6c45d59d0c494d 100644 --- a/deps/http_parser/test.c +++ b/deps/http_parser/test.c @@ -950,6 +950,42 @@ const struct message requests[] = ,.body= "" } +#define CONNECTION_MULTI 35 +, {.name = "multiple connection header values with folding" + ,.type= HTTP_REQUEST + ,.raw= "GET /demo HTTP/1.1\r\n" + "Host: example.com\r\n" + "Connection: Something,\r\n" + " Upgrade, ,Keep-Alive\r\n" + "Sec-WebSocket-Key2: 12998 5 Y3 1 .P00\r\n" + "Sec-WebSocket-Protocol: sample\r\n" + "Upgrade: WebSocket\r\n" + "Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5\r\n" + "Origin: http://example.com\r\n" + "\r\n" + "Hot diggity dogg" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_GET + ,.query_string= "" + ,.fragment= "" + ,.request_path= "/demo" + ,.request_url= "/demo" + ,.num_headers= 7 + ,.upgrade="Hot diggity dogg" + ,.headers= { { "Host", "example.com" } + , { "Connection", "Something, Upgrade, ,Keep-Alive" } + , { "Sec-WebSocket-Key2", "12998 5 Y3 1 .P00" } + , { "Sec-WebSocket-Protocol", "sample" } + , { "Upgrade", "WebSocket" } + , { "Sec-WebSocket-Key1", "4 @1 46546xW%0l 1 5" } + , { "Origin", "http://example.com" } + } + ,.body= "" + } + , {.name= NULL } /* sentinel */ }; @@ -2207,7 +2243,6 @@ print_error (const char *raw, size_t error_location) break; case '\n': - char_len = 2; fprintf(stderr, "\\n\n"); if (this_line) goto print; @@ -2910,15 +2945,11 @@ test_simple (const char *buf, enum http_errno err_expected) { parser_init(HTTP_REQUEST); - size_t parsed; - int pass; enum http_errno err; - parsed = parse(buf, strlen(buf)); - pass = (parsed == strlen(buf)); + parse(buf, strlen(buf)); err = HTTP_PARSER_ERRNO(parser); - parsed = parse(NULL, 0); - pass &= (parsed == 0); + parse(NULL, 0); parser_free(); @@ -3476,6 +3507,13 @@ main (void) test_simple(buf, HPE_INVALID_METHOD); } + // illegal header field name line folding + test_simple("GET / HTTP/1.1\r\n" + "name\r\n" + " : value\r\n" + "\r\n", + HPE_INVALID_HEADER_TOKEN); + const char *dumbfuck2 = "GET / HTTP/1.1\r\n" "X-SSL-Bullshit: -----BEGIN CERTIFICATE-----\r\n" diff --git a/deps/npm/.eslintrc b/deps/npm/.eslintrc index ba3315042102ff..b54e30fd2aa2a9 100644 --- a/deps/npm/.eslintrc +++ b/deps/npm/.eslintrc @@ -12,6 +12,8 @@ "no-lonely-if": 1, "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}], "no-mixed-requires": 0, - "space-infix-ops": 0 + "space-infix-ops": 0, + "key-spacing": 0, + "no-multi-spaces": 0 } } diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index 2734148642ff6d..c540f6559e311b 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -8,4 +8,4 @@ before_install: - "npm config set spin false" - "npm install -g npm@^2" - "sudo mkdir -p /var/run/couchdb" -script: "npm run-script tap" +script: "npm run-script test-all" diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index e67cd290927ece..a6576de6fd6a5f 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,367 @@ +### v2.2.0 (2015-01-08): + +* [`88c531d`](https://github.com/npm/npm/commit/88c531d1c0b3aced8f2a09632db01b5635e7226a) + [#7056](https://github.com/npm/npm/issues/7056) version doesn't need a + package.json. ([@othiym23](https://github.com/othiym23)) +* [`2656c19`](https://github.com/npm/npm/commit/2656c19f6b915c3173acc3b6f184cc321563da5f) + [#7095](https://github.com/npm/npm/issues/7095) Link to npm website instead + of registry. ([@konklone](https://github.com/konklone)) +* [`c76b801`](https://github.com/npm/npm/commit/c76b8013bf1758587565822626171b76cb465c9e) + [#7067](https://github.com/npm/npm/issues/7067) Obfuscate secrets, including + nerfed URLs. ([@smikes](https://github.com/smikes)) +* [`17f66ce`](https://github.com/npm/npm/commit/17f66ceb1bd421084e4ae82a6b66634a6e272929) + [#6849](https://github.com/npm/npm/issues/6849) Explain the tag workflow more + clearly. ([@smikes](https://github.com/smikes)) +* [`e309df6`](https://github.com/npm/npm/commit/e309df642de33d10d6dffadaa8a5d214a924d0dc) + [#7096](https://github.com/npm/npm/issues/7096) Really, `npm update -g` is + almost always a terrible idea. ([@smikes](https://github.com/smikes)) +* [`acf287d`](https://github.com/npm/npm/commit/acf287d2547c8a0a8871652c164019261b666d55) + [#6999](https://github.com/npm/npm/issues/6999) `npm run-script env`: add a + new default script that will print out environment values. + ([@gcb](https://github.com/gcb)) +* [`560c009`](https://github.com/npm/npm/commit/560c00945d4dec926cd29193e336f137c7f3f951) + [#6745](https://github.com/npm/npm/issues/6745) Document `npm update --dev`. + ([@smikes](https://github.com/smikes)) +* [`226a677`](https://github.com/npm/npm/commit/226a6776a1a9e28570485623b8adc2ec4b041335) + [#7046](https://github.com/npm/npm/issues/7046) We have never been the Node + package manager. ([@linclark](https://github.com/linclark)) +* [`38eef22`](https://github.com/npm/npm/commit/38eef2248f03bb8ab04cae1833e2a228fb887f3c) + `npm-install-checks@1.0.5`: Compatibility with npmlog@^1. + ([@iarna](https://github.com/iarna)) + +### v2.1.18 (2015-01-01): + +* [`bf8640b`](https://github.com/npm/npm/commit/bf8640b0395b5dff71260a0cede7efc699a7bcf5) + [#7044](https://github.com/npm/npm/issues/7044) Document `.npmignore` syntax. + ([@zeke](https://github.com/zeke)) + +### v2.1.17 (2014-12-25): + +merry npm xmas + +Working with [@phated](https://github.com/phated), I discovered that npm still +had some lingering race conditions around how it handles Git dependencies. The +following changes were intended to remedy to these issues. Thanks to +[@phated](https://github.com/phated) for all his help getting to the bottom of +these. + +* [`bdf1c84`](https://github.com/npm/npm/commit/bdf1c8483f5c4ad79b712db12d73276e15883923) + [#7006](https://github.com/npm/npm/issues/7006) Only `chown` template and + top-level Git cache directories. ([@othiym23](https://github.com/othiym23)) +* [`581a72d`](https://github.com/npm/npm/commit/581a72da18f35ec87edef6255adf4ef4714a478c) + [#7006](https://github.com/npm/npm/issues/7006) Map Git remote inflighting to + clone paths rather than Git URLs. ([@othiym23](https://github.com/othiym23)) +* [`1c48d08`](https://github.com/npm/npm/commit/1c48d08dea31a11ac11a285cac598a482481cade) + [#7009](https://github.com/npm/npm/issues/7009) `normalize-git-url@1.0.0`: + Normalize Git URLs while caching. ([@othiym23](https://github.com/othiym23)) +* [`5423cf0`](https://github.com/npm/npm/commit/5423cf0be8ff2b76bfff7c8e780e5f261235a86a) + [#7009](https://github.com/npm/npm/issues/7009) Pack tarballs to their final + locations atomically. ([@othiym23](https://github.com/othiym23)) +* [`7f6557f`](https://github.com/npm/npm/commit/7f6557ff317469ee4a87c542ff9a991e74ce9f38) + [#7009](https://github.com/npm/npm/issues/7009) Inflight local directory + packing, just to be safe. ([@othiym23](https://github.com/othiym23)) + +Other changes: + +* [`1c491e6`](https://github.com/npm/npm/commit/1c491e65d70af013e8d5ac008d6d9762d6d91793) + [#6991](https://github.com/npm/npm/issues/6991) `npm version`: fix regression + in dirty-checking behavior ([@rlidwka](https://github.com/rlidwka)) +* [`55ceb2b`](https://github.com/npm/npm/commit/55ceb2b08ff8a0f56b94cc972ca15d7862e8733c) + [#1991](https://github.com/npm/npm/issues/1991) modify docs to reflect actual + `npm restart` behavior ([@smikes](https://github.com/smikes)) +* [`fb8e31b`](https://github.com/npm/npm/commit/fb8e31b95476a50bda35a665a99eec8a5d25a4db) + [#6982](https://github.com/npm/npm/issues/6982) when doing registry + operations, ensure registry URL always ends with `/` + ([@othiym23](https://github.com/othiym23)) +* [`5bcba65`](https://github.com/npm/npm/commit/5bcba65bed2678ffe80fb596f72abe9871d131c8) + pull whitelisted Git environment variables out into a named constant + ([@othiym23](https://github.com/othiym23)) +* [`be04bbd`](https://github.com/npm/npm/commit/be04bbdc52ebfc820cd939df2f7d79fe87067747) + [#7000](https://github.com/npm/npm/issues/7000) No longer install badly-named + manpage files, and log an error when trying to uninstall them. + ([@othiym23](https://github.com/othiym23)) +* [`6b7c5ec`](https://github.com/npm/npm/commit/6b7c5eca6b65e1247d0e51f6400cf2637ac880ce) + [#7011](https://github.com/npm/npm/issues/7011) Send auth for tarball fetches + for packages in `npm-shrinkwrap.json` from private registries. + ([@othiym23](https://github.com/othiym23)) +* [`9b9de06`](https://github.com/npm/npm/commit/9b9de06a99893b40aa23f0335726dec6df7979db) + `glob@4.3.2`: Better handling of trailing slashes. + ([@isaacs](https://github.com/isaacs)) +* [`030f3c7`](https://github.com/npm/npm/commit/030f3c7450b8ce124a19073bfbae0948a0a1a02c) + `semver@4.2.0`: Diffing between version strings. + ([@isaacs](https://github.com/isaacs)) + +### v2.1.16 (2014-12-22): + +* [`a4e4e33`](https://github.com/npm/npm/commit/a4e4e33edb35c68813f04bf42bdf933a6f727bcd) + [#6987](https://github.com/npm/npm/issues/6987) `read-installed@3.1.5`: fixed + a regression where a new / empty package would cause read-installed to throw. + ([@othiym23](https://github.com/othiym23) / + [@pgilad](https://github.com/pgilad)) + +### v2.1.15 (2014-12-18): + +* [`e5a2dee`](https://github.com/npm/npm/commit/e5a2dee47c74f26c56fee5998545b97497e830c8) + [#6951](https://github.com/npm/npm/issues/6951) `fs-vacuum@1.2.5`: Use + `path-is-inside` for better Windows normalization. + ([@othiym23](https://github.com/othiym23)) +* [`ac6167c`](https://github.com/npm/npm/commit/ac6167c2b9432939c57296f7ddd11ad5f8f918b2) + [#6955](https://github.com/npm/npm/issues/6955) Call `path.normalize` in + `lib/utils/gently-rm.js` for better Windows normalization. + ([@ben-page](https://github.com/ben-page)) +* [`c625d71`](https://github.com/npm/npm/commit/c625d714795e3b5badd847945e2401adfad5a196) + [#6964](https://github.com/npm/npm/issues/6964) Clarify CA configuration + docs. ([@jeffjo](https://github.com/jeffjo)) +* [`58b8cb5`](https://github.com/npm/npm/commit/58b8cb5cdf26a854358b7c2ab636572dba9bac16) + [#6950](https://github.com/npm/npm/issues/6950) Fix documentation typos. + ([@martinvd](https://github.com/martinvd)) +* [`7c1299d`](https://github.com/npm/npm/commit/7c1299d00538ea998684a1903a4091eafc63b7f1) + [#6909](https://github.com/npm/npm/issues/6909) Remove confusing mention of + rubygems `~>` semver operator. ([@mjtko](https://github.com/mjtko)) +* [`7dfdcc6`](https://github.com/npm/npm/commit/7dfdcc6debd8ef1fc52a2b508997d15887aad824) + [#6909](https://github.com/npm/npm/issues/6909) `semver@4.1.1`: Synchronize + documentation with PR [#6909](https://github.com/npm/npm/issues/6909) + ([@othiym23](https://github.com/othiym23)) +* [`adfddf3`](https://github.com/npm/npm/commit/adfddf3b682e0ae08e4b59d87c1b380dd651c572) + [#6925](https://github.com/npm/npm/issues/6925) Correct typo in + `doc/api/npm-ls.md` ([@oddurs](https://github.com/oddurs)) +* [`f5c534b`](https://github.com/npm/npm/commit/f5c534b711ab173129baf366c4f08d68f6117333) + [#6920](https://github.com/npm/npm/issues/6920) Remove recommendation to run + as root from `README.md`. + ([@robertkowalski](https://github.com/robertkowalski)) +* [`3ef4459`](https://github.com/npm/npm/commit/3ef445922cd39f25b992d91bd22c4d367882ea22) + [#6920](https://github.com/npm/npm/issues/6920) `npm-@googlegroups.com` has + gone the way of all things. That means it's gone. + ([@robertkowalski](https://github.com/robertkowalski)) + +### v2.1.14 (2014-12-13): + +* [`cf7aeae`](https://github.com/npm/npm/commit/cf7aeae3c3a24e48d3de4006fa082f0c6040922a) + [#6923](https://github.com/npm/npm/issues/6923) Overaggressive link update + for new website broke node-gyp. ([@othiym23](https://github.com/othiym23)) + +### v2.1.13 (2014-12-11): + +* [`cbb890e`](https://github.com/npm/npm/commit/cbb890eeacc0501ba1b8c6955f1c829c8af9f486) + [#6897](https://github.com/npm/npm/issues/6897) npm is a nice package manager + that runs server-side JavaScript. ([@othiym23](https://github.com/othiym23)) +* [`d9043c3`](https://github.com/npm/npm/commit/d9043c3b8d7450c3cb9ca795028c0e1c05377820) + [#6893](https://github.com/npm/npm/issues/6893) Remove erroneous docs about + preupdate / update / postupdate lifecycle scripts, which have never existed. + ([@devTristan](https://github.com/devTristan)) +* [`c5df4d0`](https://github.com/npm/npm/commit/c5df4d0d683cd3506808d1cd1acebff02a8b82db) + [#6884](https://github.com/npm/npm/issues/6884) Update npmjs.org to npmjs.com + in docs. ([@linclark](https://github.com/linclark)) +* [`cb6ff8d`](https://github.com/npm/npm/commit/cb6ff8dace1b439851701d4784d2d719c22ca7a7) + [#6879](https://github.com/npm/npm/issues/6879) npm version: Update + shrinkwrap post-check. ([@othiym23](https://github.com/othiym23)) +* [`2a340bd`](https://github.com/npm/npm/commit/2a340bdd548c6449468281e1444a032812bff677) + [#6868](https://github.com/npm/npm/issues/6868) Use magic numbers instead of + regexps to distinguish tarballs from other things. + ([@daxxog](https://github.com/daxxog)) +* [`f1c8bdb`](https://github.com/npm/npm/commit/f1c8bdb3f6b753d0600597e12346bdc3a34cb9c1) + [#6861](https://github.com/npm/npm/issues/6861) `npm-registry-client@4.0.5`: + Distinguish between error properties that are part of the response and error + strings that should be returned to the user. + ([@disrvptor](https://github.com/disrvptor)) +* [`d3a1b63`](https://github.com/npm/npm/commit/d3a1b6397fddef04b5198ca89d36d720aeb05eb6) + [#6762](https://github.com/npm/npm/issues/6762) Make `npm outdated` ignore + private packages. ([@KenanY](https://github.com/KenanY)) +* [`16d8542`](https://github.com/npm/npm/commit/16d854283ca5bcdb0cb2812fc5745d841652b952) + install.sh: Drop support for node < 0.8, remove engines bits. + ([@isaacs](https://github.com/isaacs)) +* [`b9c6046`](https://github.com/npm/npm/commit/b9c60466d5b713b1dc2947da14a5dfe42352e029) + `init-package-json@1.1.3`: ([@terinstock](https://github.com/terinstock)) + noticed that `init.license` configuration doesn't stick. Make sure that + dashed defaults don't trump dotted parameters. + ([@othiym23](https://github.com/othiym23)) +* [`b6d6acf`](https://github.com/npm/npm/commit/b6d6acfc02c8887f78067931babab8f7c5180fed) + `which@1.0.8`: No longer use graceful-fs for some reason. + ([@isaacs](https://github.com/isaacs)) +* [`d39f673`](https://github.com/npm/npm/commit/d39f673caf08a90fb2bb001d79c98062d2cd05f4) + `request@2.51.0`: Incorporate bug fixes. ([@nylen](https://github.com/nylen)) +* [`c7ad727`](https://github.com/npm/npm/commit/c7ad7279cc879930ec58ccc62fa642e621ecb65c) + `columnify@1.3.2`: Incorporate bug fixes. + ([@timoxley](https://github.com/timoxley)) + +### v2.1.12 (2014-12-04): + +* [`e5b1e44`](https://github.com/npm/npm/commit/e5b1e448bb4a9d6eae4ba0f67b1d3c2cea8ed383) + add alias verison=version ([@isaacs](https://github.com/isaacs)) +* [`5eed7bd`](https://github.com/npm/npm/commit/5eed7bddbd7bb92a44c4193c93e8529500c558e6) + `request@2.49.0` ([@nylen](https://github.com/nylen)) +* [`e72f81d`](https://github.com/npm/npm/commit/e72f81d8412540ae7d1e0edcc37c11bcb8169051) + `glob@4.3.1` / `minimatch@2.0.1` ([@isaacs](https://github.com/isaacs)) +* [`b8dcc36`](https://github.com/npm/npm/commit/b8dcc3637b5b71933b97162b7aff1b1a622c13e2) + `graceful-fs@3.0.5` ([@isaacs](https://github.com/isaacs)) + +### v2.1.11 (2014-11-27): + +* [`4861d28`](https://github.com/npm/npm/commit/4861d28ad0ebd959fe6bc15b9c9a50fcabe57f55) + `which@1.0.7`: License update. ([@isaacs](https://github.com/isaacs)) +* [`30a2ea8`](https://github.com/npm/npm/commit/30a2ea80c891d384b31a1cf28665bba4271915bd) + `ini@1.3.2`: License update. ([@isaacs](https://github.com/isaacs)) +* [`6a4ea05`](https://github.com/npm/npm/commit/6a4ea054f6ddf52fc58842ba2046564b04c5c0e2) + `fstream@1.0.3`: Propagate error events to downstream streams. + ([@gfxmonk](https://github.com/gfxmonk)) +* [`a558695`](https://github.com/npm/npm/commit/a5586954f1c18df7c96137e0a79f41a69e7a884e) + `tar@1.0.3`: Don't extract broken files, propagate `drain` event. + ([@gfxmonk](https://github.com/gfxmonk)) +* [`989624e`](https://github.com/npm/npm/commit/989624e8321f87734c1b1272fc2f646e7af1f81c) + [#6767](https://github.com/npm/npm/issues/6767) Actually pass parameters when + adding git repo to cach under Windows. + ([@othiym23](https://github.com/othiym23)) +* [`657af73`](https://github.com/npm/npm/commit/657af7308f7d6cd2f81389fcf0d762252acaf1ce) + [#6774](https://github.com/npm/npm/issues/6774) When verifying paths on + unbuild, resolve both source and target as symlinks. + ([@hokaccha](https://github.com/hokaccha)) +* [`fd19c40`](https://github.com/npm/npm/commit/fd19c4046414494f9647a6991c00f8406a939929) + [#6713](https://github.com/npm/npm/issues/6713) + `realize-package-specifier@1.3.0`: Make it so that `npm install foo@1` work + when a file named `1` exists. ([@iarna](https://github.com/iarna)) +* [`c8ac37a`](https://github.com/npm/npm/commit/c8ac37a470491b2ed28514536e2e198494638c79) + `npm-registry-client@4.0.4`: Fix regression in failed fetch retries. + ([@othiym23](https://github.com/othiym23)) + +### v2.1.10 (2014-11-20): + +* [`756f3d4`](https://github.com/npm/npm/commit/756f3d40fe18bc02bc93afe17016dfcc266c4b6b) + [#6735](https://github.com/npm/npm/issues/6735) Log "already built" messages + at info, not error. ([@smikes](https://github.com/smikes)) +* [`1b7330d`](https://github.com/npm/npm/commit/1b7330dafba3bbba171f74f1e58b261cb1b9301e) + [#6729](https://github.com/npm/npm/issues/6729) `npm-registry-client@4.0.3`: + GitHub won't redirect you through an HTML page to a compressed tarball if you + don't tell it you accept JSON responses. + ([@KenanY](https://github.com/KenanY)) +* [`d9c7857`](https://github.com/npm/npm/commit/d9c7857be02dacd274e55bf6d430d90d91509d53) + [#6506](https://github.com/npm/npm/issues/6506) + `readdir-scoped-modules@1.0.1`: Use `graceful-fs` so the whole dependency + tree gets read, even in case of `EMFILE`. + ([@sakana](https://github.com/sakana)) +* [`3a085be`](https://github.com/npm/npm/commit/3a085be158ace8f1e4395e69f8c102d3dea00c5f) + Grammar fix in docs. ([@icylace](https://github.com/icylace)) +* [`3f8e2ff`](https://github.com/npm/npm/commit/3f8e2ff8342d327d6f1375437ecf4bd945dc360f) + Did you know that npm has a Code of Conduct? Add a link to it to + CONTRIBUTING.md. ([@isaacs](https://github.com/isaacs)) +* [`319ccf6`](https://github.com/npm/npm/commit/319ccf633289e06e57a80d74c39706899348674c) + `glob@4.2.1`: Performance tuning. ([@isaacs](https://github.com/isaacs)) +* [`835f046`](https://github.com/npm/npm/commit/835f046e7568c33e81a0b48c84cff965024d8b8a) + `readable-stream@1.0.33`: Bug fixes. ([@rvagg](https://github.com/rvagg)) +* [`a34c38d`](https://github.com/npm/npm/commit/a34c38d0732fb246d11f2a776d2ad0d8db654338) + `request@2.48.0`: Bug fixes. ([@nylen](https://github.com/nylen)) + +### v2.1.9 (2014-11-13): + +* [`eed9f61`](https://github.com/npm/npm/commit/eed9f6101963364acffc59d7194fc1655180e80c) + [#6542](https://github.com/npm/npm/issues/6542) `npm owner add / remove` now + works properly with scoped packages + ([@othiym23](https://github.com/othiym23)) +* [`cd25973`](https://github.com/npm/npm/commit/cd25973825aa5315b7ebf26227bd32bd6be5533f) + [#6548](https://github.com/npm/npm/issues/6548) using sudo won't leave the + cache's git directories with bad permissions + ([@othiym23](https://github.com/othiym23)) +* [`56930ab`](https://github.com/npm/npm/commit/56930abcae6a6ea41f1b75e23765c61259cef2dd) + fixed irregular `npm cache ls` output (yes, that's a thing) + ([@othiym23](https://github.com/othiym23)) +* [`740f483`](https://github.com/npm/npm/commit/740f483db6ec872b453065842da080a646c3600a) + legacy tests no longer poison user's own cache + ([@othiym23](https://github.com/othiym23)) +* [`ce37f14`](https://github.com/npm/npm/commit/ce37f142a487023747a9086335618638ebca4372) + [#6169](https://github.com/npm/npm/issues/6169) add terse output similar to + `npm publish / unpublish` for `npm owner add / remove` + ([@KenanY](https://github.com/KenanY)) +* [`bf2b8a6`](https://github.com/npm/npm/commit/bf2b8a66d7188900bf1e957c052b893948b67e0e) + [#6680](https://github.com/npm/npm/issues/6680) pass auth credentials to + registry when downloading search index + ([@terinjokes](https://github.com/terinjokes)) +* [`00ecb61`](https://github.com/npm/npm/commit/00ecb6101422984696929f602e14da186f9f669c) + [#6400](https://github.com/npm/npm/issues/6400) `.npmignore` is respected for + git repos on cache / pack / publish + ([@othiym23](https://github.com/othiym23)) +* [`d1b3a9e`](https://github.com/npm/npm/commit/d1b3a9ec5e2b6d52765ba5da5afb08dba41c49c1) + [#6311](https://github.com/npm/npm/issues/6311) `npm ls -l --depth=0` no + longer prints phantom duplicate children + ([@othiym23](https://github.com/othiym23)) +* [`07c5f34`](https://github.com/npm/npm/commit/07c5f34e45c9b18c348ed53b5763b1c5d4325740) + [#6690](https://github.com/npm/npm/issues/6690) `uid-number@0.0.6`: clarify + confusing names in error-handling code ([@isaacs](https://github.com/isaacs)) +* [`1ac9be9`](https://github.com/npm/npm/commit/1ac9be9f3bab816211d72d13cb05b5587878a586) + [#6684](https://github.com/npm/npm/issues/6684) `npm init`: don't report + write if canceled ([@smikes](https://github.com/smikes)) +* [`7bb207d`](https://github.com/npm/npm/commit/7bb207d1d6592a9cffc986871e4b671575363c2f) + [#5754](https://github.com/npm/npm/issues/5754) never remove app directories + on failed install ([@othiym23](https://github.com/othiym23)) +* [`705ce60`](https://github.com/npm/npm/commit/705ce601e7b9c5428353e02ebb30cb76c1991fdd) + [#5754](https://github.com/npm/npm/issues/5754) `fs-vacuum@1.2.2`: don't + throw when another fs task writes to a directory being vacuumed + ([@othiym23](https://github.com/othiym23)) +* [`1b650f4`](https://github.com/npm/npm/commit/1b650f4f217c413a2ffb96e1701beb5aa67a0de2) + [#6255](https://github.com/npm/npm/issues/6255) ensure that order credentials + are used from `.npmrc` doesn't regress + ([@othiym23](https://github.com/othiym23)) +* [`9bb2c34`](https://github.com/npm/npm/commit/9bb2c3435cedef40b45d3e9bd7a8edfb8cbe7209) + [#6644](https://github.com/npm/npm/issues/6644) `warn` rather than `info` on + fetch failure ([@othiym23](https://github.com/othiym23)) +* [`e34a7b6`](https://github.com/npm/npm/commit/e34a7b6b7371b1893a062f627ae8e168546d7264) + [#6524](https://github.com/npm/npm/issues/6524) `npm-registry-client@4.0.2`: + proxy via `request` more transparently + ([@othiym23](https://github.com/othiym23)) +* [`40afd6a`](https://github.com/npm/npm/commit/40afd6aaf34c11a10e80ec87b115fb2bb907e3bd) + [#6524](https://github.com/npm/npm/issues/6524) push proxy settings into + `request` ([@tauren](https://github.com/tauren)) + +### v2.1.8 (2014-11-06): + +* [`063d843`](https://github.com/npm/npm/commit/063d843965f9f0bfa5732d7c2d6f5aa37a8260a2) + npm version now updates version in npm-shrinkwrap.json + ([@faiq](https://github.com/faiq)) +* [`3f53cd7`](https://github.com/npm/npm/commit/3f53cd795f8a600e904a97f215ba5b5a9989d9dd) + [#6559](https://github.com/npm/npm/issues/6559) save local dependencies in + npm-shrinkwrap.json ([@Torsph](https://github.com/Torsph)) +* [`e249262`](https://github.com/npm/npm/commit/e24926268b2d2220910bc81cce6d3b2e08d94eb1) + npm-faq.md: mention scoped pkgs in namespace Q + ([@smikes](https://github.com/smikes)) +* [`6b06ec4`](https://github.com/npm/npm/commit/6b06ec4ef5da490bdca1512fa7f12490245c192b) + [#6642](https://github.com/npm/npm/issues/6642) `init-package-json@1.1.2`: + Handle both `init-author-name` and `init.author.name`. + ([@othiym23](https://github.com/othiym23)) +* [`9cb334c`](https://github.com/npm/npm/commit/9cb334c8a895a55461aac18791babae779309a0e) + [#6409](https://github.com/npm/npm/issues/6409) document commit-ish with + GitHub URLs ([@smikes](https://github.com/smikes)) +* [`0aefae9`](https://github.com/npm/npm/commit/0aefae9bc2598a4b7a3ee7bb2306b42e3e12bb28) + [#2959](https://github.com/npm/npm/issues/2959) npm run no longer fails + silently ([@flipside](https://github.com/flipside)) +* [`e007a2c`](https://github.com/npm/npm/commit/e007a2c1e4fac1759fa61ac6e78c6b83b2417d11) + [#3908](https://github.com/npm/npm/issues/3908) include command in spawn + errors ([@smikes](https://github.com/smikes)) + +### v2.1.7 (2014-10-30): + +* [`6750b05`](https://github.com/npm/npm/commit/6750b05dcba20d8990a672957ec56c48f97e241a) + [#6398](https://github.com/npm/npm/issues/6398) `npm-registry-client@4.0.0`: + consistent API, handle relative registry paths, use auth more consistently + ([@othiym23](https://github.com/othiym23)) +* [`7719cfd`](https://github.com/npm/npm/commit/7719cfdd8b204dfeccc41289707ea58b4d608905) + [#6560](https://github.com/npm/npm/issues/6560) use new npm-registry-client + API ([@othiym23](https://github.com/othiym23)) +* [`ed61971`](https://github.com/npm/npm/commit/ed619714c93718b6c1922b8c286f4b6cd2b97c80) + move caching of search metadata from `npm-registry-client` to npm itself + ([@othiym23](https://github.com/othiym23)) +* [`3457041`](https://github.com/npm/npm/commit/34570414cd528debeb22943873440594d7f47abf) + handle caching of metadata independently from `npm-registry-client` + ([@othiym23](https://github.com/othiym23)) +* [`20a331c`](https://github.com/npm/npm/commit/20a331ced6a52faac6ec242e3ffdf28bcd447c40) + [#6538](https://github.com/npm/npm/issues/6538) map registry URLs to + credentials more safely ([@indexzero](https://github.com/indexzero)) +* [`4072e97`](https://github.com/npm/npm/commit/4072e97856bf1e7affb38333d080c172767eea27) + [#6589](https://github.com/npm/npm/issues/6589) `npm-registry-client@4.0.1`: + allow publishing of packages with names identical to built-in Node modules + ([@feross](https://github.com/feross)) +* [`254f0e4`](https://github.com/npm/npm/commit/254f0e4adaf2c56e9df25c7343c43b0b0804a3b5) + `tar@1.0.2`: better error-handling ([@runk](https://github.com/runk)) +* [`73ee2aa`](https://github.com/npm/npm/commit/73ee2aa4f1a47e43fe7cf4317a5446875f7521fa) + `request@2.47.0` ([@mikeal](https://github.com/mikeal)) + ### v2.1.6 (2014-10-23): * [`681b398`](https://github.com/npm/npm/commit/681b3987a18e7aba0aaf78c91a23c7cc0ab82ce8) diff --git a/deps/npm/CONTRIBUTING.md b/deps/npm/CONTRIBUTING.md index 0a5b53a125ca84..73049a495e1f7a 100644 --- a/deps/npm/CONTRIBUTING.md +++ b/deps/npm/CONTRIBUTING.md @@ -7,3 +7,6 @@ issues](https://github.com/npm/npm/search?q=Similar%20issues&type=Issues). * Ensure your new issue conforms to the [Contributing Guidelines](https://github.com/npm/npm/wiki/Contributing-Guidelines). + +Participation in this open source project is subject to the [npm Code +of Conduct](http://www.npmjs.com/policies/conduct). diff --git a/deps/npm/README.md b/deps/npm/README.md index ecb3f29e291bc9..0a4301e3b4f6c7 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -1,4 +1,4 @@ -npm(1) -- node package manager +npm(1) -- a JavaScript package manager ============================== [![Build Status](https://img.shields.io/travis/npm/npm/master.svg)](https://travis-ci.org/npm/npm) ## SYNOPSIS @@ -36,11 +36,11 @@ paths, etc.) then read on. ## Fancy Install (Unix) There's a pretty robust install script at -. You can download that and run it. +. You can download that and run it. Here's an example using curl: - curl -L https://npmjs.org/install.sh | sh + curl -L https://npmjs.com/install.sh | sh ### Slightly Fancier @@ -62,11 +62,16 @@ arbitrary config keys using the `./configure --key=val ...`, and then run npm commands by doing `node cli.js `. (This is helpful for testing, or running stuff without actually installing npm itself.) -## Fancy Windows Install +## Windows Install or Upgrade -You can download a zip file from , and unpack it +You can download a zip file from , and unpack it in the same folder where node.exe lives. +The latest version in a zip file is 1.4.12. To upgrade to npm 2, follow the +Windows upgrade instructions in the npm Troubleshooting Guide: + + + If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly. @@ -74,31 +79,6 @@ git, and mess with it directly. No. -## Permissions when Using npm to Install Other Stuff - -**tl;dr** - -* Use `sudo` for greater safety. Or don't, if you prefer not to. -* npm will downgrade permissions if it's root before running any build - scripts that package authors specified. - -### More details... - -As of version 0.3, it is recommended to run npm as root. -This allows npm to change the user identifier to the `nobody` user prior -to running any package build or test commands. - -If you are not the root user, or if you are on a platform that does not -support uid switching, then npm will not attempt to change the userid. - -If you would like to ensure that npm **always** runs scripts as the -"nobody" user, and have it fail if it cannot downgrade permissions, then -set the following configuration param: - - npm config set unsafe-perm false - -This will prevent running in unsafe mode, even as non-root users. - ## Uninstalling So sad to see you go. @@ -173,13 +153,13 @@ help config` to learn about all the options you can set there. ## More Docs -Check out the [docs](https://www.npmjs.org/doc/), -especially the [faq](https://www.npmjs.org/doc/faq.html). +Check out the [docs](https://docs.npmjs.com/), +especially the [faq](https://docs.npmjs.com/misc/faq). You can use the `npm help` command to read any of them. If you're a developer, and you want to use npm to publish your program, -you should [read this](https://www.npmjs.org/doc/developers.html) +you should [read this](https://docs.npmjs.com/misc/developers) ## Legal Stuff @@ -199,7 +179,7 @@ specific purpose, or lack of malice in any given npm package. If you have a complaint about a package in the public npm registry, and cannot [resolve it with the package -owner](https://www.npmjs.org/doc/misc/npm-disputes.html), please email +owner](https://docs.npmjs.com/misc/disputes), please email and explain the situation. Any data published to The npm Registry (including user account @@ -228,8 +208,6 @@ When you find issues, please report them: * web: -* email: - Be sure to include *all* of the output from the npm command that didn't work as expected. The `npm-debug.log` file is also helpful to provide. diff --git a/deps/npm/doc/api/npm-ls.md b/deps/npm/doc/api/npm-ls.md index ed890ff146941b..5de78f2104ae0c 100644 --- a/deps/npm/doc/api/npm-ls.md +++ b/deps/npm/doc/api/npm-ls.md @@ -52,5 +52,5 @@ List packages in the global install prefix instead of in the current project. Note, if parseable is set or long isn't set, then duplicates will be trimmed. -This means that if a submodule a same dependency as a parent module, then the +This means that if a submodule has the same dependency as a parent module, then the dependency will only be output once. diff --git a/deps/npm/doc/api/npm-restart.md b/deps/npm/doc/api/npm-restart.md index c40704438e7e1a..606c41bf8505f4 100644 --- a/deps/npm/doc/api/npm-restart.md +++ b/deps/npm/doc/api/npm-restart.md @@ -1,5 +1,5 @@ -npm-restart(3) -- Start a package -================================= +npm-restart(3) -- Restart a package +=================================== ## SYNOPSIS @@ -7,14 +7,33 @@ npm-restart(3) -- Start a package ## DESCRIPTION -This runs a package's "restart" script, if one was provided. -Otherwise it runs package's "stop" script, if one was provided, and then -the "start" script. +This restarts a package (or multiple packages). + +This runs a package's "stop", "restart", and "start" scripts, and associated +pre- and post- scripts, in the order given below: + +1. prerestart +2. prestop +3. stop +4. poststop +5. restart +6. prestart +7. start +8. poststart +9. postrestart If no version is specified, then it restarts the "active" version. -npm can run tests on multiple packages. Just specify multiple packages -in the `packages` parameter. +npm can restart multiple packages. Just specify multiple packages in +the `packages` parameter. + +## NOTE + +Note that the "restart" script is run **in addition to** the "stop" +and "start" scripts, not instead of them. + +This is the behavior as of `npm` major version 2. A change in this +behavior will be accompanied by an increase in major version number ## SEE ALSO diff --git a/deps/npm/doc/api/npm-start.md b/deps/npm/doc/api/npm-start.md index 74491146aac3e4..deeea90d97649b 100644 --- a/deps/npm/doc/api/npm-start.md +++ b/deps/npm/doc/api/npm-start.md @@ -9,5 +9,5 @@ npm-start(3) -- Start a package This runs a package's "start" script, if one was provided. -npm can run tests on multiple packages. Just specify multiple packages -in the `packages` parameter. +npm can start multiple packages. Just specify multiple packages in the +`packages` parameter. diff --git a/deps/npm/doc/api/npm-tag.md b/deps/npm/doc/api/npm-tag.md index b5a3d7faa6b0f9..9cda0c407dec84 100644 --- a/deps/npm/doc/api/npm-tag.md +++ b/deps/npm/doc/api/npm-tag.md @@ -18,6 +18,6 @@ is the package name and version is the version number (much like installing a specific version). The second element is the name of the tag to tag this version with. If this -parameter is missing or falsey (empty), the default froom the config will be +parameter is missing or falsey (empty), the default from the config will be used. For more information about how to set this config, check `man 3 npm-config` for programmatic usage or `man npm-config` for cli usage. diff --git a/deps/npm/doc/api/npm.md b/deps/npm/doc/api/npm.md index 4b4dfcaddd2c6d..611292ec94688d 100644 --- a/deps/npm/doc/api/npm.md +++ b/deps/npm/doc/api/npm.md @@ -1,5 +1,5 @@ -npm(3) -- node package manager -============================== +npm(3) -- javascript package manager +==================================== ## SYNOPSIS diff --git a/deps/npm/doc/cli/npm-adduser.md b/deps/npm/doc/cli/npm-adduser.md index 54e785b07fefb4..80d0f9855b2a87 100644 --- a/deps/npm/doc/cli/npm-adduser.md +++ b/deps/npm/doc/cli/npm-adduser.md @@ -13,13 +13,14 @@ the default registry will be used (see `npm-config(7)`). The username, password, and email are read in from prompts. -You may use this command to change your email address, but not username -or password. +To reset your password, go to -To reset your password, go to +To change your email address, go to You may use this command multiple times with the same user account to -authorize on a new machine. +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record. `npm login` is an alias to `adduser` and behaves exactly the same way. @@ -57,7 +58,7 @@ registries. Can be used with `--registry` and / or `--scope`, e.g. This will ensure that all requests to that registry (including for tarballs) include an authorization header. See `always-auth` in `npm-config(7)` for more -details on always-auth. Registry-specific configuaration of `always-auth` takes +details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-link.md b/deps/npm/doc/cli/npm-link.md index a6c27479007f97..786ad815dc3c23 100644 --- a/deps/npm/doc/cli/npm-link.md +++ b/deps/npm/doc/cli/npm-link.md @@ -22,7 +22,7 @@ Note that `package-name` is taken from `package.json`, not from directory name. The package name can be optionally prefixed with a scope. See `npm-scope(7)`. -The scope must by preceded by an @-symbol and followed by a slash. +The scope must be preceded by an @-symbol and followed by a slash. When creating tarballs for `npm publish`, the linked packages are "snapshotted" to their current state by resolving the symbolic links. diff --git a/deps/npm/doc/cli/npm-restart.md b/deps/npm/doc/cli/npm-restart.md index 6d594a26c1bdcc..1aa0c57a6829eb 100644 --- a/deps/npm/doc/cli/npm-restart.md +++ b/deps/npm/doc/cli/npm-restart.md @@ -1,5 +1,5 @@ -npm-restart(1) -- Start a package -================================= +npm-restart(1) -- Restart a package +=================================== ## SYNOPSIS @@ -7,8 +7,28 @@ npm-restart(1) -- Start a package ## DESCRIPTION -This runs a package's "restart" script, if one was provided. Otherwise it runs -package's "stop" script, if one was provided, and then the "start" script. +This restarts a package. + +This runs a package's "stop", "restart", and "start" scripts, and associated +pre- and post- scripts, in the order given below: + +1. prerestart +2. prestop +3. stop +4. poststop +5. restart +6. prestart +7. start +8. poststart +9. postrestart + +## NOTE + +Note that the "restart" script is run **in addition to** the "stop" +and "start" scripts, not instead of them. + +This is the behavior as of `npm` major version 2. A change in this +behavior will be accompanied by an increase in major version number ## SEE ALSO @@ -17,3 +37,4 @@ package's "stop" script, if one was provided, and then the "start" script. * npm-test(1) * npm-start(1) * npm-stop(1) +* npm-restart(3) \ No newline at end of file diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index 74f416e0bec8c6..c218c845f5351b 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -11,10 +11,13 @@ npm-run-script(1) -- Run arbitrary package scripts This runs an arbitrary command from a package's `"scripts"` object. If no package name is provided, it will search for a `package.json` in the current folder and use its `"scripts"` object. If no `"command"` -is provided, it will list the available top level scripts. +is provided, it will list the available top level scripts. The `env` command +can be used to list environment variables that will be available to the script +at runtime. If an "env" command is defined in your package it will have +precedence instead. -It is used by the test, start, restart, and stop commands, but can be -called directly, as well. +`run[-script]` is used by the test, start, restart, and stop commands, but can +be called directly, as well. As of [`npm@2.0.0`](http://blog.npmjs.org/post/98131109725/npm-2-0-0), you can use custom arguments when executing scripts. The special option `--` is used by diff --git a/deps/npm/doc/cli/npm-tag.md b/deps/npm/doc/cli/npm-tag.md index 3e1d1051bd0219..28a1c9334fb0bf 100644 --- a/deps/npm/doc/cli/npm-tag.md +++ b/deps/npm/doc/cli/npm-tag.md @@ -23,6 +23,29 @@ This also applies to `npm dedupe`. Publishing a package always sets the "latest" tag to the published version. +## PURPOSE + +Tags can be used to provide an alias instead of version numbers. For +example, `npm` currently uses the tag "next" to identify the upcoming +version, and the tag "latest" to identify the current version. + +A project might choose to have multiple streams of development, e.g., +"stable", "canary". + +## CAVEATS + +Tags must share a namespace with version numbers, because they are +specified in the same slot: `npm install @` vs `npm +install @`. + +Tags that can be interpreted as valid semver ranges will be +rejected. For example, `v1.4` cannot be used as a tag, because it is +interpreted by semver as `>=1.4.0 <1.5.0`. See +. + +The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter `v`. + ## SEE ALSO * npm-publish(1) @@ -31,4 +54,5 @@ Publishing a package always sets the "latest" tag to the published version. * npm-registry(7) * npm-config(1) * npm-config(7) +* npm-tag(3) * npmrc(5) diff --git a/deps/npm/doc/cli/npm-update.md b/deps/npm/doc/cli/npm-update.md index a53d29459282f3..2aa0f366bc27fc 100644 --- a/deps/npm/doc/cli/npm-update.md +++ b/deps/npm/doc/cli/npm-update.md @@ -10,7 +10,9 @@ npm-update(1) -- Update a package This command will update all the packages listed to the latest version (specified by the `tag` config). -It will also install missing packages. +It will also install missing packages. As with all commands that install +packages, the `--dev` flag will cause `devDependencies` to be processed +as well. If the `-g` flag is specified, this command will update globally installed packages. diff --git a/deps/npm/doc/cli/npm-version.md b/deps/npm/doc/cli/npm-version.md index b30b6a3a2146ac..69f3581bfcbbc0 100644 --- a/deps/npm/doc/cli/npm-version.md +++ b/deps/npm/doc/cli/npm-version.md @@ -8,7 +8,7 @@ npm-version(1) -- Bump a package version ## DESCRIPTION Run this in a package directory to bump the version and write the new -data back to the package.json file. +data back to `package.json` and, if present, `npm-shrinkwrap.json`. The `newversion` argument should be a valid semver string, *or* a valid second argument to semver.inc (one of "patch", "minor", "major", @@ -38,6 +38,7 @@ in your git config for this to work properly. For example: Enter passphrase: + ## SEE ALSO * npm-init(1) diff --git a/deps/npm/doc/cli/npm.md b/deps/npm/doc/cli/npm.md index ad16d419e8b8a8..331a03577b20d0 100644 --- a/deps/npm/doc/cli/npm.md +++ b/deps/npm/doc/cli/npm.md @@ -1,5 +1,5 @@ -npm(1) -- node package manager -============================== +npm(1) -- javascript package manager +==================================== ## SYNOPSIS diff --git a/deps/npm/doc/files/npmrc.md b/deps/npm/doc/files/npmrc.md index ba57a6f2c33763..a3eb4389f4eb30 100644 --- a/deps/npm/doc/files/npmrc.md +++ b/deps/npm/doc/files/npmrc.md @@ -30,6 +30,12 @@ Each of these files is loaded, and config options are resolved in priority order. For example, a setting in the userconfig file would override the setting in the globalconfig file. +Array values are specified by adding "[]" after the key name. For +example: + + key[] = "first value" + key[] = "second value" + ### Per-project config file When working locally in a project, a `.npmrc` file in the root of the diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index 1138bc2749e699..00939cbf49d448 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -28,7 +28,7 @@ The name is what your thing is called. Some tips: * The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive. * You may want to check the npm registry to see if there's something by that name - already, before you get too attached to it. http://registry.npmjs.org/ + already, before you get too attached to it. A name can be optionally prefixed by a scope, e.g. `@myorg/mypackage`. See `npm-scope(7)` for more detail. @@ -253,7 +253,7 @@ Put example scripts in here. Someday, it might be exposed in some clever way. ## repository Specify the place where your code lives. This is helpful for people who -want to contribute. If the git repo is on github, then the `npm docs` +want to contribute. If the git repo is on GitHub, then the `npm docs` command will be able to find you. Do it like this: @@ -366,13 +366,16 @@ an argument to `git checkout`. The default is `master`. ## GitHub URLs -As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example: +As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a `commit-ish` suffix can be +included. For example: { "name": "foo", "version": "0.0.0", "dependencies": { - "express": "visionmedia/express" + "express": "visionmedia/express", + "mocha": "visionmedia/mocha#4727d357ea" } } @@ -442,7 +445,7 @@ run this script as well, so that you can test it easily. In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a `require` of this host. -This is usually refered to as a *plugin*. Notably, your module may be exposing +This is usually referred to as a *plugin*. Notably, your module may be exposing a specific interface, expected and specified by the host documentation. For example: diff --git a/deps/npm/doc/misc/npm-coding-style.md b/deps/npm/doc/misc/npm-coding-style.md index 80609f4f2fef7f..7dd7ad556deba1 100644 --- a/deps/npm/doc/misc/npm-coding-style.md +++ b/deps/npm/doc/misc/npm-coding-style.md @@ -10,7 +10,7 @@ designed to reduce visual clutter and make bugs more apparent. If you want to contribute to npm (which is very encouraged), you should make your code conform to npm's style. -Note: this concerns npm's code not the specific packages at npmjs.org +Note: this concerns npm's code not the specific packages that you can download from the npm registry. ## Line Length @@ -21,7 +21,7 @@ statements onto multiple lines. ## Indentation Two-spaces. Tabs are better, but they look like hell in web browsers -(and on github), and node uses 2 spaces, so that's that. +(and on GitHub), and node uses 2 spaces, so that's that. Configure your editor appropriately. diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 6e7d995dd8e5d9..fc6201e66792ab 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -137,14 +137,22 @@ The browser that is called by the `npm docs` command to open websites. ### ca * Default: The npm CA certificate -* Type: String or null +* Type: String, Array or null The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. +connections to the registry. Values should be in PEM format with newlines +replaced by the string "\n". For example: + + ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----" Set to `null` to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority. +Multiple CAs can be trusted by specifying an array of certificates: + + ca[]="..." + ca[]="..." + See also the `strict-ssl` config. ### cafile @@ -361,11 +369,12 @@ The string that starts all the debugging log output. ### https-proxy -* Default: the `HTTPS_PROXY` or `https_proxy` or `HTTP_PROXY` or - `http_proxy` environment variables. +* Default: null * Type: url -A proxy to use for outgoing https requests. +A proxy to use for outgoing https requests. If the `HTTPS_PROXY` or +`https_proxy` or `HTTP_PROXY` or `http_proxy` environment variables are set, +proxy settings will be honored by the underlying `request` library. ### ignore-scripts @@ -577,10 +586,12 @@ this as true. ### proxy -* Default: `HTTP_PROXY` or `http_proxy` environment variable, or null +* Default: null * Type: url -A proxy to use for outgoing http requests. +A proxy to use for outgoing http requests. If the `HTTP_PROXY` or +`http_proxy` environment variables are set, proxy settings will be +honored by the underlying `request` library. ### rebuild-bundle diff --git a/deps/npm/doc/misc/npm-developers.md b/deps/npm/doc/misc/npm-developers.md index f6ea01176fae9a..2b025034f85188 100644 --- a/deps/npm/doc/misc/npm-developers.md +++ b/deps/npm/doc/misc/npm-developers.md @@ -102,6 +102,14 @@ ignore the stuff matched by the `.gitignore` file. If you *want* to include something that is excluded by your `.gitignore` file, you can create an empty `.npmignore` file to override it. +`.npmignore` files follow the [same pattern rules](http://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files) +as `.gitignore` files: + +* Blank lines or lines starting with `#` are ignored. +* Standard glob patterns work. +* You can end patterns with a forward slash `/` to specify a directory. +* You can negate a pattern by starting it with an exclamation point `!`. + By default, the following paths and files are ignored, so there's no need to add them to `.npmignore` explicitly: diff --git a/deps/npm/doc/misc/npm-faq.md b/deps/npm/doc/misc/npm-faq.md index 72891271f95be9..176effc4e42830 100644 --- a/deps/npm/doc/misc/npm-faq.md +++ b/deps/npm/doc/misc/npm-faq.md @@ -3,7 +3,7 @@ npm-faq(7) -- Frequently Asked Questions ## Where can I find these docs in HTML? -, or run: +, or run: npm config set viewer browser @@ -80,7 +80,7 @@ Usually, no. Allow npm to resolve dependencies for your packages. For packages you **deploy**, such as websites and apps, you should use npm shrinkwrap to lock down your full dependency tree: -https://www.npmjs.org/doc/cli/npm-shrinkwrap.html + If you are paranoid about depending on the npm ecosystem, you should run a private npm mirror or a private cache. @@ -147,7 +147,7 @@ command.) In those cases, you can do this: - curl https://www.npmjs.org/install.sh | sh + curl https://www.npmjs.com/install.sh | sh ## What is a `package`? @@ -307,7 +307,7 @@ See `npm-registry(7)`. ## I forgot my password, and can't publish. How do I reset it? -Go to . +Go to . ## I get ECONNREFUSED a lot. What's up? @@ -327,13 +327,38 @@ on Freenode IRC. ## Why no namespaces? -Please see this discussion: +npm has only one global namespace. If you want to namespace your own packages, +you may: simply use the `-` character to separate the names. npm is a mostly +anarchic system. There is not sufficient need to impose namespace rules on +everyone. -tl;dr - It doesn't actually make things better, and can make them worse. +As of 2.0, npm supports scoped packages, which allow you to publish a group of +related modules without worrying about name collisions. -If you want to namespace your own packages, you may: simply use the -`-` character to separate the names. npm is a mostly anarchic system. -There is not sufficient need to impose namespace rules on everyone. +Every npm user owns the scope associated with their username. For example, the +user named `npm` owns the scope `@npm`. Scoped packages are published inside a +scope by naming them as if they were files under the scope directory, e.g., by +setting `name` in `package.json` to `@npm/npm`. + +Scoped packages can coexist with public npm packages in a private npm registry. +At present (2014-11-04) scoped packages may NOT be published to the public npm +registry. + +Unscoped packages can only depend on other unscoped packages. Scoped packages +can depend on packages from their own scope, a different scope, or the public +registry (unscoped). + +For the current documentation of scoped packages, see + + +References: + +1. For the reasoning behind the "one global namespace", please see this + discussion: (TL;DR: It doesn't + actually make things better, and can make them worse.) + +2. For the pre-implementation discussion of the scoped package feature, see + this discussion: ## Who does npm? @@ -341,7 +366,7 @@ npm was originally written by Isaac Z. Schlueter, and many others have contributed to it, some of them quite substantially. The npm open source project, The npm Registry, and [the community -website](https://www.npmjs.org) are maintained and operated by the +website](https://www.npmjs.com) are maintained and operated by the good folks at [npm, Inc.](http://www.npmjs.com) ## I have a question or request not addressed here. Where should I put it? diff --git a/deps/npm/doc/misc/npm-index.md b/deps/npm/doc/misc/npm-index.md index 9c804bf802c409..96c62cced613e5 100644 --- a/deps/npm/doc/misc/npm-index.md +++ b/deps/npm/doc/misc/npm-index.md @@ -3,7 +3,7 @@ npm-index(7) -- Index of all npm documentation ### README(1) -node package manager +a JavaScript package manager ## Command Line Documentation @@ -11,7 +11,7 @@ Using npm on the command line ### npm(1) -node package manager +javascript package manager ### npm-adduser(1) @@ -123,7 +123,7 @@ Open package repository page in the browser ### npm-restart(1) -Start a package +Restart a package ### npm-rm(1) @@ -199,7 +199,7 @@ Using npm in your Node programs ### npm(3) -node package manager +javascript package manager ### npm-bin(3) @@ -295,7 +295,7 @@ Open package repository page in the browser ### npm-restart(3) -Start a package +Restart a package ### npm-root(3) diff --git a/deps/npm/doc/misc/npm-registry.md b/deps/npm/doc/misc/npm-registry.md index 42cec59448a173..b0487f6df9db20 100644 --- a/deps/npm/doc/misc/npm-registry.md +++ b/deps/npm/doc/misc/npm-registry.md @@ -57,7 +57,7 @@ effectively implement the entire CouchDB API anyway. ## Is there a website or something to see package docs and such? -Yes, head over to +Yes, head over to ## SEE ALSO diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index 054886b4d548c5..3be4af377f2dac 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -19,10 +19,6 @@ following scripts: Run BEFORE the package is uninstalled. * postuninstall: Run AFTER the package is uninstalled. -* preupdate: - Run BEFORE the package is updated with the update command. -* update, postupdate: - Run AFTER the package is updated with the update command. * pretest, test, posttest: Run by the `npm test` command. * prestop, stop, poststop: diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index bd697d959e1d5d..3f9555db142090 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.md @@ -16,12 +16,12 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | -d ] + Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] Test if version(s) satisfy the supplied range(s), and sort them. Multiple versions or ranges may be supplied, unless increment - or decrement options are specified. In that case, only a single - version may be used, and it is incremented by the specified level + option is specified. In that case, only a single version may + be used, and it is incremented by the specified level Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. @@ -101,6 +101,30 @@ the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the *next* set of prerelease versions. +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +````javascript +> semver.inc('1.2.3', 'pre', 'beta') +'1.2.4-beta.0' +``` + +command-line example: + +```shell +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```shell +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + ### Advanced Range Syntax Advanced range syntax desugars to primitive comparators in @@ -161,8 +185,6 @@ comparator. Allows minor-level changes if not. `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. -Note: this is the same as the `~>` operator in rubygems. - #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` Allows changes that do not modify the left-most non-zero digit in the @@ -245,6 +267,9 @@ strings that they parse. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. ### Ranges diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 96bc06401a00c8..2738adcd74b4c0 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -9,7 +9,7 @@
-

npm

node package manager

+

npm

a JavaScript package manager

Build Status

SYNOPSIS

This is just enough info to get you up and running.

@@ -30,9 +30,9 @@

Other Sorts of Unices

paths, etc.) then read on.

Fancy Install (Unix)

There's a pretty robust install script at -https://www.npmjs.org/install.sh. You can download that and run it.

+https://www.npmjs.com/install.sh. You can download that and run it.

Here's an example using curl:

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

Slightly Fancier

You can set any npm configuration params with that script:

npm_config_prefix=/some/path sh install.sh
@@ -45,31 +45,16 @@ 

Fancy Install (Unix)

arbitrary config keys using the ./configure --key=val ..., and then run npm commands by doing node cli.js <cmd> <args>. (This is helpful for testing, or running stuff without actually installing npm itself.)

-

Fancy Windows Install

-

You can download a zip file from https://npmjs.org/dist/, and unpack it +

Windows Install or Upgrade

+

You can download a zip file from https://github.com/npm/npm/releases, and unpack it in the same folder where node.exe lives.

+

The latest version in a zip file is 1.4.12. To upgrade to npm 2, follow the +Windows upgrade instructions in the npm Troubleshooting Guide:

+

https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly.

Installing on Cygwin

No.

-

Permissions when Using npm to Install Other Stuff

-

tl;dr

-
    -
  • Use sudo for greater safety. Or don't, if you prefer not to.
  • -
  • npm will downgrade permissions if it's root before running any build -scripts that package authors specified.
  • -
-

More details...

-

As of version 0.3, it is recommended to run npm as root. -This allows npm to change the user identifier to the nobody user prior -to running any package build or test commands.

-

If you are not the root user, or if you are on a platform that does not -support uid switching, then npm will not attempt to change the userid.

-

If you would like to ensure that npm always runs scripts as the -"nobody" user, and have it fail if it cannot downgrade permissions, then -set the following configuration param:

-
npm config set unsafe-perm false
-

This will prevent running in unsafe mode, even as non-root users.

Uninstalling

So sad to see you go.

sudo npm uninstall npm -g
@@ -122,11 +107,11 @@ 

Using npm Programmatically

command line arguments using nopt. You may also want to check out npm help config to learn about all the options you can set there.

More Docs

-

Check out the docs, -especially the faq.

+

Check out the docs, +especially the faq.

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

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

+you should read this

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

@@ -139,9 +124,9 @@ assertion expressed or implied as to the quality, fitness for a specific purpose, or lack of malice in any given npm package.

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

+support@npmjs.com and explain the situation.

Any data published to The npm Registry (including user account information) may be removed or modified at the sole discretion of the npm server administrators.

@@ -160,8 +145,6 @@

BUGS

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

@@ -186,5 +169,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html index a25612475695ce..971bb136114221 100644 --- a/deps/npm/html/doc/api/npm-bin.html +++ b/deps/npm/html/doc/api/npm-bin.html @@ -28,5 +28,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html index 9cf2cc4131fc22..e34204f8a6b11d 100644 --- a/deps/npm/html/doc/api/npm-bugs.html +++ b/deps/npm/html/doc/api/npm-bugs.html @@ -33,5 +33,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html index 6dfc4a0e5cc3bf..65e5d0d399ca29 100644 --- a/deps/npm/html/doc/api/npm-cache.html +++ b/deps/npm/html/doc/api/npm-cache.html @@ -42,5 +42,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html index 3f3ae544e99c43..36e2ab9a03f2b8 100644 --- a/deps/npm/html/doc/api/npm-commands.html +++ b/deps/npm/html/doc/api/npm-commands.html @@ -36,5 +36,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html index 3767a46aca5fb8..7ee80e63e3cbf4 100644 --- a/deps/npm/html/doc/api/npm-config.html +++ b/deps/npm/html/doc/api/npm-config.html @@ -57,5 +57,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html index a235c2baa96a33..8799f10ffd9e3c 100644 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ b/deps/npm/html/doc/api/npm-deprecate.html @@ -47,5 +47,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html index 222b90e70a811a..e13998e46fc216 100644 --- a/deps/npm/html/doc/api/npm-docs.html +++ b/deps/npm/html/doc/api/npm-docs.html @@ -33,5 +33,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html index aa3d7bdb0ba566..9779d1743d5024 100644 --- a/deps/npm/html/doc/api/npm-edit.html +++ b/deps/npm/html/doc/api/npm-edit.html @@ -36,5 +36,5 @@

SYNOPSIS

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

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html index 886d0c5acbe779..7311b1d5d53f5c 100644 --- a/deps/npm/html/doc/api/npm-help-search.html +++ b/deps/npm/html/doc/api/npm-help-search.html @@ -44,5 +44,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html index 80b14a41df3b67..8ae0adaebb9e4a 100644 --- a/deps/npm/html/doc/api/npm-init.html +++ b/deps/npm/html/doc/api/npm-init.html @@ -39,5 +39,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html index 43cf4f166ff958..dc3cb69c747941 100644 --- a/deps/npm/html/doc/api/npm-install.html +++ b/deps/npm/html/doc/api/npm-install.html @@ -32,5 +32,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html index c41a31c9b4b89c..81831911dfe184 100644 --- a/deps/npm/html/doc/api/npm-link.html +++ b/deps/npm/html/doc/api/npm-link.html @@ -42,5 +42,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html index fbf22994f6d808..3dd0d472df9097 100644 --- a/deps/npm/html/doc/api/npm-load.html +++ b/deps/npm/html/doc/api/npm-load.html @@ -37,5 +37,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html index e221bab4a0f152..7c533218f611a6 100644 --- a/deps/npm/html/doc/api/npm-ls.html +++ b/deps/npm/html/doc/api/npm-ls.html @@ -49,7 +49,7 @@

global

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

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

@@ -63,5 +63,5 @@

global

       - + diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html index 91fafce32974f5..2511656267255b 100644 --- a/deps/npm/html/doc/api/npm-outdated.html +++ b/deps/npm/html/doc/api/npm-outdated.html @@ -28,5 +28,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html index 878a9e59d865d8..35070f867e92e9 100644 --- a/deps/npm/html/doc/api/npm-owner.html +++ b/deps/npm/html/doc/api/npm-owner.html @@ -47,5 +47,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html index 1e146e41f4fb49..c506967a880445 100644 --- a/deps/npm/html/doc/api/npm-pack.html +++ b/deps/npm/html/doc/api/npm-pack.html @@ -33,5 +33,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html index bd406009c5afc9..19d5abc29118ef 100644 --- a/deps/npm/html/doc/api/npm-prefix.html +++ b/deps/npm/html/doc/api/npm-prefix.html @@ -29,5 +29,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html index 0e446c26f588ea..c528d1f1b74748 100644 --- a/deps/npm/html/doc/api/npm-prune.html +++ b/deps/npm/html/doc/api/npm-prune.html @@ -30,5 +30,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html index 0e41c2ad0ef60c..96338745cac1e4 100644 --- a/deps/npm/html/doc/api/npm-publish.html +++ b/deps/npm/html/doc/api/npm-publish.html @@ -46,5 +46,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html index f5d2e6a6629b37..9ff291a32423d8 100644 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ b/deps/npm/html/doc/api/npm-rebuild.html @@ -30,5 +30,5 @@

CONFIGURATION

       - + diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html index 024e7279b76cdf..0f4436b8c3a1b2 100644 --- a/deps/npm/html/doc/api/npm-repo.html +++ b/deps/npm/html/doc/api/npm-repo.html @@ -33,5 +33,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html index 29d1a566708ff0..aade48106ada33 100644 --- a/deps/npm/html/doc/api/npm-restart.html +++ b/deps/npm/html/doc/api/npm-restart.html @@ -9,16 +9,32 @@
-

npm-restart

Start a package

+

npm-restart

Restart a package

SYNOPSIS

npm.commands.restart(packages, callback)
 

DESCRIPTION

-

This runs a package's "restart" script, if one was provided. -Otherwise it runs package's "stop" script, if one was provided, and then -the "start" script.

+

This restarts a package (or multiple packages).

+

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

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

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

-

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

+

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

+

NOTE

+

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

+

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

SEE ALSO

  • npm-start(3)
  • @@ -36,5 +52,5 @@

    SEE ALSO

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

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html index 26707808009501..aed1a1f9d18c9a 100644 --- a/deps/npm/html/doc/api/npm-run-script.html +++ b/deps/npm/html/doc/api/npm-run-script.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html index 903aa521eb59be..7faf23b6491960 100644 --- a/deps/npm/html/doc/api/npm-search.html +++ b/deps/npm/html/doc/api/npm-search.html @@ -53,5 +53,5 @@

    SYNOPSIS

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

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html index 23678bc9ec1e74..5af05b1f1eac7d 100644 --- a/deps/npm/html/doc/api/npm-start.html +++ b/deps/npm/html/doc/api/npm-start.html @@ -14,8 +14,8 @@

    SYNOPSIS

    npm.commands.start(packages, callback)
     

    DESCRIPTION

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

    -

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

    +

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

@@ -28,5 +28,5 @@

SYNOPSIS

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

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-submodule.html index d70ee36d49f992..35364403c35ce4 100644 --- a/deps/npm/html/doc/api/npm-submodule.html +++ b/deps/npm/html/doc/api/npm-submodule.html @@ -42,5 +42,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html index b4a326161e1758..454329e630f573 100644 --- a/deps/npm/html/doc/api/npm-tag.html +++ b/deps/npm/html/doc/api/npm-tag.html @@ -21,7 +21,7 @@

SYNOPSIS

is the package name and version is the version number (much like installing a specific version).

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

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

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html index 78168084c2dfe1..ecb1f949b252f9 100644 --- a/deps/npm/html/doc/api/npm-test.html +++ b/deps/npm/html/doc/api/npm-test.html @@ -30,5 +30,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html index 962ff879c3ddf9..97baf3e8e9ff55 100644 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ b/deps/npm/html/doc/api/npm-uninstall.html @@ -30,5 +30,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html index 2b9a5c58f61bf7..8e8d3e41867a15 100644 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ b/deps/npm/html/doc/api/npm-unpublish.html @@ -33,5 +33,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html index f60e83de3f54ca..60a56e336c7806 100644 --- a/deps/npm/html/doc/api/npm-update.html +++ b/deps/npm/html/doc/api/npm-update.html @@ -27,5 +27,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html index c4ce078a4820d6..07f17f84911932 100644 --- a/deps/npm/html/doc/api/npm-version.html +++ b/deps/npm/html/doc/api/npm-version.html @@ -32,5 +32,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html index 75c75fdbb478b4..13b73d54634db9 100644 --- a/deps/npm/html/doc/api/npm-view.html +++ b/deps/npm/html/doc/api/npm-view.html @@ -81,5 +81,5 @@

RETURN VALUE

       - + diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html index 4ed6d79a42818a..f15772c49bc1d5 100644 --- a/deps/npm/html/doc/api/npm-whoami.html +++ b/deps/npm/html/doc/api/npm-whoami.html @@ -29,5 +29,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html index 67ff3d32f8ad5d..3e9e8cd7aa548a 100644 --- a/deps/npm/html/doc/api/npm.html +++ b/deps/npm/html/doc/api/npm.html @@ -9,7 +9,7 @@
-

npm

node package manager

+

npm

javascript package manager

SYNOPSIS

var npm = require("npm")
 npm.load([configObject, ]function (er, npm) {
@@ -23,7 +23,7 @@ 

SYNOPSIS

npm.commands.install(["package"], cb) })

VERSION

-

2.1.6

+

2.2.0

DESCRIPTION

This is the API documentation for npm. To find documentation of the command line @@ -109,5 +109,5 @@

ABBREVS

       - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 84f0ac389efbdd..73c55a20f5d669 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -17,11 +17,12 @@

SYNOPSIS

save the credentials to the .npmrc file. If no registry is specified, the default registry will be used (see npm-config(7)).

The username, password, and email are read in from prompts.

-

You may use this command to change your email address, but not username -or password.

-

To reset your password, go to https://www.npmjs.org/forgot

+

To reset your password, go to https://www.npmjs.com/forgot

+

To change your email address, go to https://www.npmjs.com/email-edit

You may use this command multiple times with the same user account to -authorize on a new machine.

+authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record.

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

CONFIGURATION

registry

@@ -44,7 +45,7 @@

always-auth

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

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

SEE ALSO

    @@ -67,5 +68,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 7f6e3a5c0dd53b..9fb28248be7075 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 7758efa72641e0..46e1bb7142579d 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -54,5 +54,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index ca62cb246517ee..321af44288dee7 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 9b833d0b6dd92a..49c06b89274ea9 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 53835b35db3a58..e08fdc15702b04 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 5a678ba352f019..49e16489c67b4d 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index d97845e708a79b..a35e60beef5be7 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -66,5 +66,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index bf6c9974ea4807..85b74cb783952c 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -63,5 +63,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 8182c6ecf1b8d4..ccbd2330524cb8 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index e9f2c9e732eb3b..53e8f77c8c3d5b 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 24a70fe7fc1d06..6fc2b6cb997e51 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index eeb49064486fdf..d8b1c3345fc486 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 2cf7506f03f1d7..47ae3dd8842e68 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -46,5 +46,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 12c6c0e8fd2d13..ad398fd1cbec2b 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -52,5 +52,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index e7640ea46c6f6f..8d1573a9070c07 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -40,5 +40,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 3759f011559a73..4ecf983b60216a 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -239,5 +239,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 8d085892df2e5a..605250dff9d236 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -24,7 +24,7 @@

    SYNOPSIS

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

    The package name can be optionally prefixed with a scope. See npm-scope(7). -The scope must by preceded by an @-symbol and followed by a slash.

    +The scope must be preceded by an @-symbol and followed by a slash.

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

    This is handy for installing your own stuff, so that you can work on it and @@ -71,5 +71,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 30419bdb0d6103..9e339765c731e8 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -22,7 +22,7 @@

    SYNOPSIS

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

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

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

    @@ -85,5 +85,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 07a0a933d76035..097040ae339e36 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -67,5 +67,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 3600e087f15049..8f525c08e59dd1 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 987ba3f792b9cb..dc24a7fb4d694a 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 7b6a3c58a51e57..03b21377139205 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index dea291b4909bc8..98c757a4532533 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index e1b46d21d0b3f3..f5d7adfaa4cb9c 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -59,5 +59,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 4da97a70518b19..e1a3ca6e98fdee 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 02335b4f4a19e7..050c1f624d6633 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index d7536f81fdfe00..37deabf88764b4 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -9,12 +9,29 @@
    -

    npm-restart

    Start a package

    +

    npm-restart

    Restart a package

    SYNOPSIS

    npm restart [-- <args>]
     

    DESCRIPTION

    -

    This runs a package's "restart" script, if one was provided. Otherwise it runs -package's "stop" script, if one was provided, and then the "start" script.

    +

    This restarts a package.

    +

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

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

    NOTE

    +

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

    +

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

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html index 3b28aaad4d3e8d..845da11c616a95 100644 --- a/deps/npm/html/doc/cli/npm-rm.html +++ b/deps/npm/html/doc/cli/npm-rm.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index f6b8b22dfcba96..044a914531072c 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 8ca2ea2a5ed4e9..69f93318c4a0fe 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -17,9 +17,12 @@

    SYNOPSIS

    This runs an arbitrary command from a package's "scripts" object. If no package name is provided, it will search for a package.json in the current folder and use its "scripts" object. If no "command" -is provided, it will list the available top level scripts.

    -

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

    +is provided, it will list the available top level scripts. The env command +can be used to list environment variables that will be available to the script +at runtime. If an "env" command is defined in your package it will have +precedence instead.

    +

    run[-script] is used by the test, start, restart, and stop commands, but can +be called directly, as well.

    As of npm@2.0.0, you can use custom arguments when executing scripts. The special option -- is used by getopt to delimit the end of the options. npm will pass @@ -47,5 +50,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index f5fe720baa11c0..f2943cca9f20b4 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index fbfaa6c3dc00a3..3d6fb470b35b93 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -164,5 +164,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index d3bbde5b9d696f..ceb9bcf0b5fbbb 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 7873880f4159e3..ee5cf6ed57846e 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -37,5 +37,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 0a3134bc82e3e1..c9ed7fc39eb6cb 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -34,5 +34,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 01638ee4daf773..c1f54ba8f75dc4 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html index 4ac55a88525bfa..6716c4a11cce24 100644 --- a/deps/npm/html/doc/cli/npm-submodule.html +++ b/deps/npm/html/doc/cli/npm-submodule.html @@ -27,7 +27,7 @@

    SYNOPSIS

    dependencies into the submodule folder.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index 946d5fa767c8c5..d3540dae31e392 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -22,6 +22,22 @@

    SYNOPSIS

    npm install --tag <tag>
     

    This also applies to npm dedupe.

    Publishing a package always sets the "latest" tag to the published version.

    +

    PURPOSE

    +

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

    +

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

    +

    CAVEATS

    +

    Tags must share a namespace with version numbers, because they are +specified in the same slot: npm install <pkg>@<version> vs npm +install <pkg>@<tag>.

    +

    Tags that can be interpreted as valid semver ranges will be +rejected. For example, v1.4 cannot be used as a tag, because it is +interpreted by semver as >=1.4.0 <1.5.0. See +https://github.com/npm/npm/issues/6082.

    +

    The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter v.

    SEE ALSO

    @@ -44,5 +61,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index 6c5467de51fdd0..754e7a91a1490a 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -37,5 +37,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 2a3c12c148d050..b7a7426ea8785b 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -57,5 +57,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 59b278e23da596..3c4df5efe327b2 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -47,5 +47,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 5fa7846f5348ef..72f508aab30d6b 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -15,7 +15,9 @@

    SYNOPSIS

    DESCRIPTION

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

    -

    It will also install missing packages.

    +

    It will also install missing packages. As with all commands that install +packages, the --dev flag will cause devDependencies to be processed +as well.

    If the -g flag is specified, this command will update globally installed packages.

    If no package name is specified, all packages in the specified location (global @@ -40,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 6477726f495f07..a9a40f736649f1 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -14,7 +14,7 @@

    SYNOPSIS

    npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
     

    DESCRIPTION

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

    +data back to package.json and, if present, npm-shrinkwrap.json.

    The newversion argument should be a valid semver string, or a valid second argument to semver.inc (one of "patch", "minor", "major", "prepatch", "preminor", "premajor", "prerelease"). In the second case, @@ -55,5 +55,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 3b87ba0be205aa..aee2ff19a6831b 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -82,5 +82,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index a2705c40c3a95a..d6b6425c0a56e8 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -33,5 +33,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 3bd3849d2ad257..64f8d3f554c773 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -9,11 +9,11 @@
    -

    npm

    node package manager

    +

    npm

    javascript package manager

    SYNOPSIS

    npm <command> [args]
     

    VERSION

    -

    2.1.6

    +

    2.2.0

    DESCRIPTION

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

    CONTRIBUTIONS

    the issues list or ask on the mailing list.

    BUGS

    When you find issues, please report them:

    @@ -118,7 +118,7 @@

    BUGS

  • web: http://github.com/npm/npm/issues
  • email: -npm-@googlegroups.com
  • +npm-@googlegroups.com

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

@@ -128,7 +128,7 @@

AUTHOR

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

+i@izs.me

SEE ALSO

  • npm-help(1)
  • @@ -154,5 +154,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index ec320399971e4a..78a6ac66622c71 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -184,5 +184,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 90e5dcaf1dc3c6..20d5413a483463 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -184,5 +184,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index ade4fd07ec4d01..ebfecab01c724b 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -32,7 +32,7 @@

    name

  • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
  • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. http://registry.npmjs.org/
  • +already, before you get too attached to it. https://www.npmjs.com/

A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See npm-scope(7) for more detail.

@@ -181,7 +181,7 @@

directories.example

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

repository

Specify the place where your code lives. This is helpful for people who -want to contribute. If the git repo is on github, then the npm docs +want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.

Do it like this:

"repository" :
@@ -269,12 +269,15 @@ 

Git URLs as Dependencies

The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

GitHub URLs

-

As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example:

+

As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

{
   "name": "foo",
   "version": "0.0.0",
   "dependencies": {
-    "express": "visionmedia/express"
+    "express": "visionmedia/express",
+    "mocha": "visionmedia/mocha#4727d357ea"
   }
 }
 

Local Paths

@@ -328,7 +331,7 @@

devDependencies

peerDependencies

In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a require of this host. -This is usually refered to as a plugin. Notably, your module may be exposing +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

For example:

{
@@ -485,5 +488,5 @@ 

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 9f379006f09515..4ee352e536dfb1 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -31,7 +31,11 @@

FILES

Each of these files is loaded, and config options are resolved in priority order. For example, a setting in the userconfig file would override the setting in the globalconfig file.

-

Per-project config file

+

Array values are specified by adding "[]" after the key name. For +example:

+
key[] = "first value"
+key[] = "second value"
+

Per-project config file

When working locally in a project, a .npmrc file in the root of the project (ie, a sibling of node_modules and package.json) will set config values specific to this project.

@@ -73,5 +77,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 183ad8ea5d6a4f..ff1f7cff213850 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -32,7 +32,7 @@

name

  • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
  • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. http://registry.npmjs.org/
  • +already, before you get too attached to it. https://www.npmjs.com/

    A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See npm-scope(7) for more detail.

    @@ -181,7 +181,7 @@

    directories.example

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

    repository

    Specify the place where your code lives. This is helpful for people who -want to contribute. If the git repo is on github, then the npm docs +want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.

    Do it like this:

    "repository" :
    @@ -269,12 +269,15 @@ 

    Git URLs as Dependencies

    The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

    GitHub URLs

    -

    As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example:

    +

    As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

    {
       "name": "foo",
       "version": "0.0.0",
       "dependencies": {
    -    "express": "visionmedia/express"
    +    "express": "visionmedia/express",
    +    "mocha": "visionmedia/mocha#4727d357ea"
       }
     }
     

    Local Paths

    @@ -328,7 +331,7 @@

    devDependencies

    peerDependencies

    In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a require of this host. -This is usually refered to as a plugin. Notably, your module may be exposing +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

    For example:

    {
    @@ -485,5 +488,5 @@ 

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 6c68895e073001..97d5862263d176 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -11,11 +11,11 @@

    npm-index

    Index of all npm documentation

    README

    -

    node package manager

    +

    a JavaScript package manager

    Command Line Documentation

    Using npm on the command line

    npm(1)

    -

    node package manager

    +

    javascript package manager

    npm-adduser(1)

    Add a registry user account

    npm-bin(1)

    @@ -71,7 +71,7 @@

    npm-repo(1)

    Open package repository page in the browser

    npm-restart(1)

    -

    Start a package

    +

    Restart a package

    npm-rm(1)

    Remove a package

    npm-root(1)

    @@ -109,7 +109,7 @@

    API Documentation

    Using npm in your Node programs

    npm(3)

    -

    node package manager

    +

    javascript package manager

    npm-bin(3)

    Display npm bin folder

    npm-bugs(3)

    @@ -157,7 +157,7 @@

    npm-repo(3)

    Open package repository page in the browser

    npm-restart(3)

    -

    Start a package

    +

    Restart a package

    npm-root(3)

    Display npm root

    npm-run-script(3)

    @@ -230,5 +230,5 @@

    semver(        - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index 30d3e07cfab492..04925d5e2d5247 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -16,14 +16,14 @@

    DESCRIPTION

    designed to reduce visual clutter and make bugs more apparent.

    If you want to contribute to npm (which is very encouraged), you should make your code conform to npm's style.

    -

    Note: this concerns npm's code not the specific packages at npmjs.org

    +

    Note: this concerns npm's code not the specific packages that you can download from the npm registry.

    Line Length

    Keep lines shorter than 80 characters. It's better for lines to be too short than to be too long. Break up long lists, objects, and other statements onto multiple lines.

    Indentation

    Two-spaces. Tabs are better, but they look like hell in web browsers -(and on github), and node uses 2 spaces, so that's that.

    +(and on GitHub), and node uses 2 spaces, so that's that.

    Configure your editor appropriately.

    Curly braces

    Curly braces belong on the same line as the thing that necessitates them.

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index 249d5934c9eb76..f3e89cf43fe009 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -118,13 +118,18 @@

    browser

    ca

    • Default: The npm CA certificate
    • -
    • Type: String or null
    • +
    • Type: String, Array or null

    The Certificate Authority signing certificate that is trusted for SSL -connections to the registry.

    -

    Set to null to only allow "known" registrars, or to a specific CA cert +connections to the registry. Values should be in PEM format with newlines +replaced by the string "\n". For example:

    +
    ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
    +

    Set to null to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority.

    -

    See also the strict-ssl config.

    +

    Multiple CAs can be trusted by specifying an array of certificates:

    +
    ca[]="..."
    +ca[]="..."
    +

    See also the strict-ssl config.

    cafile

    • Default: null
    • @@ -313,11 +318,12 @@

      heading

      The string that starts all the debugging log output.

      https-proxy

        -
      • Default: the HTTPS_PROXY or https_proxy or HTTP_PROXY or -http_proxy environment variables.
      • +
      • Default: null
      • Type: url
      -

      A proxy to use for outgoing https requests.

      +

      A proxy to use for outgoing https requests. If the HTTPS_PROXY or +https_proxy or HTTP_PROXY or http_proxy environment variables are set, +proxy settings will be honored by the underlying request library.

      ignore-scripts

      • Default: false
      • @@ -500,10 +506,12 @@

        proprietary-attribs

        this as true.

        proxy

          -
        • Default: HTTP_PROXY or http_proxy environment variable, or null
        • +
        • Default: null
        • Type: url
        -

        A proxy to use for outgoing http requests.

        +

        A proxy to use for outgoing http requests. If the HTTP_PROXY or +http_proxy environment variables are set, proxy settings will be +honored by the underlying request library.

        rebuild-bundle

        • Default: true
        • @@ -759,5 +767,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index b4190a1a2b17e0..42f10063737219 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -94,6 +94,14 @@

          Keeping files out of your pa ignore the stuff matched by the .gitignore file. If you want to include something that is excluded by your .gitignore file, you can create an empty .npmignore file to override it.

          +

          .npmignore files follow the same pattern rules +as .gitignore files:

          +
            +
          • Blank lines or lines starting with # are ignored.
          • +
          • Standard glob patterns work.
          • +
          • You can end patterns with a forward slash / to specify a directory.
          • +
          • You can negate a pattern by starting it with an exclamation point !.
          • +

          By default, the following paths and files are ignored, so there's no need to add them to .npmignore explicitly:

            @@ -181,5 +189,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index f59921e2e95b22..68f9271ca7da50 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -13,7 +13,7 @@

            npm-disputes

            Handling Module

            SYNOPSIS

            1. Get the author email with npm owner ls <pkgname>
            2. -
            3. Email the author, CC support@npmjs.com
            4. +
            5. Email the author, CC support@npmjs.com
            6. After a few weeks, if there's no resolution, we'll sort it out.

            Don't squat on package names. Publish code or move out of the way.

            @@ -51,12 +51,12 @@

            DESCRIPTION

            owner (Bob).
          • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
          • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
          • @@ -112,5 +112,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html index 08c8eafce242a2..01caec95a6d610 100644 --- a/deps/npm/html/doc/misc/npm-faq.html +++ b/deps/npm/html/doc/misc/npm-faq.html @@ -11,7 +11,7 @@

            npm-faq

            Frequently Asked Questions

            Where can I find these docs in HTML?

            -

            https://www.npmjs.org/doc/, or run:

            +

            https://docs.npmjs.com/, or run:

            npm config set viewer browser
             

            to open these documents in your default web browser rather than man.

            It didn't work.

            @@ -62,7 +62,7 @@

            Should I check my Usually, no. Allow npm to resolve dependencies for your packages.

            For packages you deploy, such as websites and apps, you should use npm shrinkwrap to lock down your full dependency tree:

            -

            https://www.npmjs.org/doc/cli/npm-shrinkwrap.html

            +

            https://docs.npmjs.com/cli/shrinkwrap

            If you are paranoid about depending on the npm ecosystem, you should run a private npm mirror or a private cache.

            If you want 100% confidence in being able to reproduce the specific bytes @@ -108,7 +108,7 @@

            How do I update npm?

            installed already. (Consider, if there is ever a bug in the update command.)

            In those cases, you can do this:

            -
            curl https://www.npmjs.org/install.sh | sh
            +
            curl https://www.npmjs.com/install.sh | sh
             

            What is a package?

            A package is:

              @@ -230,28 +230,51 @@

              See npm-registry(7).

              I forgot my password, and can't publish. How do I reset it?

              -

              Go to https://npmjs.org/forgot.

              +

              Go to https://npmjs.com/forgot.

              I get ECONNREFUSED a lot. What's up?

              Either the registry is down, or node's DNS isn't able to reach out.

              To check if the registry is down, open up https://registry.npmjs.org/ in a web browser. This will also tell you if you are just unable to access the internet for some reason.

              -

              If the registry IS down, let us know by emailing support@npmjs.com +

              If the registry IS down, let us know by emailing support@npmjs.com or posting an issue at https://github.com/npm/npm/issues. If it's down for the world (and not just on your local network) then we're probably already being pinged about it.

              You can also often get a faster response by visiting the #npm channel on Freenode IRC.

              Why no namespaces?

              -

              Please see this discussion: https://github.com/npm/npm/issues/798

              -

              tl;dr - It doesn't actually make things better, and can make them worse.

              -

              If you want to namespace your own packages, you may: simply use the -- character to separate the names. npm is a mostly anarchic system. -There is not sufficient need to impose namespace rules on everyone.

              +

              npm has only one global namespace. If you want to namespace your own packages, +you may: simply use the - character to separate the names. npm is a mostly +anarchic system. There is not sufficient need to impose namespace rules on +everyone.

              +

              As of 2.0, npm supports scoped packages, which allow you to publish a group of +related modules without worrying about name collisions.

              +

              Every npm user owns the scope associated with their username. For example, the +user named npm owns the scope @npm. Scoped packages are published inside a +scope by naming them as if they were files under the scope directory, e.g., by +setting name in package.json to @npm/npm.

              +

              Scoped packages can coexist with public npm packages in a private npm registry. +At present (2014-11-04) scoped packages may NOT be published to the public npm +registry.

              +

              Unscoped packages can only depend on other unscoped packages. Scoped packages +can depend on packages from their own scope, a different scope, or the public +registry (unscoped).

              +

              For the current documentation of scoped packages, see +https://docs.npmjs.com/misc/scope

              +

              References:

              +
                +
              1. For the reasoning behind the "one global namespace", please see this +discussion: https://github.com/npm/npm/issues/798 (TL;DR: It doesn't +actually make things better, and can make them worse.)

                +
              2. +
              3. For the pre-implementation discussion of the scoped package feature, see +this discussion: https://github.com/npm/npm/issues/5239

                +
              4. +

              Who does npm?

              npm was originally written by Isaac Z. Schlueter, and many others have contributed to it, some of them quite substantially.

              -

              The npm open source project, The npm Registry, and the community +

              The npm open source project, The npm Registry, and the community website are maintained and operated by the good folks at npm, Inc.

              I have a question or request not addressed here. Where should I put it?

              @@ -284,5 +307,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 1ca7d7586284a8..4f6fd592282a26 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -11,11 +11,11 @@

              npm-index

              Index of all npm documentation

              README

              -

              node package manager

              +

              a JavaScript package manager

              Command Line Documentation

              Using npm on the command line

              npm(1)

              -

              node package manager

              +

              javascript package manager

              npm-adduser(1)

              Add a registry user account

              npm-bin(1)

              @@ -71,7 +71,7 @@

              npm-repo(1)

              Open package repository page in the browser

              npm-restart(1)

              -

              Start a package

              +

              Restart a package

              npm-rm(1)

              Remove a package

              npm-root(1)

              @@ -109,7 +109,7 @@

              API Documentation

              Using npm in your Node programs

              npm(3)

              -

              node package manager

              +

              javascript package manager

              npm-bin(3)

              Display npm bin folder

              npm-bugs(3)

              @@ -157,7 +157,7 @@

              npm-repo(3)

              Open package repository page in the browser

              npm-restart(3)

              -

              Start a package

              +

              Restart a package

              npm-root(3)

              Display npm root

              npm-run-script(3)

              @@ -230,5 +230,5 @@

              s        - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index d746316f581413..4730dff2970b8d 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -49,7 +49,7 @@

              Do I

              No, but it's way easier. Basically, yes, you do, or you have to effectively implement the entire CouchDB API anyway.

              Is there a website or something to see package docs and such?

              -

              Yes, head over to https://npmjs.org/

              +

              Yes, head over to https://npmjs.com/

              SEE ALSO

              • npm-config(1)
              • @@ -70,5 +70,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index 9fed0bbf110fea..ffb364a06abcce 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -78,5 +78,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index b2a3dbd383d3a9..3210818e401a96 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -27,10 +27,6 @@

                DESCRIPTION

                Run BEFORE the package is uninstalled.
              • postuninstall: Run AFTER the package is uninstalled.
              • -
              • preupdate: -Run BEFORE the package is updated with the update command.
              • -
              • update, postupdate: -Run AFTER the package is updated with the update command.
              • pretest, test, posttest: Run by the npm test command.
              • prestop, stop, poststop: @@ -220,5 +216,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index 3028625d1bf0c1..aad4b522d4b458 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@

                SEE ALSO

                       - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index eeea8fbc40f68f..98de492fd77544 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -22,12 +22,12 @@

                Usage

            As a command-line utility:

            $ semver -h
             
            -Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]
            +Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
             Test if version(s) satisfy the supplied range(s), and sort them.
             
             Multiple versions or ranges may be supplied, unless increment
            -or decrement options are specified.  In that case, only a single
            -version may be used, and it is incremented by the specified level
            +option is specified.  In that case, only a single version may
            +be used, and it is incremented by the specified level
             
             Program exits successfully if any valid version satisfies
             all supplied ranges, and prints all satisfying versions.
            @@ -91,6 +91,20 @@ 

            Prerelease Tags

            the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the next set of prerelease versions.

            +

            Prerelease Identifiers

            +

            The method .inc takes an additional identifier string argument that +will append the value of the string as a prerelease identifier:

            +
            > semver.inc('1.2.3', 'pre', 'beta')
            +'1.2.4-beta.0'
            +
            +

            command-line example:

            +
            $ semver 1.2.3 -i prerelease --preid beta
            +1.2.4-beta.0
            +
            +

            Which then can be used to increment further:

            +
            $ semver 1.2.4-beta.0 -i prerelease
            +1.2.4-beta.1
            +

            Advanced Range Syntax

            Advanced range syntax desugars to primitive comparators in deterministic ways.

            @@ -145,7 +159,6 @@

            Tilde Ranges ~1.2.3 ~1.21.2.4-beta.2 would not, because it is a prerelease of a different [major, minor, patch] tuple.

          -

          Note: this is the same as the ~> operator in rubygems.

          Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

          Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. In other words, this allows patch and @@ -225,6 +238,9 @@

          Comparison

          v2 is greater. Sorts in ascending order if passed to Array.sort().
        • rcompare(v1, v2): The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort().
        • +
        • diff(v1, v2): Returns difference between two versions by the release type +(major, premajor, minor, preminor, patch, prepatch, or prerelease), +or null if the versions are the same.

        Ranges

          @@ -263,5 +279,5 @@

          Ranges

                 - + diff --git a/deps/npm/html/index.html b/deps/npm/html/index.html index bf0a3f0b62a1d8..06ca14ba4ac9b7 100644 --- a/deps/npm/html/index.html +++ b/deps/npm/html/index.html @@ -52,7 +52,7 @@ } - npm - Node Package Manager + npm - JavaScript Package Manager

          npm

          diff --git a/deps/npm/html/partial/doc/README.html b/deps/npm/html/partial/doc/README.html index 13ff98d2c3756d..182dbb18bd3e61 100644 --- a/deps/npm/html/partial/doc/README.html +++ b/deps/npm/html/partial/doc/README.html @@ -1,4 +1,4 @@ -

          npm

          node package manager

          +

          npm

          a JavaScript package manager

          Build Status

          SYNOPSIS

          This is just enough info to get you up and running.

          @@ -19,9 +19,9 @@

          Other Sorts of Unices

          paths, etc.) then read on.

          Fancy Install (Unix)

          There's a pretty robust install script at -https://www.npmjs.org/install.sh. You can download that and run it.

          +https://www.npmjs.com/install.sh. You can download that and run it.

          Here's an example using curl:

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

          Slightly Fancier

          You can set any npm configuration params with that script:

          npm_config_prefix=/some/path sh install.sh
          @@ -34,31 +34,16 @@ 

          Fancy Install (Unix)

          arbitrary config keys using the ./configure --key=val ..., and then run npm commands by doing node cli.js <cmd> <args>. (This is helpful for testing, or running stuff without actually installing npm itself.)

          -

          Fancy Windows Install

          -

          You can download a zip file from https://npmjs.org/dist/, and unpack it +

          Windows Install or Upgrade

          +

          You can download a zip file from https://github.com/npm/npm/releases, and unpack it in the same folder where node.exe lives.

          +

          The latest version in a zip file is 1.4.12. To upgrade to npm 2, follow the +Windows upgrade instructions in the npm Troubleshooting Guide:

          +

          https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

          If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly.

          Installing on Cygwin

          No.

          -

          Permissions when Using npm to Install Other Stuff

          -

          tl;dr

          -
            -
          • Use sudo for greater safety. Or don't, if you prefer not to.
          • -
          • npm will downgrade permissions if it's root before running any build -scripts that package authors specified.
          • -
          -

          More details...

          -

          As of version 0.3, it is recommended to run npm as root. -This allows npm to change the user identifier to the nobody user prior -to running any package build or test commands.

          -

          If you are not the root user, or if you are on a platform that does not -support uid switching, then npm will not attempt to change the userid.

          -

          If you would like to ensure that npm always runs scripts as the -"nobody" user, and have it fail if it cannot downgrade permissions, then -set the following configuration param:

          -
          npm config set unsafe-perm false
          -

          This will prevent running in unsafe mode, even as non-root users.

          Uninstalling

          So sad to see you go.

          sudo npm uninstall npm -g
          @@ -111,11 +96,11 @@ 

          Using npm Programmatically

          command line arguments using nopt. You may also want to check out npm help config to learn about all the options you can set there.

          More Docs

          -

          Check out the docs, -especially the faq.

          +

          Check out the docs, +especially the faq.

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

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

          +you should read this

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

          @@ -128,9 +113,9 @@ assertion expressed or implied as to the quality, fitness for a specific purpose, or lack of malice in any given npm package.

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

          +support@npmjs.com and explain the situation.

          Any data published to The npm Registry (including user account information) may be removed or modified at the sole discretion of the npm server administrators.

          @@ -149,8 +134,6 @@

          BUGS

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

          diff --git a/deps/npm/html/partial/doc/api/npm-ls.html b/deps/npm/html/partial/doc/api/npm-ls.html index 508003ca158d43..850955b836120b 100644 --- a/deps/npm/html/partial/doc/api/npm-ls.html +++ b/deps/npm/html/partial/doc/api/npm-ls.html @@ -38,6 +38,6 @@

          global

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

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

          diff --git a/deps/npm/html/partial/doc/api/npm-restart.html b/deps/npm/html/partial/doc/api/npm-restart.html index 35db404d78567d..f0de7504a5b925 100644 --- a/deps/npm/html/partial/doc/api/npm-restart.html +++ b/deps/npm/html/partial/doc/api/npm-restart.html @@ -1,13 +1,29 @@ -

          npm-restart

          Start a package

          +

          npm-restart

          Restart a package

          SYNOPSIS

          npm.commands.restart(packages, callback)
           

          DESCRIPTION

          -

          This runs a package's "restart" script, if one was provided. -Otherwise it runs package's "stop" script, if one was provided, and then -the "start" script.

          +

          This restarts a package (or multiple packages).

          +

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

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

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

          -

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

          +

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

          +

          NOTE

          +

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

          +

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

          SEE ALSO

          • npm-start(3)
          • diff --git a/deps/npm/html/partial/doc/api/npm-start.html b/deps/npm/html/partial/doc/api/npm-start.html index 2eae8ba0f5903e..98bd41f6b24d87 100644 --- a/deps/npm/html/partial/doc/api/npm-start.html +++ b/deps/npm/html/partial/doc/api/npm-start.html @@ -3,6 +3,6 @@

            SYNOPSIS

            npm.commands.start(packages, callback)
             

            DESCRIPTION

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

            -

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

            +

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

            diff --git a/deps/npm/html/partial/doc/api/npm-tag.html b/deps/npm/html/partial/doc/api/npm-tag.html index f288fc15cfd891..227c91b46ca328 100644 --- a/deps/npm/html/partial/doc/api/npm-tag.html +++ b/deps/npm/html/partial/doc/api/npm-tag.html @@ -10,7 +10,7 @@

            SYNOPSIS

            is the package name and version is the version number (much like installing a specific version).

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

            diff --git a/deps/npm/html/partial/doc/api/npm.html b/deps/npm/html/partial/doc/api/npm.html index dbd481b380a9eb..52e80b12badf53 100644 --- a/deps/npm/html/partial/doc/api/npm.html +++ b/deps/npm/html/partial/doc/api/npm.html @@ -1,4 +1,4 @@ -

            npm

            node package manager

            +

            npm

            javascript package manager

            SYNOPSIS

            var npm = require("npm")
             npm.load([configObject, ]function (er, npm) {
            @@ -12,7 +12,7 @@ 

            SYNOPSIS

            npm.commands.install(["package"], cb) })

            VERSION

            -

            2.1.6

            +

            2.2.0

            DESCRIPTION

            This is the API documentation for npm. To find documentation of the command line diff --git a/deps/npm/html/partial/doc/cli/npm-adduser.html b/deps/npm/html/partial/doc/cli/npm-adduser.html index ac9fa0086ca7d2..ce2c5dcce6f36b 100644 --- a/deps/npm/html/partial/doc/cli/npm-adduser.html +++ b/deps/npm/html/partial/doc/cli/npm-adduser.html @@ -6,11 +6,12 @@

            SYNOPSIS

            save the credentials to the .npmrc file. If no registry is specified, the default registry will be used (see npm-config(7)).

            The username, password, and email are read in from prompts.

            -

            You may use this command to change your email address, but not username -or password.

            -

            To reset your password, go to https://www.npmjs.org/forgot

            +

            To reset your password, go to https://www.npmjs.com/forgot

            +

            To change your email address, go to https://www.npmjs.com/email-edit

            You may use this command multiple times with the same user account to -authorize on a new machine.

            +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record.

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

            CONFIGURATION

            registry

            @@ -33,7 +34,7 @@

            always-auth

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

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

            SEE ALSO

              diff --git a/deps/npm/html/partial/doc/cli/npm-link.html b/deps/npm/html/partial/doc/cli/npm-link.html index 3c832399ddbb28..c4b01c2a65e451 100644 --- a/deps/npm/html/partial/doc/cli/npm-link.html +++ b/deps/npm/html/partial/doc/cli/npm-link.html @@ -13,7 +13,7 @@

              SYNOPSIS

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

              The package name can be optionally prefixed with a scope. See npm-scope(7). -The scope must by preceded by an @-symbol and followed by a slash.

              +The scope must be preceded by an @-symbol and followed by a slash.

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

              This is handy for installing your own stuff, so that you can work on it and diff --git a/deps/npm/html/partial/doc/cli/npm-ls.html b/deps/npm/html/partial/doc/cli/npm-ls.html index 199b6002b89446..bfbb8f8c509d0a 100644 --- a/deps/npm/html/partial/doc/cli/npm-ls.html +++ b/deps/npm/html/partial/doc/cli/npm-ls.html @@ -11,7 +11,7 @@

              SYNOPSIS

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

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

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

              diff --git a/deps/npm/html/partial/doc/cli/npm-restart.html b/deps/npm/html/partial/doc/cli/npm-restart.html index 267e570eca8ce6..2186473373c513 100644 --- a/deps/npm/html/partial/doc/cli/npm-restart.html +++ b/deps/npm/html/partial/doc/cli/npm-restart.html @@ -1,9 +1,26 @@ -

              npm-restart

              Start a package

              +

              npm-restart

              Restart a package

              SYNOPSIS

              npm restart [-- <args>]
               

              DESCRIPTION

              -

              This runs a package's "restart" script, if one was provided. Otherwise it runs -package's "stop" script, if one was provided, and then the "start" script.

              +

              This restarts a package.

              +

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

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

              NOTE

              +

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

              +

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

              SEE ALSO

              diff --git a/deps/npm/html/partial/doc/cli/npm-run-script.html b/deps/npm/html/partial/doc/cli/npm-run-script.html index b9a7cefce9fa1c..13ff259638e5aa 100644 --- a/deps/npm/html/partial/doc/cli/npm-run-script.html +++ b/deps/npm/html/partial/doc/cli/npm-run-script.html @@ -6,9 +6,12 @@

              SYNOPSIS

              This runs an arbitrary command from a package's "scripts" object. If no package name is provided, it will search for a package.json in the current folder and use its "scripts" object. If no "command" -is provided, it will list the available top level scripts.

              -

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

              +is provided, it will list the available top level scripts. The env command +can be used to list environment variables that will be available to the script +at runtime. If an "env" command is defined in your package it will have +precedence instead.

              +

              run[-script] is used by the test, start, restart, and stop commands, but can +be called directly, as well.

              As of npm@2.0.0, you can use custom arguments when executing scripts. The special option -- is used by getopt to delimit the end of the options. npm will pass diff --git a/deps/npm/html/partial/doc/cli/npm-tag.html b/deps/npm/html/partial/doc/cli/npm-tag.html index 61b1c76e65c6ae..3d0ff718614696 100644 --- a/deps/npm/html/partial/doc/cli/npm-tag.html +++ b/deps/npm/html/partial/doc/cli/npm-tag.html @@ -11,6 +11,22 @@

              SYNOPSIS

              npm install --tag <tag>
               

              This also applies to npm dedupe.

              Publishing a package always sets the "latest" tag to the published version.

              +

              PURPOSE

              +

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

              +

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

              +

              CAVEATS

              +

              Tags must share a namespace with version numbers, because they are +specified in the same slot: npm install <pkg>@<version> vs npm +install <pkg>@<tag>.

              +

              Tags that can be interpreted as valid semver ranges will be +rejected. For example, v1.4 cannot be used as a tag, because it is +interpreted by semver as >=1.4.0 <1.5.0. See +https://github.com/npm/npm/issues/6082.

              +

              The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter v.

              SEE ALSO

              diff --git a/deps/npm/html/partial/doc/cli/npm-update.html b/deps/npm/html/partial/doc/cli/npm-update.html index 3923be7faf948a..6e35abd45179da 100644 --- a/deps/npm/html/partial/doc/cli/npm-update.html +++ b/deps/npm/html/partial/doc/cli/npm-update.html @@ -4,7 +4,9 @@

              SYNOPSIS

              DESCRIPTION

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

              -

              It will also install missing packages.

              +

              It will also install missing packages. As with all commands that install +packages, the --dev flag will cause devDependencies to be processed +as well.

              If the -g flag is specified, this command will update globally installed packages.

              If no package name is specified, all packages in the specified location (global diff --git a/deps/npm/html/partial/doc/cli/npm-version.html b/deps/npm/html/partial/doc/cli/npm-version.html index 5217f019635445..0cc3a21ad42844 100644 --- a/deps/npm/html/partial/doc/cli/npm-version.html +++ b/deps/npm/html/partial/doc/cli/npm-version.html @@ -3,7 +3,7 @@

              SYNOPSIS

              npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
               

              DESCRIPTION

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

              +data back to package.json and, if present, npm-shrinkwrap.json.

              The newversion argument should be a valid semver string, or a valid second argument to semver.inc (one of "patch", "minor", "major", "prepatch", "preminor", "premajor", "prerelease"). In the second case, diff --git a/deps/npm/html/partial/doc/cli/npm.html b/deps/npm/html/partial/doc/cli/npm.html index 646fffcb378ff1..7f7892ec6267a4 100644 --- a/deps/npm/html/partial/doc/cli/npm.html +++ b/deps/npm/html/partial/doc/cli/npm.html @@ -1,8 +1,8 @@ -

              npm

              node package manager

              +

              npm

              javascript package manager

              SYNOPSIS

              npm <command> [args]
               

              VERSION

              -

              2.1.6

              +

              2.2.0

              DESCRIPTION

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

              CONTRIBUTIONS

              the issues list or ask on the mailing list.

              BUGS

              When you find issues, please report them:

              @@ -107,7 +107,7 @@

              BUGS

            • web: http://github.com/npm/npm/issues
            • email: -npm-@googlegroups.com
            • +npm-@googlegroups.com

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

            @@ -117,7 +117,7 @@

            AUTHOR

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

            +i@izs.me

            SEE ALSO

            • npm-help(1)
            • diff --git a/deps/npm/html/partial/doc/files/npm-json.html b/deps/npm/html/partial/doc/files/npm-json.html index df3bea83742d76..31e4979b87c846 100644 --- a/deps/npm/html/partial/doc/files/npm-json.html +++ b/deps/npm/html/partial/doc/files/npm-json.html @@ -21,7 +21,7 @@

              name

            • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
            • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. http://registry.npmjs.org/
            • +already, before you get too attached to it. https://www.npmjs.com/

            A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See npm-scope(7) for more detail.

            @@ -170,7 +170,7 @@

            directories.example

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

            repository

            Specify the place where your code lives. This is helpful for people who -want to contribute. If the git repo is on github, then the npm docs +want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.

            Do it like this:

            "repository" :
            @@ -258,12 +258,15 @@ 

            Git URLs as Dependencies

            The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

            GitHub URLs

            -

            As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example:

            +

            As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

            {
               "name": "foo",
               "version": "0.0.0",
               "dependencies": {
            -    "express": "visionmedia/express"
            +    "express": "visionmedia/express",
            +    "mocha": "visionmedia/mocha#4727d357ea"
               }
             }
             

            Local Paths

            @@ -317,7 +320,7 @@

            devDependencies

            peerDependencies

            In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a require of this host. -This is usually refered to as a plugin. Notably, your module may be exposing +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

            For example:

            {
            diff --git a/deps/npm/html/partial/doc/files/npmrc.html b/deps/npm/html/partial/doc/files/npmrc.html
            index ac386ca85e2e23..988920a4896283 100644
            --- a/deps/npm/html/partial/doc/files/npmrc.html
            +++ b/deps/npm/html/partial/doc/files/npmrc.html
            @@ -20,7 +20,11 @@ 

            FILES

            Each of these files is loaded, and config options are resolved in priority order. For example, a setting in the userconfig file would override the setting in the globalconfig file.

            -

            Per-project config file

            +

            Array values are specified by adding "[]" after the key name. For +example:

            +
            key[] = "first value"
            +key[] = "second value"
            +

            Per-project config file

            When working locally in a project, a .npmrc file in the root of the project (ie, a sibling of node_modules and package.json) will set config values specific to this project.

            diff --git a/deps/npm/html/partial/doc/files/package.json.html b/deps/npm/html/partial/doc/files/package.json.html index df3bea83742d76..31e4979b87c846 100644 --- a/deps/npm/html/partial/doc/files/package.json.html +++ b/deps/npm/html/partial/doc/files/package.json.html @@ -21,7 +21,7 @@

            name

          • The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive.
          • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. http://registry.npmjs.org/
          • +already, before you get too attached to it. https://www.npmjs.com/

          A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See npm-scope(7) for more detail.

          @@ -170,7 +170,7 @@

          directories.example

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

          repository

          Specify the place where your code lives. This is helpful for people who -want to contribute. If the git repo is on github, then the npm docs +want to contribute. If the git repo is on GitHub, then the npm docs command will be able to find you.

          Do it like this:

          "repository" :
          @@ -258,12 +258,15 @@ 

          Git URLs as Dependencies

          The commit-ish can be any tag, sha, or branch which can be supplied as an argument to git checkout. The default is master.

          GitHub URLs

          -

          As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". For example:

          +

          As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

          {
             "name": "foo",
             "version": "0.0.0",
             "dependencies": {
          -    "express": "visionmedia/express"
          +    "express": "visionmedia/express",
          +    "mocha": "visionmedia/mocha#4727d357ea"
             }
           }
           

          Local Paths

          @@ -317,7 +320,7 @@

          devDependencies

          peerDependencies

          In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a require of this host. -This is usually refered to as a plugin. Notably, your module may be exposing +This is usually referred to as a plugin. Notably, your module may be exposing a specific interface, expected and specified by the host documentation.

          For example:

          {
          diff --git a/deps/npm/html/partial/doc/index.html b/deps/npm/html/partial/doc/index.html
          index f6678d937154d2..4fb98e1bd6d42c 100644
          --- a/deps/npm/html/partial/doc/index.html
          +++ b/deps/npm/html/partial/doc/index.html
          @@ -1,10 +1,10 @@
           

          npm-index

          Index of all npm documentation

          README

          -

          node package manager

          +

          a JavaScript package manager

          Command Line Documentation

          Using npm on the command line

          npm(1)

          -

          node package manager

          +

          javascript package manager

          npm-adduser(1)

          Add a registry user account

          npm-bin(1)

          @@ -60,7 +60,7 @@

          npm-rebuild(1)

          npm-repo(1)

          Open package repository page in the browser

          npm-restart(1)

          -

          Start a package

          +

          Restart a package

          npm-rm(1)

          Remove a package

          npm-root(1)

          @@ -98,7 +98,7 @@

          npm-whoami(1)

          API Documentation

          Using npm in your Node programs

          npm(3)

          -

          node package manager

          +

          javascript package manager

          npm-bin(3)

          Display npm bin folder

          npm-bugs(3)

          @@ -146,7 +146,7 @@

          npm-rebuild(3)

          npm-repo(3)

          Open package repository page in the browser

          npm-restart(3)

          -

          Start a package

          +

          Restart a package

          npm-root(3)

          Display npm root

          npm-run-script(3)

          diff --git a/deps/npm/html/partial/doc/misc/npm-coding-style.html b/deps/npm/html/partial/doc/misc/npm-coding-style.html index 732b326c997763..b50b95f27f7e45 100644 --- a/deps/npm/html/partial/doc/misc/npm-coding-style.html +++ b/deps/npm/html/partial/doc/misc/npm-coding-style.html @@ -5,14 +5,14 @@

          DESCRIPTION

          designed to reduce visual clutter and make bugs more apparent.

          If you want to contribute to npm (which is very encouraged), you should make your code conform to npm's style.

          -

          Note: this concerns npm's code not the specific packages at npmjs.org

          +

          Note: this concerns npm's code not the specific packages that you can download from the npm registry.

          Line Length

          Keep lines shorter than 80 characters. It's better for lines to be too short than to be too long. Break up long lists, objects, and other statements onto multiple lines.

          Indentation

          Two-spaces. Tabs are better, but they look like hell in web browsers -(and on github), and node uses 2 spaces, so that's that.

          +(and on GitHub), and node uses 2 spaces, so that's that.

          Configure your editor appropriately.

          Curly braces

          Curly braces belong on the same line as the thing that necessitates them.

          diff --git a/deps/npm/html/partial/doc/misc/npm-config.html b/deps/npm/html/partial/doc/misc/npm-config.html index 87409720b9fcfa..d9b9dfdbe0269a 100644 --- a/deps/npm/html/partial/doc/misc/npm-config.html +++ b/deps/npm/html/partial/doc/misc/npm-config.html @@ -107,13 +107,18 @@

          browser

          ca

          • Default: The npm CA certificate
          • -
          • Type: String or null
          • +
          • Type: String, Array or null

          The Certificate Authority signing certificate that is trusted for SSL -connections to the registry.

          -

          Set to null to only allow "known" registrars, or to a specific CA cert +connections to the registry. Values should be in PEM format with newlines +replaced by the string "\n". For example:

          +
          ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
          +

          Set to null to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority.

          -

          See also the strict-ssl config.

          +

          Multiple CAs can be trusted by specifying an array of certificates:

          +
          ca[]="..."
          +ca[]="..."
          +

          See also the strict-ssl config.

          cafile

          • Default: null
          • @@ -302,11 +307,12 @@

            heading

            The string that starts all the debugging log output.

            https-proxy

              -
            • Default: the HTTPS_PROXY or https_proxy or HTTP_PROXY or -http_proxy environment variables.
            • +
            • Default: null
            • Type: url
            -

            A proxy to use for outgoing https requests.

            +

            A proxy to use for outgoing https requests. If the HTTPS_PROXY or +https_proxy or HTTP_PROXY or http_proxy environment variables are set, +proxy settings will be honored by the underlying request library.

            ignore-scripts

            • Default: false
            • @@ -489,10 +495,12 @@

              proprietary-attribs

              this as true.

              proxy

                -
              • Default: HTTP_PROXY or http_proxy environment variable, or null
              • +
              • Default: null
              • Type: url
              -

              A proxy to use for outgoing http requests.

              +

              A proxy to use for outgoing http requests. If the HTTP_PROXY or +http_proxy environment variables are set, proxy settings will be +honored by the underlying request library.

              rebuild-bundle

              • Default: true
              • diff --git a/deps/npm/html/partial/doc/misc/npm-developers.html b/deps/npm/html/partial/doc/misc/npm-developers.html index 7ba880a44bc0a9..10d0cd89198a3f 100644 --- a/deps/npm/html/partial/doc/misc/npm-developers.html +++ b/deps/npm/html/partial/doc/misc/npm-developers.html @@ -83,6 +83,14 @@

                Keeping files out of your pa ignore the stuff matched by the .gitignore file. If you want to include something that is excluded by your .gitignore file, you can create an empty .npmignore file to override it.

                +

                .npmignore files follow the same pattern rules +as .gitignore files:

                +
                  +
                • Blank lines or lines starting with # are ignored.
                • +
                • Standard glob patterns work.
                • +
                • You can end patterns with a forward slash / to specify a directory.
                • +
                • You can negate a pattern by starting it with an exclamation point !.
                • +

                By default, the following paths and files are ignored, so there's no need to add them to .npmignore explicitly:

                  diff --git a/deps/npm/html/partial/doc/misc/npm-disputes.html b/deps/npm/html/partial/doc/misc/npm-disputes.html index 6a7abca71227d8..1cc7ca38aee22b 100644 --- a/deps/npm/html/partial/doc/misc/npm-disputes.html +++ b/deps/npm/html/partial/doc/misc/npm-disputes.html @@ -2,7 +2,7 @@

                  npm-disputes

                  Handling Module

                  SYNOPSIS

                  1. Get the author email with npm owner ls <pkgname>
                  2. -
                  3. Email the author, CC support@npmjs.com
                  4. +
                  5. Email the author, CC support@npmjs.com
                  6. After a few weeks, if there's no resolution, we'll sort it out.

                  Don't squat on package names. Publish code or move out of the way.

                  @@ -40,12 +40,12 @@

                  DESCRIPTION

                  owner (Bob).
                • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
                • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
                • diff --git a/deps/npm/html/partial/doc/misc/npm-faq.html b/deps/npm/html/partial/doc/misc/npm-faq.html index 7fc16344f79604..5b935102cdfbac 100644 --- a/deps/npm/html/partial/doc/misc/npm-faq.html +++ b/deps/npm/html/partial/doc/misc/npm-faq.html @@ -1,6 +1,6 @@

                  npm-faq

                  Frequently Asked Questions

                  Where can I find these docs in HTML?

                  -

                  https://www.npmjs.org/doc/, or run:

                  +

                  https://docs.npmjs.com/, or run:

                  npm config set viewer browser
                   

                  to open these documents in your default web browser rather than man.

                  It didn't work.

                  @@ -51,7 +51,7 @@

                  Should I check my Usually, no. Allow npm to resolve dependencies for your packages.

                  For packages you deploy, such as websites and apps, you should use npm shrinkwrap to lock down your full dependency tree:

                  -

                  https://www.npmjs.org/doc/cli/npm-shrinkwrap.html

                  +

                  https://docs.npmjs.com/cli/shrinkwrap

                  If you are paranoid about depending on the npm ecosystem, you should run a private npm mirror or a private cache.

                  If you want 100% confidence in being able to reproduce the specific bytes @@ -97,7 +97,7 @@

                  How do I update npm?

                  installed already. (Consider, if there is ever a bug in the update command.)

                  In those cases, you can do this:

                  -
                  curl https://www.npmjs.org/install.sh | sh
                  +
                  curl https://www.npmjs.com/install.sh | sh
                   

                  What is a package?

                  A package is:

                    @@ -219,28 +219,51 @@

                    See npm-registry(7).

                    I forgot my password, and can't publish. How do I reset it?

                    -

                    Go to https://npmjs.org/forgot.

                    +

                    Go to https://npmjs.com/forgot.

                    I get ECONNREFUSED a lot. What's up?

                    Either the registry is down, or node's DNS isn't able to reach out.

                    To check if the registry is down, open up https://registry.npmjs.org/ in a web browser. This will also tell you if you are just unable to access the internet for some reason.

                    -

                    If the registry IS down, let us know by emailing support@npmjs.com +

                    If the registry IS down, let us know by emailing support@npmjs.com or posting an issue at https://github.com/npm/npm/issues. If it's down for the world (and not just on your local network) then we're probably already being pinged about it.

                    You can also often get a faster response by visiting the #npm channel on Freenode IRC.

                    Why no namespaces?

                    -

                    Please see this discussion: https://github.com/npm/npm/issues/798

                    -

                    tl;dr - It doesn't actually make things better, and can make them worse.

                    -

                    If you want to namespace your own packages, you may: simply use the -- character to separate the names. npm is a mostly anarchic system. -There is not sufficient need to impose namespace rules on everyone.

                    +

                    npm has only one global namespace. If you want to namespace your own packages, +you may: simply use the - character to separate the names. npm is a mostly +anarchic system. There is not sufficient need to impose namespace rules on +everyone.

                    +

                    As of 2.0, npm supports scoped packages, which allow you to publish a group of +related modules without worrying about name collisions.

                    +

                    Every npm user owns the scope associated with their username. For example, the +user named npm owns the scope @npm. Scoped packages are published inside a +scope by naming them as if they were files under the scope directory, e.g., by +setting name in package.json to @npm/npm.

                    +

                    Scoped packages can coexist with public npm packages in a private npm registry. +At present (2014-11-04) scoped packages may NOT be published to the public npm +registry.

                    +

                    Unscoped packages can only depend on other unscoped packages. Scoped packages +can depend on packages from their own scope, a different scope, or the public +registry (unscoped).

                    +

                    For the current documentation of scoped packages, see +https://docs.npmjs.com/misc/scope

                    +

                    References:

                    +
                      +
                    1. For the reasoning behind the "one global namespace", please see this +discussion: https://github.com/npm/npm/issues/798 (TL;DR: It doesn't +actually make things better, and can make them worse.)

                      +
                    2. +
                    3. For the pre-implementation discussion of the scoped package feature, see +this discussion: https://github.com/npm/npm/issues/5239

                      +
                    4. +

                    Who does npm?

                    npm was originally written by Isaac Z. Schlueter, and many others have contributed to it, some of them quite substantially.

                    -

                    The npm open source project, The npm Registry, and the community +

                    The npm open source project, The npm Registry, and the community website are maintained and operated by the good folks at npm, Inc.

                    I have a question or request not addressed here. Where should I put it?

                    diff --git a/deps/npm/html/partial/doc/misc/npm-index.html b/deps/npm/html/partial/doc/misc/npm-index.html index 6e4c0ca80046fb..eab0753c9e62da 100644 --- a/deps/npm/html/partial/doc/misc/npm-index.html +++ b/deps/npm/html/partial/doc/misc/npm-index.html @@ -1,10 +1,10 @@

                    npm-index

                    Index of all npm documentation

                    README

                    -

                    node package manager

                    +

                    a JavaScript package manager

                    Command Line Documentation

                    Using npm on the command line

                    npm(1)

                    -

                    node package manager

                    +

                    javascript package manager

                    npm-adduser(1)

                    Add a registry user account

                    npm-bin(1)

                    @@ -60,7 +60,7 @@

                    npm-rebuild(1)

                    npm-repo(1)

                  Open package repository page in the browser

                  npm-restart(1)

                  -

                  Start a package

                  +

                  Restart a package

                  npm-rm(1)

                  Remove a package

                  npm-root(1)

                  @@ -98,7 +98,7 @@

                  npm-whoami(1)

                  API Documentation

                  Using npm in your Node programs

                  npm(3)

                  -

                  node package manager

                  +

                  javascript package manager

                  npm-bin(3)

                  Display npm bin folder

                  npm-bugs(3)

                  @@ -146,7 +146,7 @@

                  npm-rebuild(3)

                  npm-repo(3)

                Open package repository page in the browser

                npm-restart(3)

                -

                Start a package

                +

                Restart a package

                npm-root(3)

                Display npm root

                npm-run-script(3)

                diff --git a/deps/npm/html/partial/doc/misc/npm-registry.html b/deps/npm/html/partial/doc/misc/npm-registry.html index 0031f61b10c984..2a7c16014586b6 100644 --- a/deps/npm/html/partial/doc/misc/npm-registry.html +++ b/deps/npm/html/partial/doc/misc/npm-registry.html @@ -38,7 +38,7 @@

                Do I

                No, but it's way easier. Basically, yes, you do, or you have to effectively implement the entire CouchDB API anyway.

                Is there a website or something to see package docs and such?

                -

                Yes, head over to https://npmjs.org/

                +

                Yes, head over to https://npmjs.com/

                SEE ALSO

                • npm-config(1)
                • diff --git a/deps/npm/html/partial/doc/misc/npm-scripts.html b/deps/npm/html/partial/doc/misc/npm-scripts.html index 08bcbd54a5b096..1e68be479be707 100644 --- a/deps/npm/html/partial/doc/misc/npm-scripts.html +++ b/deps/npm/html/partial/doc/misc/npm-scripts.html @@ -16,10 +16,6 @@

                  DESCRIPTION

                  Run BEFORE the package is uninstalled.
                • postuninstall: Run AFTER the package is uninstalled.
                • -
                • preupdate: -Run BEFORE the package is updated with the update command.
                • -
                • update, postupdate: -Run AFTER the package is updated with the update command.
                • pretest, test, posttest: Run by the npm test command.
                • prestop, stop, poststop: diff --git a/deps/npm/html/partial/doc/misc/semver.html b/deps/npm/html/partial/doc/misc/semver.html index 691a277dc78442..b078197e8063b9 100644 --- a/deps/npm/html/partial/doc/misc/semver.html +++ b/deps/npm/html/partial/doc/misc/semver.html @@ -11,12 +11,12 @@

                  Usage

          As a command-line utility:

          $ semver -h
           
          -Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]
          +Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
           Test if version(s) satisfy the supplied range(s), and sort them.
           
           Multiple versions or ranges may be supplied, unless increment
          -or decrement options are specified.  In that case, only a single
          -version may be used, and it is incremented by the specified level
          +option is specified.  In that case, only a single version may
          +be used, and it is incremented by the specified level
           
           Program exits successfully if any valid version satisfies
           all supplied ranges, and prints all satisfying versions.
          @@ -80,6 +80,20 @@ 

          Prerelease Tags

          the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the next set of prerelease versions.

          +

          Prerelease Identifiers

          +

          The method .inc takes an additional identifier string argument that +will append the value of the string as a prerelease identifier:

          +
          > semver.inc('1.2.3', 'pre', 'beta')
          +'1.2.4-beta.0'
          +
          +

          command-line example:

          +
          $ semver 1.2.3 -i prerelease --preid beta
          +1.2.4-beta.0
          +
          +

          Which then can be used to increment further:

          +
          $ semver 1.2.4-beta.0 -i prerelease
          +1.2.4-beta.1
          +

          Advanced Range Syntax

          Advanced range syntax desugars to primitive comparators in deterministic ways.

          @@ -134,7 +148,6 @@

          Tilde Ranges ~1.2.3 ~1.21.2.4-beta.2 would not, because it is a prerelease of a different [major, minor, patch] tuple.

        -

        Note: this is the same as the ~> operator in rubygems.

        Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

        Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple. In other words, this allows patch and @@ -214,6 +227,9 @@

        Comparison

        v2 is greater. Sorts in ascending order if passed to Array.sort().
      • rcompare(v1, v2): The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort().
      • +
      • diff(v1, v2): Returns difference between two versions by the release type +(major, premajor, minor, preminor, patch, prepatch, or prerelease), +or null if the versions are the same.

      Ranges

        diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 9693aebd389bf0..6c8a652bea36c4 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -3,7 +3,6 @@ module.exports = adduser var log = require("npmlog") , npm = require("./npm.js") - , registry = npm.registry , read = require("read") , userValidate = require("npm-user-validate") , crypto @@ -125,13 +124,6 @@ function readEmail (c, u, cb) { } function save (c, u, cb) { - if (c.changed) { - delete registry.auth - delete registry.username - delete registry.password - registry.username = u.u - registry.password = u.p - } npm.spinner.start() // save existing configs, but yank off for this PUT @@ -146,14 +138,17 @@ function save (c, u, cb) { if (scopedRegistry) uri = scopedRegistry } - registry.adduser(uri, u.u, u.p, u.e, function (er, doc) { + var params = { + auth : { + username : u.u, + password : u.p, + email : u.e + } + } + npm.registry.adduser(uri, params, function (er, doc) { npm.spinner.stop() if (er) return cb(er) - registry.username = u.u - registry.password = u.p - registry.email = u.e - // don't want this polluting the configuration npm.config.del("_token", "user") diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 16744cd5c84e31..fabbbaf10e5065 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -4,7 +4,6 @@ module.exports = bugs bugs.usage = "npm bugs " var npm = require("./npm.js") - , registry = npm.registry , log = require("npmlog") , opener = require("opener") , path = require("path") @@ -15,20 +14,22 @@ var npm = require("./npm.js") bugs.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - mapToRegistry("-/short", npm.config, function (er, uri) { + mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, { timeout : 60000 }, function (er, list) { + npm.registry.get(uri, { timeout : 60000, auth : auth }, function (er, list) { return cb(null, list || []) }) }) } function bugs (args, cb) { - var n = args.length && npa(args[0]).name || '.' + var n = args.length && npa(args[0]).name || "." fs.stat(n, function (er, s) { - if (er && er.code === "ENOENT") return callRegistry(n, cb) - else if (er) return cb (er) + if (er) { + if (er.code === "ENOENT") return callRegistry(n, cb) + return cb(er) + } if (!s.isDirectory()) return callRegistry(n, cb) readJson(path.resolve(n, "package.json"), function(er, d) { if (er) return cb(er) @@ -38,35 +39,36 @@ function bugs (args, cb) { } function getUrlAndOpen (d, cb) { - var bugs = d.bugs - , repo = d.repository || d.repositories + var repo = d.repository || d.repositories , url - if (bugs) { - url = (typeof url === "string") ? bugs : bugs.url - } else if (repo) { + if (d.bugs) { + url = (typeof d.bugs === "string") ? d.bugs : d.bugs.url + } + else if (repo) { if (Array.isArray(repo)) repo = repo.shift() if (repo.hasOwnProperty("url")) repo = repo.url - log.verbose("repository", repo) - if (bugs && bugs.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { - url = bugs.replace(/^git(@|:\/\/)/, "https://") + log.verbose("bugs", "repository", repo) + if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { + url = repo.replace(/^git(@|:\/\/)/, "https://") .replace(/^https?:\/\/github.com:/, "https://github.com/") - .replace(/\.git$/, '')+"/issues" + .replace(/\.git$/, "")+"/issues" } } if (!url) { - url = "https://npmjs.org/package/" + d.name + url = "https://www.npmjs.org/package/" + d.name } + log.silly("bugs", "url", url) opener(url, { command: npm.config.get("browser") }, cb) } -function callRegistry (n, cb) { - mapToRegistry(n, npm.config, function (er, uri) { +function callRegistry (name, cb) { + mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + npm.registry.get(uri + "/latest", { auth : auth }, function (er, d) { if (er) return cb(er) - getUrlAndOpen (d, cb) + getUrlAndOpen(d, cb) }) }) } diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 2e01ef6eeaa432..7477ba45791f52 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -43,7 +43,7 @@ function build (args, global, didPre, didRB, cb) { function build_ (global, didPre, didRB) { return function (folder, cb) { folder = path.resolve(folder) - if (build._didBuild[folder]) log.error("build", "already built", folder) + if (build._didBuild[folder]) log.info("build", "already built", folder) build._didBuild[folder] = true log.info("build", folder) readJson(path.resolve(folder, "package.json"), function (er, pkg) { @@ -212,6 +212,7 @@ function linkMans (pkg, folder, parent, gtop, cb) { if (!pkg.man || !gtop || process.platform === "win32") return cb() var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") + log.verbose("linkMans", "man files are", pkg.man, "in", manRoot) // make sure that the mans are unique. // otherwise, if there are dupes, it'll fail with EEXIST @@ -225,11 +226,20 @@ function linkMans (pkg, folder, parent, gtop, cb) { asyncMap(pkg.man, function (man, cb) { if (typeof man !== "string") return cb() + log.silly("linkMans", "preparing to link", man) var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - , stem = parseMan[1] - , sxn = parseMan[2] - , bn = path.basename(stem) - , manDest = path.join(manRoot, "man" + sxn, bn) + if (!parseMan) { + return cb(new Error( + man+" is not a valid name for a man file. " + + "Man files must end with a number, " + + "and optionally a .gz suffix if they are compressed." + )) + } + + var stem = parseMan[1] + var sxn = parseMan[2] + var bn = path.basename(stem) + var manDest = path.join(manRoot, "man" + sxn, bn) linkIfExists(man, manDest, gtop && folder, cb) }, cb) diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index e1afb0d1578713..357063551d4987 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -82,6 +82,7 @@ var npm = require("./npm.js") , npa = require("npm-package-arg") , getStat = require("./cache/get-stat.js") , cachedPackageRoot = require("./cache/cached-package-root.js") + , mapToRegistry = require("./utils/map-to-registry.js") cache.usage = "npm cache add " + "\nnpm cache add " @@ -172,6 +173,7 @@ function normalize (args) { if (normalized.substr(-1) === "/") { normalized = normalized.substr(0, normalized.length - 1) } + normalized = path.normalize(normalized) log.silly("ls", "normalized", normalized) return normalized @@ -202,7 +204,7 @@ function clean (args, cb) { if (!args) args = [] - var f = path.join(npm.cache, path.normalize(normalize(args))) + var f = path.join(npm.cache, normalize(args)) if (f === npm.cache) { fs.readdir(npm.cache, function (er, files) { if (er) return cb() @@ -213,7 +215,10 @@ function clean (args, cb) { }) , rm, cb ) }) - } else rm(path.join(npm.cache, path.normalize(normalize(args))), cb) + } + else { + rm(f, cb) + } } // npm cache add @@ -285,7 +290,12 @@ function add (args, where, cb) { addLocal(p, null, cb) break case "remote": - addRemoteTarball(p.spec, {name : p.name}, null, cb) + // get auth, if possible + mapToRegistry(spec, npm.config, function (err, uri, auth) { + if (err) return cb(err) + + addRemoteTarball(p.spec, {name : p.name}, null, auth, cb) + }) break case "git": addRemoteGit(p.spec, false, cb) diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index b425d7f911847d..e7d286e4fb5d40 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -12,6 +12,7 @@ var assert = require("assert") , cachedPackageRoot = require("./cached-package-root.js") , addLocalTarball = require("./add-local-tarball.js") , sha = require("sha") + , inflight = require("inflight") module.exports = addLocal @@ -28,6 +29,8 @@ function addLocal (p, pkgData, cb_) { } if (data && !data._fromGithub) { data._from = path.relative(npm.prefix, p.spec) || "." + var resolved = path.relative(npm.prefix, p.spec) + if (resolved) data._resolved = "file:"+resolved } return cb_(er, data) } @@ -79,20 +82,24 @@ function addLocalDirectory (p, pkgData, shasum, cb) { var root = cachedPackageRoot(data) var tgz = path.resolve(root, "package.tgz") var pj = path.resolve(root, "package/package.json") + + var wrapped = inflight(tgz, next) + if (!wrapped) return log.verbose("addLocalDirectory", tgz, "already in flight; waiting") + log.verbose("addLocalDirectory", tgz, "not in flight; packing") + getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { if (er) return cb(er) var fancy = !pathIsInside(p, npm.tmp) tar.pack(tgz, p, data, fancy, function (er) { if (er) { - log.error( "addLocalDirectory", "Could not pack %j to %j" - , p, tgz ) + log.error("addLocalDirectory", "Could not pack", p, "to", tgz) return cb(er) } - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) next() + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() - chownr(made || tgz, cs.uid, cs.gid, next) + chownr(made || tgz, cs.uid, cs.gid, wrapped) }) }) }) diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index 1bd7af1448684c..cb5a3fa8a66e5b 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -7,7 +7,6 @@ var path = require("path") , readJson = require("read-package-json") , url = require("url") , npm = require("../npm.js") - , registry = npm.registry , deprCheck = require("../utils/depr-check.js") , inflight = require("inflight") , addRemoteTarball = require("./add-remote-tarball.js") @@ -18,7 +17,7 @@ var path = require("path") module.exports = addNamed function getOnceFromRegistry (name, from, next, done) { - mapToRegistry(name, npm.config, function (er, uri) { + mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return done(er) var key = "registry:" + uri @@ -26,7 +25,7 @@ function getOnceFromRegistry (name, from, next, done) { if (!next) return log.verbose(from, key, "already in flight; waiting") else log.verbose(from, key, "not in flight; fetching") - registry.get(uri, null, next) + npm.registry.get(uri, { auth : auth }, next) }) } @@ -169,28 +168,28 @@ function addNameVersion (name, v, data, cb) { }) function fetchit () { - if (!npm.config.get("registry")) { - return cb(new Error("Cannot fetch: "+dist.tarball)) - } - - // Use the same protocol as the registry. https registry --> https - // tarballs, but only if they're the same hostname, or else detached - // tarballs may not work. - var tb = url.parse(dist.tarball) - var rp = url.parse(npm.config.get("registry")) - if (tb.hostname === rp.hostname - && tb.protocol !== rp.protocol) { - tb.protocol = url.parse(npm.config.get("registry")).protocol - delete tb.href - } - tb = url.format(tb) - - // Only add non-shasum'ed packages if --forced. Only ancient things - // would lack this for good reasons nowadays. - if (!dist.shasum && !npm.config.get("force")) { - return cb(new Error("package lacks shasum: " + data._id)) - } - return addRemoteTarball(tb, data, dist.shasum, cb) + mapToRegistry(name, npm.config, function (er, _, auth, ruri) { + if (er) return cb(er) + + // Use the same protocol as the registry. https registry --> https + // tarballs, but only if they're the same hostname, or else detached + // tarballs may not work. + var tb = url.parse(dist.tarball) + var rp = url.parse(ruri) + if (tb.hostname === rp.hostname && tb.protocol !== rp.protocol) { + tb.protocol = rp.protocol + delete tb.href + } + tb = url.format(tb) + + // Only add non-shasum'ed packages if --forced. Only ancient things + // would lack this for good reasons nowadays. + if (!dist.shasum && !npm.config.get("force")) { + return cb(new Error("package lacks shasum: " + data._id)) + } + + addRemoteTarball(tb, data, dist.shasum, auth, cb) + }) } } } diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index d8f3f1cd88f924..1ad925eec35fae 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -1,21 +1,29 @@ var mkdir = require("mkdirp") , assert = require("assert") , git = require("../utils/git.js") - , once = require("once") , fs = require("graceful-fs") , log = require("npmlog") , path = require("path") , url = require("url") , chownr = require("chownr") - , zlib = require("zlib") , crypto = require("crypto") , npm = require("../npm.js") , rm = require("../utils/gently-rm.js") , inflight = require("inflight") , getCacheStat = require("./get-stat.js") - , addLocalTarball = require("./add-local-tarball.js") - , writeStream = require("fs-write-stream-atomic") + , addLocal = require("./add-local.js") + , realizePackageSpecifier = require("realize-package-specifier") + , normalizeGitUrl = require("normalize-git-url") +var remotes = path.resolve(npm.config.get("cache"), "_git-remotes") +var templates = path.join(remotes, "_templates") + +var VALID_VARIABLES = [ + "GIT_SSH", + "GIT_SSL_NO_VERIFY", + "GIT_PROXY_COMMAND", + "GIT_SSL_CAINFO" +] // 1. cacheDir = path.join(cache,'_git-remotes',sha1(u)) // 2. checkGitDir(cacheDir) ? 4. : 3. (rm cacheDir if necessary) @@ -29,41 +37,21 @@ module.exports = function addRemoteGit (u, silent, cb) { assert(typeof cb === "function", "must have callback") log.verbose("addRemoteGit", "u=%j silent=%j", u, silent) - var parsed = url.parse(u, true) - log.silly("addRemoteGit", "parsed", parsed) - - // git is so tricky! - // if the path is like ssh://foo:22/some/path then it works, but - // it needs the ssh:// - // If the path is like ssh://foo:some/path then it works, but - // only if you remove the ssh:// - var origUrl = u - u = u.replace(/^git\+/, "") - .replace(/#.*$/, "") - - // ssh paths that are scp-style urls don't need the ssh:// - if (parsed.pathname.match(/^\/?:/)) { - u = u.replace(/^ssh:\/\//, "") - } - - cb = inflight(u, cb) - if (!cb) return log.verbose("addRemoteGit", u, "already in flight; waiting") - log.verbose("addRemoteGit", u, "not in flight; cloning") - - // figure out what we should check out. - var co = parsed.hash && parsed.hash.substr(1) || "master" - - var v = crypto.createHash("sha1").update(u).digest("hex").slice(0, 8) - v = u.replace(/[^a-zA-Z0-9]+/g, "-")+"-"+v + var normalized = normalizeGitUrl(u) + log.silly("addRemoteGit", "normalized", normalized) - log.verbose("addRemoteGit", [u, co]) + var v = crypto.createHash("sha1").update(normalized.url).digest("hex").slice(0, 8) + v = normalized.url.replace(/[^a-zA-Z0-9]+/g, "-")+"-"+v + log.silly("addRemoteGit", "v", v) - var p = path.join(npm.config.get("cache"), "_git-remotes", v) + var p = path.join(remotes, v) + cb = inflight(p, cb) + if (!cb) return log.verbose("addRemoteGit", p, "already in flight; waiting") + log.verbose("addRemoteGit", p, "not in flight; cloning") - // we don't need global templates when cloning. use this empty dir to specify as template dir - mkdir(path.join(npm.config.get("cache"), "_git-remotes", "_templates"), function (er) { + getGitDir(function (er) { if (er) return cb(er) - checkGitDir(p, u, co, origUrl, silent, function (er, data) { + checkGitDir(p, normalized.url, normalized.branch, u, silent, function (er, data) { if (er) return cb(er, data) addModeRecursive(p, npm.modes.file, function (er) { @@ -73,31 +61,53 @@ module.exports = function addRemoteGit (u, silent, cb) { }) } +function getGitDir (cb) { + getCacheStat(function (er, st) { + if (er) return cb(er) + + // We don't need global templates when cloning. Use an empty directory for + // the templates, creating it (and setting its permissions) if necessary. + mkdir(templates, function (er) { + if (er) return cb(er) + + // Ensure that both the template and remotes directories have the correct + // permissions. + fs.chown(templates, st.uid, st.gid, function (er) { + if (er) return cb(er) + + fs.chown(remotes, st.uid, st.gid, function (er) { + cb(er, st) + }) + }) + }) + }) +} + function checkGitDir (p, u, co, origUrl, silent, cb) { fs.stat(p, function (er, s) { if (er) return cloneGitRemote(p, u, co, origUrl, silent, cb) - if (!s.isDirectory()) return rm(p, function (er){ + if (!s.isDirectory()) return rm(p, function (er) { if (er) return cb(er) cloneGitRemote(p, u, co, origUrl, silent, cb) }) - var args = [ "config", "--get", "remote.origin.url" ] - var env = gitEnv() - - // check for git - git.whichAndExec(args, {cwd: p, env: env}, function (er, stdout, stderr) { - var stdoutTrimmed = (stdout + "\n" + stderr).trim() - if (er || u !== stdout.trim()) { - log.warn( "`git config --get remote.origin.url` returned " - + "wrong result ("+u+")", stdoutTrimmed ) - return rm(p, function (er){ - if (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) + git.whichAndExec( + [ "config", "--get", "remote.origin.url" ], + { cwd : p, env : gitEnv }, + function (er, stdout, stderr) { + var stdoutTrimmed = (stdout + "\n" + stderr).trim() + if (er || u !== stdout.trim()) { + log.warn( "`git config --get remote.origin.url` returned " + + "wrong result ("+u+")", stdoutTrimmed ) + return rm(p, function (er){ + if (er) return cb(er) + cloneGitRemote(p, u, co, origUrl, silent, cb) + }) + } + log.verbose("git remote.origin.url", stdoutTrimmed) + fetchRemote(p, u, co, origUrl, cb) } - log.verbose("git remote.origin.url", stdoutTrimmed) - archiveGitRemote(p, u, co, origUrl, cb) - }) + ) }) } @@ -105,66 +115,68 @@ function cloneGitRemote (p, u, co, origUrl, silent, cb) { mkdir(p, function (er) { if (er) return cb(er) - var args = [ "clone", "--template=" + path.join(npm.config.get("cache"), - "_git_remotes", "_templates"), "--mirror", u, p ] - var env = gitEnv() - - // check for git - git.whichAndExec(args, {cwd: p, env: env}, function (er, stdout, stderr) { - stdout = (stdout + "\n" + stderr).trim() - if (er) { - if (silent) { - log.verbose("git clone " + u, stdout) - } else { - log.error("git clone " + u, stdout) + git.whichAndExec( + [ "clone", "--template=" + templates, "--mirror", u, p ], + { cwd : p, env : gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + "\n" + stderr).trim() + if (er) { + if (silent) { + log.verbose("git clone " + u, stdout) + } else { + log.error("git clone " + u, stdout) + } + return cb(er) } - return cb(er) + log.verbose("git clone " + u, stdout) + fetchRemote(p, u, co, origUrl, cb) } - log.verbose("git clone " + u, stdout) - archiveGitRemote(p, u, co, origUrl, cb) - }) + ) }) } -function archiveGitRemote (p, u, co, origUrl, cb) { - var archive = [ "fetch", "-a", "origin" ] - var resolve = [ "rev-list", "-n1", co ] - var env = gitEnv() - - var resolved = null - var tmp +function fetchRemote (p, u, co, origUrl, cb) { + git.whichAndExec( + [ "fetch", "-a", "origin" ], + { cwd : p, env : gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + "\n" + stderr).trim() + if (er) { + log.error("git fetch -a origin ("+u+")", stdout) + return cb(er) + } + log.verbose("git fetch -a origin ("+u+")", stdout) - git.whichAndExec(archive, {cwd: p, env: env}, function (er, stdout, stderr) { - stdout = (stdout + "\n" + stderr).trim() - if (er) { - log.error("git fetch -a origin ("+u+")", stdout) - return cb(er) - } - log.verbose("git fetch -a origin ("+u+")", stdout) - tmp = path.join(npm.tmp, Date.now()+"-"+Math.random(), "tmp.tgz") - - if (process.platform === "win32") { - log.silly("verifyOwnership", "skipping for windows") - resolveHead() - } else { - getCacheStat(function(er, cs) { - if (er) { - log.error("Could not get cache stat") - return cb(er) - } - chownr(p, cs.uid, cs.gid, function(er) { + if (process.platform === "win32") { + log.silly("verifyOwnership", "skipping for windows") + resolveHead(p, u, co, origUrl, cb) + } + else { + getGitDir(function (er, cs) { if (er) { - log.error("Failed to change folder ownership under npm cache for %s", p) + log.error("Could not get cache stat") return cb(er) } - resolveHead() + + chownr(p, cs.uid, cs.gid, function (er) { + if (er) { + log.error("Failed to change folder ownership under npm cache for %s", p) + return cb(er) + } + + resolveHead(p, u, co, origUrl, cb) + }) }) - }) + } } - }) + ) +} - function resolveHead () { - git.whichAndExec(resolve, {cwd: p, env: env}, function (er, stdout, stderr) { +function resolveHead (p, u, co, origUrl, cb) { + git.whichAndExec( + [ "rev-list", "-n1", co ], + { cwd : p, env : gitEnv() }, + function (er, stdout, stderr) { stdout = (stdout + "\n" + stderr).trim() if (er) { log.error("Failed resolving git HEAD (" + u + ")", stderr) @@ -173,48 +185,73 @@ function archiveGitRemote (p, u, co, origUrl, cb) { log.verbose("git rev-list -n1 " + co, stdout) var parsed = url.parse(origUrl) parsed.hash = stdout - resolved = url.format(parsed) + var resolved = url.format(parsed) - if (parsed.protocol !== "git:") { - resolved = "git+" + resolved - } + if (parsed.protocol !== "git:") resolved = "git+" + resolved // https://github.com/npm/npm/issues/3224 - // node incorrectly sticks a / at the start of the path - // We know that the host won't change, so split and detect this + // node incorrectly sticks a / at the start of the path We know that the + // host won't change, so split and detect this var spo = origUrl.split(parsed.host) var spr = resolved.split(parsed.host) - if (spo[1].charAt(0) === ":" && spr[1].charAt(0) === "/") + if (spo[1].charAt(0) === ":" && spr[1].charAt(0) === "/") { spr[1] = spr[1].slice(1) + } resolved = spr.join(parsed.host) log.verbose("resolved git url", resolved) - next() - }) - } - - function next () { - mkdir(path.dirname(tmp), function (er) { - if (er) return cb(er) - var gzip = zlib.createGzip({ level: 9 }) - var args = ["archive", co, "--format=tar", "--prefix=package/"] - var out = writeStream(tmp) - var env = gitEnv() - cb = once(cb) - var cp = git.spawn(args, { env: env, cwd: p }) - cp.on("error", cb) - cp.stderr.on("data", function(chunk) { - log.silly(chunk.toString(), "git archive") - }) + cache(p, u, stdout, resolved, cb) + } + ) +} - cp.stdout.pipe(gzip).pipe(out).on("close", function() { - addLocalTarball(tmp, null, null, function(er, data) { - if (data) data._resolved = resolved - cb(er, data) - }) - }) - }) - } +/** + * Make an actual clone from the bare (mirrored) cache. There is no safe way to + * do a one-step clone to a treeish that isn't guaranteed to be a branch, so + * this has to be two steps. + */ +function cache (p, u, treeish, resolved, cb) { + var tmp = path.join(npm.tmp, Date.now()+"-"+Math.random(), treeish) + git.whichAndExec( + [ "clone", p, tmp ], + { cwd : p, env : gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + "\n" + stderr).trim() + if (er) { + log.error("Failed to clone "+resolved+" from "+u, stderr) + return cb(er) + } + log.verbose("git clone", "from", p) + log.verbose("git clone", stdout) + + git.whichAndExec( + [ "checkout", treeish ], + { cwd : tmp, env : gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + "\n" + stderr).trim() + if (er) { + log.error("Failed to check out "+treeish, stderr) + return cb(er) + } + log.verbose("git checkout", stdout) + + realizePackageSpecifier(tmp, function (er, spec) { + if (er) { + log.error("Failed to map", tmp, "to a package specifier") + return cb(er) + } + + // https://github.com/npm/npm/issues/6400 + // ensure pack logic is applied + addLocal(spec, null, function (er, data) { + if (data) data._resolved = resolved + cb(er, data) + }) + }) + } + ) + } + ) } var gitEnv_ @@ -224,7 +261,7 @@ function gitEnv () { if (gitEnv_) return gitEnv_ gitEnv_ = {} for (var k in process.env) { - if (!~["GIT_PROXY_COMMAND","GIT_SSH","GIT_SSL_NO_VERIFY","GIT_SSL_CAINFO"].indexOf(k) && k.match(/^GIT/)) continue + if (!~VALID_VARIABLES.indexOf(k) && k.match(/^GIT/)) continue gitEnv_[k] = process.env[k] } return gitEnv_ diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index 9591ba89d23177..e87ac54bb1b6da 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -6,14 +6,13 @@ var mkdir = require("mkdirp") , retry = require("retry") , createWriteStream = require("fs-write-stream-atomic") , npm = require("../npm.js") - , registry = npm.registry , inflight = require("inflight") , addLocalTarball = require("./add-local-tarball.js") , cacheFile = require("npm-cache-filename") module.exports = addRemoteTarball -function addRemoteTarball (u, pkgData, shasum, cb_) { +function addRemoteTarball (u, pkgData, shasum, auth, cb_) { assert(typeof u === "string", "must have module URL") assert(typeof cb_ === "function", "must have callback") @@ -42,11 +41,11 @@ function addRemoteTarball (u, pkgData, shasum, cb_) { log.verbose("addRemoteTarball", [u, shasum]) mkdir(path.dirname(tmp), function (er) { if (er) return cb(er) - addRemoteTarball_(u, tmp, shasum, next) + addRemoteTarball_(u, tmp, shasum, auth, next) }) } -function addRemoteTarball_(u, tmp, shasum, cb) { +function addRemoteTarball_ (u, tmp, shasum, auth, cb) { // Tuned to spread 3 attempts over about a minute. // See formula at . var operation = retry.operation({ @@ -59,12 +58,12 @@ function addRemoteTarball_(u, tmp, shasum, cb) { operation.attempt(function (currentAttempt) { log.info("retry", "fetch attempt " + currentAttempt + " at " + (new Date()).toLocaleTimeString()) - fetchAndShaCheck(u, tmp, shasum, function (er, response, shasum) { + fetchAndShaCheck(u, tmp, shasum, auth, function (er, response, shasum) { // Only retry on 408, 5xx or no `response`. var sc = response && response.statusCode var statusRetry = !sc || (sc === 408 || sc >= 500) if (er && statusRetry && operation.retry(er)) { - log.info("retry", "will retry, error on last attempt: " + er) + log.warn("retry", "will retry, error on last attempt: " + er) return } cb(er, response, shasum) @@ -72,8 +71,8 @@ function addRemoteTarball_(u, tmp, shasum, cb) { }) } -function fetchAndShaCheck (u, tmp, shasum, cb) { - registry.fetch(u, null, function (er, response) { +function fetchAndShaCheck (u, tmp, shasum, auth, cb) { + npm.registry.fetch(u, { auth : auth }, function (er, response) { if (er) { log.error("fetch failed", u) return cb(er, response) diff --git a/deps/npm/lib/cache/caching-client.js b/deps/npm/lib/cache/caching-client.js new file mode 100644 index 00000000000000..d81e6f53d6285c --- /dev/null +++ b/deps/npm/lib/cache/caching-client.js @@ -0,0 +1,206 @@ +module.exports = CachingRegistryClient + +var path = require("path") + , fs = require("graceful-fs") + , url = require("url") + , assert = require("assert") + , inherits = require("util").inherits + +var RegistryClient = require("npm-registry-client") + , npm = require("../npm.js") + , log = require("npmlog") + , getCacheStat = require("./get-stat.js") + , cacheFile = require("npm-cache-filename") + , mkdirp = require("mkdirp") + , rimraf = require("rimraf") + , chownr = require("chownr") + , writeFile = require("write-file-atomic") + +function CachingRegistryClient (config) { + RegistryClient.call(this, adaptConfig(config)) + + this._mapToCache = cacheFile(config.get("cache")) + + // swizzle in our custom cache invalidation logic + this._request = this.request + this.request = this._invalidatingRequest +} +inherits(CachingRegistryClient, RegistryClient) + +CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb) { + var client = this + this._request.call(this, uri, params, function () { + var args = arguments + + var method = params.method + if (method !== "HEAD" && method !== "GET") { + var invalidated = client._mapToCache(uri) + // invalidate cache + // + // This is irrelevant for commands that do etag caching, but ls and + // view also have a timed cache, so this keeps the user from thinking + // that it didn't work when it did. + // Note that failure is an acceptable option here, since the only + // result will be a stale cache for some helper commands. + client.log.verbose("request", "invalidating", invalidated, "on", method) + return rimraf(invalidated, function () { + cb.apply(undefined, args) + }) + } + + cb.apply(undefined, args) + }) +} + +CachingRegistryClient.prototype.get = function get (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to get") + assert(params && typeof params === "object", "must pass params to get") + assert(typeof cb === "function", "must pass callback to get") + + var parsed = url.parse(uri) + assert( + parsed.protocol === "http:" || parsed.protocol === "https:", + "must have a URL that starts with http: or https:" + ) + + var cacheBase = cacheFile(npm.config.get("cache"))(uri) + var cachePath = path.join(cacheBase, ".cache.json") + + // If the GET is part of a write operation (PUT or DELETE), then + // skip past the cache entirely, but still save the results. + if (uri.match(/\?write=true$/)) return get_.call(this, uri, cachePath, params, cb) + + var client = this + fs.stat(cachePath, function (er, stat) { + if (!er) { + fs.readFile(cachePath, function (er, data) { + try { + data = JSON.parse(data) + } + catch (ex) { + data = null + } + + params.stat = stat + params.data = data + + get_.call(client, uri, cachePath, params, cb) + }) + } + else { + get_.call(client, uri, cachePath, params, cb) + } + }) +} + +function get_ (uri, cachePath, params, cb) { + var staleOk = params.staleOk === undefined ? false : params.staleOk + , timeout = params.timeout === undefined ? -1 : params.timeout + , data = params.data + , stat = params.stat + , etag + + timeout = Math.min(timeout, npm.config.get("cache-max") || 0) + timeout = Math.max(timeout, npm.config.get("cache-min") || -Infinity) + if (process.env.COMP_CWORD !== undefined && + process.env.COMP_LINE !== undefined && + process.env.COMP_POINT !== undefined) { + timeout = Math.max(timeout, 60000) + } + + if (data) { + if (data._etag) etag = data._etag + + if (stat && timeout && timeout > 0) { + if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { + log.verbose("get", uri, "not expired, no request") + delete data._etag + return cb(null, data, JSON.stringify(data), { statusCode : 304 }) + } + + if (staleOk) { + log.verbose("get", uri, "staleOk, background update") + delete data._etag + process.nextTick( + cb.bind(null, null, data, JSON.stringify(data), { statusCode : 304 } ) + ) + cb = function () {} + } + } + } + + var options = { + etag : etag, + follow : params.follow, + auth : params.auth + } + this.request(uri, options, function (er, remoteData, raw, response) { + // if we get an error talking to the registry, but we have it + // from the cache, then just pretend we got it. + if (er && cachePath && data && !data.error) { + er = null + response = { statusCode: 304 } + } + + if (response) { + log.silly("get", "cb", [response.statusCode, response.headers]) + if (response.statusCode === 304 && etag) { + remoteData = data + log.verbose("etag", uri+" from cache") + } + } + + data = remoteData + if (!data) er = er || new Error("failed to fetch from registry: " + uri) + + if (er) return cb(er, data, raw, response) + + saveToCache(cachePath, data, saved) + + // just give the write the old college try. if it fails, whatever. + function saved () { + delete data._etag + cb(er, data, raw, response) + } + + function saveToCache (cachePath, data, saved) { + getCacheStat(function (er, st) { + mkdirp(path.dirname(cachePath), function (er, made) { + if (er) return saved() + + writeFile(cachePath, JSON.stringify(data), function (er) { + if (er || st.uid === null || st.gid === null) return saved() + + chownr(made || cachePath, st.uid, st.gid, saved) + }) + }) + }) + } + }) +} + +function adaptConfig (config) { + return { + proxy : { + http : config.get("proxy"), + https : config.get("https-proxy"), + localAddress : config.get("local-address") + }, + ssl : { + certificate : config.get("cert"), + key : config.get("key"), + ca : config.get("ca"), + strict : config.get("strict-ssl") + }, + retry : { + retries : config.get("fetch-retries"), + factor : config.get("fetch-retry-factor"), + minTimeout : config.get("fetch-retry-mintimeout"), + maxTimeout : config.get("fetch-retry-maxtimeout") + }, + userAgent : config.get("user-agent"), + log : log, + defaultTag : config.get("tag"), + couchToken : config.get("_token") + } +} diff --git a/deps/npm/lib/cache/update-index.js b/deps/npm/lib/cache/update-index.js new file mode 100644 index 00000000000000..2955f6a1488feb --- /dev/null +++ b/deps/npm/lib/cache/update-index.js @@ -0,0 +1,100 @@ +module.exports = updateIndex + +var fs = require("graceful-fs") + , assert = require("assert") + , path = require("path") + , mkdir = require("mkdirp") + , chownr = require("chownr") + , url = require("url") + , npm = require("../npm.js") + , log = require("npmlog") + , cacheFile = require("npm-cache-filename") + , getCacheStat = require("./get-stat.js") + +/* /-/all is special. + * It uses timestamp-based caching and partial updates, + * because it is a monster. + */ +function updateIndex (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to updateIndex") + assert(params && typeof params === "object", "must pass params to updateIndex") + assert(typeof cb === "function", "must pass callback to updateIndex") + + var parsed = url.parse(uri) + assert( + parsed.protocol === "http:" || parsed.protocol === "https:", + "must have a URL that starts with http: or https:" + ) + + var cacheBase = cacheFile(npm.config.get("cache"))(uri) + var cachePath = path.join(cacheBase, ".cache.json") + log.info("updateIndex", cachePath) + + getCacheStat(function (er, st) { + if (er) return cb(er) + + mkdir(cacheBase, function (er, made) { + if (er) return cb(er) + + fs.readFile(cachePath, function (er, data) { + if (er) return updateIndex_(uri, params, 0, {}, cachePath, cb) + + try { + data = JSON.parse(data) + } + catch (ex) { + fs.writeFile(cachePath, "{}", function (er) { + if (er) return cb(new Error("Broken cache.")) + + return updateIndex_(uri, params, 0, {}, cachePath, cb) + }) + } + var t = +data._updated || 0 + chownr(made || cachePath, st.uid, st.gid, function (er) { + if (er) return cb(er) + + updateIndex_(uri, params, t, data, cachePath, cb) + }) + }) + }) + }) +} + +function updateIndex_ (uri, params, t, data, cachePath, cb) { + // use the cache and update in the background if it's not too old + if (Date.now() - t < 60000) { + cb(null, data) + cb = function () {} + } + + var full + if (t === 0) { + log.warn("", "Building the local index for the first time, please be patient") + full = url.resolve(uri, "/-/all") + } + else { + full = url.resolve(uri, "/-/all/since?stale=update_after&startkey=" + t) + } + + npm.registry.request(full, params, function (er, updates, _, res) { + if (er) return cb(er, data) + + var headers = res.headers + var updated = updates._updated || Date.parse(headers.date) + + Object.keys(updates).forEach(function (p) { data[p] = updates[p] }) + + data._updated = updated + getCacheStat(function (er, st) { + if (er) return cb(er) + + fs.writeFile(cachePath, JSON.stringify(data), function (er) { + delete data._updated + if (er) return cb(er) + chownr(cachePath, st.uid, st.gid, function (er) { + cb(er, data) + }) + }) + }) + }) +} diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index f51156aad4ee8e..d2a6a89f6962c7 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -84,7 +84,7 @@ function edit (cb) { ] ) .concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { - var obj = {}; + var obj = {} obj[key] = npmconf.defaults[key] if (key === "logstream") return arr return arr.concat( @@ -138,7 +138,7 @@ function set (key, val, cb) { function get (key, cb) { if (!key) return list(cb) - if (key.charAt(0) === "_") { + if (!public(key)) { return cb(new Error("---sekretz---")) } console.log(npm.config.get(key)) @@ -150,7 +150,9 @@ function sort (a, b) { } function public (k) { - return !(k.charAt(0) === "_" || types[k] !== types[k]) + return !(k.charAt(0) === "_" || + k.indexOf(":_") !== -1 || + types[k] !== types[k]) } function getKeys (data) { diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index 7bd672114deb8c..febd1049ed1608 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -189,9 +189,8 @@ Object.defineProperty(exports, "defaults", {get: function () { , prefix : globalPrefix , production: process.env.NODE_ENV === "production" , "proprietary-attribs": true - , proxy : process.env.HTTP_PROXY || process.env.http_proxy || null - , "https-proxy" : process.env.HTTPS_PROXY || process.env.https_proxy || - process.env.HTTP_PROXY || process.env.http_proxy || null + , proxy : null + , "https-proxy" : null , "user-agent" : "npm/{npm-version} " + "node/{node-version} " + "{platform} " diff --git a/deps/npm/lib/config/nerf-dart.js b/deps/npm/lib/config/nerf-dart.js index 3b26a56c65f1cc..07c817500f6fbe 100644 --- a/deps/npm/lib/config/nerf-dart.js +++ b/deps/npm/lib/config/nerf-dart.js @@ -13,9 +13,11 @@ module.exports = toNerfDart */ function toNerfDart(uri) { var parsed = url.parse(uri) - parsed.pathname = "/" delete parsed.protocol delete parsed.auth + delete parsed.query + delete parsed.search + delete parsed.hash - return url.format(parsed) + return url.resolve(url.format(parsed), ".") } diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index 74397d0cb95792..6a4abd730771ac 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -240,10 +240,10 @@ function findVersions (npm, summary, cb) { var versions = data.versions var ranges = data.ranges - mapToRegistry(name, npm.config, function (er, uri) { + mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, null, next) + npm.registry.get(uri, { auth : auth }, next) }) function next (er, data) { diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index 17dd4eab0c1326..c90ad9027231c0 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -12,13 +12,16 @@ deprecate.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() // get the list of packages by user var path = "/-/by-user/" - mapToRegistry(path, npm.config, function (er, uri) { + mapToRegistry(path, npm.config, function (er, uri, c) { if (er) return cb(er) - var c = npm.config.getCredentialsByURI(uri) if (!(c && c.username)) return cb() - npm.registry.get(uri + c.username, { timeout : 60000 }, function (er, list) { + var params = { + timeout : 60000, + auth : c + } + npm.registry.get(uri + c.username, params, function (er, list) { if (er) return cb() console.error(list) return cb(null, list[c.username]) @@ -34,11 +37,14 @@ function deprecate (args, cb) { // fetch the data and make sure it exists. var p = npa(pkg) - mapToRegistry(p.name, npm.config, next) - - function next (er, uri) { + mapToRegistry(p.name, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.deprecate(uri, p.spec, msg, cb) - } + var params = { + version : p.spec, + message : msg, + auth : auth + } + npm.registry.deprecate(uri, params, cb) + }) } diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index dead3f7551c2fd..9abe740a3c77f0 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -4,23 +4,22 @@ docs.usage = "npm docs " docs.usage += "\n" docs.usage += "npm docs ." +var npm = require("./npm.js") + , opener = require("opener") + , path = require("path") + , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") + docs.completion = function (opts, cb) { - mapToRegistry("/-/short", npm.config, function (er, uri) { + mapToRegistry("/-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, { timeout : 60000 }, function (er, list) { + npm.registry.get(uri, { timeout : 60000, auth : auth }, function (er, list) { return cb(null, list || []) }) }) } -var npm = require("./npm.js") - , registry = npm.registry - , opener = require("opener") - , path = require("path") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") - function url (json) { return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name } @@ -28,7 +27,7 @@ function url (json) { function docs (args, cb) { args = args || [] var pending = args.length - if (!pending) return getDoc('.', cb) + if (!pending) return getDoc(".", cb) args.forEach(function(proj) { getDoc(proj, function(err) { if (err) { @@ -40,10 +39,10 @@ function docs (args, cb) { } function getDoc (project, cb) { - project = project || '.' + project = project || "." var package = path.resolve(npm.localPrefix, "package.json") - if (project === '.' || project === './') { + if (project === "." || project === "./") { var json try { json = require(package) @@ -57,10 +56,10 @@ function getDoc (project, cb) { return opener(url(json), { command: npm.config.get("browser") }, cb) } - mapToRegistry(project, npm.config, function (er, uri) { + mapToRegistry(project, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri + "/latest", { timeout : 3600 }, next) + npm.registry.get(uri + "/latest", { timeout : 3600, auth : auth }, next) }) function next (er, json) { diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index e87e839354b6b9..96475a0691f987 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -6,7 +6,7 @@ explore.usage = "npm explore [ -- ]" explore.completion = require("./utils/completion/installed-shallow.js") var npm = require("./npm.js") - , spawn = require("child_process").spawn + , spawn = require("./utils/spawn") , path = require("path") , fs = require("graceful-fs") diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index 747bd5020da99e..07d92194969d55 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -7,7 +7,7 @@ help.completion = function (opts, cb) { } var path = require("path") - , spawn = require("child_process").spawn + , spawn = require("./utils/spawn") , npm = require("./npm.js") , log = require("npmlog") , opener = require("opener") diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js index 925654beef7f96..401e700af3cde2 100644 --- a/deps/npm/lib/init.js +++ b/deps/npm/lib/init.js @@ -31,11 +31,11 @@ function init (args, cb) { initJson(dir, initFile, npm.config, function (er, data) { log.resume() log.silly("package data", data) - log.info("init", "written successfully") if (er && er.message === "canceled") { log.warn("init", "canceled") return cb(null, data) } + log.info("init", "written successfully") cb(er, data) }) } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index e539307aff3404..756d12ee3621ac 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -33,11 +33,11 @@ install.completion = function (opts, cb) { // if it has a slash, then it's gotta be a folder // if it starts with https?://, then just give up, because it's a url // for now, not yet implemented. - var registry = npm.registry - mapToRegistry("-/short", npm.config, function (er, uri) { + mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, pkgs) { + var options = { auth : auth } + npm.registry.get(uri, options, function (er, pkgs) { if (er) return cb() if (!opts.partialWord) return cb(null, pkgs) @@ -53,7 +53,7 @@ install.completion = function (opts, cb) { mapToRegistry(pkgs[0], npm.config, function (er, uri) { if (er) return cb(er) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, options, function (er, d) { if (er) return cb() return cb(null, Object.keys(d["dist-tags"] || {}) .concat(Object.keys(d.versions || {})) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index ed329d19e1bb9a..eee4f2772e0918 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -250,8 +250,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { if (data._found === true && data._id) { if (npm.color) { out.label = color.bgBlack(color.yellow(out.label.trim())) + " " - } - else { + } else { out.label = out.label.trim() + " " } } @@ -291,10 +290,13 @@ function makeArchy_ (data, long, dir, depth, parent, d) { } // now all the children. - out.nodes = Object.keys(data.dependencies || {}) - .sort(alphasort).map(function (d) { - return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) - }) + out.nodes = [] + if (depth <= npm.config.get("depth")) { + out.nodes = Object.keys(data.dependencies || {}) + .sort(alphasort).map(function (d) { + return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) + }) + } if (out.nodes.length === 0 && data.path === dir) { out.nodes = ["(empty)"] diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index e933a1346cc85c..d03ec47b6bbb99 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -22,8 +22,7 @@ var EventEmitter = require("events").EventEmitter , path = require("path") , abbrev = require("abbrev") , which = require("which") - , semver = require("semver") - , RegClient = require("npm-registry-client") + , CachingRegClient = require("./cache/caching-client.js") , charSpin = require("char-spinner") npm.config = { @@ -41,7 +40,6 @@ npm.commands = {} npm.rollbacks = [] try { - var pv = process.version.replace(/^v/, '') // startup, ok to do this synchronously var j = JSON.parse(fs.readFileSync( path.join(__dirname, "../package.json"))+"") @@ -86,6 +84,7 @@ var commandCache = {} , "find-dupes": "dedupe" , "ddp": "dedupe" , "v": "view" + , "verison": "version" } , aliasNames = Object.keys(aliases) @@ -142,16 +141,21 @@ var commandCache = {} ] , plumbing = [ "build" , "unbuild" - , "isntall" , "xmas" , "substack" , "visnup" ] - , fullList = npm.fullList = cmdList.concat(aliasNames).filter(function (c) { + , littleGuys = [ "isntall" ] + , fullList = cmdList.concat(aliasNames).filter(function (c) { return plumbing.indexOf(c) === -1 }) , abbrevs = abbrev(fullList) +// we have our reasons +fullList = npm.fullList = fullList.filter(function (c) { + return littleGuys.indexOf(c) === -1 +}) + npm.spinner = { int: null , started: false @@ -351,7 +355,7 @@ function load (npm, cli, cb) { // at this point the configs are all set. // go ahead and spin up the registry client. - npm.registry = new RegClient(npm.config) + npm.registry = new CachingRegClient(npm.config) var umask = npm.config.get("umask") npm.modes = { exec: 0777 & (~umask) diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index fdfd7624db25fe..fe25a8e910c2d0 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -22,7 +22,6 @@ outdated.completion = require("./utils/completion/installed-deep.js") var path = require("path") - , fs = require("graceful-fs") , readJson = require("read-package-json") , cache = require("./cache.js") , asyncMap = require("slide").asyncMap @@ -35,6 +34,7 @@ var path = require("path") , os = require("os") , mapToRegistry = require("./utils/map-to-registry.js") , npa = require("npm-package-arg") + , readInstalled = require("read-installed") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -193,11 +193,12 @@ function outdated_ (args, dir, parentHas, depth, cb) { }) var has = null - fs.readdir(path.resolve(dir, "node_modules"), function (er, pkgs) { + readInstalled(path.resolve(dir), { dev : true }, function (er, data) { if (er) { has = Object.create(parentHas) return next() } + var pkgs = Object.keys(data.dependencies) pkgs = pkgs.filter(function (p) { return !p.match(/^[\._-]/) }) @@ -205,6 +206,7 @@ function outdated_ (args, dir, parentHas, depth, cb) { var jsonFile = path.resolve(dir, "node_modules", pkg, "package.json") readJson(jsonFile, function (er, d) { if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (d && d.name && d.private) delete deps[d.name] cb(null, er ? [] : [[d.name, d.version, d._from]]) }) }, function (er, pvs) { @@ -269,10 +271,10 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) { return doIt("git", "git") // search for the latest package - mapToRegistry(dep, npm.config, function (er, uri) { + mapToRegistry(dep, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, null, updateDeps) + npm.registry.get(uri, { auth : auth }, updateDeps) }) function updateDeps (er, d) { diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index 2fdee7adb69ab9..7b34508337ea48 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -1,4 +1,3 @@ - module.exports = owner owner.usage = "npm owner add " @@ -6,7 +5,6 @@ owner.usage = "npm owner add " + "\nnpm owner ls " var npm = require("./npm.js") - , registry = npm.registry , log = require("npmlog") , readJson = require("read-package-json") , mapToRegistry = require("./utils/map-to-registry.js") @@ -29,21 +27,21 @@ owner.completion = function (opts, cb) { switch (argv[2]) { case "ls": if (argv.length > 3) return cb() - return mapToRegistry("-/short", npm.config, function (er, uri) { + return mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, cb) + npm.registry.get(uri, { auth : auth }, cb) }) case "rm": if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) byUser = "-/by-user/" + theUser + "|" + un - return mapToRegistry(byUser, npm.config, function (er, uri) { + return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, { auth : auth }, function (er, d) { if (er) return cb(er) // return the intersection return cb(null, d[theUser].filter(function (p) { @@ -58,11 +56,11 @@ owner.completion = function (opts, cb) { if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) byUser = "-/by-user/" + theUser + "|" + un - return mapToRegistry(byUser, npm.config, function (er, uri) { + return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, { auth : auth }, function (er, d) { console.error(uri, er || d) // return mine that they're not already on. if (er) return cb(er) @@ -75,10 +73,10 @@ owner.completion = function (opts, cb) { }) } // just list all users who aren't me. - return mapToRegistry("-/users", npm.config, function (er, uri) { + return mapToRegistry("-/users", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, list) { + npm.registry.get(uri, { auth : auth }, function (er, list) { if (er) return cb() return cb(null, Object.keys(list).filter(function (n) { return n !== un @@ -109,10 +107,10 @@ function ls (pkg, cb) { ls(pkg, cb) }) - mapToRegistry(pkg, npm.config, function (er, uri) { + mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, data) { + npm.registry.get(uri, { auth : auth }, function (er, data) { var msg = "" if (er) { log.error("owner ls", "Couldn't get owner data", pkg) @@ -161,7 +159,7 @@ function rm (user, pkg, cb) { }) log.verbose("owner rm", "%s from %s", user, pkg) - mutate(pkg, null, function (u, owners) { + mutate(pkg, user, function (u, owners) { var found = false , m = owners.filter(function (o) { var match = (o.name === user) @@ -181,10 +179,10 @@ function rm (user, pkg, cb) { function mutate (pkg, user, mutation, cb) { if (user) { var byUser = "-/user/org.couchdb.user:" + user - mapToRegistry(byUser, npm.config, function (er, uri) { + mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, mutate_) + npm.registry.get(uri, { auth : auth }, mutate_) }) } else { mutate_(null, null) @@ -200,31 +198,52 @@ function mutate (pkg, user, mutation, cb) { } if (u) u = { "name" : u.name, "email" : u.email } - mapToRegistry(pkg, npm.config, function (er, uri) { + mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, data) { + npm.registry.get(uri, { auth : auth }, function (er, data) { if (er) { log.error("owner mutate", "Error getting package data for %s", pkg) return cb(er) } + + // save the number of maintainers before mutation so that we can figure + // out if maintainers were added or removed + var beforeMutation = data.maintainers.length + var m = mutation(u, data.maintainers) if (!m) return cb() // handled if (m instanceof Error) return cb(m) // error - data = { _id : data._id - , _rev : data._rev - , maintainers : m - } - var dataPath = pkg + "/-rev/" + data._rev - mapToRegistry(dataPath, npm.config, function (er, uri) { + + data = { + _id : data._id, + _rev : data._rev, + maintainers : m + } + var dataPath = pkg.replace("/", "%2f") + "/-rev/" + data._rev + mapToRegistry(dataPath, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.request("PUT", uri, { body : data }, function (er, data) { - if (!er && data.error) er = new Error( - "Failed to update package metadata: " + JSON.stringify(data)) + var params = { + method : "PUT", + body : data, + auth : auth + } + npm.registry.request(uri, params, function (er, data) { + if (!er && data.error) { + er = new Error("Failed to update package metadata: "+JSON.stringify(data)) + } + if (er) { log.error("owner mutate", "Failed to update package metadata") } + else if (m.length > beforeMutation) { + console.log("+ %s (%s)", user, pkg) + } + else if (m.length < beforeMutation) { + console.log("- %s (%s)", user, pkg) + } + cb(er, data) }) }) diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 2a0fcff5a5c972..f179bd42220e2f 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -1,17 +1,17 @@ module.exports = publish -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , log = require("npmlog") , path = require("path") , readJson = require("read-package-json") , lifecycle = require("./utils/lifecycle.js") , chain = require("slide").chain , Conf = require("./config/core.js").Conf - , RegClient = require("npm-registry-client") + , CachingRegClient = require("./cache/caching-client.js") , mapToRegistry = require("./utils/map-to-registry.js") , cachedPackageRoot = require("./cache/cached-package-root.js") + , createReadStream = require("graceful-fs").createReadStream publish.usage = "npm publish " + "\nnpm publish " @@ -87,7 +87,7 @@ function publish_ (arg, data, isRetry, cachedir, cb) { s[k] = data.publishConfig[k] return s }, {})) - registry = new RegClient(config) + registry = new CachingRegClient(config) } data._npmVersion = npm.version @@ -101,21 +101,29 @@ function publish_ (arg, data, isRetry, cachedir, cb) { ) ) - mapToRegistry(data.name, config, function (er, registryURI) { + mapToRegistry(data.name, config, function (er, registryURI, auth, registryBase) { if (er) return cb(er) - var tarball = cachedir + ".tgz" + var tarballPath = cachedir + ".tgz" // we just want the base registry URL in this case - var registryBase = url.resolve(registryURI, ".") log.verbose("publish", "registryBase", registryBase) + log.silly("publish", "uploading", tarballPath) - var c = config.getCredentialsByURI(registryBase) - data._npmUser = {name: c.username, email: c.email} + data._npmUser = { + name : auth.username, + email : auth.email + } + + var params = { + metadata : data, + body : createReadStream(tarballPath), + auth : auth + } - registry.publish(registryBase, data, tarball, function (er) { - if (er && er.code === "EPUBLISHCONFLICT" - && npm.config.get("force") && !isRetry) { + registry.publish(registryBase, params, function (er) { + if (er && er.code === "EPUBLISHCONFLICT" && + npm.config.get("force") && !isRetry) { log.warn("publish", "Forced publish over " + data._id) return npm.commands.unpublish([data._id], function (er) { // ignore errors. Use the force. Reach out with your feelings. diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index c6db8e37b012a4..3db4a16bc9de1f 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -3,21 +3,9 @@ module.exports = repo repo.usage = "npm repo " -repo.completion = function (opts, cb) { - if (opts.conf.argv.remain.length > 2) return cb() - mapToRegistry("/-/short", npm.config, function (er, uri) { - if (er) return cb(er) - - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) - }) - }) -} - var npm = require("./npm.js") - , registry = npm.registry , opener = require("opener") - , github = require('github-url-from-git') + , github = require("github-url-from-git") , githubUserRepo = require("github-url-from-username-repo") , path = require("path") , readJson = require("read-package-json") @@ -26,6 +14,17 @@ var npm = require("./npm.js") , mapToRegistry = require("./utils/map-to-registry.js") , npa = require("npm-package-arg") +repo.completion = function (opts, cb) { + if (opts.conf.argv.remain.length > 2) return cb() + mapToRegistry("/-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + npm.registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) + }) +} + function repo (args, cb) { var n = args.length && npa(args[0]).name || "." fs.stat(n, function (er, s) { @@ -41,18 +40,18 @@ function repo (args, cb) { function getUrlAndOpen (d, cb) { var r = d.repository - if (!r) return cb(new Error('no repository')) + if (!r) return cb(new Error("no repository")) // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated // from https://github.com/npm/npm-www/issues/418 if (githubUserRepo(r.url)) r.url = githubUserRepo(r.url) - var url = (r.url && ~r.url.indexOf('github')) + var url = (r.url && ~r.url.indexOf("github")) ? github(r.url) : nonGithubUrl(r.url) if (!url) - return cb(new Error('no repository: could not get url')) + return cb(new Error("no repository: could not get url")) opener(url, { command: npm.config.get("browser") }, cb) } @@ -60,7 +59,7 @@ function callRegistry (n, cb) { mapToRegistry(n, npm.config, function (er, uri) { if (er) return cb(er) - registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + npm.registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { if (er) return cb(er) getUrlAndOpen(d, cb) }) @@ -69,16 +68,16 @@ function callRegistry (n, cb) { function nonGithubUrl (url) { try { - var idx = url.indexOf('@') + var idx = url.indexOf("@") if (idx !== -1) { - url = url.slice(idx+1).replace(/:([^\d]+)/, '/$1') + url = url.slice(idx+1).replace(/:([^\d]+)/, "/$1") } url = url_.parse(url) - var protocol = url.protocol === 'https:' - ? 'https:' - : 'http:' - return protocol + '//' + (url.host || '') + - url.path.replace(/\.git$/, '') + var protocol = url.protocol === "https:" + ? "https:" + : "http:" + return protocol + "//" + (url.host || "") + + url.path.replace(/\.git$/, "") } catch(e) {} } diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 4495b93c48ef17..ce8ea0f13a747f 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -1,4 +1,3 @@ - module.exports = runScript var lifecycle = require("./utils/lifecycle.js") @@ -124,6 +123,21 @@ function run (pkg, wd, cmd, args, cb) { "prestart", "start", "poststart" ] } else { + if (!pkg.scripts[cmd]) { + if (cmd === "test") { + pkg.scripts.test = "echo \"Error: no test specified\"" + } else if (cmd === "env") { + if (process.platform === "win32") { + log.verbose("run-script using default platform env: SET (Windows)") + pkg.scripts[cmd] = "SET" + } else { + log.verbose("run-script using default platform env: env (Unix)") + pkg.scripts[cmd] = "env" + } + } else { + return cb(new Error("missing script: " + cmd)) + } + } cmds = [cmd] } @@ -134,7 +148,9 @@ function run (pkg, wd, cmd, args, cb) { log.verbose("run-script", cmds) chain(cmds.map(function (c) { // pass cli arguments after -- to script. - if (pkg.scripts[c] && c === cmd) pkg.scripts[c] = pkg.scripts[c] + joinArgs(args) + if (pkg.scripts[c] && c === cmd) { + pkg.scripts[c] = pkg.scripts[c] + joinArgs(args) + } // when running scripts explicitly, assume that they're trusted. return [lifecycle, pkg, c, wd, true] diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 5dd060f829c47f..ad3f312e546890 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -2,9 +2,9 @@ module.exports = exports = search var npm = require("./npm.js") - , registry = npm.registry - , columnify = require('columnify') + , columnify = require("columnify") , mapToRegistry = require("./utils/map-to-registry.js") + , updateIndex = require("./cache/update-index.js") search.usage = "npm search [some search terms ...]" @@ -58,15 +58,16 @@ function search (args, silent, staleness, cb) { } function getFilteredData (staleness, args, notArgs, cb) { - var opts = { - timeout : staleness, - follow : true, - staleOk : true - } - mapToRegistry("-/all", npm.config, function (er, uri) { + mapToRegistry("-/all", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, opts, function (er, data) { + var params = { + timeout : staleness, + follow : true, + staleOk : true, + auth : auth + } + updateIndex(uri, params, function (er, data) { if (er) return cb(er) return cb(null, filter(data, args, notArgs)) }) @@ -164,7 +165,7 @@ function prettify (data, args) { dat.keywords = dat.keywords.split(/[,\s]+/) } if (Array.isArray(dat.keywords)) { - dat.keywords = dat.keywords.join(' ') + dat.keywords = dat.keywords.join(" ") } // split author on whitespace or , @@ -172,7 +173,7 @@ function prettify (data, args) { dat.author = dat.author.split(/[,\s]+/) } if (Array.isArray(dat.author)) { - dat.author = dat.author.join(' ') + dat.author = dat.author.join(" ") } return dat }) @@ -194,7 +195,7 @@ function prettify (data, args) { include: columns , truncate: truncate , config: { - name: { maxWidth: 40, truncate: false, truncateMarker: '' } + name: { maxWidth: 40, truncate: false, truncateMarker: "" } , description: { maxWidth: 60 } , author: { maxWidth: 20 } , date: { maxWidth: 11 } @@ -260,9 +261,9 @@ function getMaxWidth() { function trimToMaxWidth(str) { var maxWidth = getMaxWidth() - return str.split('\n').map(function(line) { + return str.split("\n").map(function(line) { return line.slice(0, maxWidth) - }).join('\n') + }).join("\n") } function highlightSearchTerms(str, terms) { diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 123c4ebbb44e35..d2e69deb94f1e2 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -2,7 +2,6 @@ module.exports = star var npm = require("./npm.js") - , registry = npm.registry , log = require("npmlog") , asyncMap = require("slide").asyncMap , mapToRegistry = require("./utils/map-to-registry.js") @@ -11,10 +10,14 @@ star.usage = "npm star [pkg, pkg, ...]\n" + "npm unstar [pkg, pkg, ...]" star.completion = function (opts, cb) { - mapToRegistry("-/short", npm.config, function (er, uri) { + mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, { timeout : 60000 }, function (er, list) { + var params = { + timeout : 60000, + auth : auth + } + npm.registry.get(uri, params, function (er, list) { return cb(null, list || []) }) }) @@ -27,10 +30,14 @@ function star (args, cb) { , using = !(npm.command.match(/^un/)) if (!using) s = u asyncMap(args, function (pkg, cb) { - mapToRegistry(pkg, npm.config, function (er, uri) { + mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.star(uri, using, function (er, data, raw, req) { + var params = { + starred : using, + auth : auth + } + npm.registry.star(uri, params, function (er, data, raw, req) { if (!er) { console.log(s + " "+pkg) log.verbose("star", data) diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index dee5c152afa5ec..087e8d9bf20422 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -3,17 +3,20 @@ module.exports = stars stars.usage = "npm stars [username]" var npm = require("./npm.js") - , registry = npm.registry , log = require("npmlog") , mapToRegistry = require("./utils/map-to-registry.js") function stars (args, cb) { npm.commands.whoami([], true, function (er, username) { var name = args.length === 1 ? args[0] : username - mapToRegistry("", npm.config, function (er, uri) { + mapToRegistry("", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.stars(uri, name, showstars) + var params = { + username : name, + auth : auth + } + npm.registry.stars(uri, params, showstars) }) }) diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js index 47e9a8c0ac7a29..bc7ec918796dc3 100644 --- a/deps/npm/lib/tag.js +++ b/deps/npm/lib/tag.js @@ -6,7 +6,6 @@ tag.usage = "npm tag @ []" tag.completion = require("./unpublish.js").completion var npm = require("./npm.js") - , registry = npm.registry , mapToRegistry = require("./utils/map-to-registry.js") , npa = require("npm-package-arg") , semver = require("semver") @@ -26,9 +25,14 @@ function tag (args, cb) { return cb(er) } - mapToRegistry(project, npm.config, function (er, uri) { + mapToRegistry(project, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.tag(uri, version, t, cb) + var params = { + version : version, + tag : t, + auth : auth + } + npm.registry.tag(uri, params, cb) }) } diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js index 8bd6e8507f31f7..df57c5b3463138 100644 --- a/deps/npm/lib/unbuild.js +++ b/deps/npm/lib/unbuild.js @@ -27,7 +27,7 @@ function unbuild_ (silent) { return function (folder, cb_) { log.verbose("unbuild", folder.substr(npm.prefix.length + 1)) readJson(path.resolve(folder, "package.json"), function (er, pkg) { // if no json, then just trash it, but no scripts or whatever. - if (er) return gentlyRm(folder, false, cb) + if (er) return gentlyRm(folder, false, npm.prefix, cb) readJson.cache.del(folder) chain ( [ [lifecycle, pkg, "preuninstall", folder, false, true] @@ -38,7 +38,7 @@ function unbuild_ (silent) { return function (folder, cb_) { } , [rmStuff, pkg, folder] , [lifecycle, pkg, "postuninstall", folder, false, true] - , [gentlyRm, folder, undefined] ] + , [gentlyRm, folder, false, npm.prefix] ] , cb ) }) }} @@ -63,15 +63,12 @@ function rmStuff (pkg, folder, cb) { function rmBins (pkg, folder, parent, top, cb) { if (!pkg.bin) return cb() var binRoot = top ? npm.bin : path.resolve(parent, ".bin") - log.verbose([binRoot, pkg.bin], "binRoot") asyncMap(Object.keys(pkg.bin), function (b, cb) { if (process.platform === "win32") { - chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", undefined] - , [gentlyRm, path.resolve(binRoot, b), undefined] ], cb) + chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", true] + , [gentlyRm, path.resolve(binRoot, b), true] ], cb) } else { - gentlyRm( path.resolve(binRoot, b) - , !npm.config.get("force") && folder - , cb ) + gentlyRm(path.resolve(binRoot, b), true, cb) } }, cb) } @@ -84,6 +81,7 @@ function rmMans (pkg, folder, parent, top, cb) { return cb() } var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") + log.verbose("rmMans", "man files are", pkg.man, "in", manRoot) asyncMap(pkg.man, function (man, cb) { if (Array.isArray(man)) { man.forEach(rmMan) @@ -91,21 +89,28 @@ function rmMans (pkg, folder, parent, top, cb) { rmMan(man) } - function rmMan(man) { - var parseMan = man.match(/(.*)\.([0-9]+)(\.gz)?$/) - , stem = parseMan[1] - , sxn = parseMan[2] - , gz = parseMan[3] || "" - , bn = path.basename(stem) - , manDest = path.join( manRoot - , "man"+sxn - , (bn.indexOf(pkg.name) === 0 ? bn - : pkg.name + "-" + bn) - + "." + sxn + gz - ) - gentlyRm( manDest - , !npm.config.get("force") && folder - , cb ) + function rmMan (man) { + log.silly("rmMan", "preparing to remove", man) + var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) + if (!parseMan) { + log.error( + "rmMan", man, "is not a valid name for a man file.", + "Man files must end with a number, " + + "and optionally a .gz suffix if they are compressed." + ) + return cb() + } + + var stem = parseMan[1] + var sxn = parseMan[2] + var gz = parseMan[3] || "" + var bn = path.basename(stem) + var manDest = path.join( + manRoot, + "man"+sxn, + (bn.indexOf(pkg.name) === 0 ? bn : pkg.name+"-"+bn)+"."+sxn+gz + ) + gentlyRm(manDest, true, cb) } }, cb) } diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 2566cd5ae62644..da03b0dcc86948 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -3,7 +3,6 @@ module.exports = unpublish var log = require("npmlog") , npm = require("./npm.js") - , registry = npm.registry , readJson = require("read-package-json") , path = require("path") , mapToRegistry = require("./utils/map-to-registry.js") @@ -19,10 +18,10 @@ unpublish.completion = function (opts, cb) { var un = encodeURIComponent(username) if (!un) return cb() var byUser = "-/by-user/" + un - mapToRegistry(byUser, npm.config, function (er, uri) { + mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, pkgs) { + npm.registry.get(uri, { auth : auth }, function (er, pkgs) { // do a bit of filtering at this point, so that we don't need // to fetch versions for more than one thing, but also don't // accidentally a whole project. @@ -33,10 +32,10 @@ unpublish.completion = function (opts, cb) { return p.indexOf(pp) === 0 }) if (pkgs.length > 1) return cb(null, pkgs) - mapToRegistry(pkgs[0], npm.config, function (er, uri) { + mapToRegistry(pkgs[0], npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, { auth : auth }, function (er, d) { if (er) return cb(er) var vers = Object.keys(d.versions) if (!vers.length) return cb(null, pkgs) @@ -92,10 +91,14 @@ function gotProject (project, version, cb_) { return cb(er) } - mapToRegistry(project, npm.config, function (er, uri) { + mapToRegistry(project, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.unpublish(uri, version, cb) + var params = { + version : version, + auth : auth + } + npm.registry.unpublish(uri, params, cb) }) }) } diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js index 5201a15ff64754..6ce2f83467d012 100644 --- a/deps/npm/lib/utils/completion/file-completion.js +++ b/deps/npm/lib/utils/completion/file-completion.js @@ -15,10 +15,8 @@ function fileCompletion (root, req, depth, cb) { glob(pattern, opts, function (er, files) { if (er) return cb(er) return cb(null, (files || []).map(function (f) { - return path.join(req, f.substr(root.length + 1) - .substr((f === req ? path.dirname(req) - : req).length) - .replace(/^\//, "")) + var tail = f.substr(root.length + 1).replace(/^\//, "") + return path.join(req, tail) })) }) }) diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index 95b78a8ccbeb4a..12c6dd407b91be 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -181,7 +181,7 @@ function errorHandler (er) { case "ELIFECYCLE": log.error("", er.message) - log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script." + log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script '"+er.script+"'." ,"This is most likely a problem with the "+er.pkgname+" package," ,"not with npm itself." ,"Tell the author that this fails on your system:" @@ -339,6 +339,14 @@ function errorHandler (er) { ].join("\n")) break + case "ENOENT": + log.error("enoent", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to npm not being able to find a file." + ,er.file?"\nCheck if the file '"+er.file+"' is present.":"" + ].join("\n")) + break + default: log.error("", er.message || er) log.error("", ["", "If you need help, you may report this error at:" diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js index d43d0725ebb2d8..587ad0eb1bdeff 100644 --- a/deps/npm/lib/utils/gently-rm.js +++ b/deps/npm/lib/utils/gently-rm.js @@ -11,13 +11,19 @@ var npm = require("../npm.js") , readlink = require("graceful-fs").readlink , isInside = require("path-is-inside") , vacuum = require("fs-vacuum") - , rimraf = require("rimraf") , some = require("async-some") + , asyncMap = require("slide").asyncMap + , normalize = require("path").normalize + +function gentlyRm (path, gently, base, cb) { + if (!cb) { + cb = base + base = undefined + } -function gentlyRm (path, gently, cb) { if (!cb) { cb = gently - gently = null + gently = false } // never rm the root, prefix, or bin dirs. @@ -27,7 +33,7 @@ function gentlyRm (path, gently, cb) { npm.globalDir, npm.globalRoot, npm.globalBin, npm.globalPrefix ] - var resolved = resolve(path) + var resolved = normalize(resolve(path)) if (prefixes.indexOf(resolved) !== -1) { log.verbose("gentlyRm", resolved, "is part of npm and can't be removed") return cb(new Error("May not delete: "+resolved)) @@ -35,13 +41,14 @@ function gentlyRm (path, gently, cb) { var options = {log : log.silly.bind(log, "gentlyRm")} if (npm.config.get("force") || !gently) options.purge = true + if (base) options.base = normalize(base) if (!gently) { log.verbose("gentlyRm", "vacuuming", resolved) return vacuum(resolved, options, cb) } - var parent = resolve(gently) + var parent = options.base = normalize(base ? base : npm.prefix) log.verbose("gentlyRm", "verifying that", parent, "is managed by npm") some(prefixes, isManaged(parent), function (er, matched) { if (er) return cb(er) @@ -56,7 +63,6 @@ function gentlyRm (path, gently, cb) { if (isInside(resolved, parent)) { log.silly("gentlyRm", resolved, "is under", parent) log.verbose("gentlyRm", "vacuuming", resolved, "up to", parent) - options.base = parent return vacuum(resolved, options, cb) } @@ -94,7 +100,7 @@ function gentlyRm (path, gently, cb) { if (matched) { log.silly("gentlyRm", source, "is under", matched) log.verbose("gentlyRm", "removing", resolved) - rimraf(resolved, cb) + vacuum(resolved, options, cb) } log.verbose("gentlyRm", source, "is not managed by npm") @@ -107,55 +113,55 @@ function gentlyRm (path, gently, cb) { var resolvedPaths = {} function isManaged (target) { - return predicate - - function predicate (path, cb) { + return function predicate (path, cb) { if (!path) { log.verbose("isManaged", "no path") return cb(null, false) } - path = resolve(path) - - // if the path has already been memoized, return immediately - var resolved = resolvedPaths[path] - if (resolved) { - var inside = isInside(target, resolved) - log.silly("isManaged", target, inside ? "is" : "is not", "inside", resolved) - - return cb(null, inside && path) - } - - // otherwise, check the path - lstat(path, function (er, stat) { + asyncMap([path, target], resolveSymlink, function (er, results) { if (er) { if (er.code === "ENOENT") return cb(null, false) return cb(er) } - // if it's not a link, cache & test the path itself - if (!stat.isSymbolicLink()) return cacheAndTest(path, path, target, cb) + var path = results[0] + var target = results[1] + var inside = isInside(target, path) + log.silly("isManaged", target, inside ? "is" : "is not", "inside", path) - // otherwise, cache & test the link's source - readlink(path, function (er, source) { - if (er) { - if (er.code === "ENOENT") return cb(null, false) + return cb(null, inside && path) + }) + } - return cb(er) - } + function resolveSymlink (toResolve, cb) { + var resolved = resolve(toResolve) + + // if the path has already been memoized, return immediately + var cached = resolvedPaths[resolved] + if (cached) return cb(null, cached) + + // otherwise, check the path + lstat(resolved, function (er, stat) { + if (er) return cb(er) + + // if it's not a link, cache & return the path itself + if (!stat.isSymbolicLink()) { + resolvedPaths[resolved] = resolved + return cb(null, resolved) + } - cacheAndTest(resolve(path, source), path, target, cb) + // otherwise, cache & return the link's source + readlink(resolved, function (er, source) { + if (er) return cb(er) + + resolved = resolve(resolved, source) + resolvedPaths[resolved] = resolved + cb(null, resolved) }) }) } - - function cacheAndTest (resolved, source, target, cb) { - resolvedPaths[source] = resolved - var inside = isInside(target, resolved) - log.silly("cacheAndTest", target, inside ? "is" : "is not", "inside", resolved) - cb(null, inside && source) - } } function clobberFail (p, g, cb) { diff --git a/deps/npm/lib/utils/git.js b/deps/npm/lib/utils/git.js index db5cc7baf0726b..78cb083eefaa4d 100644 --- a/deps/npm/lib/utils/git.js +++ b/deps/npm/lib/utils/git.js @@ -6,37 +6,37 @@ exports.chainableExec = chainableExec exports.whichAndExec = whichAndExec var exec = require("child_process").execFile - , spawn = require("child_process").spawn + , spawn = require("./spawn") , npm = require("../npm.js") , which = require("which") , git = npm.config.get("git") , assert = require("assert") , log = require("npmlog") -function prefixGitArgs() { +function prefixGitArgs () { return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] } -function execGit(args, options, cb) { +function execGit (args, options, cb) { log.info("git", args) return exec(git, prefixGitArgs().concat(args || []), options, cb) } -function spawnGit(args, options, cb) { +function spawnGit (args, options) { log.info("git", args) return spawn(git, prefixGitArgs().concat(args || []), options) } -function chainableExec() { +function chainableExec () { var args = Array.prototype.slice.call(arguments) return [execGit].concat(args) } -function whichGit(cb) { +function whichGit (cb) { return which(git, cb) } -function whichAndExec(args, options, cb) { +function whichAndExec (args, options, cb) { assert.equal(typeof cb, "function", "no callback provided") // check for git whichGit(function (err) { diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index c0eb83dfb1d524..ccee7563087009 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -3,7 +3,7 @@ exports.cmd = cmd exports.makeEnv = makeEnv var log = require("npmlog") - , spawn = require("child_process").spawn + , spawn = require("./spawn") , npm = require("../npm.js") , path = require("path") , fs = require("graceful-fs") diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js index cf665e4f656087..bd68a26d42ef8e 100644 --- a/deps/npm/lib/utils/map-to-registry.js +++ b/deps/npm/lib/utils/map-to-registry.js @@ -6,8 +6,8 @@ var log = require("npmlog") module.exports = mapToRegistry function mapToRegistry(name, config, cb) { - var uri - var scopedRegistry + log.silly("mapToRegistry", "name", name) + var registry // the name itself takes precedence var data = npa(name) @@ -15,40 +15,42 @@ function mapToRegistry(name, config, cb) { // the name is definitely scoped, so escape now name = name.replace("/", "%2f") - log.silly("mapToRegistry", "scope", data.scope) + log.silly("mapToRegistry", "scope (from package name)", data.scope) - scopedRegistry = config.get(data.scope + ":registry") - if (scopedRegistry) { - log.silly("mapToRegistry", "scopedRegistry (scoped package)", scopedRegistry) - uri = url.resolve(scopedRegistry, name) - } - else { - log.verbose("mapToRegistry", "no registry URL found for scope", data.scope) + registry = config.get(data.scope + ":registry") + if (!registry) { + log.verbose("mapToRegistry", "no registry URL found in name for scope", data.scope) } } // ...then --scope=@scope or --scope=scope var scope = config.get("scope") - if (!uri && scope) { + if (!registry && scope) { // I'm an enabler, sorry if (scope.charAt(0) !== "@") scope = "@" + scope - scopedRegistry = config.get(scope + ":registry") - if (scopedRegistry) { - log.silly("mapToRegistry", "scopedRegistry (scope in config)", scopedRegistry) - uri = url.resolve(scopedRegistry, name) - } - else { - log.verbose("mapToRegistry", "no registry URL found for scope", scope) + log.silly("mapToRegistry", "scope (from config)", scope) + + registry = config.get(scope + ":registry") + if (!registry) { + log.verbose("mapToRegistry", "no registry URL found in config for scope", scope) } } // ...and finally use the default registry - if (!uri) { - uri = url.resolve(config.get("registry"), name) + if (!registry) { + log.silly("mapToRegistry", "using default registry") + registry = config.get("registry") } - log.verbose("mapToRegistry", "name", name) - log.verbose("mapToRegistry", "uri", uri) - cb(null, uri) + log.silly("mapToRegistry", "registry", registry) + + var auth = config.getCredentialsByURI(registry) + + // normalize registry URL so resolution doesn't drop a piece of registry URL + var normalized = registry.slice(-1) !== "/" ? registry+"/" : registry + var uri = url.resolve(normalized, name) + log.silly("mapToRegistry", "uri", uri) + + cb(null, uri, auth, normalized) } diff --git a/deps/npm/lib/utils/spawn.js b/deps/npm/lib/utils/spawn.js new file mode 100644 index 00000000000000..953671857d0cdb --- /dev/null +++ b/deps/npm/lib/utils/spawn.js @@ -0,0 +1,23 @@ +module.exports = spawn + +var _spawn = require("child_process").spawn +var EventEmitter = require("events").EventEmitter + +function spawn (cmd, args, options) { + var raw = _spawn(cmd, args, options) + var cooked = new EventEmitter() + + raw.on("error", function (er) { + er.file = cmd + cooked.emit("error", er) + }).on("close", function (code, signal) { + cooked.emit("close", code, signal) + }) + + cooked.stdin = raw.stdin + cooked.stdout = raw.stdout + cooked.stderr = raw.stderr + cooked.kill = function (sig) { return raw.kill(sig) } + + return cooked +} diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index ede49a121edebf..7656b5d9754a3a 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -4,6 +4,7 @@ var npm = require("../npm.js") , fs = require("graceful-fs") , writeFileAtomic = require("write-file-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") , path = require("path") , log = require("npmlog") , uidNumber = require("uid-number") @@ -65,7 +66,7 @@ function pack_ (tarball, folder, pkg, cb) { if (er) log.error("tar.pack", "gzip error "+tarball) cb(er) }) - .pipe(fstream.Writer({ type: "File", path: tarball })) + .pipe(writeStreamAtomic(tarball)) .on("error", function (er) { if (er) log.error("tar.pack", "Could not write "+tarball) cb(er) @@ -228,8 +229,7 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { cb(er) }) .on("close", cb) - } else if (c.toString().match(/^package\//) || - c.toString().match(/^pax_global_header/)) { + } else if (hasTarHeader(c)) { // naked tar fst .pipe(tar.Extract(extractOpts)) @@ -273,3 +273,19 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { fst.emit("data", c) }) } + +function hasTarHeader (c) { + return c[257] === 0x75 && // tar archives have 7573746172 at position + c[258] === 0x73 && // 257 and 003030 or 202000 at position 262 + c[259] === 0x74 && + c[260] === 0x61 && + c[261] === 0x72 && + + ((c[262] === 0x00 && + c[263] === 0x30 && + c[264] === 0x30) || + + (c[262] === 0x20 && + c[263] === 0x20 && + c[264] === 0x00)) +} diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index a15e2c391c80bc..d4af41be5727d2 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -2,16 +2,15 @@ module.exports = version -var exec = require("child_process").execFile - , semver = require("semver") +var semver = require("semver") , path = require("path") , fs = require("graceful-fs") , writeFileAtomic = require("write-file-atomic") , chain = require("slide").chain , log = require("npmlog") - , which = require("which") , npm = require("./npm.js") , git = require("./utils/git.js") + , assert = require("assert") version.usage = "npm version [ | major | minor | patch | prerelease | preminor | premajor ]\n" + "\n(run in package dir)\n" @@ -24,104 +23,152 @@ version.usage = "npm version [ | major | minor | patch | prerelease function version (args, silent, cb_) { if (typeof cb_ !== "function") cb_ = silent, silent = false if (args.length > 1) return cb_(version.usage) - fs.readFile(path.join(npm.localPrefix, "package.json"), function (er, data) { - if (!args.length) { - var v = {} - Object.keys(process.versions).forEach(function (k) { - v[k] = process.versions[k] - }) - v.npm = npm.version - try { - data = JSON.parse(data.toString()) - } catch (er) { - data = null - } - if (data && data.name && data.version) { - v[data.name] = data.version - } - if (npm.config.get("json")) { - v = JSON.stringify(v, null, 2) - } - console.log(v) - return cb_() + + var packagePath = path.join(npm.localPrefix, "package.json") + fs.readFile(packagePath, function (er, data) { + function cb (er) { + if (!er && !silent) console.log("v" + data.version) + cb_(er) + } + + if (data) data = data.toString() + try { + data = JSON.parse(data) + } + catch (er) { + data = null } + if (!args.length) return dump(data, cb_) + if (er) { log.error("version", "No package.json found") return cb_(er) } + var newVersion = semver.valid(args[0]) + if (!newVersion) newVersion = semver.inc(data.version, args[0]) + if (!newVersion) return cb_(version.usage) + if (data.version === newVersion) return cb_(new Error("Version not changed")) + data.version = newVersion + + checkGit(function (er, hasGit) { + if (er) return cb_(er) + + write(data, "package.json", function (er) { + if (er) return cb_(er) + + updateShrinkwrap(newVersion, function (er, hasShrinkwrap) { + if (er || !hasGit) return cb(er) + + commit(data.version, hasShrinkwrap, cb) + }) + }) + }) + }) +} + +function updateShrinkwrap (newVersion, cb) { + fs.readFile(path.join(npm.localPrefix, "npm-shrinkwrap.json"), function (er, data) { + if (er && er.code === "ENOENT") return cb(null, false) + try { + data = data.toString() data = JSON.parse(data) - } catch (er) { - log.error("version", "Bad package.json data") - return cb_(er) + } + catch (er) { + log.error("version", "Bad npm-shrinkwrap.json data") + return cb(er) } - var newVer = semver.valid(args[0]) - if (!newVer) newVer = semver.inc(data.version, args[0]) - if (!newVer) return cb_(version.usage) - if (data.version === newVer) return cb_(new Error("Version not changed")) - data.version = newVer - - fs.stat(path.join(npm.localPrefix, ".git"), function (er, s) { - function cb (er) { - if (!er && !silent) console.log("v" + newVer) - cb_(er) + data.version = newVersion + write(data, "npm-shrinkwrap.json", function (er) { + if (er) { + log.error("version", "Bad npm-shrinkwrap.json data") + return cb(er) } - - var tags = npm.config.get('git-tag-version') - var doGit = !er && s.isDirectory() && tags - if (!doGit) return write(data, cb) - else checkGit(data, cb) + cb(null, true) }) }) } -function checkGit (data, cb) { - var args = [ "status", "--porcelain" ] - var options = {env: process.env} - - // check for git - git.whichAndExec(args, options, function (er, stdout) { - if (er && er.code === "ENOGIT") { - log.warn( - "version", - "This is a Git checkout, but the git command was not found.", - "npm could not create a Git tag for this release!" - ) - return write(data, cb) +function dump (data, cb) { + var v = {} + + if (data && data.name && data.version) v[data.name] = data.version + v.npm = npm.version + Object.keys(process.versions).sort().forEach(function (k) { + v[k] = process.versions[k] + }) + + if (npm.config.get("json")) v = JSON.stringify(v, null, 2) + + console.log(v) + cb() +} + +function checkGit (cb) { + fs.stat(path.join(npm.localPrefix, ".git"), function (er, s) { + var doGit = !er && s.isDirectory() && npm.config.get("git-tag-version") + if (!doGit) { + if (er) log.verbose("version", "error checking for .git", er) + log.verbose("version", "not tagging in git") + return cb(null, false) } - var lines = stdout.trim().split("\n").filter(function (line) { - return line.trim() && !line.match(/^\?\? /) - }).map(function (line) { - return line.trim() - }) - if (lines.length) return cb(new Error( - "Git working directory not clean.\n"+lines.join("\n"))) - write(data, function (er) { - if (er) return cb(er) - var message = npm.config.get("message").replace(/%s/g, data.version) - , sign = npm.config.get("sign-git-tag") - , flag = sign ? "-sm" : "-am" - chain - ( [ git.chainableExec([ "add", "package.json" ], {env: process.env}) - , git.chainableExec([ "commit", "-m", message ], {env: process.env}) - , sign && function (cb) { - npm.spinner.stop() - cb() - } - - , git.chainableExec([ "tag", "v" + data.version, flag, message ] - , {env: process.env}) ] - , cb ) - }) + // check for git + git.whichAndExec( + [ "status", "--porcelain" ], + { env : process.env }, + function (er, stdout) { + if (er && er.code === "ENOGIT") { + log.warn( + "version", + "This is a Git checkout, but the git command was not found.", + "npm could not create a Git tag for this release!" + ) + return cb(null, false) + } + + var lines = stdout.trim().split("\n").filter(function (line) { + return line.trim() && !line.match(/^\?\? /) + }).map(function (line) { + return line.trim() + }) + if (lines.length) return cb(new Error( + "Git working directory not clean.\n"+lines.join("\n") + )) + + cb(null, true) + } + ) }) } -function write (data, cb) { - writeFileAtomic( path.join(npm.localPrefix, "package.json") - , new Buffer(JSON.stringify(data, null, 2) + "\n") - , cb ) +function commit (version, hasShrinkwrap, cb) { + var options = { env : process.env } + var message = npm.config.get("message").replace(/%s/g, version) + var sign = npm.config.get("sign-git-tag") + var flag = sign ? "-sm" : "-am" + chain( + [ + git.chainableExec([ "add", "package.json" ], options), + hasShrinkwrap && git.chainableExec([ "add", "npm-shrinkwrap.json" ] , options), + git.chainableExec([ "commit", "-m", message ], options), + git.chainableExec([ "tag", "v" + version, flag, message ], options) + ], + cb + ) +} + +function write (data, file, cb) { + assert(data && typeof data === "object", "must pass data to version write") + assert(typeof file === "string", "must pass filename to write to version write") + + log.verbose("version.write", "data", data, "to", file) + writeFileAtomic( + path.join(npm.localPrefix, file), + new Buffer(JSON.stringify(data, null, 2) + "\n"), + cb + ) } diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 6b45cca2ec0beb..bd20ab5a3f0ae6 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -3,20 +3,29 @@ module.exports = view view.usage = "npm view pkg[@version] [[.subfield]...]" +var npm = require("./npm.js") + , readJson = require("read-package-json") + , log = require("npmlog") + , util = require("util") + , semver = require("semver") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , path = require("path") + view.completion = function (opts, cb) { if (opts.conf.argv.remain.length <= 2) { - return mapToRegistry("-/short", npm.config, function (er, uri) { + return mapToRegistry("-/short", npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, cb) + npm.registry.get(uri, { auth : auth }, cb) }) } // have the package, get the fields. var tag = npm.config.get("tag") - mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri) { + mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, d) { + npm.registry.get(uri, { auth : auth }, function (er, d) { if (er) return cb(er) var dv = d.versions[d["dist-tags"][tag]] , fields = [] @@ -48,16 +57,6 @@ view.completion = function (opts, cb) { } } -var npm = require("./npm.js") - , readJson = require("read-package-json") - , registry = npm.registry - , log = require("npmlog") - , util = require("util") - , semver = require("semver") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , path = require("path") - function view (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -97,10 +96,10 @@ function fetchAndRead (nv, args, silent, cb) { var name = nv.name , version = nv.rawSpec || npm.config.get("tag") - mapToRegistry(name, npm.config, function (er, uri) { + mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - registry.get(uri, null, function (er, data) { + npm.registry.get(uri, { auth : auth }, function (er, data) { if (er) return cb(er) if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { version = data["dist-tags"][version] diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index b33f93743d2bb4..121c4336aeab5c 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -14,14 +14,14 @@ function whoami (args, silent, cb) { var registry = npm.config.get("registry") if (!registry) return cb(new Error("no default registry set")) - var credentials = npm.config.getCredentialsByURI(registry) - if (credentials) { - if (credentials.username) { - if (!silent) console.log(credentials.username) - return process.nextTick(cb.bind(this, null, credentials.username)) + var auth = npm.config.getCredentialsByURI(registry) + if (auth) { + if (auth.username) { + if (!silent) console.log(auth.username) + return process.nextTick(cb.bind(this, null, auth.username)) } - else if (credentials.token) { - return npm.registry.whoami(registry, function (er, username) { + else if (auth.token) { + return npm.registry.whoami(registry, { auth : auth }, function (er, username) { if (er) return cb(er) if (!silent) console.log(username) diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index a7cf1046f0c0df..4f274c5c913c3e 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,6 +1,6 @@ -.TH "NPM" "1" "October 2014" "" "" +.TH "NPM" "1" "January 2015" "" "" .SH "NAME" -\fBnpm\fR \- node package manager +\fBnpm\fR \- a JavaScript package manager .P Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg\fR \fIhttps://travis\-ci\.org/npm/npm\fR .SH SYNOPSIS @@ -32,13 +32,13 @@ paths, etc\.) then read on\. .SH Fancy Install (Unix) .P There's a pretty robust install script at -https://www\.npmjs\.org/install\.sh\|\. You can download that and run it\. +https://www\.npmjs\.com/install\.sh\|\. You can download that and run it\. .P Here's an example using curl: .P .RS 2 .nf -curl \-L https://npmjs\.org/install\.sh | sh +curl \-L https://npmjs\.com/install\.sh | sh .fi .RE .SS Slightly Fancier @@ -67,47 +67,21 @@ If you've got the npm source code, you can also semi\-permanently set arbitrary config keys using the \fB\|\./configure \-\-key=val \.\.\.\fR, and then run npm commands by doing \fBnode cli\.js \fR\|\. (This is helpful for testing, or running stuff without actually installing npm itself\.) -.SH Fancy Windows Install +.SH Windows Install or Upgrade .P -You can download a zip file from https://npmjs\.org/dist/, and unpack it +You can download a zip file from https://github\.com/npm/npm/releases, and unpack it in the same folder where node\.exe lives\. .P +The latest version in a zip file is 1\.4\.12\. To upgrade to npm 2, follow the +Windows upgrade instructions in the npm Troubleshooting Guide: +.P +https://github\.com/npm/npm/wiki/Troubleshooting#upgrading\-on\-windows +.P If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly\. .SH Installing on Cygwin .P No\. -.SH Permissions when Using npm to Install Other Stuff -.P -\fBtl;dr\fR -.RS 0 -.IP \(bu 2 -Use \fBsudo\fR for greater safety\. Or don't, if you prefer not to\. -.IP \(bu 2 -npm will downgrade permissions if it's root before running any build -scripts that package authors specified\. - -.RE -.SS More details\.\.\. -.P -As of version 0\.3, it is recommended to run npm as root\. -This allows npm to change the user identifier to the \fBnobody\fR user prior -to running any package build or test commands\. -.P -If you are not the root user, or if you are on a platform that does not -support uid switching, then npm will not attempt to change the userid\. -.P -If you would like to ensure that npm \fBalways\fR runs scripts as the -"nobody" user, and have it fail if it cannot downgrade permissions, then -set the following configuration param: -.P -.RS 2 -.nf -npm config set unsafe\-perm false -.fi -.RE -.P -This will prevent running in unsafe mode, even as non\-root users\. .SH Uninstalling .P So sad to see you go\. @@ -199,13 +173,13 @@ command line arguments using nopt\. You may also want to check out \fBnpm help config\fR to learn about all the options you can set there\. .SH More Docs .P -Check out the docs \fIhttps://www\.npmjs\.org/doc/\fR, -especially the faq \fIhttps://www\.npmjs\.org/doc/faq\.html\fR\|\. +Check out the docs \fIhttps://docs\.npmjs\.com/\fR, +especially the faq \fIhttps://docs\.npmjs\.com/misc/faq\fR\|\. .P You can use the \fBnpm help\fR command to read any of them\. .P If you're a developer, and you want to use npm to publish your program, -you should read this \fIhttps://www\.npmjs\.org/doc/developers\.html\fR +you should read this \fIhttps://docs\.npmjs\.com/misc/developers\fR .SH Legal Stuff .P "npm" and "The npm Registry" are owned by npm, Inc\. @@ -224,7 +198,7 @@ specific purpose, or lack of malice in any given npm package\. .P If you have a complaint about a package in the public npm registry, and cannot resolve it with the package -owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email +owner \fIhttps://docs\.npmjs\.com/misc/disputes\fR, please email support@npmjs\.com and explain the situation\. .P Any data published to The npm Registry (including user account @@ -252,9 +226,6 @@ When you find issues, please report them: .IP \(bu 2 web: https://github\.com/npm/npm/issues -.IP \(bu 2 -email: -npm\-@googlegroups\.com .RE .P diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 6b85986e02ee69..b3abf17b68a1d5 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "October 2014" "" "" +.TH "NPM\-ADDUSER" "1" "January 2015" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS @@ -16,13 +16,14 @@ the default registry will be used (see npm help 7 \fBnpm\-config\fR)\. .P The username, password, and email are read in from prompts\. .P -You may use this command to change your email address, but not username -or password\. +To reset your password, go to https://www\.npmjs\.com/forgot .P -To reset your password, go to https://www\.npmjs\.org/forgot +To change your email address, go to https://www\.npmjs\.com/email\-edit .P You may use this command multiple times with the same user account to -authorize on a new machine\. +authorize on a new machine\. When authenticating on a new machine, +the username, password and email address must all match with +your existing record\. .P \fBnpm login\fR is an alias to \fBadduser\fR and behaves exactly the same way\. .SH CONFIGURATION @@ -64,7 +65,7 @@ npm adduser \-\-registry=http://private\-registry\.example\.com \-\-always\-auth .P This will ensure that all requests to that registry (including for tarballs) include an authorization header\. See \fBalways\-auth\fR in npm help 7 \fBnpm\-config\fR for more -details on always\-auth\. Registry\-specific configuaration of \fBalways\-auth\fR takes +details on always\-auth\. Registry\-specific configuration of \fBalways\-auth\fR takes precedence over any global configuration\. .SH SEE ALSO .RS 0 diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 6552d6cf4d52ce..8f0dc2ba57f9f0 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "October 2014" "" "" +.TH "NPM\-BIN" "1" "January 2015" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 09c7659c600f6f..5acca82e2de7b8 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "October 2014" "" "" +.TH "NPM\-BUGS" "1" "January 2015" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 0f2184292a750f..1179298c5fecf9 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "October 2014" "" "" +.TH "NPM\-BUILD" "1" "January 2015" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 0748922dae2d57..703c795c9b8e6f 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "October 2014" "" "" +.TH "NPM\-BUNDLE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index c49015ae6e72de..1cf1d7c71767e1 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "October 2014" "" "" +.TH "NPM\-CACHE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index a89cc6fd5ff01b..4cb06491007b20 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "October 2014" "" "" +.TH "NPM\-COMPLETION" "1" "January 2015" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index a93ebace724097..716303c41b4b58 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "October 2014" "" "" +.TH "NPM\-CONFIG" "1" "January 2015" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 24548077e30e42..743a5d027d6ac9 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "October 2014" "" "" +.TH "NPM\-DEDUPE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 581a58948f3c8d..95a8fd2515f033 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "October 2014" "" "" +.TH "NPM\-DEPRECATE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 1e9e5c19901e25..1feecc263c4e12 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "October 2014" "" "" +.TH "NPM\-DOCS" "1" "January 2015" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 8a19d12578839f..1d905d06b993de 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "October 2014" "" "" +.TH "NPM\-EDIT" "1" "January 2015" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 0211aef43e9edd..5f29171a9e410c 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "October 2014" "" "" +.TH "NPM\-EXPLORE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index a18a8e97a68a95..524081c93015a6 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "October 2014" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "January 2015" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 556eeb52ee8f4f..0d7f1af03cfb69 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "October 2014" "" "" +.TH "NPM\-HELP" "1" "January 2015" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 3d4ed0957f5966..d2b6a298d50e22 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "October 2014" "" "" +.TH "NPM\-INIT" "1" "January 2015" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 0df0197b0c5fb8..ec355effeb655d 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "October 2014" "" "" +.TH "NPM\-INSTALL" "1" "January 2015" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 62d76503f6abb3..86132ed1dd00e5 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "October 2014" "" "" +.TH "NPM\-LINK" "1" "January 2015" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS @@ -25,7 +25,7 @@ Note that \fBpackage\-name\fR is taken from \fBpackage\.json\fR, not from directory name\. .P The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fR\|\. -The scope must by preceded by an @\-symbol and followed by a slash\. +The scope must be preceded by an @\-symbol and followed by a slash\. .P When creating tarballs for \fBnpm publish\fR, the linked packages are "snapshotted" to their current state by resolving the symbolic links\. diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 9cf4823c9a6be3..569a2adc22d5de 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "October 2014" "" "" +.TH "NPM\-LS" "1" "January 2015" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fR in npm's source tree will show: .P .RS 2 .nf -npm@2.1.6 /path/to/npm +npm@2.2.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 45433a814e2b16..a1086ad3222191 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "October 2014" "" "" +.TH "NPM\-OUTDATED" "1" "January 2015" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 3ed5549f71c6a6..1c503795c6bcea 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "October 2014" "" "" +.TH "NPM\-OWNER" "1" "January 2015" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 8b9408abb275cd..3b39d6847a40a3 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "October 2014" "" "" +.TH "NPM\-PACK" "1" "January 2015" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index b7bcac63956a07..2ebdaa6777f614 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "October 2014" "" "" +.TH "NPM\-PREFIX" "1" "January 2015" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 1a8cc952156069..7b22233d5d59f2 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "October 2014" "" "" +.TH "NPM\-PRUNE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 665721028648df..0df825154b87a1 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "October 2014" "" "" +.TH "NPM\-PUBLISH" "1" "January 2015" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 0e04b9cfbe1d2c..1bb1e9acb3a5b4 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "October 2014" "" "" +.TH "NPM\-REBUILD" "1" "January 2015" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index dc8428d0242605..da8d6c9ad35bfc 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "October 2014" "" "" +.TH "NPM\-REPO" "1" "January 2015" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 234d0aa76e9c04..010e8153007a5a 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,6 +1,6 @@ -.TH "NPM\-RESTART" "1" "October 2014" "" "" +.TH "NPM\-RESTART" "1" "January 2015" "" "" .SH "NAME" -\fBnpm-restart\fR \- Start a package +\fBnpm-restart\fR \- Restart a package .SH SYNOPSIS .P .RS 2 @@ -10,8 +10,38 @@ npm restart [\-\- ] .RE .SH DESCRIPTION .P -This runs a package's "restart" script, if one was provided\. Otherwise it runs -package's "stop" script, if one was provided, and then the "start" script\. +This restarts a package\. +.P +This runs a package's "stop", "restart", and "start" scripts, and associated +pre\- and post\- scripts, in the order given below: +.RS 0 +.IP 1. 3 +prerestart +.IP 2. 3 +prestop +.IP 3. 3 +stop +.IP 4. 3 +poststop +.IP 5. 3 +restart +.IP 6. 3 +prestart +.IP 7. 3 +start +.IP 8. 3 +poststart +.IP 9. 3 +postrestart + +.RE +.SH NOTE +.P +Note that the "restart" script is run \fBin addition to\fR the "stop" +and "start" scripts, not instead of them\. +.P +This is the behavior as of \fBnpm\fR major version 2\. A change in this +behavior will be accompanied by an increase in major version number .SH SEE ALSO .RS 0 .IP \(bu 2 @@ -24,6 +54,8 @@ npm help test npm help start .IP \(bu 2 npm help stop +.IP \(bu 2 +npm apihelp restart .RE diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1 index c7f92fb52bf4f3..94a0afa733f27a 100644 --- a/deps/npm/man/man1/npm-rm.1 +++ b/deps/npm/man/man1/npm-rm.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RM" "1" "October 2014" "" "" +.TH "NPM\-RM" "1" "January 2015" "" "" .SH "NAME" \fBnpm-rm\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index f85ebb97085e0e..2067f9e55d2b97 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "October 2014" "" "" +.TH "NPM\-ROOT" "1" "January 2015" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 905908a7a10cd8..24ff5d9583e622 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "October 2014" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "January 2015" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS @@ -14,10 +14,13 @@ npm run [command] [\-\- ] This runs an arbitrary command from a package's \fB"scripts"\fR object\. If no package name is provided, it will search for a \fBpackage\.json\fR in the current folder and use its \fB"scripts"\fR object\. If no \fB"command"\fR -is provided, it will list the available top level scripts\. +is provided, it will list the available top level scripts\. The \fBenv\fR command +can be used to list environment variables that will be available to the script +at runtime\. If an "env" command is defined in your package it will have +precedence instead\. .P -It is used by the test, start, restart, and stop commands, but can be -called directly, as well\. +\fBrun[\-script]\fR is used by the test, start, restart, and stop commands, but can +be called directly, as well\. .P As of \fBnpm@2\.0\.0\fR \fIhttp://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can use custom arguments when executing scripts\. The special option \fB\-\-\fR is used by diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 4ad5a67b8c9587..3f7d19bd8f129c 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "October 2014" "" "" +.TH "NPM\-SEARCH" "1" "January 2015" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index fa2b313ab2bf97..5fa9fb16eeff05 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "October 2014" "" "" +.TH "NPM\-SHRINKWRAP" "1" "January 2015" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 8dbc0292ae7774..ced42ecaed737b 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "October 2014" "" "" +.TH "NPM\-STAR" "1" "January 2015" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 1762a0f08bd4e1..d2124355c4750f 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "October 2014" "" "" +.TH "NPM\-STARS" "1" "January 2015" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 0a342ee1f1d0cb..36f0c26bc5855b 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "October 2014" "" "" +.TH "NPM\-START" "1" "January 2015" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 8622d18d9640d3..0a20b4b6d4b208 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "October 2014" "" "" +.TH "NPM\-STOP" "1" "January 2015" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-submodule.1 b/deps/npm/man/man1/npm-submodule.1 index 4999ac64e91cca..71853335c59984 100644 --- a/deps/npm/man/man1/npm-submodule.1 +++ b/deps/npm/man/man1/npm-submodule.1 @@ -1,35 +1,42 @@ -.TH "NPM\-SUBMODULE" "1" "October 2014" "" "" +.\" Generated with Ronnjs 0.3.8 +.\" http://github.com/kapouer/ronnjs/ +. +.TH "NPM\-SUBMODULE" "1" "September 2014" "" "" +. .SH "NAME" -\fBnpm-submodule\fR \- Add a package as a git submodule -.SH SYNOPSIS -.P -.RS 2 +\fBnpm-submodule\fR \-\- Add a package as a git submodule +. +.SH "SYNOPSIS" +. .nf npm submodule +. .fi -.RE -.SH DESCRIPTION -.P +. +.SH "DESCRIPTION" If the specified package has a git repository url in its package\.json -description, then this command will add it as a git submodule at -\fBnode_modules/\fR\|\. +description, then this command will add it as a git submodule at \fBnode_modules/\fR\|\. +. .P -This is a convenience only\. From then on, it's up to you to manage +This is a convenience only\. From then on, it\'s up to you to manage updates by using the appropriate git commands\. npm will stubbornly refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder in it\. +. .P This command also does not install missing dependencies, if the package does not include them in its git repository\. If \fBnpm ls\fR reports that things are missing, you can either install, link, or submodule them yourself, or you can do \fBnpm explore \-\- npm install\fR to install the dependencies into the submodule folder\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 +. +.SH "SEE ALSO" +. +.IP "\(bu" 4 npm help 5 package\.json -.IP \(bu 2 +. +.IP "\(bu" 4 git help submodule - -.RE +. +.IP "" 0 diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index 5aace75083fa59..995ad3990726e7 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "1" "October 2014" "" "" +.TH "NPM\-TAG" "1" "January 2015" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS @@ -33,6 +33,27 @@ npm install \-\-tag This also applies to \fBnpm dedupe\fR\|\. .P Publishing a package always sets the "latest" tag to the published version\. +.SH PURPOSE +.P +Tags can be used to provide an alias instead of version numbers\. For +example, \fBnpm\fR currently uses the tag "next" to identify the upcoming +version, and the tag "latest" to identify the current version\. +.P +A project might choose to have multiple streams of development, e\.g\., +"stable", "canary"\. +.SH CAVEATS +.P +Tags must share a namespace with version numbers, because they are +specified in the same slot: \fBnpm install @\fR vs \fBnpm +install @\fR\|\. +.P +Tags that can be interpreted as valid semver ranges will be +rejected\. For example, \fBv1\.4\fR cannot be used as a tag, because it is +interpreted by semver as \fB>=1\.4\.0 <1\.5\.0\fR\|\. See +https://github\.com/npm/npm/issues/6082\|\. +.P +The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter \fBv\fR\|\. .SH SEE ALSO .RS 0 .IP \(bu 2 @@ -48,6 +69,8 @@ npm help config .IP \(bu 2 npm help 7 config .IP \(bu 2 +npm apihelp tag +.IP \(bu 2 npm help 5 npmrc .RE diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 0b4a9f4dbb3994..b398e81eaf02c6 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "October 2014" "" "" +.TH "NPM\-TEST" "1" "January 2015" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index a56f8bb9187a8b..5568b48371e57f 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RM" "1" "October 2014" "" "" +.TH "NPM\-RM" "1" "January 2015" "" "" .SH "NAME" \fBnpm-rm\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 6cb1df7263cc1c..7f96d4f3676d40 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "October 2014" "" "" +.TH "NPM\-UNPUBLISH" "1" "January 2015" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 19adfc92765b4a..969909482c5081 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "October 2014" "" "" +.TH "NPM\-UPDATE" "1" "January 2015" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS @@ -13,7 +13,9 @@ npm update [\-g] [ [ \.\.\.]] This command will update all the packages listed to the latest version (specified by the \fBtag\fR config)\. .P -It will also install missing packages\. +It will also install missing packages\. As with all commands that install +packages, the \fB\-\-dev\fR flag will cause \fBdevDependencies\fR to be processed +as well\. .P If the \fB\-g\fR flag is specified, this command will update globally installed packages\. diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 21fde3452faf2f..2ae02d093747a4 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "October 2014" "" "" +.TH "NPM\-VERSION" "1" "January 2015" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS @@ -11,7 +11,7 @@ npm version [ | major | minor | patch | premajor | preminor | prepat .SH DESCRIPTION .P Run this in a package directory to bump the version and write the new -data back to the package\.json file\. +data back to \fBpackage\.json\fR and, if present, \fBnpm\-shrinkwrap\.json\fR\|\. .P The \fBnewversion\fR argument should be a valid semver string, \fIor\fR a valid second argument to semver\.inc (one of "patch", "minor", "major", diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 35ef045329e315..2a279d2a799b9d 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "October 2014" "" "" +.TH "NPM\-VIEW" "1" "January 2015" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 34a3f04ac35d6d..b993e0c9b53f92 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "October 2014" "" "" +.TH "NPM\-WHOAMI" "1" "January 2015" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index a275e4728d5a54..6f6b18416eb210 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,6 +1,6 @@ -.TH "NPM" "1" "October 2014" "" "" +.TH "NPM" "1" "January 2015" "" "" .SH "NAME" -\fBnpm\fR \- node package manager +\fBnpm\fR \- javascript package manager .SH SYNOPSIS .P .RS 2 @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -2.1.6 +2.2.0 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 index 4c76b8a0cdb672..27588a2407ed0f 100644 --- a/deps/npm/man/man3/npm-bin.3 +++ b/deps/npm/man/man3/npm-bin.3 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "3" "October 2014" "" "" +.TH "NPM\-BIN" "3" "January 2015" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 index cd8dda6ea5e49b..6b7503fefd11e3 100644 --- a/deps/npm/man/man3/npm-bugs.3 +++ b/deps/npm/man/man3/npm-bugs.3 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "3" "October 2014" "" "" +.TH "NPM\-BUGS" "3" "January 2015" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3 index 1dccd8fd0c1acf..15a2839cce5a9f 100644 --- a/deps/npm/man/man3/npm-cache.3 +++ b/deps/npm/man/man3/npm-cache.3 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "3" "October 2014" "" "" +.TH "NPM\-CACHE" "3" "January 2015" "" "" .SH "NAME" \fBnpm-cache\fR \- manage the npm cache programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3 index 87ad3253b12d6f..ee757dfce766fc 100644 --- a/deps/npm/man/man3/npm-commands.3 +++ b/deps/npm/man/man3/npm-commands.3 @@ -1,4 +1,4 @@ -.TH "NPM\-COMMANDS" "3" "October 2014" "" "" +.TH "NPM\-COMMANDS" "3" "January 2015" "" "" .SH "NAME" \fBnpm-commands\fR \- npm commands .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 index 763e2252548ba5..be2522cb49c9c7 100644 --- a/deps/npm/man/man3/npm-config.3 +++ b/deps/npm/man/man3/npm-config.3 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "3" "October 2014" "" "" +.TH "NPM\-CONFIG" "3" "January 2015" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 index 9b543d36d5a2f5..d04e25d43f8220 100644 --- a/deps/npm/man/man3/npm-deprecate.3 +++ b/deps/npm/man/man3/npm-deprecate.3 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "3" "October 2014" "" "" +.TH "NPM\-DEPRECATE" "3" "January 2015" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 index ad93e305bd5956..4dd5a84f7e2284 100644 --- a/deps/npm/man/man3/npm-docs.3 +++ b/deps/npm/man/man3/npm-docs.3 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "3" "October 2014" "" "" +.TH "NPM\-DOCS" "3" "January 2015" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3 index 82767c8b7e1cf0..d7c2ad4f1de0a0 100644 --- a/deps/npm/man/man3/npm-edit.3 +++ b/deps/npm/man/man3/npm-edit.3 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "3" "October 2014" "" "" +.TH "NPM\-EDIT" "3" "January 2015" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3 index 54948eadc17095..8648eac98e3f4d 100644 --- a/deps/npm/man/man3/npm-explore.3 +++ b/deps/npm/man/man3/npm-explore.3 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "3" "October 2014" "" "" +.TH "NPM\-EXPLORE" "3" "January 2015" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 index 8f4f346c260197..a9baaf36d9e986 100644 --- a/deps/npm/man/man3/npm-help-search.3 +++ b/deps/npm/man/man3/npm-help-search.3 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "3" "October 2014" "" "" +.TH "NPM\-HELP\-SEARCH" "3" "January 2015" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search the help pages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3 index d5da00dd8f6d97..9a2ce6bc82e8fa 100644 --- a/deps/npm/man/man3/npm-init.3 +++ b/deps/npm/man/man3/npm-init.3 @@ -1,4 +1,4 @@ -.TH "NPM" "" "October 2014" "" "" +.TH "NPM" "" "January 2015" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3 index ec98278cad9ba2..511791791d1645 100644 --- a/deps/npm/man/man3/npm-install.3 +++ b/deps/npm/man/man3/npm-install.3 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "3" "October 2014" "" "" +.TH "NPM\-INSTALL" "3" "January 2015" "" "" .SH "NAME" \fBnpm-install\fR \- install a package programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3 index 0c379a48c5927c..2d5bf77c3c12c4 100644 --- a/deps/npm/man/man3/npm-link.3 +++ b/deps/npm/man/man3/npm-link.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "3" "October 2014" "" "" +.TH "NPM\-LINK" "3" "January 2015" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3 index 61fac42ebd1fcf..68787c89b1917b 100644 --- a/deps/npm/man/man3/npm-load.3 +++ b/deps/npm/man/man3/npm-load.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LOAD" "3" "October 2014" "" "" +.TH "NPM\-LOAD" "3" "January 2015" "" "" .SH "NAME" \fBnpm-load\fR \- Load config settings .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 index 84558abeb3a2b3..de3d127df64e75 100644 --- a/deps/npm/man/man3/npm-ls.3 +++ b/deps/npm/man/man3/npm-ls.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "3" "October 2014" "" "" +.TH "NPM\-LS" "3" "January 2015" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -63,6 +63,6 @@ List packages in the global install prefix instead of in the current project\. .P Note, if parseable is set or long isn't set, then duplicates will be trimmed\. -This means that if a submodule a same dependency as a parent module, then the +This means that if a submodule has the same dependency as a parent module, then the dependency will only be output once\. diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3 index 2bba8469fc5eef..9e96d44ab3f737 100644 --- a/deps/npm/man/man3/npm-outdated.3 +++ b/deps/npm/man/man3/npm-outdated.3 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "3" "October 2014" "" "" +.TH "NPM\-OUTDATED" "3" "January 2015" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 index 101b752e9f7bc4..35a993ba8b3003 100644 --- a/deps/npm/man/man3/npm-owner.3 +++ b/deps/npm/man/man3/npm-owner.3 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "3" "October 2014" "" "" +.TH "NPM\-OWNER" "3" "January 2015" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 index d9da93e33c2536..7d95e575137871 100644 --- a/deps/npm/man/man3/npm-pack.3 +++ b/deps/npm/man/man3/npm-pack.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "3" "October 2014" "" "" +.TH "NPM\-PACK" "3" "January 2015" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 index e2da6d67eda9e9..4aaed71a734928 100644 --- a/deps/npm/man/man3/npm-prefix.3 +++ b/deps/npm/man/man3/npm-prefix.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "3" "October 2014" "" "" +.TH "NPM\-PREFIX" "3" "January 2015" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3 index 48a06c97c7ad53..310dfe292e0baa 100644 --- a/deps/npm/man/man3/npm-prune.3 +++ b/deps/npm/man/man3/npm-prune.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "3" "October 2014" "" "" +.TH "NPM\-PRUNE" "3" "January 2015" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 index 13dbd95f33bd53..28f77205c5450e 100644 --- a/deps/npm/man/man3/npm-publish.3 +++ b/deps/npm/man/man3/npm-publish.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "3" "October 2014" "" "" +.TH "NPM\-PUBLISH" "3" "January 2015" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 index 21a5aba1deb816..082589b5de8878 100644 --- a/deps/npm/man/man3/npm-rebuild.3 +++ b/deps/npm/man/man3/npm-rebuild.3 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "3" "October 2014" "" "" +.TH "NPM\-REBUILD" "3" "January 2015" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 index 5638d434aec737..64cc0bad698e8e 100644 --- a/deps/npm/man/man3/npm-repo.3 +++ b/deps/npm/man/man3/npm-repo.3 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "3" "October 2014" "" "" +.TH "NPM\-REPO" "3" "January 2015" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3 index be948334aa1443..2cacefc5b18d3b 100644 --- a/deps/npm/man/man3/npm-restart.3 +++ b/deps/npm/man/man3/npm-restart.3 @@ -1,6 +1,6 @@ -.TH "NPM\-RESTART" "3" "October 2014" "" "" +.TH "NPM\-RESTART" "3" "January 2015" "" "" .SH "NAME" -\fBnpm-restart\fR \- Start a package +\fBnpm-restart\fR \- Restart a package .SH SYNOPSIS .P .RS 2 @@ -10,14 +10,43 @@ npm\.commands\.restart(packages, callback) .RE .SH DESCRIPTION .P -This runs a package's "restart" script, if one was provided\. -Otherwise it runs package's "stop" script, if one was provided, and then -the "start" script\. +This restarts a package (or multiple packages)\. +.P +This runs a package's "stop", "restart", and "start" scripts, and associated +pre\- and post\- scripts, in the order given below: +.RS 0 +.IP 1. 3 +prerestart +.IP 2. 3 +prestop +.IP 3. 3 +stop +.IP 4. 3 +poststop +.IP 5. 3 +restart +.IP 6. 3 +prestart +.IP 7. 3 +start +.IP 8. 3 +poststart +.IP 9. 3 +postrestart + +.RE .P If no version is specified, then it restarts the "active" version\. .P -npm can run tests on multiple packages\. Just specify multiple packages -in the \fBpackages\fR parameter\. +npm can restart multiple packages\. Just specify multiple packages in +the \fBpackages\fR parameter\. +.SH NOTE +.P +Note that the "restart" script is run \fBin addition to\fR the "stop" +and "start" scripts, not instead of them\. +.P +This is the behavior as of \fBnpm\fR major version 2\. A change in this +behavior will be accompanied by an increase in major version number .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 index 68bac79fa036a3..15d5230d170c72 100644 --- a/deps/npm/man/man3/npm-root.3 +++ b/deps/npm/man/man3/npm-root.3 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "3" "October 2014" "" "" +.TH "NPM\-ROOT" "3" "January 2015" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3 index 866f1e01f3f315..59bf90d965ab64 100644 --- a/deps/npm/man/man3/npm-run-script.3 +++ b/deps/npm/man/man3/npm-run-script.3 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "3" "October 2014" "" "" +.TH "NPM\-RUN\-SCRIPT" "3" "January 2015" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 index ba0cc5f4c3b1c4..4fffa3bd960fc2 100644 --- a/deps/npm/man/man3/npm-search.3 +++ b/deps/npm/man/man3/npm-search.3 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "3" "October 2014" "" "" +.TH "NPM\-SEARCH" "3" "January 2015" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 index 0f87c50906cd75..92ce7b1b2fea99 100644 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ b/deps/npm/man/man3/npm-shrinkwrap.3 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "3" "October 2014" "" "" +.TH "NPM\-SHRINKWRAP" "3" "January 2015" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3 index 4eabb36c444b21..f3330a5885e5b3 100644 --- a/deps/npm/man/man3/npm-start.3 +++ b/deps/npm/man/man3/npm-start.3 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "3" "October 2014" "" "" +.TH "NPM\-START" "3" "January 2015" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS @@ -12,6 +12,6 @@ npm\.commands\.start(packages, callback) .P This runs a package's "start" script, if one was provided\. .P -npm can run tests on multiple packages\. Just specify multiple packages -in the \fBpackages\fR parameter\. +npm can start multiple packages\. Just specify multiple packages in the +\fBpackages\fR parameter\. diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 index aa55b84736bffc..551eedbc12c908 100644 --- a/deps/npm/man/man3/npm-stop.3 +++ b/deps/npm/man/man3/npm-stop.3 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "3" "October 2014" "" "" +.TH "NPM\-STOP" "3" "January 2015" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-submodule.3 b/deps/npm/man/man3/npm-submodule.3 index 378862a563a944..95739ce3b08428 100644 --- a/deps/npm/man/man3/npm-submodule.3 +++ b/deps/npm/man/man3/npm-submodule.3 @@ -1,35 +1,42 @@ -.TH "NPM\-SUBMODULE" "3" "October 2014" "" "" +.\" Generated with Ronnjs 0.3.8 +.\" http://github.com/kapouer/ronnjs/ +. +.TH "NPM\-SUBMODULE" "3" "September 2014" "" "" +. .SH "NAME" -\fBnpm-submodule\fR \- Add a package as a git submodule -.SH SYNOPSIS -.P -.RS 2 +\fBnpm-submodule\fR \-\- Add a package as a git submodule +. +.SH "SYNOPSIS" +. .nf npm\.commands\.submodule(packages, callback) +. .fi -.RE -.SH DESCRIPTION -.P +. +.SH "DESCRIPTION" For each package specified, npm will check if it has a git repository url -in its package\.json description then add it as a git submodule at -\fBnode_modules/\fR\|\. +in its package\.json description then add it as a git submodule at \fBnode_modules/\fR\|\. +. .P -This is a convenience only\. From then on, it's up to you to manage +This is a convenience only\. From then on, it\'s up to you to manage updates by using the appropriate git commands\. npm will stubbornly refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder in it\. +. .P This command also does not install missing dependencies, if the package does not include them in its git repository\. If \fBnpm ls\fR reports that things are missing, you can either install, link, or submodule them yourself, or you can do \fBnpm explore \-\- npm install\fR to install the dependencies into the submodule folder\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 +. +.SH "SEE ALSO" +. +.IP "\(bu" 4 npm help json -.IP \(bu 2 +. +.IP "\(bu" 4 git help submodule - -.RE +. +.IP "" 0 diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 index 4da13767f93f89..c0092c274f4274 100644 --- a/deps/npm/man/man3/npm-tag.3 +++ b/deps/npm/man/man3/npm-tag.3 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "3" "October 2014" "" "" +.TH "NPM\-TAG" "3" "January 2015" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS @@ -21,7 +21,7 @@ is the package name and version is the version number (much like installing a specific version)\. .P The second element is the name of the tag to tag this version with\. If this -parameter is missing or falsey (empty), the default froom the config will be +parameter is missing or falsey (empty), the default from the config will be used\. For more information about how to set this config, check \fBman 3 npm\-config\fR for programmatic usage or \fBman npm\-config\fR for cli usage\. diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 index f6d0f6d3f115e0..ff969ec023d414 100644 --- a/deps/npm/man/man3/npm-test.3 +++ b/deps/npm/man/man3/npm-test.3 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "3" "October 2014" "" "" +.TH "NPM\-TEST" "3" "January 2015" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 index 8505f399559bc4..0cf637ca2c9462 100644 --- a/deps/npm/man/man3/npm-uninstall.3 +++ b/deps/npm/man/man3/npm-uninstall.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "3" "October 2014" "" "" +.TH "NPM\-UNINSTALL" "3" "January 2015" "" "" .SH "NAME" \fBnpm-uninstall\fR \- uninstall a package programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3 index 9b4ab467d2f9ba..48f865db19b2e8 100644 --- a/deps/npm/man/man3/npm-unpublish.3 +++ b/deps/npm/man/man3/npm-unpublish.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "3" "October 2014" "" "" +.TH "NPM\-UNPUBLISH" "3" "January 2015" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3 index 3f40eb0db2da3c..eee573b2d88bbd 100644 --- a/deps/npm/man/man3/npm-update.3 +++ b/deps/npm/man/man3/npm-update.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "3" "October 2014" "" "" +.TH "NPM\-UPDATE" "3" "January 2015" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS @@ -8,7 +8,7 @@ npm\.commands\.update(packages, callback) .fi .RE -.TH "DESCRIPTION" "" "October 2014" "" "" +.TH "DESCRIPTION" "" "January 2015" "" "" .SH "NAME" \fBDESCRIPTION\fR .P diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 index 16979247fe4d43..2cf7fe21534e7f 100644 --- a/deps/npm/man/man3/npm-version.3 +++ b/deps/npm/man/man3/npm-version.3 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "3" "October 2014" "" "" +.TH "NPM\-VERSION" "3" "January 2015" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3 index e49f28d7edc993..42bbf40c508faa 100644 --- a/deps/npm/man/man3/npm-view.3 +++ b/deps/npm/man/man3/npm-view.3 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "3" "October 2014" "" "" +.TH "NPM\-VIEW" "3" "January 2015" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3 index 2d32507f513a9c..cb320ec46ab29f 100644 --- a/deps/npm/man/man3/npm-whoami.3 +++ b/deps/npm/man/man3/npm-whoami.3 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "3" "October 2014" "" "" +.TH "NPM\-WHOAMI" "3" "January 2015" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 index 71bbc58ad09e03..5f89ff7a36b105 100644 --- a/deps/npm/man/man3/npm.3 +++ b/deps/npm/man/man3/npm.3 @@ -1,6 +1,6 @@ -.TH "NPM" "3" "October 2014" "" "" +.TH "NPM" "3" "January 2015" "" "" .SH "NAME" -\fBnpm\fR \- node package manager +\fBnpm\fR \- javascript package manager .SH SYNOPSIS .P .RS 2 @@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) { .RE .SH VERSION .P -2.1.6 +2.2.0 .SH DESCRIPTION .P This is the API documentation for npm\. diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 9cd3436f894a08..2ae88d142af438 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2014" "" "" +.TH "NPM\-FOLDERS" "5" "January 2015" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index 9cd3436f894a08..2ae88d142af438 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2014" "" "" +.TH "NPM\-FOLDERS" "5" "January 2015" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index fa9ef95c4ba2d2..113153f082b588 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2014" "" "" +.TH "PACKAGE\.JSON" "5" "January 2015" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -31,7 +31,7 @@ The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive\. .IP \(bu 2 You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it\. http://registry\.npmjs\.org/ +already, before you get too attached to it\. https://www\.npmjs\.com/ .RE .P @@ -279,7 +279,7 @@ Put example scripts in here\. Someday, it might be exposed in some clever way\. .SH repository .P Specify the place where your code lives\. This is helpful for people who -want to contribute\. If the git repo is on github, then the \fBnpm docs\fR +want to contribute\. If the git repo is on GitHub, then the \fBnpm docs\fR command will be able to find you\. .P Do it like this: @@ -421,7 +421,9 @@ The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. .SH GitHub URLs .P -As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-project"\. For example: +As of version 1\.1\.65, you can refer to GitHub urls as just "foo": +"user/foo\-project"\. Just as with git URLs, a \fBcommit\-ish\fR suffix can be +included\. For example: .P .RS 2 .nf @@ -429,7 +431,8 @@ As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-p "name": "foo", "version": "0\.0\.0", "dependencies": { - "express": "visionmedia/express" + "express": "visionmedia/express", + "mocha": "visionmedia/mocha#4727d357ea" } } .fi @@ -510,7 +513,7 @@ run this script as well, so that you can test it easily\. .P In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a \fBrequire\fR of this host\. -This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing +This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing a specific interface, expected and specified by the host documentation\. .P For example: diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index d2846869abf75b..fc2986b901df55 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "October 2014" "" "" +.TH "NPMRC" "5" "January 2015" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION @@ -38,6 +38,16 @@ prefix = ${HOME}/\.npm\-packages Each of these files is loaded, and config options are resolved in priority order\. For example, a setting in the userconfig file would override the setting in the globalconfig file\. +.P +Array values are specified by adding "[]" after the key name\. For +example: +.P +.RS 2 +.nf +key[] = "first value" +key[] = "second value" +.fi +.RE .SS Per\-project config file .P When working locally in a project, a \fB\|\.npmrc\fR file in the root of the diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index fa9ef95c4ba2d2..113153f082b588 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2014" "" "" +.TH "PACKAGE\.JSON" "5" "January 2015" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -31,7 +31,7 @@ The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive\. .IP \(bu 2 You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it\. http://registry\.npmjs\.org/ +already, before you get too attached to it\. https://www\.npmjs\.com/ .RE .P @@ -279,7 +279,7 @@ Put example scripts in here\. Someday, it might be exposed in some clever way\. .SH repository .P Specify the place where your code lives\. This is helpful for people who -want to contribute\. If the git repo is on github, then the \fBnpm docs\fR +want to contribute\. If the git repo is on GitHub, then the \fBnpm docs\fR command will be able to find you\. .P Do it like this: @@ -421,7 +421,9 @@ The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. .SH GitHub URLs .P -As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-project"\. For example: +As of version 1\.1\.65, you can refer to GitHub urls as just "foo": +"user/foo\-project"\. Just as with git URLs, a \fBcommit\-ish\fR suffix can be +included\. For example: .P .RS 2 .nf @@ -429,7 +431,8 @@ As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-p "name": "foo", "version": "0\.0\.0", "dependencies": { - "express": "visionmedia/express" + "express": "visionmedia/express", + "mocha": "visionmedia/mocha#4727d357ea" } } .fi @@ -510,7 +513,7 @@ run this script as well, so that you can test it easily\. .P In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a \fBrequire\fR of this host\. -This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing +This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing a specific interface, expected and specified by the host documentation\. .P For example: diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 0dc15318ab4587..ebaf0386c23207 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "October 2014" "" "" +.TH "NPM\-CODING\-STYLE" "7" "January 2015" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION @@ -10,7 +10,7 @@ designed to reduce visual clutter and make bugs more apparent\. If you want to contribute to npm (which is very encouraged), you should make your code conform to npm's style\. .P -Note: this concerns npm's code not the specific packages at npmjs\.org +Note: this concerns npm's code not the specific packages that you can download from the npm registry\. .SH Line Length .P Keep lines shorter than 80 characters\. It's better for lines to be @@ -19,7 +19,7 @@ statements onto multiple lines\. .SH Indentation .P Two\-spaces\. Tabs are better, but they look like hell in web browsers -(and on github), and node uses 2 spaces, so that's that\. +(and on GitHub), and node uses 2 spaces, so that's that\. .P Configure your editor appropriately\. .SH Curly braces diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index e3b4c5c6f639c3..d561e074732c1c 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "October 2014" "" "" +.TH "NPM\-CONFIG" "7" "January 2015" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -192,16 +192,32 @@ The browser that is called by the \fBnpm docs\fR command to open websites\. .IP \(bu 2 Default: The npm CA certificate .IP \(bu 2 -Type: String or null +Type: String, Array or null .RE .P The Certificate Authority signing certificate that is trusted for SSL -connections to the registry\. +connections to the registry\. Values should be in PEM format with newlines +replaced by the string "\\n"\. For example: +.P +.RS 2 +.nf +ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-" +.fi +.RE .P Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority\. .P +Multiple CAs can be trusted by specifying an array of certificates: +.P +.RS 2 +.nf +ca[]="\.\.\." +ca[]="\.\.\." +.fi +.RE +.P See also the \fBstrict\-ssl\fR config\. .SS cafile .RS 0 @@ -504,14 +520,15 @@ The string that starts all the debugging log output\. .SS https\-proxy .RS 0 .IP \(bu 2 -Default: the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or -\fBhttp_proxy\fR environment variables\. +Default: null .IP \(bu 2 Type: url .RE .P -A proxy to use for outgoing https requests\. +A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fR or +\fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables are set, +proxy settings will be honored by the underlying \fBrequest\fR library\. .SS ignore\-scripts .RS 0 .IP \(bu 2 @@ -801,13 +818,15 @@ this as true\. .SS proxy .RS 0 .IP \(bu 2 -Default: \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variable, or null +Default: null .IP \(bu 2 Type: url .RE .P -A proxy to use for outgoing http requests\. +A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fR or +\fBhttp_proxy\fR environment variables are set, proxy settings will be +honored by the underlying \fBrequest\fR library\. .SS rebuild\-bundle .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index bf8edb29f23893..ba47e45fabb1e1 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "October 2014" "" "" +.TH "NPM\-DEVELOPERS" "7" "January 2015" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION @@ -112,6 +112,20 @@ ignore the stuff matched by the \fB\|\.gitignore\fR file\. If you \fIwant\fR to include something that is excluded by your \fB\|\.gitignore\fR file, you can create an empty \fB\|\.npmignore\fR file to override it\. .P +\fB\|\.npmignore\fR files follow the same pattern rules \fIhttp://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR +as \fB\|\.gitignore\fR files: +.RS 0 +.IP \(bu 2 +Blank lines or lines starting with \fB#\fR are ignored\. +.IP \(bu 2 +Standard glob patterns work\. +.IP \(bu 2 +You can end patterns with a forward slash \fB/\fR to specify a directory\. +.IP \(bu 2 +You can negate a pattern by starting it with an exclamation point \fB!\fR\|\. + +.RE +.P By default, the following paths and files are ignored, so there's no need to add them to \fB\|\.npmignore\fR explicitly: .RS 0 diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index 9cf7009f6206bb..3d67933982cdc1 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "October 2014" "" "" +.TH "NPM\-DISPUTES" "7" "January 2015" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .SH SYNOPSIS diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7 index 563509a8728b9b..cf6a37cfdde22b 100644 --- a/deps/npm/man/man7/npm-faq.7 +++ b/deps/npm/man/man7/npm-faq.7 @@ -1,9 +1,9 @@ -.TH "NPM\-FAQ" "7" "October 2014" "" "" +.TH "NPM\-FAQ" "7" "January 2015" "" "" .SH "NAME" \fBnpm-faq\fR \- Frequently Asked Questions .SH Where can I find these docs in HTML? .P -https://www\.npmjs\.org/doc/, or run: +https://docs\.npmjs\.com/, or run: .P .RS 2 .nf @@ -80,7 +80,7 @@ Usually, no\. Allow npm to resolve dependencies for your packages\. For packages you \fBdeploy\fR, such as websites and apps, you should use npm shrinkwrap to lock down your full dependency tree: .P -https://www\.npmjs\.org/doc/cli/npm\-shrinkwrap\.html +https://docs\.npmjs\.com/cli/shrinkwrap .P If you are paranoid about depending on the npm ecosystem, you should run a private npm mirror or a private cache\. @@ -148,7 +148,7 @@ In those cases, you can do this: .P .RS 2 .nf -curl https://www\.npmjs\.org/install\.sh | sh +curl https://www\.npmjs\.com/install\.sh | sh .fi .RE .SH What is a \fBpackage\fR? @@ -332,7 +332,7 @@ See npm help \fBnpm\-link\fR See npm help 7 \fBnpm\-registry\fR\|\. .SH I forgot my password, and can't publish\. How do I reset it? .P -Go to https://npmjs\.org/forgot\|\. +Go to https://npmjs\.com/forgot\|\. .SH I get ECONNREFUSED a lot\. What's up? .P Either the registry is down, or node's DNS isn't able to reach out\. @@ -350,20 +350,48 @@ You can also often get a faster response by visiting the #npm channel on Freenode IRC\. .SH Why no namespaces? .P -Please see this discussion: https://github\.com/npm/npm/issues/798 +npm has only one global namespace\. If you want to namespace your own packages, +you may: simply use the \fB\-\fR character to separate the names\. npm is a mostly +anarchic system\. There is not sufficient need to impose namespace rules on +everyone\. .P -tl;dr \- It doesn't actually make things better, and can make them worse\. +As of 2\.0, npm supports scoped packages, which allow you to publish a group of +related modules without worrying about name collisions\. .P -If you want to namespace your own packages, you may: simply use the -\fB\-\fR character to separate the names\. npm is a mostly anarchic system\. -There is not sufficient need to impose namespace rules on everyone\. +Every npm user owns the scope associated with their username\. For example, the +user named \fBnpm\fR owns the scope \fB@npm\fR\|\. Scoped packages are published inside a +scope by naming them as if they were files under the scope directory, e\.g\., by +setting \fBname\fR in \fBpackage\.json\fR to \fB@npm/npm\fR\|\. +.P +Scoped packages can coexist with public npm packages in a private npm registry\. +At present (2014\-11\-04) scoped packages may NOT be published to the public npm +registry\. +.P +Unscoped packages can only depend on other unscoped packages\. Scoped packages +can depend on packages from their own scope, a different scope, or the public +registry (unscoped)\. +.P +For the current documentation of scoped packages, see +https://docs\.npmjs\.com/misc/scope +.P +References: +.RS 0 +.IP 1. 3 +For the reasoning behind the "one global namespace", please see this +discussion: https://github\.com/npm/npm/issues/798 (TL;DR: It doesn't +actually make things better, and can make them worse\.) +.IP 2. 3 +For the pre\-implementation discussion of the scoped package feature, see +this discussion: https://github\.com/npm/npm/issues/5239 + +.RE .SH Who does npm? .P npm was originally written by Isaac Z\. Schlueter, and many others have contributed to it, some of them quite substantially\. .P The npm open source project, The npm Registry, and the community -website \fIhttps://www\.npmjs\.org\fR are maintained and operated by the +website \fIhttps://www\.npmjs\.com\fR are maintained and operated by the good folks at npm, Inc\. \fIhttp://www\.npmjs\.com\fR .SH I have a question or request not addressed here\. Where should I put it? .P diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 442815a2e52029..b3608b57774d41 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,15 +1,15 @@ -.TH "NPM\-INDEX" "7" "October 2014" "" "" +.TH "NPM\-INDEX" "7" "January 2015" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README .P -node package manager +a JavaScript package manager .SH Command Line Documentation .P Using npm on the command line .SS npm help npm .P -node package manager +javascript package manager .SS npm help adduser .P Add a registry user account @@ -93,7 +93,7 @@ Rebuild a package Open package repository page in the browser .SS npm help restart .P -Start a package +Restart a package .SS npm help rm .P Remove a package @@ -150,7 +150,7 @@ Display npm username Using npm in your Node programs .SS npm apihelp npm .P -node package manager +javascript package manager .SS npm apihelp bin .P Display npm bin folder @@ -222,7 +222,7 @@ Rebuild a package Open package repository page in the browser .SS npm apihelp restart .P -Start a package +Restart a package .SS npm apihelp root .P Display npm root diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 9de209d468fc32..f89b94507e7e3a 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "October 2014" "" "" +.TH "NPM\-REGISTRY" "7" "January 2015" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION @@ -52,7 +52,7 @@ No, but it's way easier\. Basically, yes, you do, or you have to effectively implement the entire CouchDB API anyway\. .SH Is there a website or something to see package docs and such? .P -Yes, head over to https://npmjs\.org/ +Yes, head over to https://npmjs\.com/ .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index f876e4eaaa65fd..2cae9e88c7bb27 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "October 2014" "" "" +.TH "NPM\-SCOPE" "7" "January 2015" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 9d11f4626cbf1d..69d880d34f19c0 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "October 2014" "" "" +.TH "NPM\-SCRIPTS" "7" "January 2015" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -26,12 +26,6 @@ Run BEFORE the package is uninstalled\. postuninstall: Run AFTER the package is uninstalled\. .IP \(bu 2 -preupdate: -Run BEFORE the package is updated with the update command\. -.IP \(bu 2 -update, postupdate: -Run AFTER the package is updated with the update command\. -.IP \(bu 2 pretest, test, posttest: Run by the \fBnpm test\fR command\. .IP \(bu 2 diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index b0a4fca5d7cc49..73963fe3b37787 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "October 2014" "" "" +.TH "NPM\-REMOVAL" "1" "January 2015" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index a6be932b4747f9..bf239f7e621aff 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "October 2014" "" "" +.TH "SEMVER" "7" "January 2015" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage @@ -22,12 +22,12 @@ As a command\-line utility: .nf $ semver \-h -Usage: semver [ [\.\.\.]] [\-r | \-i | \-d ] +Usage: semver [ [\.\.\.]] [\-r | \-i | \-\-preid | \-l | \-rv] Test if version(s) satisfy the supplied range(s), and sort them\. Multiple versions or ranges may be supplied, unless increment -or decrement options are specified\. In that case, only a single -version may be used, and it is incremented by the specified level +option is specified\. In that case, only a single version may +be used, and it is incremented by the specified level Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions\. @@ -112,6 +112,35 @@ alpha/beta/rc versions\. By including a prerelease tag in the range, the user is indicating that they are aware of the risk\. However, it is still not appropriate to assume that they have opted into taking a similar risk on the \fInext\fR set of prerelease versions\. +.SS Prerelease Identifiers +.P +The method \fB\|\.inc\fR takes an additional \fBidentifier\fR string argument that +will append the value of the string as a prerelease identifier: +.P +.RS 2 +.nf +> semver\.inc('1\.2\.3', 'pre', 'beta') +\|'1\.2\.4\-beta\.0' +.fi +.RE +.P +command\-line example: +.P +.RS 2 +.nf +$ semver 1\.2\.3 \-i prerelease \-\-preid beta +1\.2\.4\-beta\.0 +.fi +.RE +.P +Which then can be used to increment further: +.P +.RS 2 +.nf +$ semver 1\.2\.4\-beta\.0 \-i prerelease +1\.2\.4\-beta\.1 +.fi +.RE .SS Advanced Range Syntax .P Advanced range syntax desugars to primitive comparators in @@ -197,8 +226,6 @@ equal to \fBbeta\.2\fR\|\. So, \fB1\.2\.3\-beta\.4\fR would be allowed, but different \fB[major, minor, patch]\fR tuple\. .RE -.P -Note: this is the same as the \fB~>\fR operator in rubygems\. .SS Caret Ranges \fB^1\.2\.3\fR \fB^0\.2\.5\fR \fB^0\.0\.4\fR .P Allows changes that do not modify the left\-most non\-zero digit in the @@ -313,6 +340,10 @@ invalid comparison string is provided\. .IP \(bu 2 \fBrcompare(v1, v2)\fR: The reverse of compare\. Sorts an array of versions in descending order when passed to \fBArray\.sort()\fR\|\. +.IP \(bu 2 +\fBdiff(v1, v2)\fR: Returns difference between two versions by the release type +(\fBmajor\fR, \fBpremajor\fR, \fBminor\fR, \fBpreminor\fR, \fBpatch\fR, \fBprepatch\fR, or \fBprerelease\fR), +or null if the versions are the same\. .RE .SS Ranges diff --git a/deps/npm/node_modules/columnify/index.js b/deps/npm/node_modules/columnify/index.js index c44b8ca8fa962c..8c15c993eaf1be 100644 --- a/deps/npm/node_modules/columnify/index.js +++ b/deps/npm/node_modules/columnify/index.js @@ -9,6 +9,14 @@ var splitIntoLines = utils.splitIntoLines var splitLongWords = utils.splitLongWords var truncateString = utils.truncateString +var DEFAULT_HEADING_TRANSFORM = function(key) { + return key.toUpperCase() +} + +var DEFAULT_DATA_TRANSFORM = function(cell, column, index) { + return cell +} + var DEFAULTS = { maxWidth: Infinity, minWidth: 0, @@ -18,12 +26,8 @@ var DEFAULTS = { preserveNewLines: false, paddingChr: ' ', showHeaders: true, - headingTransform: function(key) { - return key.toUpperCase() - }, - dataTransform: function(cell, column, index) { - return cell - } + headingTransform: DEFAULT_HEADING_TRANSFORM, + dataTransform: DEFAULT_DATA_TRANSFORM } module.exports = function(items, options) { @@ -68,9 +72,11 @@ module.exports = function(items, options) { // sanitize column settings columnNames.forEach(function(columnName) { var column = columns[columnName] + column.name = columnName column.maxWidth = Math.ceil(column.maxWidth) column.minWidth = Math.ceil(column.minWidth) column.truncate = !!column.truncate + column.align = column.align || 'left' }) // sanitize data @@ -96,7 +102,18 @@ module.exports = function(items, options) { columnNames.forEach(function(columnName) { var column = columns[columnName] items = items.map(function(item, index) { - item[columnName] = column.dataTransform(item[columnName], column, index) + var col = Object.create(column) + item[columnName] = column.dataTransform(item[columnName], col, index) + + var changedKeys = Object.keys(col) + // disable default heading transform if we wrote to column.name + if (changedKeys.indexOf('name') !== -1) { + if (column.headingTransform !== DEFAULT_HEADING_TRANSFORM) return + column.headingTransform = function(heading) {return heading} + } + changedKeys.forEach(function(key) { + column[key] = col[key] + }) return item }) }) @@ -106,7 +123,7 @@ module.exports = function(items, options) { if(options.showHeaders) { columnNames.forEach(function(columnName) { var column = columns[columnName] - headers[columnName] = column.headingTransform(columnName) + headers[columnName] = column.headingTransform(column.name) }) items.unshift(headers) } @@ -194,8 +211,8 @@ function createRows(items, columns, columnNames, paddingChr) { columnNames.forEach(function(columnName) { var column = columns[columnName] var val = item[columnName][i] || '' // || '' ensures empty columns get padded - if (column.align == 'right') row[i].push(padLeft(val, column.width, paddingChr)) - else if (column.align == 'center') row[i].push(padCenter(val, column.width, paddingChr)) + if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr)) + else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr)) else row[i].push(padRight(val, column.width, paddingChr)) }) } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js index 602ae00e8fc902..5b9546aabf8a2e 100755 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js @@ -2,38 +2,46 @@ 'use strict'; var fs = require('fs'); var pkg = require('./package.json'); -var strip = require('./'); -var input = process.argv[2]; +var stripAnsi = require('./'); +var argv = process.argv.slice(2); +var input = argv[0]; function help() { console.log([ - pkg.description, '', - 'Usage', - ' $ strip-ansi > ', - ' $ cat | strip-ansi > ', + ' ' + pkg.description, '', - 'Example', - ' $ strip-ansi unicorn.txt > unicorn-stripped.txt' + ' Usage', + ' strip-ansi > ', + ' cat | strip-ansi > ', + '', + ' Example', + ' strip-ansi unicorn.txt > unicorn-stripped.txt' ].join('\n')); } -if (process.argv.indexOf('--help') !== -1) { +function init(data) { + process.stdout.write(stripAnsi(data)); +} + +if (argv.indexOf('--help') !== -1) { help(); return; } -if (process.argv.indexOf('--version') !== -1) { +if (argv.indexOf('--version') !== -1) { console.log(pkg.version); return; } -if (input) { - process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); - return; -} +if (process.stdin.isTTY) { + if (!input) { + help(); + return; + } -process.stdin.setEncoding('utf8'); -process.stdin.on('data', function (data) { - process.stdout.write(strip(data)); -}); + init(fs.readFileSync(input, 'utf8')); +} else { + process.stdin.setEncoding('utf8'); + process.stdin.on('data', init); +} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js index 783c5c7bb69eec..2fcdd1e472f961 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js @@ -1,4 +1,4 @@ 'use strict'; module.exports = function () { - return /\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g; + return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g; }; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json index ca610250c9e9b0..ab8ea0388fc635 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -1,6 +1,6 @@ { "name": "ansi-regex", - "version": "0.2.1", + "version": "1.1.0", "description": "Regular expression for matching ANSI escape codes", "license": "MIT", "repository": { @@ -16,7 +16,8 @@ "node": ">=0.10.0" }, "scripts": { - "test": "mocha" + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" }, "files": [ "index.js" @@ -55,9 +56,9 @@ "url": "https://github.com/sindresorhus/ansi-regex/issues" }, "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@0.2.1", - "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "_from": "ansi-regex@0.2.1", + "_id": "ansi-regex@1.1.0", + "_shasum": "67792c5d6ad05c792d6cd6057ac8f5e69ebf4357", + "_from": "ansi-regex@>=1.0.0 <2.0.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", @@ -67,12 +68,17 @@ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" } ], "dist": { - "shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" + "shasum": "67792c5d6ad05c792d6cd6057ac8f5e69ebf4357", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json index 64c4dee52c4d75..89d1041bd7a8b8 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json @@ -1,11 +1,8 @@ { "name": "strip-ansi", - "version": "1.0.0", + "version": "2.0.0", "description": "Strip ANSI escape codes", "license": "MIT", - "bin": { - "strip-ansi": "cli.js" - }, "repository": { "type": "git", "url": "git://github.com/sindresorhus/strip-ansi" @@ -15,6 +12,9 @@ "email": "sindresorhus@gmail.com", "url": "http://sindresorhus.com" }, + "bin": { + "strip-ansi": "cli.js" + }, "engines": { "node": ">=0.10.0" }, @@ -51,19 +51,19 @@ "text" ], "dependencies": { - "ansi-regex": "^0.2.1" + "ansi-regex": "^1.0.0" }, "devDependencies": { "mocha": "*" }, - "gitHead": "6fea2ef935f1ba10d43e4c4d9814af328803935c", + "gitHead": "c5e780acc07532f5d651cfb6ea035198095c6c74", "bugs": { "url": "https://github.com/sindresorhus/strip-ansi/issues" }, "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@1.0.0", - "_shasum": "6c021321d6ece161a3c608fbab268c7328901c73", - "_from": "strip-ansi@>=1.0.0-0 <2.0.0-0", + "_id": "strip-ansi@2.0.0", + "_shasum": "fa8d69432e97674746f55f51d076ae78b18df13f", + "_from": "strip-ansi@>=2.0.0 <3.0.0", "_npmVersion": "1.4.14", "_npmUser": { "name": "sindresorhus", @@ -80,9 +80,10 @@ } ], "dist": { - "shasum": "6c021321d6ece161a3c608fbab268c7328901c73", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" + "shasum": "fa8d69432e97674746f55f51d076ae78b18df13f", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md index 527743b601fd20..d7231cfca7daa7 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md @@ -21,7 +21,7 @@ var clone = require('clone'); var a, b; -a = { foo: { bar: 'baz' } }; // inital value of a +a = { foo: { bar: 'baz' } }; // initial value of a b = clone(a); // clone a -> b a.foo.bar = 'foo'; // change a @@ -52,7 +52,7 @@ can clone dates in arrays in objects, for example. Call `clone` with `circular` set to `false` if you are certain that `obj` contains no circular references. This will give better performance if needed. There is no error if `undefined` or `null` is passed as `obj`. - * `depth` -- depth to wich the object is to be cloned (optional, + * `depth` -- depth to which the object is to be cloned (optional, defaults to infinity) `clone.clonePrototype(obj)` diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js index 5d402073b3653f..321ffa30f5e2ab 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js @@ -72,6 +72,7 @@ function clone(parent, circular, depth, prototype) { return parent; var child; + var proto; if (typeof parent != 'object') { return parent; } @@ -88,8 +89,14 @@ function clone(parent, circular, depth, prototype) { parent.copy(child); return child; } else { - if (typeof prototype == 'undefined') child = Object.create(Object.getPrototypeOf(parent)); - else child = Object.create(prototype); + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } } if (circular) { @@ -103,6 +110,14 @@ function clone(parent, circular, depth, prototype) { } for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } child[i] = _clone(parent[i], depth - 1); } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json index 3c6b77647092c0..dc56f3f191f7fb 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json @@ -8,7 +8,7 @@ "function", "date" ], - "version": "0.1.18", + "version": "0.1.19", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" @@ -81,6 +81,11 @@ { "name": "Nathan Zadoks", "url": "https://github.com/nathan7" + }, + { + "name": "Róbert Oroszi", + "email": "robert+gh@oroszi.net", + "url": "https://github.com/oroce" } ], "license": "MIT", @@ -96,11 +101,11 @@ "scripts": { "test": "nodeunit test.js" }, - "gitHead": "17eea36140d61d97a9954c53417d0e04a00525d9", + "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd", "homepage": "https://github.com/pvorb/node-clone", - "_id": "clone@0.1.18", - "_shasum": "64a0d5d57eaa85a1a8af380cd1db8c7b3a895f66", - "_from": "clone@>=0.1.5-0 <0.2.0-0", + "_id": "clone@0.1.19", + "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", + "_from": "clone@>=0.1.5 <0.2.0", "_npmVersion": "1.4.14", "_npmUser": { "name": "pvorb", @@ -113,9 +118,10 @@ } ], "dist": { - "shasum": "64a0d5d57eaa85a1a8af380cd1db8c7b3a895f66", - "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.18.tgz" + "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", + "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.18.tgz" + "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js index ee49ad893aac1d..cb3d16631ab87f 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js @@ -269,3 +269,21 @@ exports['clone object with null children'] = function(test) { test.deepEqual(b, a); test.done(); } + +exports['clone instance with getter'] = function(test) { + test.expect(1); + function Ctor() {}; + Object.defineProperty(Ctor.prototype, 'prop', { + configurable: true, + enumerable: true, + get: function() { + return 'value'; + } + }); + + var a = new Ctor(); + var b = clone(a); + + test.strictEqual(b.prop, 'value'); + test.done(); +}; \ No newline at end of file diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json index f9243a12005532..e3ee62191906fb 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json @@ -45,6 +45,10 @@ ], "directories": {}, "_shasum": "3ae25f44416c6c01f9809a25fcdd285912d2a6b1", - "_from": "defaults@>=1.0.0-0 <2.0.0-0", - "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz", + "_from": "defaults@>=1.0.0 <2.0.0", + "bugs": { + "url": "https://github.com/tmpvar/defaults/issues" + }, + "homepage": "https://github.com/tmpvar/defaults" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json index f12d49b789e4c4..4744d9dc3f7f7b 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -40,7 +40,7 @@ "gitHead": "5bc3aafd45c89f233c27b9479c18a23ca91ba660", "_id": "wcwidth@1.0.0", "_shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", - "_from": "wcwidth@>=1.0.0-0 <2.0.0-0", + "_from": "wcwidth@>=1.0.0 <2.0.0", "_npmVersion": "1.4.23", "_npmUser": { "name": "timoxley", diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index ef307b50925c5d..c60e1d9de6bbe6 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -1,20 +1,21 @@ { "name": "columnify", - "version": "1.2.1", - "description": "Render data in text columns, supports in-column text-wrap.", + "version": "1.3.2", + "description": "Render data in text columns. supports in-column text-wrap.", "main": "index.js", "scripts": { "pretest": "npm prune", - "test": "faucet" + "test": "tape test/*.js | tap-spec", + "bench": "npm test && node bench" }, "author": { "name": "Tim Oxley" }, "license": "MIT", "devDependencies": { - "chalk": "^0.4.0", - "faucet": "0.0.1", - "tape": "~2.12.3" + "chalk": "^0.5.1", + "tap-spec": "^2.1.1", + "tape": "^3.0.3" }, "repository": { "type": "git", @@ -34,17 +35,18 @@ }, "homepage": "https://github.com/timoxley/columnify", "dependencies": { - "strip-ansi": "^1.0.0", + "strip-ansi": "^2.0.0", "wcwidth": "^1.0.0" }, "directories": { "test": "test" }, - "gitHead": "14e77bef3f57acaa3f390145915a9f2d2a4f882c", - "_id": "columnify@1.2.1", - "_shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", - "_from": "columnify@>=1.2.1-0 <2.0.0-0", - "_npmVersion": "1.4.23", + "gitHead": "5c7d4363a8d6178f0d415e8bdaf692281fe71975", + "_id": "columnify@1.3.2", + "_shasum": "61bd578a9269ae6fd949ce36fff589f3702c7867", + "_from": "columnify@>=1.3.2 <1.4.0", + "_npmVersion": "2.1.10", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "timoxley", "email": "secoif@gmail.com" @@ -56,8 +58,8 @@ } ], "dist": { - "shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", - "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" + "shasum": "61bd578a9269ae6fd949ce36fff589f3702c7867", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.3.2.tgz" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.3.2.tgz" } diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json index 140536797f8881..559b7bf2bd3766 100644 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -1,6 +1,6 @@ { "name": "fs-vacuum", - "version": "1.2.1", + "version": "1.2.5", "description": "recursively remove empty directories -- to a point", "main": "vacuum.js", "scripts": { @@ -27,16 +27,17 @@ "devDependencies": { "mkdirp": "^0.5.0", "tap": "^0.4.11", - "tmp": "0.0.23" + "tmp": "0.0.24" }, "dependencies": { "graceful-fs": "^3.0.2", + "path-is-inside": "^1.0.1", "rimraf": "^2.2.8" }, "readme": "# fs-vacuum\n\nRemove the empty branches of a directory tree, optionally up to (but not\nincluding) a specified base directory. Optionally nukes the leaf directory.\n\n## Usage\n\n```javascript\nvar logger = require(\"npmlog\");\nvar vacuum = require(\"fs-vacuum\");\n\nvar options = {\n base : \"/path/to/my/tree/root\",\n purge : true,\n log : logger.silly.bind(logger, \"myCleanup\")\n};\n\n/* Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\n * the final path will just be \"/path/to/my/tree/root\".\n */\nvacuum(\"/path/to/my/tree/root/out/to/my/files\", function (error) {\n if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\n});\n```\n# vacuum(directory, options, callback)\n\n* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**\n* `options` {Object}\n * `base` {String} No directories at or above this level of the filesystem will be removed.\n * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.\n * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.\n* `callback` {Function} Function to call once vacuuming is complete.\n * `error` {Error} What went wrong along the way, if anything.\n", "readmeFilename": "README.md", - "gitHead": "bad24b21c45d86b3da991f2c3d058ef03546d83e", - "_id": "fs-vacuum@1.2.1", - "_shasum": "1bc3c62da30d6272569b8b9089c9811abb0a600b", - "_from": "fs-vacuum@>=1.2.1-0 <1.3.0-0" + "gitHead": "4911a38a65b6a6cb19fc980d18304e1cfca91fbf", + "_id": "fs-vacuum@1.2.5", + "_shasum": "a5cbaa844b4b3a7cff139f3cc90e7f7007e5fbb8", + "_from": "fs-vacuum@~1.2.5" } diff --git a/deps/npm/node_modules/fs-vacuum/vacuum.js b/deps/npm/node_modules/fs-vacuum/vacuum.js index f706a4be68ca81..e55abe9701b6df 100644 --- a/deps/npm/node_modules/fs-vacuum/vacuum.js +++ b/deps/npm/node_modules/fs-vacuum/vacuum.js @@ -1,6 +1,7 @@ -var assert = require("assert") -var dirname = require("path").dirname -var resolve = require("path").resolve +var assert = require("assert") +var dirname = require("path").dirname +var resolve = require("path").resolve +var isInside = require("path-is-inside") var rimraf = require("rimraf") var lstat = require("graceful-fs").lstat @@ -19,9 +20,10 @@ function vacuum(leaf, options, cb) { var log = options.log ? options.log : function () {} - var base = options.base - if (base && resolve(leaf).indexOf(resolve(base)) !== 0) { - return cb(new Error(resolve(leaf) + " is not a child of " + resolve(base))) + leaf = leaf && resolve(leaf) + var base = options.base && resolve(options.base) + if (base && !isInside(leaf, base)) { + return cb(new Error(leaf + " is not a child of " + base)) } lstat(leaf, function (error, stat) { @@ -59,8 +61,9 @@ function vacuum(leaf, options, cb) { }) function next(branch) { + branch = branch && resolve(branch) // either we've reached the base or we've reached the root - if ((base && resolve(branch) === resolve(base)) || branch === dirname(branch)) { + if ((base && branch === base) || branch === dirname(branch)) { log("finished vacuuming up to", branch) return cb(null) } @@ -90,7 +93,14 @@ function vacuum(leaf, options, cb) { var remove = stat.isDirectory() ? rmdir : unlink remove(branch, function (error) { if (error) { - if (error.code === "ENOENT") return cb(null) + if (error.code === "ENOENT") { + log("quitting because lost the race to remove", branch) + return cb(null) + } + if (error.code === "ENOTEMPTY") { + log("quitting because new (racy) entries in", branch) + return cb(null) + } log("unable to remove", branch, "due to", error.message) return cb(error) diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json index 29e508673a50fa..161b82564bc540 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json @@ -6,7 +6,7 @@ }, "name": "fstream-ignore", "description": "A thing for ignoring files based on globs", - "version": "1.0.1", + "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream-ignore.git" @@ -18,7 +18,7 @@ "dependencies": { "fstream": "^1.0.0", "inherits": "2", - "minimatch": "^1.0.0" + "minimatch": "^2.0.1" }, "devDependencies": { "tap": "", @@ -26,15 +26,16 @@ "mkdirp": "" }, "license": "ISC", - "gitHead": "290f2b621fa4f8fe3eec97307d22527fa2065375", + "gitHead": "20363d39660671c0de746bd07a0d07de7090d085", "bugs": { "url": "https://github.com/isaacs/fstream-ignore/issues" }, "homepage": "https://github.com/isaacs/fstream-ignore", - "_id": "fstream-ignore@1.0.1", - "_shasum": "153df36c4fa2cb006fb915dc71ac9d75f6a17c82", + "_id": "fstream-ignore@1.0.2", + "_shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", "_from": "fstream-ignore@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.22", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -46,10 +47,9 @@ } ], "dist": { - "shasum": "153df36c4fa2cb006fb915dc71ac9d75f6a17c82", - "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.1.tgz" + "shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", + "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz" } diff --git a/deps/npm/node_modules/fstream-npm/package.json b/deps/npm/node_modules/fstream-npm/package.json index e7de77086af5e5..6b2ccc99d270da 100644 --- a/deps/npm/node_modules/fstream-npm/package.json +++ b/deps/npm/node_modules/fstream-npm/package.json @@ -25,7 +25,7 @@ "_id": "fstream-npm@1.0.1", "scripts": {}, "_shasum": "1e35c77f0fa24f5d6367e6d447ae7d6ddb482db2", - "_from": "fstream-npm@>=1.0.1 <1.1.0", + "_from": "fstream-npm@1.0.1", "_npmVersion": "2.1.3", "_nodeVersion": "0.10.31", "_npmUser": { diff --git a/deps/npm/node_modules/fstream/examples/filter-pipe.js b/deps/npm/node_modules/fstream/examples/filter-pipe.js index c6b55b3e02a979..983649bb9d5814 100644 --- a/deps/npm/node_modules/fstream/examples/filter-pipe.js +++ b/deps/npm/node_modules/fstream/examples/filter-pipe.js @@ -4,8 +4,8 @@ var path = require("path") var r = fstream.Reader({ path: path.dirname(__dirname) , filter: function () { return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) - !this.basename.match(/^deep-copy$/) + !this.basename.match(/^node_modules$/) && + !this.basename.match(/^deep-copy$/) && !this.basename.match(/^filter-copy$/) } }) diff --git a/deps/npm/node_modules/fstream/examples/pipe.js b/deps/npm/node_modules/fstream/examples/pipe.js index 648ec849388e2b..0bad122f9bd6cc 100644 --- a/deps/npm/node_modules/fstream/examples/pipe.js +++ b/deps/npm/node_modules/fstream/examples/pipe.js @@ -4,7 +4,7 @@ var path = require("path") var r = fstream.Reader({ path: path.dirname(__dirname) , filter: function () { return !this.basename.match(/^\./) && - !this.basename.match(/^node_modules$/) + !this.basename.match(/^node_modules$/) && !this.basename.match(/^deep-copy$/) } }) diff --git a/deps/npm/node_modules/fstream/examples/reader.js b/deps/npm/node_modules/fstream/examples/reader.js index 9aa1a9538d65a4..3787ae376ffe1e 100644 --- a/deps/npm/node_modules/fstream/examples/reader.js +++ b/deps/npm/node_modules/fstream/examples/reader.js @@ -2,13 +2,12 @@ var fstream = require("../fstream.js") var tap = require("tap") var fs = require("fs") var path = require("path") -var children = -1 var dir = path.dirname(__dirname) -var gotReady = false -var ended = false - tap.test("reader test", function (t) { + var children = -1 + var gotReady = false + var ended = false var r = fstream.Reader({ path: dir , filter: function () { @@ -52,3 +51,18 @@ tap.test("reader test", function (t) { }) }) + +tap.test("reader error test", function (t) { + // assumes non-root on a *nix system + var r = fstream.Reader({ path: '/etc/shadow' }) + + r.once("error", function (er) { + t.ok(true); + t.end() + }) + + r.on("end", function () { + t.fail("reader ended without error"); + t.end() + }) +}) diff --git a/deps/npm/node_modules/fstream/lib/file-reader.js b/deps/npm/node_modules/fstream/lib/file-reader.js index b1f9861838ad7d..4720cd86a4aa38 100644 --- a/deps/npm/node_modules/fstream/lib/file-reader.js +++ b/deps/npm/node_modules/fstream/lib/file-reader.js @@ -80,6 +80,10 @@ FileReader.prototype._getStream = function () { } }) + stream.on("error", function (e) { + me.emit("error", e); + }); + me._read() } diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index d0ac58243ad2f6..f920c10036b75d 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -6,7 +6,7 @@ }, "name": "fstream", "description": "Advanced file system stream things", - "version": "1.0.2", + "version": "1.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream.git" @@ -28,30 +28,14 @@ "test": "tap examples/*.js" }, "license": "BSD", - "gitHead": "b3b74e92ef4a91ae206fab90b7998c7cd2e4290d", + "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", + "readmeFilename": "README.md", + "gitHead": "d205397b27d93eee5314e9d2d87693e82b560106", "bugs": { "url": "https://github.com/isaacs/fstream/issues" }, "homepage": "https://github.com/isaacs/fstream", - "_id": "fstream@1.0.2", - "_shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "_from": "fstream@1.0.2", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz", - "readme": "ERROR: No README data found!" + "_id": "fstream@1.0.3", + "_shasum": "5ce69767710d7a39c8cd9232470d9426790195da", + "_from": "fstream@>=1.0.3 <1.1.0" } diff --git a/deps/npm/node_modules/glob/.npmignore b/deps/npm/node_modules/glob/.npmignore deleted file mode 100644 index c34fdd597ee0c7..00000000000000 --- a/deps/npm/node_modules/glob/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -.*.swp -test/a/ -node_modules/* diff --git a/deps/npm/node_modules/glob/README.md b/deps/npm/node_modules/glob/README.md index 82b7ef6d61d69d..d72bdccbe0e078 100644 --- a/deps/npm/node_modules/glob/README.md +++ b/deps/npm/node_modules/glob/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) + # Glob Match files using the patterns the shell uses, like stars and stuff. @@ -21,25 +23,94 @@ glob("**/*.js", options, function (er, files) { }) ``` -## Features +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Negation + +The intent for negation would be for a pattern starting with `!` to +match everything that *doesn't* match the supplied pattern. However, +the implementation is weird, and for the time being, this should be +avoided. The behavior will change or be deprecated in version 5. + +### Empty Sets -Please see the [minimatch -documentation](https://github.com/isaacs/minimatch) for more details. +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: -Supports these glob features: + $ echo a*s*d*f + a*s*d*f -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching +To get the bash-style behavior, set the `nonull:true` in the options. -See: +### See Also: * `man sh` -* `man bash` +* `man bash` (Search for "Pattern Matching") * `man 3 fnmatch` * `man 5 gitignore` * [minimatch documentation](https://github.com/isaacs/minimatch) +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + ## glob(pattern, [options], cb) * `pattern` {String} Pattern to be matched @@ -60,7 +131,7 @@ Perform a synchronous glob search. ## Class: glob.Glob -Create a Glob object by instanting the `glob.Glob` class. +Create a Glob object by instantiating the `glob.Glob` class. ```javascript var Glob = require("glob").Glob @@ -85,8 +156,6 @@ be immediately available on the `g.found` member. * `minimatch` The minimatch object that the glob uses. * `options` The options object passed in. -* `error` The error encountered. When an error is encountered, the - glob object is in an undefined state, and should be discarded. * `aborted` Boolean which is set to true when calling `abort()`. There is no way at this time to continue a glob search after aborting, but you can re-use the statCache to avoid having to duplicate syscalls. @@ -96,10 +165,14 @@ be immediately available on the `g.found` member. values: * `false` - Path does not exist * `true` - Path exists - * `1` - Path exists, and is not a directory - * `2` - Path exists, and is a directory + * `'DIR'` - Path exists, and is not a directory + * `'FILE'` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. ### Events @@ -114,7 +187,9 @@ be immediately available on the `g.found` member. ### Methods -* `abort` Stop the search. +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever ### Options @@ -124,7 +199,14 @@ or have glob-specific ramifications. All options are false by default, unless otherwise noted. -All options are added to the glob object, as well. +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, and `cache` options, so that parallel glob +operations will be sped up by sharing information about the +filesystem. * `cwd` The current working directory in which to search. Defaults to `process.cwd()`. @@ -142,36 +224,50 @@ All options are added to the glob object, as well. * `nosort` Don't sort the results. * `stat` Set to true to stat *all* results. This reduces performance somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. It will cause - ELOOP to be triggered one level sooner in the case of cyclical - symbolic links. -* `silent` When an unusual error is encountered - when attempting to read a directory, a warning will be printed to - stderr. Set the `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered - when attempting to read a directory, the process will just continue on - in search of other matches. Set the `strict` option to raise an error - in these cases. + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. * `cache` See `cache` property above. Pass in a previously generated cache object to save some fs calls. * `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary to - set this, you may pass the statCache from one glob() call to the + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the options object of another, if you know that the filesystem will not change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. * `sync` Perform a synchronous glob search. * `nounique` In some cases, brace-expanded patterns can result in the same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. - Set this flag to disable that behavior. + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. * `nonull` Set to never return an empty set, instead returning a set containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that case-insensitive - filesystems will sometimes result in glob returning results that are - case-insensitively matched anyway, since readdir and stat will not - raise an error. +* `nocase` Perform a case-insensitive match. Note that + case-insensitive filesystems will sometimes result in glob returning + results that are case-insensitively matched anyway, since readdir + and stat will not raise an error. * `debug` Set to enable debug logging in minimatch and glob. -* `globDebug` Set to enable debug logging in glob, but not minimatch. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nonegate` Suppress `negate` behavior. (See below.) +* `nocomment` Suppress `comment` behavior. (See below.) +* `nonull` Return the pattern when no matches are found. +* `nodir` Do not match directories, only files. ## Comparisons to other fnmatch/glob implementations @@ -192,10 +288,14 @@ start of a line, or set the `nocomment` flag to suppress this behavior. The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only +and bash 4.3, where `**` only has special significance if it is the only thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but `a/**b` will not. +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + If an escaped pattern has no matches, and the `nonull` flag is set, then glob returns the pattern as-provided, rather than interpreting the character escapes. For example, @@ -239,3 +339,23 @@ calls. Users are thus advised not to use a glob result as a guarantee of filesystem state in the face of rapid changes. For the vast majority of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/deps/npm/node_modules/glob/common.js b/deps/npm/node_modules/glob/common.js new file mode 100644 index 00000000000000..610d1245b4de26 --- /dev/null +++ b/deps/npm/node_modules/glob/common.js @@ -0,0 +1,177 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.isAbsolute = process.platform === "win32" ? absWin : absUnix +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var Minimatch = minimatch.Minimatch + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + var result = splitDeviceRe.exec(p) + var device = result[1] || '' + var isUnc = device && device.charAt(1) !== ':' + var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + + +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.pattern = pattern + self.strict = options.strict !== false + 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) + + 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 + + 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) { + 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)) + }) + } + } + + self.found = all +} + +function mark (self, p) { + var c = self.cache[p] + 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) { + self.statCache[m] = self.statCache[p] + self.cache[m] = self.cache[p] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(self.root, f) + } else if (exports.isAbsolute(f)) { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } + return abs +} diff --git a/deps/npm/node_modules/glob/examples/g.js b/deps/npm/node_modules/glob/examples/g.js deleted file mode 100644 index be122df0023908..00000000000000 --- a/deps/npm/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "test/a/**/[cg]/../[cg]" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/deps/npm/node_modules/glob/examples/usr-local.js b/deps/npm/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425e47b763..00000000000000 --- a/deps/npm/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "{./*/*,/*,/usr/local/*}" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js index 564f3b1217cce7..8c990782189bb7 100644 --- a/deps/npm/node_modules/glob/glob.js +++ b/deps/npm/node_modules/glob/glob.js @@ -1,24 +1,30 @@ // Approach: // // 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern) +// 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // -// PROCESS(pattern) +// PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. -// readdir(PREFIX) as ENTRIES -// If fails, END +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) @@ -32,146 +38,80 @@ // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. - - module.exports = glob -var fs = require("graceful-fs") -, minimatch = require("minimatch") -, Minimatch = minimatch.Minimatch -, inherits = require("inherits") -, EE = require("events").EventEmitter -, path = require("path") -, isDir = {} -, assert = require("assert").ok -, once = require("once") +var fs = require("fs") +var minimatch = require("minimatch") +var Minimatch = minimatch.Minimatch +var inherits = require("inherits") +var EE = require("events").EventEmitter +var path = require("path") +var assert = require("assert") +var globSync = require("./sync.js") +var common = require("./common.js") +var alphasort = common.alphasort +var isAbsolute = common.isAbsolute +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require("inflight") +var util = require("util") + +var once = require("once") function glob (pattern, options, cb) { if (typeof options === "function") cb = options, options = {} if (!options) options = {} - if (typeof options === "number") { - deprecated() - return + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) } - var g = new Glob(pattern, options, cb) - return g.sync ? g.found : g + return new Glob(pattern, options, cb) } -glob.fnmatch = deprecated +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync -function deprecated () { - throw new Error("glob's interface has changed. Please see the docs.") -} +// old api surface +glob.glob = glob -glob.sync = globSync -function globSync (pattern, options) { - if (typeof options === "number") { - deprecated() - return +glob.hasMagic = function (pattern, options_) { + var options = util._extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true } - options = options || {} - options.sync = true - return glob(pattern, options) + return false } -this._processingEmitQueue = false - glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { - if (!(this instanceof Glob)) { - return new Glob(pattern, options, cb) - } - if (typeof options === "function") { cb = options options = null } - if (typeof cb === "function") { - cb = once(cb) - this.on("error", cb) - this.on("end", function (matches) { - cb(null, matches) - }) - } - - options = options || {} - - this._endEmitted = false - this.EOF = {} - this._emitQueue = [] - - this.paused = false - this._processingEmitQueue = false - - this.maxDepth = options.maxDepth || 1000 - this.maxLength = options.maxLength || Infinity - this.cache = options.cache || {} - this.statCache = options.statCache || {} - - this.changedCwd = false - var cwd = process.cwd() - if (!options.hasOwnProperty("cwd")) this.cwd = cwd - else { - this.cwd = options.cwd - this.changedCwd = path.resolve(options.cwd) !== cwd - } - - this.root = options.root || path.resolve(this.cwd, "/") - this.root = path.resolve(this.root) - if (process.platform === "win32") - this.root = this.root.replace(/\\/g, "/") - - this.nomount = !!options.nomount - - if (!pattern) { - throw new Error("must provide pattern") - } - - // 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 + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) } - this.strict = options.strict !== false - this.dot = !!options.dot - this.mark = !!options.mark - this.sync = !!options.sync - this.nounique = !!options.nounique - this.nonull = !!options.nonull - this.nosort = !!options.nosort - this.nocase = !!options.nocase - this.stat = !!options.stat - - this.debug = !!options.debug || !!options.globDebug - - if (/\bglob\b/.test(process.env.NODE_DEBUG || '')) - this.debug = true - - if (this.debug) - this.log = console.error - - this.silent = !!options.silent - - var mm = this.minimatch = new Minimatch(pattern, options) - this.options = mm.options - pattern = this.pattern = mm.pattern - - this.error = null - this.aborted = false - - // list of all the patterns that ** has resolved do, so - // we can avoid visiting multiple times. - this._globstars = {} + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) - EE.call(this) + setopts(this, pattern, options) // process each pattern in the minimatch set var n = this.minimatch.set.length @@ -182,93 +122,56 @@ function Glob (pattern, options, cb) { // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) - if (this.minimatch.set.length === 0) { - return process.nextTick(this._finish.bind(this)) - } - - this.minimatch.set.forEach(iterator.bind(this)) - function iterator (pattern, i, set) { - this._process(pattern, 0, i, function (er) { - if (er) this.emit("error", er) - if (-- n <= 0) this._finish() + if (typeof cb === "function") { + cb = once(cb) + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) }) } -} -Glob.prototype.log = function () {} + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) -Glob.prototype._finish = function () { - assert(this instanceof Glob) + this._emitQueue = [] + this._processQueue = [] + this.paused = false - var nou = this.nounique - , all = nou ? [] : {} - - for (var i = 0, l = this.matches.length; i < l; i ++) { - var matches = this.matches[i] - this.log("matches[%d] =", i, matches) - // do like the shell, and spit out the literal glob - if (!matches) { - if (this.nonull) { - var literal = this.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 (this.noprocess) + return this - if (!nou) all = Object.keys(all) + if (n === 0) + return done() - if (!this.nosort) { - all = all.sort(this.nocase ? alphasorti : alphasort) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) } - if (this.mark) { - // at *some* point we statted all of these - all = all.map(this._mark, this) + function done () { + --self._processing + if (self._processing <= 0) + self._finish() } - - this.log("emitting end", all) - - this.EOF = this.found = all - this.emitMatch(this.EOF) } -function alphasorti (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return alphasort(a, b) -} +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return -function alphasort (a, b) { - return a > b ? 1 : a < b ? -1 : 0 + //console.error('FINISH', this.matches) + common.finish(this) + this.emit("end", this.found) } Glob.prototype._mark = function (p) { - var c = this.cache[p] - var m = p - if (c) { - var isDir = c === 2 || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - this.statCache[m] = this.statCache[p] - this.cache[m] = this.cache[p] - } - } + return common.mark(this, p) +} - return m +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) } Glob.prototype.abort = function () { @@ -277,111 +180,50 @@ Glob.prototype.abort = function () { } Glob.prototype.pause = function () { - if (this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = true - this.emit("pause") + if (!this.paused) { + this.paused = true + this.emit("pause") + } } Glob.prototype.resume = function () { - if (!this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = false - this.emit("resume") - this._processEmitQueue() - //process.nextTick(this.emit.bind(this, "resume")) -} - -Glob.prototype.emitMatch = function (m) { - this.log('emitMatch', m) - this._emitQueue.push(m) - this._processEmitQueue() -} - -Glob.prototype._processEmitQueue = function (m) { - this.log("pEQ paused=%j processing=%j m=%j", this.paused, - this._processingEmitQueue, m) - var done = false - while (!this._processingEmitQueue && - !this.paused) { - this._processingEmitQueue = true - var m = this._emitQueue.shift() - this.log(">processEmitQueue", m === this.EOF ? ":EOF:" : m) - if (!m) { - this.log(">processEmitQueue, falsey m") - this._processingEmitQueue = false - break - } - - if (m === this.EOF || !(this.mark && !this.stat)) { - this.log("peq: unmarked, or eof") - next.call(this, 0, false) - } else if (this.statCache[m]) { - var sc = this.statCache[m] - var exists - if (sc) - exists = sc.isDirectory() ? 2 : 1 - this.log("peq: stat cached") - next.call(this, exists, exists === 2) - } else { - this.log("peq: _stat, then next") - this._stat(m, next) + if (this.paused) { + this.emit("resume") + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } } - } - done = true - - function next(exists, isDir) { - this.log("next", m, exists, isDir) - var ev = m === this.EOF ? "end" : "match" - - // "end" can only happen once. - assert(!this._endEmitted) - if (ev === "end") - this._endEmitted = true - - if (exists) { - // Doesn't mean it necessarily doesn't exist, it's possible - // we just didn't check because we don't care that much, or - // this is EOF anyway. - if (isDir && !m.match(/\/$/)) { - m = m + "/" - } else if (!isDir && m.match(/\/$/)) { - m = m.replace(/\/+$/, "") + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) } } - this.log("emit", ev, m) - this.emit(ev, m) - this._processingEmitQueue = false - if (done && m !== this.EOF && !this.paused) - this._processEmitQueue() } } -Glob.prototype._process = function (pattern, depth, index, cb_) { +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) + assert(typeof cb === 'function') - var cb = function cb (er, res) { - assert(this instanceof Glob) - if (this.paused) { - if (!this._processQueue) { - this._processQueue = [] - this.once("resume", function () { - var q = this._processQueue - this._processQueue = null - q.forEach(function (cb) { cb() }) - }) - } - this._processQueue.push(cb_.bind(this, er, res)) - } else { - cb_.call(this, er, res) - } - }.bind(this) + if (this.aborted) + return - if (this.aborted) return cb() + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } - if (depth > this.maxDepth) return cb() + //console.error("PROCESS %d", this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 @@ -395,28 +237,7 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { switch (n) { // if not, then this is rather simple case pattern.length: - prefix = pattern.join("/") - this._stat(prefix, function (exists, isDir) { - // either it's there, or it isn't. - // nothing more to do, either way. - if (exists) { - if (prefix && isAbsolute(prefix) && !this.nomount) { - if (prefix.charAt(0) === "/") { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - } - } - - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][prefix] = true - this.emitMatch(prefix) - } - return cb() - }) + this._processSimple(pattern.join('/'), index, cb) return case 0: @@ -429,318 +250,399 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { // 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) - prefix = prefix.join("/") + prefix = pattern.slice(0, n).join("/") break } + var remain = pattern.slice(n) + // get the list of entries. var read - if (prefix === null) read = "." + if (prefix === null) + read = "." else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { - if (!prefix || !isAbsolute(prefix)) { + if (!prefix || !isAbsolute(prefix)) prefix = "/" + prefix - } + read = prefix + } else read = prefix - // if (process.platform === "win32") - // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + var abs = this._makeAbs(read) - this.log('absolute: ', prefix, this.root, pattern, read) - } else { - read = prefix - } + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} - this.log('readdir(%j)', read, this.cwd, this.root) - return this._readdir(read, function (er, entries) { - if (er) { - // not a directory! - // this means that, whatever else comes after this, it can never match - return cb() +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === "." + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== "." || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) } + } - // globstar is special - if (pattern[n] === minimatch.GLOBSTAR) { - // test without the globstar, and with every child both below - // and replacing the globstar. - var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] - entries.forEach(function (e) { - if (e.charAt(0) === "." && !this.dot) return - // instead of the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) - // below the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) - }, this) - - s = s.filter(function (pattern) { - var key = gsKey(pattern) - var seen = !this._globstars[key] - this._globstars[key] = true - return seen - }, this) - - if (!s.length) - return cb() - - // now asyncForEach over this - var l = s.length - , errState = null - s.forEach(function (gsPattern) { - this._process(gsPattern, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l <= 0) return cb() - }) - }, this) + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e + else + e = prefix + e + } - return + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) } + // This was the last one, and no stats were needed + return cb() + } - // not a globstar - // 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 = pattern[n] - var negate = !!this.minimatch.negate; - var rawGlob = pattern[n]._glob - , dotOk = this.dot || rawGlob.charAt(0) === "." - - entries = entries.filter(function (e) { - if (e.charAt(0) !== "." || dotOk) { - if (negate && n === 0) { - return !e.match(pattern[n]); - } else { - return e.match(pattern[n]); - } - } + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== "/") + e = prefix + "/" + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} - return null; - }) +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return - // If n === pattern.length - 1, then there's no need for the extra stat - // *unless* the user has specified "mark" or "stat" explicitly. - // We know that they exist, since the readdir returned them. - if (n === pattern.length - 1 && - !this.mark && - !this.stat) { - entries.forEach(function (e) { - if (prefix) { - if (prefix !== "/") e = prefix + "/" + e - else e = prefix + e - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path.join(this.root, e) - } - - if (process.platform === "win32") - e = e.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][e] = true - this.emitMatch(e) - }, this) - return cb.call(this) + if (!this.matches[index][e]) { + if (this.paused) { + this._emitQueue.push([index, e]) + return } + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } - // now test all the remaining entries as stand-ins for that part - // of the pattern. - var l = entries.length - , errState = null - if (l === 0) return cb() // no matches possible - entries.forEach(function (e) { - var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) - this._process(p, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l === 0) return cb.call(this) - }) - }, this) - }) + this.matches[index][e] = true + if (!this.stat && !this.mark) + return this.emit("match", e) + var self = this + this._stat(this._makeAbs(e), function (er, c, st) { + self.emit("stat", e, st) + self.emit("match", e) + }) + } } -function gsKey (pattern) { - return '**' + pattern.map(function (p) { - return (p === minimatch.GLOBSTAR) ? '**' : (''+p) - }).join('/') -} +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return -Glob.prototype._stat = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } + var lstatkey = "lstat\0" + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterStat(f, abs, cb, er) - } + if (lstatcb) + fs.lstat(abs, lstatcb) - this.log('stat', [this.cwd, f, '=', abs]) + function lstatcb_ (er, lstat) { + if (er) + return cb() - if (!this.stat && this.cache.hasOwnProperty(f)) { - var exists = this.cache[f] - , isDir = exists && (Array.isArray(exists) || exists === 2) - if (this.sync) return cb.call(this, !!exists, isDir) - return process.nextTick(cb.bind(this, !!exists, isDir)) - } + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym - var stat = this.statCache[abs] - if (this.sync || stat) { - var er - try { - stat = fs.statSync(abs) - } catch (e) { - er = e - } - this._afterStat(f, abs, cb, er, stat) - } else { - fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) } } -Glob.prototype._afterStat = function (f, abs, cb, er, stat) { - var exists - assert(this instanceof Glob) +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return - if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { - this.log("should be ENOTDIR, fake it") + cb = inflight("readdir\0"+abs+"\0"+inGlobStar, cb) + if (!cb) + return - er = new Error("ENOTDIR, not a directory '" + abs + "'") - er.path = abs - er.code = "ENOTDIR" - stat = null - } + //console.error("RD %j %j", +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) - var emit = !this.statCache[abs] - this.statCache[abs] = stat + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() - if (er || !stat) { - exists = false - } else { - exists = stat.isDirectory() ? 2 : 1 - if (emit) - this.emit('stat', f, stat) + if (Array.isArray(c)) + return cb(null, c) } - this.cache[f] = this.cache[f] || exists - cb.call(this, !!exists, exists === 2) -} -Glob.prototype._readdir = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (isAbsolute(f)) { - abs = f - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterReaddir(f, abs, cb, er) +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries.sort(alphasort), cb) } +} - this.log('readdir', [this.cwd, f, abs]) - if (this.cache.hasOwnProperty(f)) { - var c = this.cache[f] - if (Array.isArray(c)) { - if (this.sync) return cb.call(this, null, c) - return process.nextTick(cb.bind(this, null, c)) - } - - if (!c || c === 1) { - // either ENOENT or ENOTDIR - var code = c ? "ENOTDIR" : "ENOENT" - , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) - er.path = f - er.code = code - this.log(f, er) - if (this.sync) return cb.call(this, er) - return process.nextTick(cb.bind(this, er)) - } - - // at this point, c === 2, meaning it's a dir, but we haven't - // had to read it yet, or c === true, meaning it's *something* - // but we don't have any idea what. Need to read it, either way. - } +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return - if (this.sync) { - var er, entries - try { - entries = fs.readdirSync(abs) - } catch (e) { - er = e + // 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 } - return this._afterReaddir(f, abs, cb, er, entries) } - fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) + this.cache[abs] = entries + return cb(null, entries) } -Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { - assert(this instanceof Glob) - if (entries && !er) { - this.cache[f] = entries - // if we haven't asked to stat everything for suresies, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. This also gets us one step - // further into ELOOP territory. - if (!this.mark && !this.stat) { - entries.forEach(function (e) { - if (f === "/") e = f + e - else e = f + "/" + e - this.cache[e] = true - }, this) - } - - return cb.call(this, er, entries) - } +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return - // now handle errors, and cache the information - if (er) switch (er.code) { + // handle errors, and cache the information + switch (er.code) { case "ENOTDIR": // totally normal. means it *does* exist. - this.cache[f] = 1 - return cb.call(this, er) + this.cache[f] = 'FILE' + break + case "ENOENT": // not terribly unusual case "ELOOP": case "ENAMETOOLONG": case "UNKNOWN": this.cache[f] = false - return cb.call(this, er) + break + default: // some unusual error. Treat as failure. this.cache[f] = false - if (this.strict) this.emit("error", er) + if (this.strict) return this.emit("error", er) if (!this.silent) console.error("glob error", er) - return cb.call(this, er) + break } + return cb() } -var isAbsolute = process.platform === "win32" ? absWin : absUnix +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error("pgs2", prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - , result = splitDeviceRe.exec(p) - , device = result[1] || '' - , isUnc = device && device.charAt(1) !== ':' - , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + var isSym = this.symlinks[abs] + var len = entries.length - return isAbsolute + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === "." && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() } -function absUnix (p) { - return p.charAt(0) === "/" || p === "" +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error("ps2", prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = f + if (f.charAt(0) === "/") + abs = path.join(this.root, f) + else if (this.changedCwd) + abs = path.resolve(this.cwd, f) + + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, f)) { + var c = this.cache[f] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but not how we need it + if (abs.slice(-1) === "/" && c !== 'DIR') + return cb() + + return cb(null, c) + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else + return cb(null, stat.isDirectory() ? 'DIR' : 'FILE', stat) + } + + var self = this + var statcb = inflight("stat\0" + abs, statcb_) + if (statcb) + fs.stat(abs, statcb) + + function statcb_ (er, stat) { + self._stat2(f, abs, er, stat, cb) + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + this.statCache[abs] = stat + + if (abs.slice(-1) === "/" && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[f] = this.cache[f] || c + return cb(null, c, stat) } diff --git a/deps/npm/node_modules/glob/oh-my-glob.gif b/deps/npm/node_modules/glob/oh-my-glob.gif deleted file mode 100644 index a1568c13ca6955..00000000000000 Binary files a/deps/npm/node_modules/glob/oh-my-glob.gif and /dev/null differ diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 6bf85e8dfebab6..214a260458f874 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -6,41 +6,52 @@ }, "name": "glob", "description": "a little globber", - "version": "4.0.6", + "version": "4.3.2", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" }, "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], "engines": { "node": "*" }, "dependencies": { - "graceful-fs": "^3.0.2", + "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^1.0.0", + "minimatch": "^2.0.1", "once": "^1.3.0" }, "devDependencies": { - "tap": "~0.4.0", "mkdirp": "0", - "rimraf": "1" + "rimraf": "^2.2.8", + "tap": "~0.4.0", + "tick": "0.0.6" }, "scripts": { - "test": "tap test/*.js", - "test-regen": "TEST_REGEN=1 node test/00-setup.js" + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "npm run profclean && tap test/*.js", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "bash benchclean.sh" }, "license": "ISC", - "gitHead": "6825c425e738eaffa315d8cdb1a4c3255ededcb3", + "gitHead": "941d53c8ab6216f43a6f5e8e01245364ba90cfe9", "bugs": { "url": "https://github.com/isaacs/node-glob/issues" }, "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.0.6", - "_shasum": "695c50bdd4e2fb5c5d370b091f388d3707e291a7", - "_from": "glob@>=4.0.6 <5.0.0", - "_npmVersion": "2.0.0", - "_nodeVersion": "0.10.31", + "_id": "glob@4.3.2", + "_shasum": "351ec7dafc29256b253ad86cd6b48c5a3404b76d", + "_from": "glob@>=4.3.2 <4.4.0", + "_npmVersion": "2.1.14", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -52,10 +63,10 @@ } ], "dist": { - "shasum": "695c50bdd4e2fb5c5d370b091f388d3707e291a7", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.0.6.tgz" + "shasum": "351ec7dafc29256b253ad86cd6b48c5a3404b76d", + "tarball": "http://registry.npmjs.org/glob/-/glob-4.3.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.0.6.tgz", + "_resolved": "https://registry.npmjs.org/glob/-/glob-4.3.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/glob/sync.js b/deps/npm/node_modules/glob/sync.js new file mode 100644 index 00000000000000..a7f9f52daf6f97 --- /dev/null +++ b/deps/npm/node_modules/glob/sync.js @@ -0,0 +1,408 @@ +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 common = require("./common.js") +var alphasort = common.alphasort +var isAbsolute = common.isAbsolute +var setopts = common.setopts +var ownProp = common.ownProp + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob') + + 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') + + 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) + 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) + + 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) { + if (!this.matches[index][e]) { + 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.mark) + this._stat(this._makeAbs(e)) + } +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + 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).sort(alphasort)) + } 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 "ENOTDIR": // totally normal. means it *does* exist. + this.cache[f] = 'FILE' + break + + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[f] = false + break + + default: // some unusual error. Treat as failure. + this.cache[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 = f + if (f.charAt(0) === "/") + abs = path.join(this.root, f) + else if (this.changedCwd) + abs = path.resolve(this.cwd, f) + + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, f)) { + var c = this.cache[f] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but not how we need it + if (abs.slice(-1) === "/" && c !== 'DIR') + return false + + return c + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + try { + stat = fs.statSync(abs) + } catch (er) { + return false + } + } + + this.statCache[abs] = stat + + if (abs.slice(-1) === "/" && !stat.isDirectory()) + return false + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[f] = this.cache[f] || c + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/deps/npm/node_modules/glob/test/00-setup.js b/deps/npm/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afafda4c9ed..00000000000000 --- a/deps/npm/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// just a little pre-run script to set up the fixtures. -// zz-finish cleans it up - -var mkdirp = require("mkdirp") -var path = require("path") -var i = 0 -var tap = require("tap") -var fs = require("fs") -var rimraf = require("rimraf") - -var files = -[ "a/.abcdef/x/y/z/a" -, "a/abcdef/g/h" -, "a/abcfed/g/h" -, "a/b/c/d" -, "a/bc/e/f" -, "a/c/d/c/b" -, "a/cb/e/f" -] - -var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") -var symlinkFrom = "../.." - -files = files.map(function (f) { - return path.resolve(__dirname, f) -}) - -tap.test("remove fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "remove fixtures") - t.end() - }) -}) - -files.forEach(function (f) { - tap.test(f, function (t) { - var d = path.dirname(f) - mkdirp(d, 0755, function (er) { - if (er) { - t.fail(er) - return t.bailout() - } - fs.writeFile(f, "i like tests", function (er) { - t.ifError(er, "make file") - t.end() - }) - }) - }) -}) - -if (process.platform !== "win32") { - tap.test("symlinky", function (t) { - var d = path.dirname(symlinkTo) - console.error("mkdirp", d) - mkdirp(d, 0755, function (er) { - t.ifError(er) - fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { - t.ifError(er, "make symlink") - t.end() - }) - }) - }) -} - -;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { - w = "/tmp/glob-test/" + w - tap.test("create " + w, function (t) { - mkdirp(w, function (er) { - if (er) - throw er - t.pass(w) - t.end() - }) - }) -}) - - -// generate the bash pattern test-fixtures if possible -if (process.platform === "win32" || !process.env.TEST_REGEN) { - console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") - return -} - -var spawn = require("child_process").spawn; -var globs = - // put more patterns here. - // anything that would be directly in / should be in /tmp/glob-test - ["test/a/*/+(c|g)/./d" - ,"test/a/**/[cg]/../[cg]" - ,"test/a/{b,c,d,e,f}/**/g" - ,"test/a/b/**" - ,"test/**/g" - ,"test/a/abc{fed,def}/g/h" - ,"test/a/abc{fed/g,def}/**/" - ,"test/a/abc{fed/g,def}/**///**/" - ,"test/**/a/**/" - ,"test/+(a|b|c)/a{/,bc*}/**" - ,"test/*/*/*/f" - ,"test/**/f" - ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" - ,"{./*/*,/tmp/glob-test/*}" - ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! - ,"test/a/!(symlink)/**" - ] -var bashOutput = {} -var fs = require("fs") - -globs.forEach(function (pattern) { - tap.test("generate fixture " + pattern, function (t) { - var cmd = "shopt -s globstar && " + - "shopt -s extglob && " + - "shopt -s nullglob && " + - // "shopt >&2; " + - "eval \'for i in " + pattern + "; do echo $i; done\'" - var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) - var out = [] - cp.stdout.on("data", function (c) { - out.push(c) - }) - cp.stderr.pipe(process.stderr) - cp.on("close", function (code) { - out = flatten(out) - if (!out) - out = [] - else - out = cleanResults(out.split(/\r*\n/)) - - bashOutput[pattern] = out - t.notOk(code, "bash test should finish nicely") - t.end() - }) - }) -}) - -tap.test("save fixtures", function (t) { - var fname = path.resolve(__dirname, "bash-results.json") - var data = JSON.stringify(bashOutput, null, 2) + "\n" - fs.writeFile(fname, data, function (er) { - t.ifError(er) - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -function flatten (chunks) { - var s = 0 - chunks.forEach(function (c) { s += c.length }) - var out = new Buffer(s) - s = 0 - chunks.forEach(function (c) { - c.copy(out, s) - s += c.length - }) - - return out.toString().trim() -} - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} diff --git a/deps/npm/node_modules/glob/test/bash-comparison.js b/deps/npm/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a9c39e73..00000000000000 --- a/deps/npm/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// basic test -// show that it does the same thing by default as the shell. -var tap = require("tap") -, child_process = require("child_process") -, bashResults = require("./bash-results.json") -, globs = Object.keys(bashResults) -, glob = require("../") -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -globs.forEach(function (pattern) { - var expect = bashResults[pattern] - // anything regarding the symlink thing will fail on windows, so just skip it - if (process.platform === "win32" && - expect.some(function (m) { - return /\/symlink\//.test(m) - })) - return - - tap.test(pattern, function (t) { - glob(pattern, function (er, matches) { - if (er) - throw er - - // sort and unmark, just to match the shell results - matches = cleanResults(matches) - - t.deepEqual(matches, expect, pattern) - t.end() - }) - }) - - tap.test(pattern + " sync", function (t) { - var matches = cleanResults(glob.sync(pattern)) - - t.deepEqual(matches, expect, "should match shell") - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') - }) -} diff --git a/deps/npm/node_modules/glob/test/bash-results.json b/deps/npm/node_modules/glob/test/bash-results.json deleted file mode 100644 index 8223d0675b52f6..00000000000000 --- a/deps/npm/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "test/a/*/+(c|g)/./d": [ - "test/a/b/c/./d" - ], - "test/a/**/[cg]/../[cg]": [ - "test/a/abcdef/g/../g", - "test/a/abcfed/g/../g", - "test/a/b/c/../c", - "test/a/c/../c", - "test/a/c/d/c/../c", - "test/a/symlink/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" - ], - "test/a/{b,c,d,e,f}/**/g": [], - "test/a/b/**": [ - "test/a/b", - "test/a/b/c", - "test/a/b/c/d" - ], - "test/**/g": [ - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed,def}/g/h": [ - "test/a/abcdef/g/h", - "test/a/abcfed/g/h" - ], - "test/a/abc{fed/g,def}/**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed/g,def}/**///**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/**/a/**/": [ - "test/a", - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/b", - "test/a/b/c", - "test/a/bc", - "test/a/bc/e", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/cb", - "test/a/cb/e", - "test/a/symlink", - "test/a/symlink/a", - "test/a/symlink/a/b", - "test/a/symlink/a/b/c", - "test/a/symlink/a/b/c/a", - "test/a/symlink/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" - ], - "test/+(a|b|c)/a{/,bc*}/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h" - ], - "test/*/*/*/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/**/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" - ], - "{./*/*,/tmp/glob-test/*}": [ - "./examples/g.js", - "./examples/usr-local.js", - "./node_modules/graceful-fs", - "./node_modules/inherits", - "./node_modules/minimatch", - "./node_modules/mkdirp", - "./node_modules/once", - "./node_modules/rimraf", - "./node_modules/tap", - "./test/00-setup.js", - "./test/a", - "./test/bash-comparison.js", - "./test/bash-results.json", - "./test/cwd-test.js", - "./test/empty-set.js", - "./test/error-callback.js", - "./test/globstar-match.js", - "./test/mark.js", - "./test/negation-test.js", - "./test/new-glob-optional-options.js", - "./test/nocase-nomagic.js", - "./test/pause-resume.js", - "./test/readme-issue.js", - "./test/root-nomount.js", - "./test/root.js", - "./test/stat.js", - "./test/zz-cleanup.js", - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq" - ], - "{/tmp/glob-test/*,*}": [ - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq", - "examples", - "glob.js", - "LICENSE", - "node_modules", - "package.json", - "README.md", - "test" - ], - "test/a/!(symlink)/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h", - "test/a/b", - "test/a/b/c", - "test/a/b/c/d", - "test/a/bc", - "test/a/bc/e", - "test/a/bc/e/f", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/c/d/c/b", - "test/a/cb", - "test/a/cb/e", - "test/a/cb/e/f" - ] -} diff --git a/deps/npm/node_modules/glob/test/cwd-test.js b/deps/npm/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27efaddce0..00000000000000 --- a/deps/npm/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing cwd and searching for **/d", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('**/d', function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('a', function (t) { - glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'b/c/d', 'c/d' ]) - t.end() - }) - }) - - t.test('a/b', function (t) { - glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('a/b/', function (t) { - glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('.', function (t) { - glob('**/d', {cwd: process.cwd()}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/deps/npm/node_modules/glob/test/empty-set.js b/deps/npm/node_modules/glob/test/empty-set.js deleted file mode 100644 index 3b627b0ab8a90c..00000000000000 --- a/deps/npm/node_modules/glob/test/empty-set.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tap').test -var glob = require("../glob.js") - -// Patterns that cannot match anything -var patterns = [ - '# comment', - ' ', - '\n', - 'just doesnt happen to match anything so this is a control' -] - -patterns.forEach(function (p) { - test(JSON.stringify(p), function (t) { - glob(p, function (e, f) { - t.equal(e, null, 'no error') - t.same(f, [], 'no returned values') - t.end() - }) - }) -}) diff --git a/deps/npm/node_modules/glob/test/error-callback.js b/deps/npm/node_modules/glob/test/error-callback.js deleted file mode 100644 index 60d3ba1b5fd4e1..00000000000000 --- a/deps/npm/node_modules/glob/test/error-callback.js +++ /dev/null @@ -1,21 +0,0 @@ -var fs -try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } -var test = require('tap').test -var glob = require('../') - -test('mock fs', function(t) { - fs.readdir = function(path, cb) { - process.nextTick(function() { - cb(new Error('mock fs.readdir error')) - }) - } - t.pass('mocked') - t.end() -}) - -test('error callback', function(t) { - glob('*', function(err, res) { - t.ok(err, 'expecting mock error') - t.end() - }) -}) diff --git a/deps/npm/node_modules/glob/test/globstar-match.js b/deps/npm/node_modules/glob/test/globstar-match.js deleted file mode 100644 index 9b234fa2a88dde..00000000000000 --- a/deps/npm/node_modules/glob/test/globstar-match.js +++ /dev/null @@ -1,19 +0,0 @@ -var Glob = require("../glob.js").Glob -var test = require('tap').test - -test('globstar should not have dupe matches', function(t) { - var pattern = 'a/**/[gh]' - var g = new Glob(pattern, { cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - console.error('match %j', m) - matches.push(m) - }) - g.on('end', function(set) { - console.error('set', set) - matches = matches.sort() - set = set.sort() - t.same(matches, set, 'should have same set of matches') - t.end() - }) -}) diff --git a/deps/npm/node_modules/glob/test/mark.js b/deps/npm/node_modules/glob/test/mark.js deleted file mode 100644 index bf411c0e550517..00000000000000 --- a/deps/npm/node_modules/glob/test/mark.js +++ /dev/null @@ -1,118 +0,0 @@ -var test = require("tap").test -var glob = require('../') -process.chdir(__dirname) - -// expose timing issues -var lag = 5 -glob.Glob.prototype._stat = function(o) { return function(f, cb) { - var args = arguments - setTimeout(function() { - o.call(this, f, cb) - }.bind(this), lag += 5) -}}(glob.Glob.prototype._stat) - - -test("mark, with **", function (t) { - glob("a/*b*/**", {mark: true}, function (er, results) { - if (er) - throw er - var expect = - [ 'a/abcdef/', - 'a/abcdef/g/', - 'a/abcdef/g/h', - 'a/abcfed/', - 'a/abcfed/g/', - 'a/abcfed/g/h', - 'a/b/', - 'a/b/c/', - 'a/b/c/d', - 'a/bc/', - 'a/bc/e/', - 'a/bc/e/f', - 'a/cb/', - 'a/cb/e/', - 'a/cb/e/f' ] - - t.same(results, expect) - t.end() - }) -}) - -test("mark, no / on pattern", function (t) { - glob("a/*", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - - if (process.platform !== "win32") - expect.push('a/symlink/') - - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) - -test("mark=false, no / on pattern", function (t) { - glob("a/*", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef', - 'a/abcfed', - 'a/b', - 'a/bc', - 'a/c', - 'a/cb' ] - - if (process.platform !== "win32") - expect.push('a/symlink') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /[^\/]$/) - }) -}) - -test("mark=true, / on pattern", function (t) { - glob("a/*/", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) - -test("mark=false, / on pattern", function (t) { - glob("a/*/", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }).on('match', function(m) { - t.similar(m, /\/$/) - }) -}) diff --git a/deps/npm/node_modules/glob/test/negation-test.js b/deps/npm/node_modules/glob/test/negation-test.js deleted file mode 100644 index fc679e2cf86660..00000000000000 --- a/deps/npm/node_modules/glob/test/negation-test.js +++ /dev/null @@ -1,16 +0,0 @@ -// Negation test -// Show that glob respect's minimatch's negate flag - -var glob = require('../glob.js') -var test = require('tap').test - -test('glob respects minimatch negate flag when activated with leading !', function(t) { - var expect = ["abcdef/g", "abcfed/g", "c/d", "cb/e", "symlink/a"] - var results = glob("!b**/*", {cwd: 'a'}, function (er, results) { - if (er) - throw er - - t.same(results, expect) - t.end() - }); -}); diff --git a/deps/npm/node_modules/glob/test/new-glob-optional-options.js b/deps/npm/node_modules/glob/test/new-glob-optional-options.js deleted file mode 100644 index 3e7dc5acbc5ac9..00000000000000 --- a/deps/npm/node_modules/glob/test/new-glob-optional-options.js +++ /dev/null @@ -1,10 +0,0 @@ -var Glob = require('../glob.js').Glob; -var test = require('tap').test; - -test('new glob, with cb, and no options', function (t) { - new Glob(__filename, function(er, results) { - if (er) throw er; - t.same(results, [__filename]); - t.end(); - }); -}); diff --git a/deps/npm/node_modules/glob/test/nocase-nomagic.js b/deps/npm/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index 5a29b08591fab4..00000000000000 --- a/deps/npm/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,125 +0,0 @@ -var fs -try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } -var test = require('tap').test; -var glob = require('../'); - -test('mock fs', function(t) { - var stat = fs.stat - var statSync = fs.statSync - var readdir = fs.readdir - var readdirSync = fs.readdirSync - - function fakeStat(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': - ret = { isDirectory: function() { return true } } - break - case '/tmp/a': case 'c:\\tmp\\a': - ret = { isDirectory: function() { return false } } - break - } - return ret - } - - fs.stat = function(path, cb) { - var f = fakeStat(path); - if (f) { - process.nextTick(function() { - cb(null, f) - }) - } else { - stat.call(fs, path, cb) - } - } - - fs.statSync = function(path) { - return fakeStat(path) || statSync.call(fs, path) - } - - function fakeReaddir(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': - ret = [ 'a', 'A' ] - break - case '/': case 'c:\\': - ret = ['tmp', 'tMp', 'tMP', 'TMP'] - } - return ret - } - - fs.readdir = function(path, cb) { - var f = fakeReaddir(path) - if (f) - process.nextTick(function() { - cb(null, f) - }) - else - readdir.call(fs, path, cb) - } - - fs.readdirSync = function(path) { - return fakeReaddir(path) || readdirSync.call(fs, path) - } - - t.pass('mocked') - t.end() -}) - -test('nocase, nomagic', function(t) { - var n = 2 - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - if(process.platform.match(/^win/)) { - want = want.map(function(p) { - return 'C:' + p - }) - } - glob('/tmp/a', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) - glob('/tmp/A', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) -}) - -test('nocase, with some magic', function(t) { - t.plan(2) - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - if(process.platform.match(/^win/)) { - want = want.map(function(p) { - return 'C:' + p - }) - } - - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) -}) diff --git a/deps/npm/node_modules/glob/test/pause-resume.js b/deps/npm/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab1c5b985..00000000000000 --- a/deps/npm/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// show that no match events happen while paused. -var tap = require("tap") -, child_process = require("child_process") -// just some gnarly pattern with lots of matches -, pattern = "test/a/!(symlink)/**" -, bashResults = require("./bash-results.json") -, patterns = Object.keys(bashResults) -, glob = require("../") -, Glob = glob.Glob -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -var globResults = [] -tap.test("use a Glob object, and pause/resume it", function (t) { - var g = new Glob(pattern) - , paused = false - , res = [] - , expect = bashResults[pattern] - - g.on("pause", function () { - console.error("pause") - }) - - g.on("resume", function () { - console.error("resume") - }) - - g.on("match", function (m) { - t.notOk(g.paused, "must not be paused") - globResults.push(m) - g.pause() - t.ok(g.paused, "must be paused") - setTimeout(g.resume.bind(g), 10) - }) - - g.on("end", function (matches) { - t.pass("reached glob end") - globResults = cleanResults(globResults) - matches = cleanResults(matches) - t.deepEqual(matches, globResults, - "end event matches should be the same as match events") - - t.deepEqual(matches, expect, - "glob matches should be the same as bash results") - - t.end() - }) -}) - diff --git a/deps/npm/node_modules/glob/test/readme-issue.js b/deps/npm/node_modules/glob/test/readme-issue.js deleted file mode 100644 index 0b4e0be2900ecd..00000000000000 --- a/deps/npm/node_modules/glob/test/readme-issue.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require("tap").test -var glob = require("../") - -var mkdirp = require("mkdirp") -var fs = require("fs") -var rimraf = require("rimraf") -var dir = __dirname + "/package" - -test("setup", function (t) { - mkdirp.sync(dir) - fs.writeFileSync(dir + "/package.json", "{}", "ascii") - fs.writeFileSync(dir + "/README", "x", "ascii") - t.pass("setup done") - t.end() -}) - -test("glob", function (t) { - var opt = { - cwd: dir, - nocase: true, - mark: true - } - - glob("README?(.*)", opt, function (er, files) { - if (er) - throw er - t.same(files, ["README"]) - t.end() - }) -}) - -test("cleanup", function (t) { - rimraf.sync(dir) - t.pass("clean") - t.end() -}) diff --git a/deps/npm/node_modules/glob/test/root-nomount.js b/deps/npm/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979b050dd8..00000000000000 --- a/deps/npm/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing root and searching for /b*/**", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) - }) - - t.test('a', function (t) { - glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/deps/npm/node_modules/glob/test/root.js b/deps/npm/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f99cab311..00000000000000 --- a/deps/npm/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -var t = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -var glob = require('../') -var path = require('path') - -t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) -}) - - -t.test('a', function (t) { - console.error("root=" + path.resolve('a')) - glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { - t.ifError(er) - var wanted = [ - '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' - ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - }) - - t.like(matches, wanted) - t.end() - }) -}) - -t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - })) - t.end() - }) -}) - -t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() -}) diff --git a/deps/npm/node_modules/glob/test/stat.js b/deps/npm/node_modules/glob/test/stat.js deleted file mode 100644 index f555b39b167d8f..00000000000000 --- a/deps/npm/node_modules/glob/test/stat.js +++ /dev/null @@ -1,32 +0,0 @@ -var glob = require('../') -var test = require('tap').test -var path = require('path') - -test('stat all the things', function(t) { - var g = new glob.Glob('a/*abc*/**', { stat: true, cwd: __dirname }) - var matches = [] - g.on('match', function(m) { - matches.push(m) - }) - var stats = [] - g.on('stat', function(m) { - stats.push(m) - }) - g.on('end', function(eof) { - stats = stats.sort() - matches = matches.sort() - eof = eof.sort() - t.same(stats, matches) - t.same(eof, matches) - var cache = Object.keys(this.statCache) - t.same(cache.map(function (f) { - return path.relative(__dirname, f).replace(/\\/g, '/') - }).sort(), matches) - - cache.forEach(function(c) { - t.equal(typeof this.statCache[c], 'object') - }, this) - - t.end() - }) -}) diff --git a/deps/npm/node_modules/glob/test/zz-cleanup.js b/deps/npm/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0fa77e0a6..00000000000000 --- a/deps/npm/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// remove the fixtures -var tap = require("tap") -, rimraf = require("rimraf") -, path = require("path") - -tap.test("cleanup fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "removed") - t.end() - }) -}) diff --git a/deps/npm/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/graceful-fs/fs.js index ae9fd6f61e3068..64ad980232ec0d 100644 --- a/deps/npm/node_modules/graceful-fs/fs.js +++ b/deps/npm/node_modules/graceful-fs/fs.js @@ -8,4 +8,4 @@ var post = '});' var src = pre + process.binding('natives').fs + post var vm = require('vm') var fn = vm.runInThisContext(src) -return fn(exports, require, module, __filename, __dirname) +fn(exports, require, module, __filename, __dirname) diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index 57ce64885acb1a..c373eebb7a4d8c 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -6,7 +6,7 @@ }, "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.4", + "version": "3.0.5", "repository": { "type": "git", "url": "git://github.com/isaacs/node-graceful-fs.git" @@ -43,15 +43,16 @@ "rimraf": "^2.2.8", "tap": "^0.4.13" }, - "gitHead": "d3fd03247ccc4fa8a3eee399307fd266c70efb06", + "gitHead": "a6cd37cff01ac3af8d0ab2fd180290538fabd326", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, "homepage": "https://github.com/isaacs/node-graceful-fs", - "_id": "graceful-fs@3.0.4", - "_shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "_from": "graceful-fs@>=3.0.4 <4.0.0", - "_npmVersion": "1.4.28", + "_id": "graceful-fs@3.0.5", + "_shasum": "4a880474bdeb716fe3278cf29792dec38dfac418", + "_from": "graceful-fs@>=3.0.5 <3.1.0", + "_npmVersion": "2.1.9", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -63,9 +64,9 @@ } ], "dist": { - "shasum": "a0306d9b0940e0fc512d33b5df1014e88e0637a3", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz" + "shasum": "4a880474bdeb716fe3278cf29792dec38dfac418", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz" }, - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.4.tgz", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.5.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/ini/LICENSE b/deps/npm/node_modules/ini/LICENSE index 05a4010949cac3..19129e315fe593 100644 --- a/deps/npm/node_modules/ini/LICENSE +++ b/deps/npm/node_modules/ini/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC 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: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE 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/ini/package.json b/deps/npm/node_modules/ini/package.json index 3042c406277ca7..a910b788619c91 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -6,7 +6,7 @@ }, "name": "ini", "description": "An ini encoder/decoder for node", - "version": "1.3.0", + "version": "1.3.2", "repository": { "type": "git", "url": "git://github.com/isaacs/ini.git" @@ -22,15 +22,17 @@ "devDependencies": { "tap": "~0.4.0" }, - "gitHead": "6c314944d0201f3199e1189aeb5687d0aaf1c575", + "license": "ISC", + "gitHead": "bbe4a8bb09afa58f724c04ce43a49037cabeadfb", "bugs": { "url": "https://github.com/isaacs/ini/issues" }, "homepage": "https://github.com/isaacs/ini", - "_id": "ini@1.3.0", - "_shasum": "625483e56c643a7721014c76604d3353f44bd429", - "_from": "ini@>=1.3.0 <2.0.0", - "_npmVersion": "2.0.0", + "_id": "ini@1.3.2", + "_shasum": "9ebf4a44daf9d89acd07aab9f89a083d887f6dec", + "_from": "ini@>=1.3.2 <1.4.0", + "_npmVersion": "2.1.9", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -42,10 +44,9 @@ } ], "dist": { - "shasum": "625483e56c643a7721014c76604d3353f44bd429", - "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.0.tgz" + "shasum": "9ebf4a44daf9d89acd07aab9f89a083d887f6dec", + "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.2.tgz" } diff --git a/deps/npm/node_modules/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/default-input.js index c86894b26a26a2..068bb00a8251ba 100644 --- a/deps/npm/node_modules/init-package-json/default-input.js +++ b/deps/npm/node_modules/init-package-json/default-input.js @@ -41,7 +41,10 @@ function readDeps (test) { return function (cb) { var name = package.name || basename exports.name = yes ? name : prompt('name', name) -var version = package.version || config.get('init-version') || '1.0.0' +var version = package.version || + config.get('init.version') || + config.get('init-version') || + '1.0.0' exports.version = yes ? version : prompt('version', version) if (!package.description) { @@ -177,14 +180,21 @@ if (!package.keywords) { } if (!package.author) { - exports.author = config.get('init-author-name') + exports.author = config.get('init.author.name') || + config.get('init-author-name') ? { - "name" : config.get('init-author-name'), - "email" : config.get('init-author-email'), - "url" : config.get('init-author-url') + "name" : config.get('init.author.name') || + config.get('init-author-name'), + "email" : config.get('init.author.email') || + config.get('init-author-email'), + "url" : config.get('init.author.url') || + config.get('init-author-url') } : prompt('author') } -var license = package.license || config.get('init-license') || 'ISC' +var license = package.license || + config.get('init.license') || + config.get('init-license') || + 'ISC' exports.license = yes ? license : prompt('license', license) diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json index f66857539f629a..c15c772241e343 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json @@ -44,6 +44,5 @@ "tarball": "http://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" } diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index 54aa7cbdf33e8b..de90de6207a581 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "1.1.1", + "version": "1.1.3", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" @@ -40,12 +40,12 @@ ], "readme": "# init-package-json\n\nA node module to get your node module started.\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n", "readmeFilename": "README.md", - "gitHead": "a4df4e57f9b6a2bf906ad50612dbed7dcb2f2c2b", + "gitHead": "b766900b2d615ddc43c452e251b8c5543538e832", "bugs": { "url": "https://github.com/isaacs/init-package-json/issues" }, "homepage": "https://github.com/isaacs/init-package-json", - "_id": "init-package-json@1.1.1", - "_shasum": "e09e9f1fb541e0fddc9175c5ce1736fd45ff4bf8", - "_from": "init-package-json@>=1.1.1 <2.0.0" + "_id": "init-package-json@1.1.3", + "_shasum": "1d633c151a4909891afc8ee13cace8b336c0c9c2", + "_from": "init-package-json@>=1.1.3 <1.2.0" } diff --git a/deps/npm/node_modules/init-package-json/test/npm-defaults.js b/deps/npm/node_modules/init-package-json/test/npm-defaults.js index 8229c84a00235f..f65f6463161f3e 100644 --- a/deps/npm/node_modules/init-package-json/test/npm-defaults.js +++ b/deps/npm/node_modules/init-package-json/test/npm-defaults.js @@ -32,6 +32,14 @@ test("npm configuration values pulled from environment", function (t) { npm.load({}, function (err) { t.ifError(err, "npm loaded successfully") + // clear out dotted names from test environment + npm.config.del("init.author.name") + npm.config.del("init.author.email") + npm.config.del("init.author.url") + // the following have npm defaults, and need to be explicitly overridden + npm.config.set("init.license", "") + npm.config.set("init.version", "") + process.chdir(resolve(__dirname)) init(__dirname, __dirname, npm.config, function (er, data) { t.ifError(err, "init ran successfully") @@ -42,6 +50,58 @@ test("npm configuration values pulled from environment", function (t) { }) }) +test("npm configuration values pulled from dotted config", function (t) { + /*eslint camelcase:0 */ + var config = { + yes : "yes", + + "init.author.name" : "npmbot", + "init.author.email" : "n@p.m", + "init.author.url" : "http://npm.im", + + "init.license" : EXPECTED.license, + "init.version" : EXPECTED.version + } + + npm.load(config, function (err) { + t.ifError(err, "npm loaded successfully") + + process.chdir(resolve(__dirname)) + init(__dirname, __dirname, npm.config, function (er, data) { + t.ifError(err, "init ran successfully") + + t.same(data, EXPECTED, "got the package data from the config") + t.end() + }) + }) +}) + +test("npm configuration values pulled from dashed config", function (t) { + /*eslint camelcase:0 */ + var config = { + yes : "yes", + + "init-author-name" : "npmbot", + "init-author-email" : "n@p.m", + "init-author-url" : "http://npm.im", + + "init-license" : EXPECTED.license, + "init-version" : EXPECTED.version + } + + npm.load(config, function (err) { + t.ifError(err, "npm loaded successfully") + + process.chdir(resolve(__dirname)) + init(__dirname, __dirname, npm.config, function (er, data) { + t.ifError(err, "init ran successfully") + + t.same(data, EXPECTED, "got the package data from the config") + t.end() + }) + }) +}) + test("cleanup", function (t) { rimraf.sync(resolve(__dirname, "package.json")) t.pass("cleaned up") diff --git a/deps/npm/node_modules/minimatch/.npmignore b/deps/npm/node_modules/minimatch/.npmignore index 3c3629e647f5dd..b2a4ba591044ee 100644 --- a/deps/npm/node_modules/minimatch/.npmignore +++ b/deps/npm/node_modules/minimatch/.npmignore @@ -1 +1 @@ -node_modules +# nothing here diff --git a/deps/npm/node_modules/minimatch/README.md b/deps/npm/node_modules/minimatch/README.md index 5b3967ea998b01..d458bc2e0a6b03 100644 --- a/deps/npm/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/minimatch/README.md @@ -7,8 +7,6 @@ A minimal matching utility. This is the matching library used internally by npm. -Eventually, it will replace the C binding in node-glob. - It works by converting glob expressions into JavaScript `RegExp` objects. diff --git a/deps/npm/node_modules/minimatch/benchmark.js b/deps/npm/node_modules/minimatch/benchmark.js new file mode 100644 index 00000000000000..e7deca390ca1b9 --- /dev/null +++ b/deps/npm/node_modules/minimatch/benchmark.js @@ -0,0 +1,15 @@ +var m = require('./minimatch.js') +var pattern = "**/*.js" +var expand = require('brace-expansion') +var files = expand('x/y/z/{1..1000}.js') +var start = process.hrtime() + +for (var i = 0; i < 1000; i++) { + for (var f = 0; f < files.length; f++) { + var res = m(pattern, files[f]) + } + if (!(i%10)) process.stdout.write('.') +} +console.log('done') +var dur = process.hrtime(start) +console.log('%s ms', dur[0]*1e3 + dur[1]/1e6) diff --git a/deps/npm/node_modules/minimatch/browser.js b/deps/npm/node_modules/minimatch/browser.js new file mode 100644 index 00000000000000..2b86fae246f231 --- /dev/null +++ b/deps/npm/node_modules/minimatch/browser.js @@ -0,0 +1,1181 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (isWindows) + pattern = pattern.split("\\").join("/") + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) + options = this.options + else + options = {} + } + + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (isWindows) + f = f.split("\\").join("/") + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + // Find the basename of the path by looking for the last non-empty segment + var filename; + for (var i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +}).call(this,require('_process')) +},{"_process":5,"brace-expansion":2}],2:[function(require,module,exports){ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + var expansions = expand(escapeBraces(str)); + return expansions.filter(identity).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0]).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + expansions.push([pre, N[j], post[k]].join('')) + } + } + + return expansions; +} + + +},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ +module.exports = balanced; +function balanced(a, b, str) { + var bal = 0; + var m = {}; + var ended = false; + + for (var i = 0; i < str.length; i++) { + if (a == str.substr(i, a.length)) { + if (!('start' in m)) m.start = i; + bal++; + } + else if (b == str.substr(i, b.length) && 'start' in m) { + ended = true; + bal--; + if (!bal) { + m.end = i; + m.pre = str.substr(0, m.start); + m.body = (m.end - m.start > 1) + ? str.substring(m.start + a.length, m.end) + : ''; + m.post = str.slice(m.end + b.length); + return m; + } + } + } + + // if we opened more than we closed, find the one we closed + if (bal && ended) { + var start = m.start + a.length; + m = balanced(a, b, str.substr(start)); + if (m) { + m.start += start; + m.end += start; + m.pre = str.slice(0, start) + m.pre; + } + return m; + } +} + +},{}],4:[function(require,module,exports){ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (Array.isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +},{}],5:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}]},{},[1]); diff --git a/deps/npm/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/minimatch/minimatch.js index 47617868b99902..6958cdc4815cb0 100644 --- a/deps/npm/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/minimatch/minimatch.js @@ -1,43 +1,13 @@ -;(function (require, exports, module, platform) { - -if (module) module.exports = minimatch -else exports.minimatch = minimatch - -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} - +module.exports = minimatch minimatch.Minimatch = Minimatch -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") +var isWindows = false +if (typeof process !== 'undefined' && process.platform === 'win32') + isWindows = true + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , expand = require("brace-expansion") -var path = require("path") // any single thing other than / // don't need to escape / when using new RegExp() , qmark = "[^/]" @@ -131,7 +101,7 @@ function minimatch (p, pattern, options) { function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) + return new Minimatch(pattern, options) } if (typeof pattern !== "string") { @@ -141,19 +111,9 @@ function Minimatch (pattern, options) { if (!options) options = {} pattern = pattern.trim() - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { + // windows support: need to use /, not \ + if (isWindows) pattern = pattern.split("\\").join("/") - } - - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) this.options = options this.set = [] @@ -256,19 +216,19 @@ function parseNegate () { // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() + return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand -function pad(n, width, z) { - z = z || '0'; - n = n + ''; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} - function braceExpand (pattern, options) { - options = options || this.options + if (!options) { + if (this instanceof Minimatch) + options = this.options + else + options = {} + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern @@ -282,187 +242,7 @@ function braceExpand (pattern, options) { return [pattern] } - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , needPadding = numset[1][0] === '0' - , startWidth = numset[1].length - , padded - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - - for (var i = start; i != (end + inc); i += inc) { - padded = needPadding ? pad(i, startWidth) : i + '' - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(padded + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret + return expand(pattern) } // parse a component of the expanded set. @@ -849,10 +629,8 @@ function match (f, partial) { var options = this.options // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { + if (isWindows) f = f.split("\\").join("/") - } // treat the test path as a set of pathparts. f = f.split(slashSplit) @@ -1065,9 +843,3 @@ function globUnescape (s) { function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") } - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..249bc20eb5573c --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,2 @@ +node_modules +*.sw* diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml new file mode 100644 index 00000000000000..6e5919de39a312 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..fd4e03a897d140 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,116 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.png)](http://travis-ci.org/juliangruber/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.bak b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.bak new file mode 100644 index 00000000000000..ed35e15af3d0e0 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.bak @@ -0,0 +1,197 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + + +var exprCommaBrace = /,.*}/; +var exprDollarEnd = /\$$/; +var exprNumericSeq = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/; +var exprAlphaSeq = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/; +var exprIsOptions = /,/; + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || exprDollarEnd.test(m.pre)) return [str]; + + var isNumericSequence = exprNumericSeq.test(m.body); + var isAlphaSequence = exprAlphaSeq.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = exprIsOptions.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (exprCommaBrace.test(m.post)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str, false); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..f8d40f79acde0a --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000000000..fd4f2b066b339e --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml new file mode 100644 index 00000000000000..cc4dba29d959a2 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..2aff0ebff4403e --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,80 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..d165ae8174ca82 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,38 @@ +module.exports = balanced; +function balanced(a, b, str) { + var bal = 0; + var m = {}; + var ended = false; + + for (var i = 0; i < str.length; i++) { + if (a == str.substr(i, a.length)) { + if (!('start' in m)) m.start = i; + bal++; + } + else if (b == str.substr(i, b.length) && 'start' in m) { + ended = true; + bal--; + if (!bal) { + m.end = i; + m.pre = str.substr(0, m.start); + m.body = (m.end - m.start > 1) + ? str.substring(m.start + a.length, m.end) + : ''; + m.post = str.slice(m.end + b.length); + return m; + } + } + } + + // if we opened more than we closed, find the one we closed + if (bal && ended) { + var start = m.start + a.length; + m = balanced(a, b, str.substr(start)); + if (m) { + m.start += start; + m.end += start; + m.pre = str.slice(0, start) + m.pre; + } + return m; + } +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..ede6efefa07883 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,73 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.1.1" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "_id": "balanced-match@0.2.0", + "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "_from": "balanced-match@>=0.2.0 <0.3.0", + "_npmVersion": "2.1.8", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "dist": { + "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..36bfd39954850d --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml new file mode 100644 index 00000000000000..f1d0f13c8a54d0 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 00000000000000..57359ff5ae2f09 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,60 @@ +concat-map +========== + +Concatenative mapdashery. + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 00000000000000..33656217b61d8f --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 00000000000000..b58da7ac9f4dd1 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,9 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (Array.isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..ff38e384ebd6b6 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,64 @@ +{ + "name": "concat-map", + "description": "concatenative mapdashery", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "main": "index.js", + "keywords": [ + "concat", + "map", + "functional", + "higher-order" + ], + "directories": { + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tap test/*.js" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "engines": { + "node": ">=0.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_id": "concat-map@0.0.0", + "dependencies": {}, + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.19", + "_nodeVersion": "v0.6.11", + "_defaultsLoaded": true, + "dist": { + "shasum": "604be9c2afb6dc9ba8182e3ff294fdd48e238e6d", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "604be9c2afb6dc9ba8182e3ff294fdd48e238e6d", + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.0.tgz", + "_from": "concat-map@0.0.0", + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/substack/node-concat-map" +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 00000000000000..6ace3459cfac08 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tap').test; + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..e9b15ce89ba6c3 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,75 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh" + }, + "dependencies": { + "balanced-match": "^0.2.0", + "concat-map": "0.0.0" + }, + "devDependencies": { + "tape": "~1.1.1" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "ceba9627f19c590feb7df404e1d6c41f8c01b93a", + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "_id": "brace-expansion@1.0.1", + "_shasum": "817708d72ab27a8c312d25efababaea963439ed5", + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "dist": { + "shasum": "817708d72ab27a8c312d25efababaea963439ed5", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js new file mode 100644 index 00000000000000..5fe2b8ad48cc1c --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var expand = require('..'); +var fs = require('fs'); +var resfile = __dirname + '/bash-results.txt'; +var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); + +// throw away the EOF marker +cases.pop() + +test('matches bash expansions', function(t) { + cases.forEach(function(testcase) { + var set = testcase.split('\n'); + var pattern = set.shift(); + var actual = expand(pattern); + + // If it expands to the empty string, then it's actually + // just nothing, but Bash is a singly typed language, so + // "nothing" is the same as "". + if (set.length === 1 && set[0] === '') { + set = [] + } else { + // otherwise, strip off the [] that were added so that + // "" expansions would be preserved properly. + set = set.map(function (s) { + return s.replace(/^\[|\]$/g, '') + }) + } + + t.same(actual, set, pattern); + }); + t.end(); +}) diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt new file mode 100644 index 00000000000000..958148d26aacb9 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt @@ -0,0 +1,1075 @@ +A{b,{d,e},{f,g}}Z +[AbZ] +[AdZ] +[AeZ] +[AfZ] +[AgZ]><><><><><><><\{a,b}{{a,b},a,b} +[{a,b}a] +[{a,b}b] +[{a,b}a] +[{a,b}b]><><><><{{a,b} +[{a] +[{b]><><><><{a,b}} +[a}] +[b}]><><><><{,} +><><><><><><><{,}b +[b] +[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} +[-01] +[000] +[001] +[002] +[003] +[004] +[005]><><><><{-05..100..5} +[-05] +[000] +[005] +[010] +[015] +[020] +[025] +[030] +[035] +[040] +[045] +[050] +[055] +[060] +[065] +[070] +[075] +[080] +[085] +[090] +[095] +[100]><><><><{-05..100} +[-05] +[-04] +[-03] +[-02] +[-01] +[000] +[001] +[002] +[003] +[004] +[005] +[006] +[007] +[008] +[009] +[010] +[011] +[012] +[013] +[014] +[015] +[016] +[017] +[018] +[019] +[020] +[021] +[022] +[023] +[024] +[025] +[026] +[027] +[028] +[029] +[030] +[031] +[032] +[033] +[034] +[035] +[036] +[037] +[038] +[039] +[040] +[041] +[042] +[043] +[044] +[045] +[046] +[047] +[048] +[049] +[050] +[051] +[052] +[053] +[054] +[055] +[056] +[057] +[058] +[059] +[060] +[061] +[062] +[063] +[064] +[065] +[066] +[067] +[068] +[069] +[070] +[071] +[072] +[073] +[074] +[075] +[076] +[077] +[078] +[079] +[080] +[081] +[082] +[083] +[084] +[085] +[086] +[087] +[088] +[089] +[090] +[091] +[092] +[093] +[094] +[095] +[096] +[097] +[098] +[099] +[100]><><><><{0..5..2} +[0] +[2] +[4]><><><><{0001..05..2} +[0001] +[0003] +[0005]><><><><{0001..-5..2} +[0001] +[-001] +[-003] +[-005]><><><><{0001..-5..-2} +[0001] +[-001] +[-003] +[-005]><><><><{0001..5..-2} +[0001] +[0003] +[0005]><><><><{01..5} +[01] +[02] +[03] +[04] +[05]><><><><{1..05} +[01] +[02] +[03] +[04] +[05]><><><><{1..05..3} +[01] +[04]><><><><{05..100} +[005] +[006] +[007] +[008] +[009] +[010] +[011] +[012] +[013] +[014] +[015] +[016] +[017] +[018] +[019] +[020] +[021] +[022] +[023] +[024] +[025] +[026] +[027] +[028] +[029] +[030] +[031] +[032] +[033] +[034] +[035] +[036] +[037] +[038] +[039] +[040] +[041] +[042] +[043] +[044] +[045] +[046] +[047] +[048] +[049] +[050] +[051] +[052] +[053] +[054] +[055] +[056] +[057] +[058] +[059] +[060] +[061] +[062] +[063] +[064] +[065] +[066] +[067] +[068] +[069] +[070] +[071] +[072] +[073] +[074] +[075] +[076] +[077] +[078] +[079] +[080] +[081] +[082] +[083] +[084] +[085] +[086] +[087] +[088] +[089] +[090] +[091] +[092] +[093] +[094] +[095] +[096] +[097] +[098] +[099] +[100]><><><><{0a..0z} +[{0a..0z}]><><><><{a,b\}c,d} +[a] +[b}c] +[d]><><><><{a,b{c,d} +[{a,bc] +[{a,bd]><><><><{a,b}c,d} +[ac,d}] +[bc,d}]><><><><{a..F} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F]><><><><{A..f} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a] +[b] +[c] +[d] +[e] +[f]><><><><{a..Z} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z]><><><><{A..z} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a] +[b] +[c] +[d] +[e] +[f] +[g] +[h] +[i] +[j] +[k] +[l] +[m] +[n] +[o] +[p] +[q] +[r] +[s] +[t] +[u] +[v] +[w] +[x] +[y] +[z]><><><><{z..A} +[z] +[y] +[x] +[w] +[v] +[u] +[t] +[s] +[r] +[q] +[p] +[o] +[n] +[m] +[l] +[k] +[j] +[i] +[h] +[g] +[f] +[e] +[d] +[c] +[b] +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F] +[E] +[D] +[C] +[B] +[A]><><><><{Z..a} +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a]><><><><{a..F..2} +[a] +[_] +[]] +[[] +[Y] +[W] +[U] +[S] +[Q] +[O] +[M] +[K] +[I] +[G]><><><><{A..f..02} +[A] +[C] +[E] +[G] +[I] +[K] +[M] +[O] +[Q] +[S] +[U] +[W] +[Y] +[[] +[]] +[_] +[a] +[c] +[e]><><><><{a..Z..5} +[a] +[]><><><><><><><{A..z..10} +[A] +[K] +[U] +[_] +[i] +[s]><><><><{z..A..-2} +[z] +[x] +[v] +[t] +[r] +[p] +[n] +[l] +[j] +[h] +[f] +[d] +[b] +[`] +[^] +[] +[Z] +[X] +[V] +[T] +[R] +[P] +[N] +[L] +[J] +[H] +[F] +[D] +[B]><><><><{Z..a..20} +[Z]><><><><{a{,b} +[{a] +[{ab]><><><><{a},b} +[a}] +[b]><><><><{x,y{,}g} +[x] +[yg] +[yg]><><><><{x,y{}g} +[x] +[y{}g]><><><><{{a,b} +[{a] +[{b]><><><><{{a,b},c} +[a] +[b] +[c]><><><><{{a,b}c} +[{ac}] +[{bc}]><><><><{{a,b},} +[a] +[b]><><><><><><><{{a,b},}c +[ac] +[bc] +[c]><><><><{{a,b}.} +[{a.}] +[{b.}]><><><><{{a,b}} +[{a}] +[{b}]><><><><><><>< +><><><><{-10..00} +[-10] +[-09] +[-08] +[-07] +[-06] +[-05] +[-04] +[-03] +[-02] +[-01] +[000]><><><><{a,\\{a,b}c} +[a] +[\ac] +[\bc]><><><><{a,\{a,b}c} +[ac}] +[{ac}] +[bc}]><><><><><><><{-10.\.00} +[{-10..00}]><><><><><><><><><><{l,n,m}xyz +[lxyz] +[nxyz] +[mxyz]><><><><{abc\,def} +[{abc,def}]><><><><{abc} +[{abc}]><><><><{x\,y,\{abc\},trie} +[x,y] +[{abc}] +[trie]><><><><{} +[{}]><><><><} +[}]><><><><{ +[{]><><><><><><><{1..10} +[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10]><><><><{0..10,braces} +[0..10] +[braces]><><><><{{0..10},braces} +[0] +[1] +[2] +[3] +[4] +[5] +[6] +[7] +[8] +[9] +[10] +[braces]><><><><><><><{3..3} +[3]><><><><><><><{10..1} +[10] +[9] +[8] +[7] +[6] +[5] +[4] +[3] +[2] +[1]><><><><{10..1}y +[10y] +[9y] +[8y] +[7y] +[6y] +[5y] +[4y] +[3y] +[2y] +[1y]><><><><><><><{a..f} +[a] +[b] +[c] +[d] +[e] +[f]><><><><{f..a} +[f] +[e] +[d] +[c] +[b] +[a]><><><><{a..A} +[a] +[`] +[_] +[^] +[]] +[] +[[] +[Z] +[Y] +[X] +[W] +[V] +[U] +[T] +[S] +[R] +[Q] +[P] +[O] +[N] +[M] +[L] +[K] +[J] +[I] +[H] +[G] +[F] +[E] +[D] +[C] +[B] +[A]><><><><{A..a} +[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[J] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +[X] +[Y] +[Z] +[[] +[] +[]] +[^] +[_] +[`] +[a]><><><><{f..f} +[f]><><><><{1..f} +[{1..f}]><><><><{f..1} +[{f..1}]><><><><{-1..-10} +[-1] +[-2] +[-3] +[-4] +[-5] +[-6] +[-7] +[-8] +[-9] +[-10]><><><><{-20..0} +[-20] +[-19] +[-18] +[-17] +[-16] +[-15] +[-14] +[-13] +[-12] +[-11] +[-10] +[-9] +[-8] +[-7] +[-6] +[-5] +[-4] +[-3] +[-2] +[-1] +[0]><><><><><><><><><><{klklkl}{1,2,3} +[{klklkl}1] +[{klklkl}2] +[{klklkl}3]><><><><{1..10..2} +[1] +[3] +[5] +[7] +[9]><><><><{-1..-10..2} +[-1] +[-3] +[-5] +[-7] +[-9]><><><><{-1..-10..-2} +[-1] +[-3] +[-5] +[-7] +[-9]><><><><{10..1..-2} +[10] +[8] +[6] +[4] +[2]><><><><{10..1..2} +[10] +[8] +[6] +[4] +[2]><><><><{1..20..2} +[1] +[3] +[5] +[7] +[9] +[11] +[13] +[15] +[17] +[19]><><><><{1..20..20} +[1]><><><><{100..0..5} +[100] +[95] +[90] +[85] +[80] +[75] +[70] +[65] +[60] +[55] +[50] +[45] +[40] +[35] +[30] +[25] +[20] +[15] +[10] +[5] +[0]><><><><{100..0..-5} +[100] +[95] +[90] +[85] +[80] +[75] +[70] +[65] +[60] +[55] +[50] +[45] +[40] +[35] +[30] +[25] +[20] +[15] +[10] +[5] +[0]><><><><{a..z} +[a] +[b] +[c] +[d] +[e] +[f] +[g] +[h] +[i] +[j] +[k] +[l] +[m] +[n] +[o] +[p] +[q] +[r] +[s] +[t] +[u] +[v] +[w] +[x] +[y] +[z]><><><><{a..z..2} +[a] +[c] +[e] +[g] +[i] +[k] +[m] +[o] +[q] +[s] +[u] +[w] +[y]><><><><{z..a..-2} +[z] +[x] +[v] +[t] +[r] +[p] +[n] +[l] +[j] +[h] +[f] +[d] +[b]><><><><{2147483645..2147483649} +[2147483645] +[2147483646] +[2147483647] +[2147483648] +[2147483649]><><><><{10..0..2} +[10] +[8] +[6] +[4] +[2] +[0]><><><><{10..0..-2} +[10] +[8] +[6] +[4] +[2] +[0]><><><><{-50..-0..5} +[-50] +[-45] +[-40] +[-35] +[-30] +[-25] +[-20] +[-15] +[-10] +[-5] +[0]><><><><{1..10.f} +[{1..10.f}]><><><><{1..ff} +[{1..ff}]><><><><{1..10..ff} +[{1..10..ff}]><><><><{1.20..2} +[{1.20..2}]><><><><{1..20..f2} +[{1..20..f2}]><><><><{1..20..2f} +[{1..20..2f}]><><><><{1..2f..2} +[{1..2f..2}]><><><><{1..ff..2} +[{1..ff..2}]><><><><{1..ff} +[{1..ff}]><><><><{1..f} +[{1..f}]><><><><{1..0f} +[{1..0f}]><><><><{1..10f} +[{1..10f}]><><><><{1..10.f} +[{1..10.f}]><><><><{1..10.f} +[{1..10.f}]><><><>< \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt new file mode 100644 index 00000000000000..e5161c3da869f3 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt @@ -0,0 +1,182 @@ +# skip quotes for now +# "{x,x}" +# {"x,x"} +# {x","x} +# '{a,b}{{a,b},a,b}' +A{b,{d,e},{f,g}}Z +PRE-{a,b}{{a,b},a,b}-POST +\\{a,b}{{a,b},a,b} +{{a,b} +{a,b}} +{,} +a{,} +{,}b +a{,}b +a{b}c +a{1..5}b +a{01..5}b +a{-01..5}b +a{-01..5..3}b +a{001..9}b +a{b,c{d,e},{f,g}h}x{y,z +a{b,c{d,e},{f,g}h}x{y,z\\} +a{b,c{d,e},{f,g}h}x{y,z} +a{b{c{d,e}f{x,y{{g}h +a{b{c{d,e}f{x,y{}g}h +a{b{c{d,e}f{x,y}}g}h +a{b{c{d,e}f}g}h +a{{x,y},z}b +f{x,y{g,z}}h +f{x,y{{g,z}}h +f{x,y{{g,z}}h} +f{x,y{{g}h +f{x,y{{g}}h +f{x,y{}g}h +z{a,b{,c}d +z{a,b},c}d +{-01..5} +{-05..100..5} +{-05..100} +{0..5..2} +{0001..05..2} +{0001..-5..2} +{0001..-5..-2} +{0001..5..-2} +{01..5} +{1..05} +{1..05..3} +{05..100} +{0a..0z} +{a,b\\}c,d} +{a,b{c,d} +{a,b}c,d} +{a..F} +{A..f} +{a..Z} +{A..z} +{z..A} +{Z..a} +{a..F..2} +{A..f..02} +{a..Z..5} +d{a..Z..5}b +{A..z..10} +{z..A..-2} +{Z..a..20} +{a{,b} +{a},b} +{x,y{,}g} +{x,y{}g} +{{a,b} +{{a,b},c} +{{a,b}c} +{{a,b},} +X{{a,b},}X +{{a,b},}c +{{a,b}.} +{{a,b}} +X{a..#}X +# this next one is an empty string + +{-10..00} +# Need to escape slashes in here for reasons i guess. +{a,\\\\{a,b}c} +{a,\\{a,b}c} +a,\\{b,c} +{-10.\\.00} +#### bash tests/braces.tests +# Note that some tests are edited out because some features of +# bash are intentionally not supported in this brace expander. +ff{c,b,a} +f{d,e,f}g +{l,n,m}xyz +{abc\\,def} +{abc} +{x\\,y,\\{abc\\},trie} +# not impementing back-ticks obviously +# XXXX\\{`echo a b c | tr ' ' ','`\\} +{} +# We only ever have to worry about parsing a single argument, +# not a command line, so spaces have a different meaning than bash. +# { } +} +{ +abcd{efgh +# spaces +# foo {1,2} bar +# not impementing back-ticks obviously +# `zecho foo {1,2} bar` +# $(zecho foo {1,2} bar) +# ${var} is not a variable here, like it is in bash. omit. +# foo{bar,${var}.} +# foo{bar,${var}} +# isaacs: skip quotes for now +# "${var}"{x,y} +# $var{x,y} +# ${var}{x,y} +# new sequence brace operators +{1..10} +# this doesn't work yet +{0..10,braces} +# but this does +{{0..10},braces} +x{{0..10},braces}y +{3..3} +x{3..3}y +{10..1} +{10..1}y +x{10..1}y +{a..f} +{f..a} +{a..A} +{A..a} +{f..f} +# mixes are incorrectly-formed brace expansions +{1..f} +{f..1} +# spaces +# 0{1..9} {10..20} +# do negative numbers work? +{-1..-10} +{-20..0} +# weirdly-formed brace expansions -- fixed in post-bash-3.1 +a-{b{d,e}}-c +a-{bdef-{g,i}-c +# isaacs: skip quotes for now +# {"klklkl"}{1,2,3} +# isaacs: this is a valid test, though +{klklkl}{1,2,3} +# {"x,x"} +{1..10..2} +{-1..-10..2} +{-1..-10..-2} +{10..1..-2} +{10..1..2} +{1..20..2} +{1..20..20} +{100..0..5} +{100..0..-5} +{a..z} +{a..z..2} +{z..a..-2} +# make sure brace expansion handles ints > 2**31 - 1 using intmax_t +{2147483645..2147483649} +# unwanted zero-padding -- fixed post-bash-4.0 +{10..0..2} +{10..0..-2} +{-50..-0..5} +# bad +{1..10.f} +{1..ff} +{1..10..ff} +{1.20..2} +{1..20..f2} +{1..20..2f} +{1..2f..2} +{1..ff..2} +{1..ff} +{1..f} +{1..0f} +{1..10f} +{1..10.f} +{1..10.f} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js new file mode 100644 index 00000000000000..3fcc185a7d6dcc --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var expand = require('..'); + +test('ignores ${', function(t) { + t.deepEqual(expand('${1..3}'), ['${1..3}']); + t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); + t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js new file mode 100644 index 00000000000000..fd1132826a00c9 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var expand = require('..'); + +test('empty option', function(t) { + t.deepEqual(expand('-v{,,,,}'), [ + '-v', '-v', '-v', '-v', '-v' + ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh new file mode 100644 index 00000000000000..e040e664d9f881 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -e + +# Bash 4.3 because of arbitrary need to pick a single standard. + +if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then + echo "this script requires bash 4.3" >&2 + exit 1 +fi + +CDPATH= cd "$(dirname "$0")" + +js='require("./")(process.argv[1]).join(" ")' + +cat cases.txt | \ + while read case; do + if [ "${case:0:1}" = "#" ]; then + continue; + fi; + b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" + echo "$case" + echo -n "$b><><><><"; + done > bash-results.txt diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js new file mode 100644 index 00000000000000..8d434c23d4514d --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var expand = require('..'); + +test('negative increment', function(t) { + t.deepEqual(expand('{3..1}'), ['3', '2', '1']); + t.deepEqual(expand('{10..8}'), ['10', '9', '8']); + t.deepEqual(expand('{10..08}'), ['10', '09', '08']); + t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); + + t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); + t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); + t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); + + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js new file mode 100644 index 00000000000000..54d1e88f6865bf --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var expand = require('..'); + +test('nested', function(t) { + t.deepEqual(expand('{a,b{1..3},c}'), [ + 'a', 'b1', 'b2', 'b3', 'c' + ]); + t.deepEqual(expand('{{A..Z},{a..z}}'), + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') + ); + t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ + 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' + ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js new file mode 100644 index 00000000000000..d5f62566c95d6d --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var expand = require('..'); + +test('order', function(t) { + t.deepEqual(expand('a{d,c,b}e'), [ + 'ade', 'ace', 'abe' + ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js new file mode 100644 index 00000000000000..f830f7c46621bb --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var expand = require('..'); + +test('pad', function(t) { + t.deepEqual(expand('{9..11}'), [ + '9', '10', '11' + ]); + t.deepEqual(expand('{09..11}'), [ + '09', '10', '11' + ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js new file mode 100644 index 00000000000000..3038fba7416b3a --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js @@ -0,0 +1,7 @@ +var test = require('tape'); +var expand = require('..'); + +test('x and y of same type', function(t) { + t.deepEqual(expand('{a..9}'), ['{a..9}']); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js new file mode 100644 index 00000000000000..18ee665fb99cd9 --- /dev/null +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js @@ -0,0 +1,49 @@ +var test = require('tape'); +var expand = require('..'); + +test('numeric sequences', function(t) { + t.deepEqual(expand('a{1..2}b{2..3}c'), [ + 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' + ]); + t.deepEqual(expand('{1..2}{2..3}'), [ + '12', '13', '22', '23' + ]); + t.end(); +}); + +test('numeric sequences with step count', function(t) { + t.deepEqual(expand('{0..8..2}'), [ + '0', '2', '4', '6', '8' + ]); + t.deepEqual(expand('{1..8..2}'), [ + '1', '3', '5', '7' + ]); + t.end(); +}); + +test('numeric sequence with negative x / y', function(t) { + t.deepEqual(expand('{3..-2}'), [ + '3', '2', '1', '0', '-1', '-2' + ]); + t.end(); +}); + +test('alphabetic sequences', function(t) { + t.deepEqual(expand('1{a..b}2{b..c}3'), [ + '1a2b3', '1a2c3', '1b2b3', '1b2c3' + ]); + t.deepEqual(expand('{a..b}{b..c}'), [ + 'ab', 'ac', 'bb', 'bc' + ]); + t.end(); +}); + +test('alphabetic sequences with step count', function(t) { + t.deepEqual(expand('{a..k..2}'), [ + 'a', 'c', 'e', 'g', 'i', 'k' + ]); + t.deepEqual(expand('{b..k..2}'), [ + 'b', 'd', 'f', 'h', 'j' + ]); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json index d96e1d36fc7c4e..f0083b91c9007c 100644 --- a/deps/npm/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/minimatch/package.json @@ -6,38 +6,40 @@ }, "name": "minimatch", "description": "a glob matcher in javascript", - "version": "1.0.0", + "version": "2.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" }, "main": "minimatch.js", "scripts": { - "test": "tap test/*.js" + "test": "tap test/*.js", + "prepublish": "browserify -o browser.js -e minimatch.js" }, "engines": { "node": "*" }, "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" + "brace-expansion": "^1.0.0" }, "devDependencies": { + "browserify": "^6.3.3", "tap": "" }, "license": { "type": "MIT", "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", + "gitHead": "eac219d8f665c8043fda9a1cd34eab9b006fae01", "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "homepage": "https://github.com/isaacs/minimatch", - "_id": "minimatch@1.0.0", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "_from": "minimatch@latest", - "_npmVersion": "1.4.21", + "_id": "minimatch@2.0.1", + "_shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37", + "_from": "minimatch@>=2.0.1 <2.1.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -49,10 +51,10 @@ } ], "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + "shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/minimatch/test/basic.js b/deps/npm/node_modules/minimatch/test/basic.js index ae7ac73c775edb..b72edf88934743 100644 --- a/deps/npm/node_modules/minimatch/test/basic.js +++ b/deps/npm/node_modules/minimatch/test/basic.js @@ -381,7 +381,7 @@ tap.test("basic tests", function (t) { , JSON.stringify(pattern) + " " + JSON.stringify(expect) , tapOpts ) - t.equal(tapOpts.re, expectRe, tapOpts) + t.equal(tapOpts.re, expectRe, null, tapOpts) }) t.comment("time=" + (Date.now() - start) + "ms") diff --git a/deps/npm/node_modules/minimatch/test/brace-expand.js b/deps/npm/node_modules/minimatch/test/brace-expand.js index e63d3f60c80e82..67bc913544815a 100644 --- a/deps/npm/node_modules/minimatch/test/brace-expand.js +++ b/deps/npm/node_modules/minimatch/test/brace-expand.js @@ -22,12 +22,17 @@ tap.test("brace expansion", function (t) { , "a5b" ] ] , [ "a{b}c", ["a{b}c"] ] , [ "a{00..05}b" - , ["a00b" - ,"a01b" - ,"a02b" - ,"a03b" - ,"a04b" - ,"a05b" ] ] + , [ "a00b" + , "a01b" + , "a02b" + , "a03b" + , "a04b" + , "a05b" ] ] + , [ "z{a,b},c}d", ["za,c}d", "zb,c}d"] ] + , [ "z{a,b{,c}d", ["z{a,bd", "z{a,bcd"] ] + , [ "a{b{c{d,e}f}g}h", ["a{b{cdf}g}h", "a{b{cef}g}h"] ] + , [ "a{b{c{d,e}f{x,y}}g}h", ["a{b{cdfx}g}h", "a{b{cdfy}g}h", "a{b{cefx}g}h", "a{b{cefy}g}h"] ] + , [ "a{b{c{d,e}f{x,y{}g}h", ["a{b{cdfxh", "a{b{cdfy{}gh", "a{b{cefxh", "a{b{cefy{}gh"] ] ].forEach(function (tc) { var p = tc[0] , expect = tc[1] diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 0b81fab2027ff7..63fefe3d16c80b 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -42,7 +42,7 @@ '-luuid.lib', '-lodbc32.lib', '-lDelayImp.lib', - '-l"<(node_root_dir)/$(ConfigurationName)/node.lib"' + '-l"<(node_root_dir)/$(ConfigurationName)/iojs.lib"' ], # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' # needs to have dll-interface to be used by clients of class 'node::ObjectWrap' diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index f3605902e93c10..3d3c58785f1795 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -173,7 +173,7 @@ function build (gyp, argv, callback) { } /** - * Copies the node.lib file for the current target architecture into the + * Copies the iojs.lib file for the current target architecture into the * current proper dev dir location. */ @@ -181,15 +181,15 @@ function build (gyp, argv, callback) { if (!win || !copyDevLib) return doBuild() var buildDir = path.resolve(nodeDir, buildType) - , archNodeLibPath = path.resolve(nodeDir, arch, 'node.lib') - , buildNodeLibPath = path.resolve(buildDir, 'node.lib') + , archNodeLibPath = path.resolve(nodeDir, arch, 'iojs.lib') + , buildNodeLibPath = path.resolve(buildDir, 'iojs.lib') mkdirp(buildDir, function (err, isNew) { if (err) return callback(err) log.verbose('"' + buildType + '" dir needed to be created?', isNew) var rs = fs.createReadStream(archNodeLibPath) , ws = fs.createWriteStream(buildNodeLibPath) - log.verbose('copying "node.lib" for ' + arch, buildNodeLibPath) + log.verbose('copying "iojs.lib" for ' + arch, buildNodeLibPath) rs.pipe(ws) rs.on('error', callback) ws.on('error', callback) diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js index 6f72e6a93d6cf8..378fbfae4769b5 100644 --- a/deps/npm/node_modules/node-gyp/lib/install.js +++ b/deps/npm/node_modules/node-gyp/lib/install.js @@ -39,7 +39,7 @@ function install (gyp, argv, callback) { } } - var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'http://nodejs.org/dist' + var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://iojs.org/dist' // Determine which node dev files version we are installing @@ -185,7 +185,7 @@ function install (gyp, argv, callback) { // now download the node tarball var tarPath = gyp.opts['tarball'] - var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/node-v' + version + '.tar.gz' + var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '.tar.gz' , badDownload = false , extractCount = 0 , gunzip = zlib.createGunzip() @@ -267,7 +267,7 @@ function install (gyp, argv, callback) { var async = 0 if (win) { - // need to download node.lib + // need to download iojs.lib async++ downloadNodeLib(deref) } @@ -295,7 +295,8 @@ function install (gyp, argv, callback) { // check content shasums for (var k in contentShasums) { log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k]) - if (contentShasums[k] !== expectShasums[k]) { + // TODO(piscisaureus) re-enable checksum verification when the correct files are in place. + if (false || contentShasums[k] !== expectShasums[k]) { cb(new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k])) return } @@ -343,36 +344,36 @@ function install (gyp, argv, callback) { } function downloadNodeLib (done) { - log.verbose('on Windows; need to download `node.lib`...') + log.verbose('on Windows; need to download `iojs.lib`...') var dir32 = path.resolve(devDir, 'ia32') , dir64 = path.resolve(devDir, 'x64') - , nodeLibPath32 = path.resolve(dir32, 'node.lib') - , nodeLibPath64 = path.resolve(dir64, 'node.lib') - , nodeLibUrl32 = distUrl + '/v' + version + '/node.lib' - , nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib' + , nodeLibPath32 = path.resolve(dir32, 'iojs.lib') + , nodeLibPath64 = path.resolve(dir64, 'iojs.lib') + , nodeLibUrl32 = distUrl + '/v' + version + '/win-x86/iojs.lib' + , nodeLibUrl64 = distUrl + '/v' + version + '/win-x64/iojs.lib' - log.verbose('32-bit node.lib dir', dir32) - log.verbose('64-bit node.lib dir', dir64) - log.verbose('`node.lib` 32-bit url', nodeLibUrl32) - log.verbose('`node.lib` 64-bit url', nodeLibUrl64) + log.verbose('32-bit iojs.lib dir', dir32) + log.verbose('64-bit iojs.lib dir', dir64) + log.verbose('`iojs.lib` 32-bit url', nodeLibUrl32) + log.verbose('`iojs.lib` 64-bit url', nodeLibUrl64) var async = 2 mkdir(dir32, function (err) { if (err) return done(err) - log.verbose('streaming 32-bit node.lib to:', nodeLibPath32) + log.verbose('streaming 32-bit iojs.lib to:', nodeLibPath32) var req = download(nodeLibUrl32) if (!req) return req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { - done(new Error(res.statusCode + ' status code downloading 32-bit node.lib')) + done(new Error(res.statusCode + ' status code downloading 32-bit iojs.lib')) return } getContentSha(res, function (_, checksum) { - contentShasums['node.lib'] = checksum - log.verbose('content checksum', 'node.lib', checksum) + contentShasums['win-x86/iojs.lib'] = checksum + log.verbose('content checksum', 'win-x86/iojs.lib', checksum) }) var ws = fs.createWriteStream(nodeLibPath32) @@ -385,20 +386,20 @@ function install (gyp, argv, callback) { }) mkdir(dir64, function (err) { if (err) return done(err) - log.verbose('streaming 64-bit node.lib to:', nodeLibPath64) + log.verbose('streaming 64-bit iojs.lib to:', nodeLibPath64) var req = download(nodeLibUrl64) if (!req) return req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { - done(new Error(res.statusCode + ' status code downloading 64-bit node.lib')) + done(new Error(res.statusCode + ' status code downloading 64-bit iojs.lib')) return } getContentSha(res, function (_, checksum) { - contentShasums['x64/node.lib'] = checksum - log.verbose('content checksum', 'x64/node.lib', checksum) + contentShasums['win-x64/iojs.lib'] = checksum + log.verbose('content checksum', 'win-x64/iojs.lib', checksum) }) var ws = fs.createWriteStream(nodeLibPath64) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore new file mode 100644 index 00000000000000..3c3629e647f5dd --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/glob/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml similarity index 100% rename from deps/npm/node_modules/glob/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE new file mode 100644 index 00000000000000..05a4010949cac3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE @@ -0,0 +1,23 @@ +Copyright 2009, 2010, 2011 Isaac Z. Schlueter. +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/node-gyp/node_modules/minimatch/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md new file mode 100644 index 00000000000000..5b3967ea998b01 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md @@ -0,0 +1,218 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +Eventually, it will replace the C binding in node-glob. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000000000..47617868b99902 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js @@ -0,0 +1,1073 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand + +function pad(n, width, z) { + z = z || '0'; + n = n + ''; + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; +} + +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , needPadding = numset[1][0] === '0' + , startWidth = numset[1].length + , padded + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + + for (var i = start; i != (end + inc); i += inc) { + padded = needPadding ? pad(i, startWidth) : i + '' + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(padded + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + // Find the basename of the path by looking for the last non-empty segment + var filename; + for (var i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/README.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/bench.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/bench.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json similarity index 98% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/package.json rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json index a1f755a7c755af..bd516c29771333 100644 --- a/deps/npm/node_modules/minimatch/node_modules/sigmund/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json @@ -49,8 +49,8 @@ } ], "_shasum": "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296", - "_from": "sigmund@~1.0.0", "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz", + "_from": "sigmund@>=1.0.0 <1.1.0", "bugs": { "url": "https://github.com/isaacs/sigmund/issues" }, diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/sigmund.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/sigmund.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js diff --git a/deps/npm/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js similarity index 99% rename from deps/npm/node_modules/minimatch/node_modules/sigmund/test/basic.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js index 50c53a13e98d0e..6149a80239f059 100644 --- a/deps/npm/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -21,4 +21,3 @@ test('basic', function (t) { t.equal(sigmund(obj3), cycleHash) t.end() }) - diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..8bf46ccae0c4f6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json @@ -0,0 +1,58 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@1.0.0", + "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "_from": "minimatch@>=1.0.0 <2.0.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js new file mode 100644 index 00000000000000..ae7ac73c775edb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js @@ -0,0 +1,399 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + + +var patterns = + [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + // https://github.com/isaacs/minimatch/issues/5 + , function () { + files = [ 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' + , 'a/b/.x' + , 'a/b/.x/' + , 'a/.x/b' + , '.x' + , '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b/.x/c' + , '.x/.x' ] + } + , ["**/.x/**", [ '.x/' + , '.x/a' + , '.x/a/b' + , 'a/.x/b' + , 'a/b/.x/' + , 'a/b/.x/c' + , 'a/b/.x/c/d' + , 'a/b/.x/c/d/e' ] ] + + ] + +var regexps = + [ '/^(?:(?=.)a[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:(?=.)X[^/]*?)$/', + '/^(?:\\*)$/', + '/^(?:(?=.)\\*[^/]*?)$/', + '/^(?:\\*\\*)$/', + '/^(?:(?=.)b[^/]*?\\/)$/', + '/^(?:(?=.)c[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', + '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', + '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', + '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', + '/^(?:(?=.)a[^/]*?[^c])$/', + '/^(?:(?=.)a[X-]b)$/', + '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', + '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[b]c)$/', + '/^(?:(?=.)a[^/]c)$/', + '/^(?:a\\*c)$/', + 'false', + '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', + '/^(?:man\\/man1\\/bash\\.1)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[-abc])$/', + '/^(?:(?!\\.)(?=.)[abc-])$/', + '/^(?:\\\\)$/', + '/^(?:(?!\\.)(?=.)[\\\\])$/', + '/^(?:(?!\\.)(?=.)[\\[])$/', + '/^(?:\\[)$/', + '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[\\]])$/', + '/^(?:(?!\\.)(?=.)[\\]-])$/', + '/^(?:(?!\\.)(?=.)[a-z])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', + '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', + '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', + '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', + '/^(?:\\[\\])$/', + '/^(?:\\[abc)$/', + '/^(?:(?=.)XYZ)$/i', + '/^(?:(?=.)ab[^/]*?)$/i', + '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', + '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', + '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', + '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', + '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', + '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', + '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', + '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', + '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', + '/^(?:(?=.)a[^/]b)$/', + '/^(?:(?=.)#[^/]*?)$/', + '/^(?!^(?:(?=.)a[^/]*?)$).*$/', + '/^(?:(?=.)\\!a[^/]*?)$/', + '/^(?:(?=.)a[^/]*?)$/', + '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', + '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', + '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] +var re = 0; + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + patterns.forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] || {} + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var m = new mm.Minimatch(pattern, options) + var r = m.makeRe() + var expectRe = regexps[re++] + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + + t.equal(tapOpts.re, expectRe, tapOpts) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js new file mode 100644 index 00000000000000..c3e19d9baf571b --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js @@ -0,0 +1,38 @@ +var tap = require("tap") + , minimatch = require("../") + +tap.test("brace expansion", function (t) { + // [ pattern, [expanded] ] + ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" + , [ "abxy" + , "abxz" + , "acdxy" + , "acdxz" + , "acexy" + , "acexz" + , "afhxy" + , "afhxz" + , "aghxy" + , "aghxz" ] ] + , [ "a{1..5}b" + , [ "a1b" + , "a2b" + , "a3b" + , "a4b" + , "a5b" ] ] + , [ "a{b}c", ["a{b}c"] ] + , [ "a{00..05}b" + , ["a00b" + ,"a01b" + ,"a02b" + ,"a03b" + ,"a04b" + ,"a05b" ] ] + ].forEach(function (tc) { + var p = tc[0] + , expect = tc[1] + t.equivalent(minimatch.braceExpand(p), expect, p) + }) + console.error("ending") + t.end() +}) diff --git a/deps/npm/node_modules/minimatch/test/caching.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js similarity index 100% rename from deps/npm/node_modules/minimatch/test/caching.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js new file mode 100644 index 00000000000000..75e05712d4c841 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js @@ -0,0 +1,274 @@ +// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test +// +// TODO: Some of these tests do very bad things with backslashes, and will +// most likely fail badly on windows. They should probably be skipped. + +var tap = require("tap") + , globalBefore = Object.keys(global) + , mm = require("../") + , files = [ "a", "b", "c", "d", "abc" + , "abd", "abe", "bb", "bcd" + , "ca", "cb", "dd", "de" + , "bdir/", "bdir/cfile"] + , next = files.concat([ "a-b", "aXb" + , ".x", ".y" ]) + +tap.test("basic tests", function (t) { + var start = Date.now() + + // [ pattern, [matches], MM opts, files, TAP opts] + ; [ "http://www.bashcookbook.com/bashinfo" + + "/source/bash-1.14.7/tests/glob-test" + , ["a*", ["a", "abc", "abd", "abe"]] + , ["X*", ["X*"], {nonull: true}] + + // allow null glob expansion + , ["X*", []] + + // isaacs: Slightly different than bash/sh/ksh + // \\* is not un-escaped to literal "*" in a failed match, + // but it does make it get treated as a literal star + , ["\\*", ["\\*"], {nonull: true}] + , ["\\**", ["\\**"], {nonull: true}] + , ["\\*\\*", ["\\*\\*"], {nonull: true}] + + , ["b*/", ["bdir/"]] + , ["c*", ["c", "ca", "cb"]] + , ["**", files] + + , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] + , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] + + , "legendary larry crashes bashes" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" + , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] + + , "character classes" + , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] + , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", + "bdir/", "ca", "cb", "dd", "de"]] + , ["a*[^c]", ["abd", "abe"]] + , function () { files.push("a-b", "aXb") } + , ["a[X-]b", ["a-b", "aXb"]] + , function () { files.push(".x", ".y") } + , ["[^a-c]*", ["d", "dd", "de"]] + , function () { files.push("a*b/", "a*b/ooo") } + , ["a\\*b/*", ["a*b/ooo"]] + , ["a\\*?/*", ["a*b/ooo"]] + , ["*\\\\!*", [], {null: true}, ["echo !7"]] + , ["*\\!*", ["echo !7"], null, ["echo !7"]] + , ["*.\\*", ["r.*"], null, ["r.*"]] + , ["a[b]c", ["abc"]] + , ["a[\\b]c", ["abc"]] + , ["a?c", ["abc"]] + , ["a\\*c", [], {null: true}, ["abc"]] + , ["", [""], { null: true }, [""]] + + , "http://www.opensource.apple.com/source/bash/bash-23/" + + "bash/tests/glob-test" + , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } + , ["*/man*/bash.*", ["man/man1/bash.1"]] + , ["man/man1/bash.1", ["man/man1/bash.1"]] + , ["a***c", ["abc"], null, ["abc"]] + , ["a*****?c", ["abc"], null, ["abc"]] + , ["?*****??", ["abc"], null, ["abc"]] + , ["*****??", ["abc"], null, ["abc"]] + , ["?*****?c", ["abc"], null, ["abc"]] + , ["?***?****c", ["abc"], null, ["abc"]] + , ["?***?****?", ["abc"], null, ["abc"]] + , ["?***?****", ["abc"], null, ["abc"]] + , ["*******c", ["abc"], null, ["abc"]] + , ["*******?", ["abc"], null, ["abc"]] + , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] + , ["[-abc]", ["-"], null, ["-"]] + , ["[abc-]", ["-"], null, ["-"]] + , ["\\", ["\\"], null, ["\\"]] + , ["[\\\\]", ["\\"], null, ["\\"]] + , ["[[]", ["["], null, ["["]] + , ["[", ["["], null, ["["]] + , ["[*", ["[abc"], null, ["[abc"]] + , "a right bracket shall lose its special meaning and\n" + + "represent itself in a bracket expression if it occurs\n" + + "first in the list. -- POSIX.2 2.8.3.2" + , ["[]]", ["]"], null, ["]"]] + , ["[]-]", ["]"], null, ["]"]] + , ["[a-\z]", ["p"], null, ["p"]] + , ["??**********?****?", [], { null: true }, ["abc"]] + , ["??**********?****c", [], { null: true }, ["abc"]] + , ["?************c****?****", [], { null: true }, ["abc"]] + , ["*c*?**", [], { null: true }, ["abc"]] + , ["a*****c*?**", [], { null: true }, ["abc"]] + , ["a********???*******", [], { null: true }, ["abc"]] + , ["[]", [], { null: true }, ["a"]] + , ["[abc", [], { null: true }, ["["]] + + , "nocase tests" + , ["XYZ", ["xYz"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["ab*", ["ABC"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } + , ["xYz", "ABC", "IjK"]] + + // [ pattern, [matches], MM opts, files, TAP opts] + , "onestar/twostar" + , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] + , ["{/?,*}", ["/a", "bb"], {null: true} + , ["/a", "/b/b", "/a/b/c", "bb"]] + + , "dots should not match unless requested" + , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] + + // .. and . can only match patterns starting with ., + // even when options.dot is set. + , function () { + files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] + } + , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] + , ["a/*/b", ["a/c/b"], {dot:false}] + , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] + + + // this also tests that changing the options needs + // to change the cache key, even if the pattern is + // the same! + , ["**", ["a/b","a/.d",".a/.d"], { dot: true } + , [ ".a/.d", "a/.d", "a/b"]] + + , "paren sets cannot contain slashes" + , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] + + // brace sets trump all else. + // + // invalid glob pattern. fails on bash4 and bsdglob. + // however, in this implementation, it's easier just + // to do the intuitive thing, and let brace-expansion + // actually come before parsing any extglob patterns, + // like the documentation seems to say. + // + // XXX: if anyone complains about this, either fix it + // or tell them to grow up and stop complaining. + // + // bash/bsdglob says this: + // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] + // but we do this instead: + , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] + + // test partial parsing in the presence of comment/negation chars + , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] + , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] + + // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. + , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] + , {} + , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] + + + // crazy nested {,,} and *(||) tests. + , function () { + files = [ "a", "b", "c", "d" + , "ab", "ac", "ad" + , "bc", "cb" + , "bc,d", "c,db", "c,d" + , "d)", "(b|c", "*(b|c" + , "b|c", "b|cc", "cb|c" + , "x(a|b|c)", "x(a|c)" + , "(a|b|c)", "(a|c)"] + } + , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] + , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] + // a + // *(b|c) + // *(b|d) + , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] + , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] + + + // test various flag settings. + , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] + , { noext: true } ] + , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} + , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] + , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] + + + // begin channelling Boole and deMorgan... + , "negation tests" + , function () { + files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] + } + + // anything that is NOT a* matches. + , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] + + // anything that IS !a* matches. + , ["!a*", ["!ab", "!abc"], {nonegate: true}] + + // anything that IS a* matches + , ["!!a*", ["a!b"]] + + // anything that is NOT !a* matches + , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] + + // negation nestled within a pattern + , function () { + files = [ "foo.js" + , "foo.bar" + // can't match this one without negative lookbehind. + , "foo.js.js" + , "blar.js" + , "foo." + , "boo.js.boo" ] + } + , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] + + ].forEach(function (c) { + if (typeof c === "function") return c() + if (typeof c === "string") return t.comment(c) + + var pattern = c[0] + , expect = c[1].sort(alpha) + , options = c[2] + , f = c[3] || files + , tapOpts = c[4] || {} + + // options.debug = true + var Class = mm.defaults(options).Minimatch + var m = new Class(pattern, {}) + var r = m.makeRe() + tapOpts.re = String(r) || JSON.stringify(r) + tapOpts.files = JSON.stringify(f) + tapOpts.pattern = pattern + tapOpts.set = m.set + tapOpts.negated = m.negate + + var actual = mm.match(f, pattern, options) + actual.sort(alpha) + + t.equivalent( actual, expect + , JSON.stringify(pattern) + " " + JSON.stringify(expect) + , tapOpts ) + }) + + t.comment("time=" + (Date.now() - start) + "ms") + t.end() +}) + +tap.test("global leak test", function (t) { + var globalAfter = Object.keys(global) + t.equivalent(globalAfter, globalBefore, "no new globals, please") + t.end() +}) + +function alpha (a, b) { + return a > b ? 1 : -1 +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js new file mode 100644 index 00000000000000..6676e2629a7e99 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js @@ -0,0 +1,8 @@ +var test = require('tap').test +var minimatch = require('../') + +test('extglob ending with statechar', function(t) { + t.notOk(minimatch('ax', 'a?(b*)')) + t.ok(minimatch('ax', '?(a*|b)')) + t.end() +}) diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 2e2e47c7a37ab0..be8cb8818df214 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -52,7 +52,7 @@ "_id": "node-gyp@1.0.2", "scripts": {}, "_shasum": "b0bb6d2d762271408dd904853e7aa3000ed2eb57", - "_from": "node-gyp@>=1.0.1-0 <1.1.0-0", + "_from": "node-gyp@>=1.0.2 <1.1.0", "_npmVersion": "2.0.0-beta.3", "_npmUser": { "name": "isaacs", @@ -77,5 +77,6 @@ "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/normalize-git-url/.eslintrc b/deps/npm/node_modules/normalize-git-url/.eslintrc new file mode 100644 index 00000000000000..b54e30fd2aa2a9 --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/.eslintrc @@ -0,0 +1,19 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "semi": [2, "never"], + "strict": 0, + "quotes": [1, "double", "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, + "key-spacing": 0, + "no-multi-spaces": 0 + } +} diff --git a/deps/npm/node_modules/normalize-git-url/.npmignore b/deps/npm/node_modules/normalize-git-url/.npmignore new file mode 100644 index 00000000000000..c2658d7d1b3184 --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/deps/npm/node_modules/normalize-git-url/CHANGELOG.md b/deps/npm/node_modules/normalize-git-url/CHANGELOG.md new file mode 100644 index 00000000000000..f2d2b94bedb40b --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/CHANGELOG.md @@ -0,0 +1,5 @@ +### 1.0.0 (2014-12-25): + +* [`8b3d874`](https://github.com/npm/normalize-git-url/commit/8b3d874afd14f4cdde65d418e0a35a615c746bba) + Initial version, with simple tests. + ([@othiym23](https://github.com/othiym23)) diff --git a/deps/npm/node_modules/normalize-git-url/README.md b/deps/npm/node_modules/normalize-git-url/README.md new file mode 100644 index 00000000000000..da3d78ed25cab9 --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/README.md @@ -0,0 +1,40 @@ +# normalize-git-url + +You have a bunch of Git URLs. You want to convert them to a canonical +representation, probably for use inside npm so that it doesn't end up creating +a bunch of superfluous cached origins. You use this package. + +## Usage + +```javascript +var ngu = require('normalize-git-url'); +var normalized = ngu("git+ssh://git@github.com:organization/repo.git#hashbrowns") +// get back: +// { +// url : "ssh://git@github.com/organization/repo.git", +// branch : "hashbrowns" // did u know hashbrowns are delicious? +// } +``` + +## API + +There's just the one function, and all it takes is a single parameter, a non-normalized Git URL. + +### normalizeGitUrl(url) + +* `url` {String} The Git URL (very loosely speaking) to be normalized. + +Returns an object with the following format: + +* `url` {String} The normalized URL. +* `branch` {String} The treeish to be checked out once the repo at `url` is + cloned. It doesn't have to be a branch, but it's a lot easier to intuit what + the output is for with that name. + +## Limitations + +Right now this doesn't try to special-case GitHub too much -- it doesn't ensure +that `.git` is added to the end of URLs, it doesn't prefer `https:` over +`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to +resolve symbolic names to treeish hashcodes. For now, it just tries to account +for minor differences in representation. diff --git a/deps/npm/node_modules/normalize-git-url/normalize-git-url.js b/deps/npm/node_modules/normalize-git-url/normalize-git-url.js new file mode 100644 index 00000000000000..7662037940f7a5 --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/normalize-git-url.js @@ -0,0 +1,27 @@ +var url = require("url") + +module.exports = function normalize (u) { + var parsed = url.parse(u, true) + + // git is so tricky! + // if the path is like ssh://foo:22/some/path then it works, but + // it needs the ssh:// + // If the path is like ssh://foo:some/path then it works, but + // only if you remove the ssh:// + if (parsed.protocol) { + parsed.protocol = parsed.protocol.replace(/^git\+/, "") + + // ssh paths that are scp-style urls don't need the ssh:// + parsed.pathname = parsed.pathname.replace(/^\/?:/, "/") + } + + // figure out what we should check out. + var checkout = parsed.hash && parsed.hash.substr(1) || "master" + parsed.hash = "" + + u = url.format(parsed) + return { + url : u, + branch : checkout + } +} diff --git a/deps/npm/node_modules/normalize-git-url/package.json b/deps/npm/node_modules/normalize-git-url/package.json new file mode 100644 index 00000000000000..1402b0e433930b --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/package.json @@ -0,0 +1,42 @@ +{ + "name": "normalize-git-url", + "version": "1.0.0", + "description": "Normalizes Git URLs. For npm, but you can use it too.", + "main": "normalize-git-url.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.4.13" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/normalize-git-url.git" + }, + "keywords": [ + "git", + "github", + "url", + "normalize", + "npm" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/normalize-git-url/issues" + }, + "homepage": "https://github.com/npm/normalize-git-url", + "readme": "# normalize-git-url\n\nYou have a bunch of Git URLs. You want to convert them to a canonical\nrepresentation, probably for use inside npm so that it doesn't end up creating\na bunch of superfluous cached origins. You use this package.\n\n## Usage\n\n```javascript\nvar ngu = require('normalize-git-url');\nvar normalized = ngu(\"git+ssh://git@github.com:organization/repo.git#hashbrowns\")\n// get back:\n// {\n// url : \"ssh://git@github.com/organization/repo.git\",\n// branch : \"hashbrowns\" // did u know hashbrowns are delicious?\n// }\n```\n\n## API\n\nThere's just the one function, and all it takes is a single parameter, a non-normalized Git URL.\n\n### normalizeGitUrl(url)\n\n* `url` {String} The Git URL (very loosely speaking) to be normalized.\n\nReturns an object with the following format:\n\n* `url` {String} The normalized URL.\n* `branch` {String} The treeish to be checked out once the repo at `url` is\n cloned. It doesn't have to be a branch, but it's a lot easier to intuit what\n the output is for with that name.\n\n## Limitations\n\nRight now this doesn't try to special-case GitHub too much -- it doesn't ensure\nthat `.git` is added to the end of URLs, it doesn't prefer `https:` over\n`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to\nresolve symbolic names to treeish hashcodes. For now, it just tries to account\nfor minor differences in representation.\n", + "readmeFilename": "README.md", + "gitHead": "e51f43718af66ffbced4ccfd9a6514470fc4c553", + "_id": "normalize-git-url@1.0.0", + "_shasum": "80e59471f0616b579893973e3f1b3684bedbad48", + "_from": "normalize-git-url@>=1.0.0 <1.1.0" +} diff --git a/deps/npm/node_modules/normalize-git-url/test/basic.js b/deps/npm/node_modules/normalize-git-url/test/basic.js new file mode 100644 index 00000000000000..f8f199f65063e1 --- /dev/null +++ b/deps/npm/node_modules/normalize-git-url/test/basic.js @@ -0,0 +1,56 @@ +var test = require("tap").test + +var normalize = require("../normalize-git-url.js") + +test("basic normalization tests", function (t) { + t.same( + normalize("git+ssh://user@hostname:project.git#commit-ish"), + { url : "ssh://user@hostname/project.git", branch : "commit-ish" } + ) + t.same( + normalize("git+http://user@hostname/project/blah.git#commit-ish"), + { url : "http://user@hostname/project/blah.git", branch : "commit-ish" } + ) + t.same( + normalize("git+https://user@hostname/project/blah.git#commit-ish"), + { url : "https://user@hostname/project/blah.git", branch : "commit-ish" } + ) + t.same( + normalize("git+ssh://git@github.com:npm/npm.git#v1.0.27"), + { url : "ssh://git@github.com/npm/npm.git", branch : "v1.0.27" } + ) + t.same( + normalize("git+ssh://git@github.com:org/repo#dev"), + { url : "ssh://git@github.com/org/repo", branch : "dev" } + ) + t.same( + normalize("git+ssh://git@github.com/org/repo#dev"), + { url : "ssh://git@github.com/org/repo", branch : "dev" } + ) + t.same( + normalize("git+ssh://foo:22/some/path"), + { url : "ssh://foo:22/some/path", branch : "master" } + ) + t.same( + normalize("git@github.com:org/repo#dev"), + { url : "git@github.com:org/repo", branch : "dev" } + ) + t.same( + normalize("git+https://github.com/KenanY/node-uuid"), + { url : "https://github.com/KenanY/node-uuid", branch : "master" } + ) + t.same( + normalize("git+https://github.com/KenanY/node-uuid#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5"), + { url : "https://github.com/KenanY/node-uuid", branch : "7a018f2d075b03a73409e8356f9b29c9ad4ea2c5" } + ) + t.same( + normalize("git+ssh://git@git.example.com:b/b.git#v1.0.0"), + { url : "ssh://git@git.example.com/b/b.git", branch : "v1.0.0" } + ) + t.same( + normalize("git+ssh://git@github.com:npm/npm-proto.git#othiym23/organized"), + { url : "ssh://git@github.com/npm/npm-proto.git", branch : "othiym23/organized" } + ) + + t.end() +}) diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 06ca052e4105b4..cc9f206d14644f 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,10 +1,10 @@ { "name": "npm-install-checks", - "version": "1.0.4", + "version": "1.0.5", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { - "npmlog": "0.1", + "npmlog": "0.1 || 1", "semver": "^2.3.0 || 3.x || 4" }, "devDependencies": { @@ -32,14 +32,15 @@ "bugs": { "url": "https://github.com/npm/npm-install-checks/issues" }, - "gitHead": "05944f95860b0ac3769667551c4b7aa3d3fcdc32", - "_id": "npm-install-checks@1.0.4", - "_shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", - "_from": "npm-install-checks@>=1.0.2-0 <1.1.0-0", - "_npmVersion": "2.0.0-beta.3", + "gitHead": "c36e052a0a54ad82932689fa86fd59197277f80d", + "_id": "npm-install-checks@1.0.5", + "_shasum": "a1b5beabfd60e0535b14f763157c410cb6bdae56", + "_from": "npm-install-checks@>=1.0.5 <1.1.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.33", "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "name": "iarna", + "email": "me@re-becca.org" }, "maintainers": [ { @@ -49,12 +50,16 @@ { "name": "isaacs", "email": "i@izs.me" + }, + { + "name": "iarna", + "email": "me@re-becca.org" } ], "dist": { - "shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", - "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" + "shasum": "a1b5beabfd60e0535b14f763157c410cb6bdae56", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.5.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.5.tgz" } diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index 6d15dadf7f55e1..182552aebfdb96 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -10,9 +10,9 @@ It handles all the caching and HTTP calls. var RegClient = require('npm-registry-client') var client = new RegClient(config) var uri = "npm://registry.npmjs.org/npm" -var options = {timeout: 1000} +var params = {timeout: 1000} -client.get(uri, options, function (error, data, raw, res) { +client.get(uri, params, function (error, data, raw, res) { // error is an error if there was a problem. // data is the parsed data object // raw is the json string @@ -23,124 +23,98 @@ client.get(uri, options, function (error, data, raw, res) { # Registry URLs The registry calls take either a full URL pointing to a resource in the -registry, or a base URL for the registry as a whole (for the base URL, any path -will be ignored). In addition to `http` and `https`, `npm` URLs are allowed. -`npm` URLs are `https` URLs with the additional restrictions that they will -always include authorization credentials, and the response is always registry -metadata (and not tarballs or other attachments). +registry, or a base URL for the registry as a whole (including the registry +path – but be sure to terminate the path with `/`). `http` and `https` URLs are +the only ones supported. -# Configuration +## Using the client -This program is designed to work with -[npmconf](https://npmjs.org/package/npmconf), but you can also pass in -a plain-jane object with the appropriate configs, and it'll shim it -for you. Any configuration thingie that has get/set/del methods will -also be accepted. - -* `cache` **Required** {String} Path to the cache folder -* `always-auth` {Boolean} Auth even for GET requests. -* `auth` {String} A base64-encoded `username:password` -* `email` {String} User's email address -* `tag` {String} The default tag to use when publishing new packages. - Default = `"latest"` -* `ca` {String} Cerficate signing authority certificates to trust. -* `cert` {String} Client certificate (PEM encoded). Enable access - to servers that require client certificates -* `key` {String} Private key (PEM encoded) for client certificate 'cert' -* `strict-ssl` {Boolean} Whether or not to be strict with SSL - certificates. Default = `true` -* `user-agent` {String} User agent header to send. Default = - `"node/{process.version} {process.platform} {process.arch}"` -* `log` {Object} The logger to use. Defaults to `require("npmlog")` if - that works, otherwise logs are disabled. -* `fetch-retries` {Number} Number of times to retry on GET failures. - Default=2 -* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10 -* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`. - Default=10000 (10 seconds) -* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`. - Default=60000 (60 seconds) -* `proxy` {URL} The url to proxy requests through. -* `https-proxy` {URL} The url to proxy https requests through. - Defaults to be the same as `proxy` if unset. -* `_auth` {String} The base64-encoded authorization header. -* `username` `_password` {String} Username/password to use to generate - `_auth` if not supplied. -* `_token` {Object} A token for use with - [couch-login](https://npmjs.org/package/couch-login) - -# client.request(method, uri, options, cb) - -* `method` {String} HTTP method -* `uri` {String} URI pointing to the resource to request -* `options` {Object} Object containing optional per-request properties. - * `what` {Stream | Buffer | String | Object} The request body. Objects - that are not Buffers or Streams are encoded as JSON. - * `etag` {String} The cached ETag - * `follow` {Boolean} Follow 302/301 responses (defaults to true) -* `cb` {Function} - * `error` {Error | null} - * `data` {Object} the parsed data object - * `raw` {String} the json - * `res` {Response Object} response from couch +Every call to the client follows the same pattern: -Make a request to the registry. All the other methods are wrappers around -`request`. +* `uri` {String} The *fully-qualified* URI of the registry API method being + invoked. +* `params` {Object} Per-request parameters. +* `callback` {Function} Callback to be invoked when the call is complete. -# client.adduser(base, username, password, email, cb) +### Credentials + +Many requests to the registry can by authenticated, and require credentials +for authorization. These credentials always look the same: -* `base` {String} Base registry URL * `username` {String} * `password` {String} * `email` {String} -* `cb` {Function} +* `alwaysAuth` {Boolean} Whether calls to the target registry are always + authed. -Add a user account to the registry, or verify the credentials. +**or** + +* `token` {String} +* `alwaysAuth` {Boolean} Whether calls to the target registry are always + authed. + +## API -# client.deprecate(uri, version, message, cb) +### client.adduser(uri, params, cb) -* `uri` {String} Full registry URI for the deprecated package -* `version` {String} Semver version range -* `message` {String} The message to use as a deprecation warning +* `uri` {String} Base registry URL. +* `params` {Object} Object containing per-request properties. + * `auth` {Credentials} * `cb` {Function} + * `error` {Error | null} + * `data` {Object} the parsed data object + * `raw` {String} the json + * `res` {Response Object} response from couch -Deprecate a version of a package in the registry. +Add a user account to the registry, or verify the credentials. -# client.bugs(uri, cb) +### client.deprecate(uri, params, cb) -* `uri` {String} Full registry URI for the package +* `uri` {String} Full registry URI for the deprecated package. +* `params` {Object} Object containing per-request properties. + * `version` {String} Semver version range. + * `message` {String} The message to use as a deprecation warning. + * `auth` {Credentials} * `cb` {Function} -Get the url for bugs of a package +Deprecate a version of a package in the registry. -# client.get(uri, options, cb) +### client.get(uri, params, cb) * `uri` {String} The complete registry URI to fetch -* `options` {Object} Object containing optional per-request properties. - * `timeout` {Number} Duration before the request times out. - * `follow` {Boolean} Follow 302/301 responses (defaults to true) - * `staleOk` {Boolean} If there's cached data available, then return that - to the callback quickly, and update the cache the background. +* `params` {Object} Object containing per-request properties. + * `timeout` {Number} Duration before the request times out. Optional + (default: never). + * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `staleOk` {Boolean} If there's cached data available, then return that to + the callback quickly, and update the cache the background. Optional + (default: false). + * `auth` {Credentials} Optional. +* `cb` {Function} Fetches data from the registry via a GET request, saving it in the cache folder with the ETag. -# client.publish(uri, data, tarball, cb) +### client.publish(uri, params, cb) -* `uri` {String} The registry URI to publish to -* `data` {Object} Package data -* `tarball` {String | Stream} Filename or stream of the package tarball +* `uri` {String} The registry URI for the package to publish. +* `params` {Object} Object containing per-request properties. + * `metadata` {Object} Package metadata. + * `body` {Stream} Stream of the package body / tarball. + * `auth` {Credentials} * `cb` {Function} Publish a package to the registry. -Note that this does not create the tarball from a folder. However, it can -accept a gzipped tar stream or a filename to a tarball. +Note that this does not create the tarball from a folder. -# client.star(uri, starred, cb) +### client.star(uri, params, cb) -* `uri` {String} The complete registry URI to star -* `starred` {Boolean} True to star the package, false to unstar it. +* `uri` {String} The complete registry URI for the package to star. +* `params` {Object} Object containing per-request properties. + * `starred` {Boolean} True to star the package, false to unstar it. Optional + (default: false). + * `auth` {Credentials} * `cb` {Function} Star or unstar a package. @@ -148,40 +122,117 @@ Star or unstar a package. Note that the user does not have to be the package owner to star or unstar a package, though other writes do require that the user be the package owner. -# client.stars(base, username, cb) +### client.stars(uri, params, cb) -* `base` {String} The base URL for the registry -* `username` {String} Name of user to fetch starred packages for. +* `uri` {String} The base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `username` {String} Name of user to fetch starred packages for. Optional + (default: user in `auth`). + * `auth` {Credentials} Optional (required if `username` is omitted). * `cb` {Function} View your own or another user's starred packages. -# client.tag(uri, version, tag, cb) +### client.tag(uri, params, cb) * `uri` {String} The complete registry URI to tag -* `version` {String} Version to tag -* `tag` {String} Tag name to apply +* `params` {Object} Object containing per-request properties. + * `version` {String} Version to tag. + * `tag` {String} Tag name to apply. + * `auth` {Credentials} * `cb` {Function} Mark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the specified version. -# client.unpublish(uri, [ver], cb) +### client.unpublish(uri, params, cb) -* `uri` {String} The complete registry URI to unpublish -* `ver` {String} version to unpublish. Leave blank to unpublish all - versions. +* `uri` {String} The complete registry URI of the package to unpublish. +* `params` {Object} Object containing per-request properties. + * `version` {String} version to unpublish. Optional – omit to unpublish all + versions. + * `auth` {Credentials} * `cb` {Function} Remove a version of a package (or all versions) from the registry. When the last version us unpublished, the entire document is removed from the database. -# client.upload(uri, file, [etag], [nofollow], cb) +### client.whoami(uri, params, cb) + +* `uri` {String} The base registry for the URI. +* `params` {Object} Object containing per-request properties. + * `auth` {Credentials} +* `cb` {Function} + +Simple call to see who the registry thinks you are. Especially useful with +token-based auth. + + +## PLUMBING + +The below are primarily intended for use by the rest of the API, or by the npm +caching logic directly. + +### client.request(uri, params, cb) + +* `uri` {String} URI pointing to the resource to request. +* `params` {Object} Object containing per-request properties. + * `method` {String} HTTP method. Optional (default: "GET"). + * `body` {Stream | Buffer | String | Object} The request body. Objects + that are not Buffers or Streams are encoded as JSON. Optional – body + only used for write operations. + * `etag` {String} The cached ETag. Optional. + * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `auth` {Credentials} Optional. +* `cb` {Function} + * `error` {Error | null} + * `data` {Object} the parsed data object + * `raw` {String} the json + * `res` {Response Object} response from couch + +Make a generic request to the registry. All the other methods are wrappers +around `client.request`. + +### client.fetch(uri, params, cb) * `uri` {String} The complete registry URI to upload to -* `file` {String | Stream} Either the filename or a readable stream -* `etag` {String} Cache ETag -* `nofollow` {Boolean} Do not follow 301/302 responses +* `params` {Object} Object containing per-request properties. + * `headers` {Stream} HTTP headers to be included with the request. Optional. + * `auth` {Credentials} Optional. * `cb` {Function} -Upload an attachment. Mostly used by `client.publish()`. +Fetch a package from a URL, with auth set appropriately if included. Used to +cache remote tarballs as well as request package tarballs from the registry. + +# Configuration + +The client uses its own configuration, which is just passed in as a simple +nested object. The following are the supported values (with their defaults, if +any): + +* `proxy.http` {URL} The URL to proxy HTTP requests through. +* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be + the same as `proxy.http` if unset. +* `proxy.localAddress` {IP} The local address to use on multi-homed systems. +* `ssl.ca` {String} Cerficate signing authority certificates to trust. +* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access + to servers that require client certificates. +* `ssl.key` {String} Private key (PEM encoded) for client certificate. +* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates. + Default = `true` +* `retry.count` {Number} Number of times to retry on GET failures. Default = 2. +* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10. +* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`. + Default = 10000 (10 seconds) +* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`. + Default = 60000 (60 seconds) +* `userAgent` {String} User agent header to send. Default = + `"node/{process.version}"` +* `log` {Object} The logger to use. Defaults to `require("npmlog")` if + that works, otherwise logs are disabled. +* `defaultTag` {String} The default tag to use when publishing new packages. + Default = `"latest"` +* `couchToken` {Object} A token for use with + [couch-login](https://npmjs.org/package/couch-login). +* `sessionToken` {string} A random identifier for this set of client requests. + Default = 8 random hexadecimal bytes. diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js index a75e8bbdbeb875..801d00f8e9f949 100644 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ b/deps/npm/node_modules/npm-registry-client/index.js @@ -2,56 +2,55 @@ module.exports = RegClient -var url = require('url') -, npmlog -, cacheFile = require('npm-cache-filename') +var join = require("path").join + , fs = require("graceful-fs") +var npmlog try { npmlog = require("npmlog") -} catch (er) { - npmlog = { error: noop, warn: noop, info: noop, - verbose: noop, silly: noop, http: noop, - pause: noop, resume: noop } +} +catch (er) { + npmlog = { + error : noop, + warn : noop, + info : noop, + verbose : noop, + silly : noop, + http : noop, + pause : noop, + resume : noop + } } function noop () {} -function RegClient (conf) { - // accept either a plain-jane object, or a npmconf object - // with a "get" method. - if (typeof conf.get !== 'function') { - var data = conf - conf = { get: function (k) { return data[k] } - , set: function (k, v) { data[k] = v } - , del: function (k) { delete data[k] } } - } +function RegClient (config) { + this.config = Object.create(config || {}) - this.conf = conf - - // if provided, then the registry needs to be a url. - // if it's not provided, then we're just using the cache only. - var registry = conf.get('registry') - if (registry) { - registry = url.parse(registry) - if (!registry.protocol) throw new Error( - 'Invalid registry: ' + registry.url) - registry = registry.href - if (registry.slice(-1) !== '/') { - registry += '/' - } - this.conf.set('registry', registry) - } else { - registry = null + this.config.proxy = this.config.proxy || {} + if (!this.config.proxy.https && this.config.proxy.http) { + this.config.proxy.https = this.config.proxy.http } - this.registry = registry + this.config.ssl = this.config.ssl || {} + if (this.config.ssl.strict === undefined) this.config.ssl.strict = true + + this.config.retry = this.config.retry || {} + if (typeof this.config.retry.retries !== "number") this.config.retry.retries = 2 + if (typeof this.config.retry.factor !== "number") this.config.retry.factor = 10 + if (typeof this.config.retry.minTimeout !== "number") this.config.retry.minTimeout = 10000 + if (typeof this.config.retry.maxTimeout !== "number") this.config.retry.maxTimeout = 60000 + + this.config.userAgent = this.config.userAgent || "node/" + process.version + this.config.defaultTag = this.config.defaultTag || "latest" - if (!conf.get('cache')) throw new Error("Cache dir is required") - this.cacheFile = cacheFile(this.conf.get('cache')) - this.log = conf.log || conf.get('log') || npmlog + this.log = this.config.log || npmlog + delete this.config.log } -require('fs').readdirSync(__dirname + "/lib").forEach(function (f) { +fs.readdirSync(join(__dirname, "lib")).forEach(function (f) { if (!f.match(/\.js$/)) return - RegClient.prototype[f.replace(/\.js$/, '')] = require('./lib/' + f) + var name = f.replace(/\.js$/, "") + .replace(/-([a-z])/, function (_, l) { return l.toUpperCase() }) + RegClient.prototype[name] = require(join(__dirname, "lib", f)) }) diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js index e449c258089db3..5f4abc8efd9a3a 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -1,49 +1,54 @@ module.exports = adduser var url = require("url") - -function adduser (base, username, password, email, cb) { - if (!base) return cb(new Error("Required base URI not supplied")) - - username = ("" + (username || "")).trim() +var assert = require("assert") + +function adduser (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to adduser") + assert( + params && typeof params === "object", + "must pass params to adduser" + ) + assert(typeof cb === "function", "must pass callback to adduser") + + assert(params.auth && typeof params.auth, "must pass auth to adduser") + var auth = params.auth + assert(typeof auth.username === "string", "must include username in auth") + assert(typeof auth.password === "string", "must include password in auth") + assert(typeof auth.email === "string", "must include email in auth") + + // normalize registry URL + if (uri.slice(-1) !== "/") uri += "/" + + var username = auth.username.trim() + var password = auth.password.trim() + var email = auth.email.trim() + + // validation if (!username) return cb(new Error("No username supplied.")) - - password = ("" + (password || "")).trim() if (!password) return cb(new Error("No password supplied.")) - - email = ("" + (email || "")).trim() if (!email) return cb(new Error("No email address supplied.")) if (!email.match(/^[^@]+@[^\.]+\.[^\.]+/)) { return cb(new Error("Please use a real email address.")) } - var userobj = - { name : username - , password : password - , email : email - , _id : 'org.couchdb.user:'+username - , type : "user" - , roles : [] - , date: new Date().toISOString() - } - - // pluck off any other username/password/token. it needs to be the - // same as the user we're becoming now. replace them on error. - var c = this.conf.getCredentialsByURI(base) - var pre = { username: c.username - , password: c.password - , email: c.email - , token: this.conf.get('_token') } - - this.conf.del('_token') - if (this.couchLogin) { - this.couchLogin.token = null + var userobj = { + _id : "org.couchdb.user:"+username, + name : username, + password : password, + email : email, + type : "user", + roles : [], + date : new Date().toISOString() } - cb = done.call(this, cb, pre) + var token = this.config.couchToken + if (this.couchLogin) this.couchLogin.token = null + + cb = done.call(this, token, cb) var logObj = Object.keys(userobj).map(function (k) { - if (k === 'password') return [k, 'XXXXX'] + if (k === "password") return [k, "XXXXX"] return [k, userobj[k]] }).reduce(function (s, kv) { s[kv[0]] = kv[1] @@ -52,70 +57,57 @@ function adduser (base, username, password, email, cb) { this.log.verbose("adduser", "before first PUT", logObj) - var uri = url.resolve(base, '/-/user/org.couchdb.user:' + encodeURIComponent(username)) - this.request('PUT' - , uri - , { body : userobj } - , function (error, data, json, response) { - // if it worked, then we just created a new user, and all is well. - // but if we're updating a current record, then it'll 409 first - var c = this.conf.getCredentialsByURI(base) - if (error && !c.auth) { - // must be trying to re-auth on a new machine. - // use this info as auth - this.conf.setCredentialsByURI(base, { - username : username, - password : password, - email : email - }) - } + var client = this - if (!error || !response || response.statusCode !== 409) { - return cb(error, data, json, response) + uri = url.resolve(uri, "-/user/org.couchdb.user:" + encodeURIComponent(username)) + var options = { + method : "PUT", + body : userobj, + auth : auth + } + this.request( + uri, + options, + function (error, data, json, response) { + if (!error || !response || response.statusCode !== 409) { + return cb(error, data, json, response) + } + + client.log.verbose("adduser", "update existing user") + return client.request( + uri+"?write=true", + { body : userobj, auth : auth }, + function (er, data, json, response) { + if (er || data.error) { + return cb(er, data, json, response) + } + Object.keys(data).forEach(function (k) { + if (!userobj[k] || k === "roles") { + userobj[k] = data[k] + } + }) + client.log.verbose("adduser", "userobj", logObj) + client.request(uri+"/-rev/"+userobj._rev, options, cb) } + ) + } + ) - this.log.verbose("adduser", "update existing user") - return this.request('GET' - , uri + '?write=true' - , null - , function (er, data, json, response) { - if (er || data.error) { - return cb(er, data, json, response) - } - Object.keys(data).forEach(function (k) { - if (!userobj[k] || k === 'roles') { - userobj[k] = data[k] - } - }) - this.log.verbose("adduser", "userobj", logObj) - this.request('PUT' - , uri + "/-rev/" + userobj._rev - , { body : userobj } - , cb) - }.bind(this)) - }.bind(this)) - - function done (cb, pre) { + function done (token, cb) { return function (error, data, json, response) { if (!error && (!response || response.statusCode === 201)) { return cb(error, data, json, response) } - // there was some kind of error, re-instate previous auth/token/etc. - this.conf.set('_token', pre.token) - if (this.couchLogin) { - this.couchLogin.token = pre.token - if (this.couchLogin.tokenSet) { - this.couchLogin.tokenSet(pre.token) + // there was some kind of error, reinstate previous auth/token/etc. + if (client.couchLogin) { + client.couchLogin.token = token + if (client.couchLogin.tokenSet) { + client.couchLogin.tokenSet(token) } } - this.conf.setCredentialsByURI(base, { - username : pre.username, - password : pre.password, - email : pre.email - }) - this.log.verbose("adduser", "back", [error, data, json]) + client.log.verbose("adduser", "back", [error, data, json]) if (!error) { error = new Error( (response && response.statusCode || "") + " " + @@ -124,13 +116,13 @@ function adduser (base, username, password, email, cb) { } if (response && (response.statusCode === 401 || response.statusCode === 403)) { - this.log.warn("adduser", "Incorrect username or password\n" + - "You can reset your account by visiting:\n" + - "\n" + - " https://npmjs.org/forgot\n") + client.log.warn("adduser", "Incorrect username or password\n" + + "You can reset your account by visiting:\n" + + "\n" + + " https://npmjs.org/forgot\n") } return cb(error) - }.bind(this) + } } } diff --git a/deps/npm/node_modules/npm-registry-client/lib/attempt.js b/deps/npm/node_modules/npm-registry-client/lib/attempt.js index 0794fdc3bff091..7f289efeb866c3 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/attempt.js +++ b/deps/npm/node_modules/npm-registry-client/lib/attempt.js @@ -5,12 +5,7 @@ module.exports = attempt function attempt(cb) { // Tuned to spread 3 attempts over about a minute. // See formula at . - var operation = retry.operation({ - retries : this.conf.get("fetch-retries") || 2, - factor : this.conf.get("fetch-retry-factor"), - minTimeout : this.conf.get("fetch-retry-mintimeout") || 10000, - maxTimeout : this.conf.get("fetch-retry-maxtimeout") || 60000 - }) + var operation = retry.operation(this.config.retry) var client = this operation.attempt(function (currentAttempt) { diff --git a/deps/npm/node_modules/npm-registry-client/lib/authify.js b/deps/npm/node_modules/npm-registry-client/lib/authify.js index 2b0c7a2a33a2b8..4d1a4dd4aba7f8 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/authify.js +++ b/deps/npm/node_modules/npm-registry-client/lib/authify.js @@ -1,21 +1,17 @@ -var url = require("url") - module.exports = authify -function authify (authed, parsed, headers) { - var c = this.conf.getCredentialsByURI(url.format(parsed)) - - if (c && c.token) { +function authify (authed, parsed, headers, credentials) { + if (credentials && credentials.token) { this.log.verbose("request", "using bearer token for auth") - headers.authorization = "Bearer " + c.token + headers.authorization = "Bearer " + credentials.token return null } if (authed) { - if (c && c.username && c.password) { - var username = encodeURIComponent(c.username) - var password = encodeURIComponent(c.password) + if (credentials && credentials.username && credentials.password) { + var username = encodeURIComponent(credentials.username) + var password = encodeURIComponent(credentials.password) parsed.auth = username + ":" + password } else { diff --git a/deps/npm/node_modules/npm-registry-client/lib/bugs.js b/deps/npm/node_modules/npm-registry-client/lib/bugs.js deleted file mode 100644 index fd0365eed6020c..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/bugs.js +++ /dev/null @@ -1,9 +0,0 @@ - -module.exports = bugs - -function bugs (uri, cb) { - this.get(uri + "/latest", 3600, function (er, d) { - if (er) return cb(er) - cb(null, d.bugs) - }) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js index f5fd597047bd12..c018570d96d528 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -1,27 +1,43 @@ module.exports = deprecate +var assert = require("assert") var url = require("url") var semver = require("semver") -function deprecate (uri, ver, message, cb) { - var c = this.conf.getCredentialsByURI(uri) - if (!(c.token || c.auth)) { - return cb(new Error("Must be logged in to deprecate a package")) - } +function deprecate (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to deprecate") + assert(params && typeof params === "object", "must pass params to deprecate") + assert(typeof cb === "function", "must pass callback to deprecate") + + assert(typeof params.version === "string", "must pass version to deprecate") + assert(typeof params.message === "string", "must pass message to deprecate") + assert( + params.auth && typeof params.auth === "object", + "must pass auth to deprecate" + ) + + var version = params.version + var message = params.message + var auth = params.auth - if (semver.validRange(ver) === null) { - return cb(new Error("invalid version range: "+ver)) + if (semver.validRange(version) === null) { + return cb(new Error("invalid version range: "+version)) } - this.get(uri + '?write=true', null, function (er, data) { + this.get(uri + "?write=true", { auth : auth }, function (er, data) { if (er) return cb(er) // filter all the versions that match Object.keys(data.versions).filter(function (v) { - return semver.satisfies(v, ver) + return semver.satisfies(v, version) }).forEach(function (v) { data.versions[v].deprecated = message }) // now update the doc on the registry - this.request('PUT', url.resolve(uri, data._id), { body : data }, cb) + var options = { + method : "PUT", + body : data, + auth : auth + } + this.request(url.resolve(uri, data._id), options, cb) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/fetch.js b/deps/npm/node_modules/npm-registry-client/lib/fetch.js index 75c52de3ae98f5..b0764b6104758b 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/fetch.js +++ b/deps/npm/node_modules/npm-registry-client/lib/fetch.js @@ -6,17 +6,16 @@ var request = require("request") module.exports = fetch -function fetch (uri, headers, cb) { - assert(uri, "must pass resource to fetch") - assert(cb, "must pass callback") - - if (!headers) headers = {} +function fetch (uri, params, cb) { + assert(typeof uri === "string", "must pass uri to request") + assert(params && typeof params === "object", "must pass params to request") + assert(typeof cb === "function", "must pass callback to request") cb = once(cb) var client = this this.attempt(function (operation) { - makeRequest.call(client, uri, headers, function (er, req) { + makeRequest.call(client, uri, params, function (er, req) { if (er) return cb(er) req.on("error", function (er) { @@ -65,21 +64,23 @@ function unstick(response) { }}(response.resume) } -function makeRequest (remote, headers, cb) { +function makeRequest (remote, params, cb) { var parsed = url.parse(remote) this.log.http("fetch", "GET", parsed.href) + var headers = params.headers || {} var er = this.authify( - this.conf.getCredentialsByURI(remote).alwaysAuth, + params.auth && params.auth.alwaysAuth, parsed, - headers + headers, + params.auth ) if (er) return cb(er) var opts = this.initialize( parsed, "GET", - "application/x-tar", + "application/x-tar, application/vnd.github+json; q=0.1", headers ) // always want to follow redirects for fetch diff --git a/deps/npm/node_modules/npm-registry-client/lib/get.js b/deps/npm/node_modules/npm-registry-client/lib/get.js index d7b58092b7ffaa..17e1349775748c 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/get.js +++ b/deps/npm/node_modules/npm-registry-client/lib/get.js @@ -1,203 +1,22 @@ - module.exports = get -var fs = require("graceful-fs") - , assert = require("assert") - , path = require("path") - , mkdir = require("mkdirp") - , chownr = require("chownr") +var assert = require("assert") , url = require("url") -/** - * options: - * - * timeout: request timeouts - * follow: follow redirects - * staleOk: stale results are OK - * stat: results of checking for cached metadata - * data: the cached metadata +/* + * This is meant to be overridden in specific implementations if you + * want specialized behavior for metadata (i.e. caching). */ -function get (uri, options, cb) { - assert(uri, "must have URL to fetch") - assert(cb, "must have callback") - if (!options) options = {} +function get (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to get") + assert(params && typeof params === "object", "must pass params to get") + assert(typeof cb === "function", "must pass callback to get") var parsed = url.parse(uri) - assert(parsed.protocol, "must have a URL that starts with npm:, http:, or https:") - - var cache = this.cacheFile(uri) + "/.cache.json" - - // /-/all is special. - // It uses timestamp-based caching and partial updates, - // because it is a monster. - if (parsed.pathname === "/-/all") { - return requestAll.call(this, uri, cache, cb) - } - - // If the GET is part of a write operation (PUT or DELETE), then - // skip past the cache entirely, but still save the results. - if (uri.match(/\?write=true$/)) { - return get_.call(this, uri, cache, options, cb) - } - - fs.stat(cache, function (er, stat) { - if (!er) fs.readFile(cache, function (er, data) { - try { data = JSON.parse(data) } - catch (ex) { data = null } - options.stat = stat - options.data = data - get_.call(this, uri, cache, options, cb) - }.bind(this)) - else { - get_.call(this, uri, cache, options, cb) - } - }.bind(this)) -} - -function requestAll (uri, cache, cb) { - this.log.info("get", cache) - mkdir(path.dirname(cache), function (er) { - if (er) return cb(er) - fs.readFile(cache, function (er, data) { - if (er) return requestAll_.call(this, uri, 0, {}, cache, cb) - try { - data = JSON.parse(data) - } catch (ex) { - fs.writeFile(cache, "{}", function (er) { - if (er) return cb(new Error("Broken cache.")) - return requestAll_.call(this, uri, 0, {}, cache, cb) - }.bind(this)) - } - var t = +data._updated || 0 - requestAll_.call(this, uri, t, data, cache, cb) - }.bind(this)) - }.bind(this)) -} - -function requestAll_ (uri, c, data, cache, cb) { - // use the cache and update in the background if it's not too old - if (Date.now() - c < 60000) { - cb(null, data) - cb = function () {} - } - - if (c === 0) { - this.log.warn("", "Building the local index for the first time, please be patient") - uri = url.resolve(uri, "/-/all") - } - else { - uri = url.resolve(uri, "/-/all/since?stale=update_after&startkey=" + c) - } - - this.request('GET', uri, null, function (er, updates, _, res) { - if (er) return cb(er, data) - var headers = res.headers - , updated = updates._updated || Date.parse(headers.date) - Object.keys(updates).forEach(function (p) { - data[p] = updates[p] - }) - data._updated = updated - fs.writeFile( cache, JSON.stringify(data) - , function (er) { - delete data._updated - return cb(er, data) - }) - }) -} - -function get_ (uri, cache, options, cb) { - var staleOk = options.staleOk === undefined ? false : options.staleOk - , follow = options.follow - , data = options.data - , stat = options.stat - , etag - - var timeout = options.timeout === undefined ? -1 : options.timeout - timeout = Math.min(timeout, this.conf.get('cache-max') || 0) - timeout = Math.max(timeout, this.conf.get('cache-min') || -Infinity) - if (process.env.COMP_CWORD !== undefined && - process.env.COMP_LINE !== undefined && - process.env.COMP_POINT !== undefined) { - timeout = Math.max(timeout, 60000) - } - - if (data && data._etag) etag = data._etag - - if (timeout && timeout > 0 && options.stat && options.data) { - if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { - this.log.verbose("registry.get", uri, "not expired, no request") - delete data._etag - return cb(null, data, JSON.stringify(data), {statusCode:304}) - } - if (staleOk) { - this.log.verbose("registry.get", uri, "staleOk, background update") - delete data._etag - process.nextTick(cb.bind( null, null, data, JSON.stringify(data) - , {statusCode: 304} )) - cb = function () {} - } - } - - this.request('GET', uri, { etag : etag, follow : follow }, function (er, remoteData, raw, response) { - // if we get an error talking to the registry, but we have it - // from the cache, then just pretend we got it. - if (er && cache && data && !data.error) { - er = null - response = {statusCode: 304} - } - - if (response) { - this.log.silly("registry.get", "cb", [response.statusCode, response.headers]) - if (response.statusCode === 304 && etag) { - remoteData = data - this.log.verbose("etag", uri+" from cache") - } - } - - data = remoteData - if (!data) { - er = er || new Error("failed to fetch from registry: " + uri) - } - - if (er) return cb(er, data, raw, response) - - // just give the write the old college try. if it fails, whatever. - function saved () { - delete data._etag - cb(er, data, raw, response) - } - - saveToCache.call(this, cache, data, saved) - }.bind(this)) -} - -function saveToCache (cache, data, saved) { - if (this._cacheStat) { - var cs = this._cacheStat - return saveToCache_.call(this, cache, data, cs.uid, cs.gid, saved) - } - fs.stat(this.conf.get('cache'), function (er, st) { - if (er) { - return fs.stat(process.env.HOME || "", function (er, st) { - // if this fails, oh well. - if (er) return saved() - this._cacheStat = st - return saveToCache.call(this, cache, data, saved) - }.bind(this)) - } - this._cacheStat = st || { uid: null, gid: null } - return saveToCache.call(this, cache, data, saved) - }.bind(this)) -} + assert( + parsed.protocol === "http:" || parsed.protocol === "https:", + "must have a URL that starts with http: or https:" + ) -function saveToCache_ (cache, data, uid, gid, saved) { - mkdir(path.dirname(cache), function (er, made) { - if (er) return saved() - fs.writeFile(cache, JSON.stringify(data), function (er) { - if (er || uid === null || gid === null) { - return saved() - } - chownr(made || cache, uid, gid, saved) - }) - }) + this.request(uri, params, cb) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/initialize.js b/deps/npm/node_modules/npm-registry-client/lib/initialize.js index b6e89ffe957893..727625e74f593f 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/initialize.js +++ b/deps/npm/node_modules/npm-registry-client/lib/initialize.js @@ -5,37 +5,40 @@ var pkg = require("../package.json") module.exports = initialize function initialize (uri, method, accept, headers) { - if (!this.sessionToken) { - this.sessionToken = crypto.randomBytes(8).toString("hex") - this.log.verbose("request id", this.sessionToken) + if (!this.config.sessionToken) { + this.config.sessionToken = crypto.randomBytes(8).toString("hex") + this.log.verbose("request id", this.config.sessionToken) } - var strict = this.conf.get("strict-ssl") - if (strict === undefined) strict = true - - var p = this.conf.get("proxy") - var sp = this.conf.get("https-proxy") || p - var opts = { url : uri, method : method, headers : headers, - proxy : uri.protocol === "https:" ? sp : p, - localAddress : this.conf.get("local-address"), - strictSSL : strict, - cert : this.conf.get("cert"), - key : this.conf.get("key"), - ca : this.conf.get("ca") + localAddress : this.config.proxy.localAddress, + strictSSL : this.config.ssl.strict, + cert : this.config.ssl.certificate, + key : this.config.ssl.key, + ca : this.config.ssl.ca + } + + // request will not pay attention to the NOPROXY environment variable if a + // config value named proxy is passed in, even if it's set to null. + var proxy + if (uri.protocol === "https") { + proxy = this.config.proxy.https + } + else { + proxy = this.config.proxy.http } + if (typeof proxy === "string") opts.proxy = proxy headers.version = this.version || pkg.version headers.accept = accept if (this.refer) headers.referer = this.refer - headers["npm-session"] = this.sessionToken - headers["user-agent"] = this.conf.get("user-agent") || - "node/" + process.version + headers["npm-session"] = this.config.sessionToken + headers["user-agent"] = this.config.userAgent return opts } diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index c3b2f3e1f2a2bf..ea9dcaef7451c6 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -1,47 +1,58 @@ - module.exports = publish var url = require("url") , semver = require("semver") , crypto = require("crypto") - , fs = require("fs") - , fixNameField = require("normalize-package-data/lib/fixer.js").fixNameField + , Stream = require("stream").Stream + , assert = require("assert") + , fixer = require("normalize-package-data/lib/fixer.js") + , concat = require("concat-stream") -function escaped(name) { +function escaped (name) { return name.replace("/", "%2f") } -function publish (uri, data, tarball, cb) { - var c = this.conf.getCredentialsByURI(uri) - if (!(c.token || (c.auth && c.username && c.email))) { - var er = new Error("auth and email required for publishing") - er.code = 'ENEEDAUTH' +function publish (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to publish") + assert(params && typeof params === "object", "must pass params to publish") + assert(typeof cb === "function", "must pass callback to publish") + + var auth = params.auth + assert(auth && typeof auth === "object", "must pass auth to publish") + if (!(auth.token || + (auth.password && auth.username && auth.email))) { + var er = new Error("auth required for publishing") + er.code = "ENEEDAUTH" return cb(er) } + var metadata = params.metadata + assert( + metadata && typeof metadata === "object", + "must pass package metadata to publish" + ) try { - fixNameField(data, true) + fixer.fixNameField(metadata, true) } catch (er) { return cb(er) } - - var ver = semver.clean(data.version) - if (!ver) - return cb(new Error('invalid semver: ' + data.version)) - data.version = ver - - var self = this - fs.stat(tarball, function(er, s) { - if (er) return cb(er) - fs.readFile(tarball, function(er, tarbuffer) { - if (er) return cb(er) - putFirst.call(self, uri, data, tarbuffer, s, c, cb) - }) + var version = semver.clean(metadata.version) + if (!version) return cb(new Error("invalid semver: " + metadata.version)) + metadata.version = version + + var body = params.body + assert(body, "must pass package body to publish") + assert(body instanceof Stream, "package body passed to publish must be a stream") + var client = this + var sink = concat(function (tarbuffer) { + putFirst.call(client, uri, metadata, tarbuffer, auth, cb) }) + sink.on("error", cb) + body.pipe(sink) } -function putFirst (registry, data, tarbuffer, stat, creds, cb) { +function putFirst (registry, data, tarbuffer, auth, cb) { // optimistically try to PUT all in one single atomic thing. // If 409, then GET and merge, try again. // If other error, then fail. @@ -55,13 +66,13 @@ function putFirst (registry, data, tarbuffer, stat, creds, cb) { , readme: data.readme || "" } - if (!creds.token) { - root.maintainers = [{name : creds.username, email : creds.email}] + if (!auth.token) { + root.maintainers = [{name : auth.username, email : auth.email}] data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) } root.versions[ data.version ] = data - var tag = data.tag || this.conf.get('tag') || "latest" + var tag = data.tag || this.config.defaultTag root["dist-tags"][tag] = data.version var tbName = data.name + "-" + data.version + ".tgz" @@ -77,11 +88,17 @@ function putFirst (registry, data, tarbuffer, stat, creds, cb) { root._attachments[ tbName ] = { "content_type": "application/octet-stream", "data": tarbuffer.toString("base64"), - "length": stat.size + "length": tarbuffer.length } var fixed = url.resolve(registry, escaped(data.name)) - this.request("PUT", fixed, { body : root }, function (er, parsed, json, res) { + var client = this + var options = { + method : "PUT", + body : root, + auth : auth + } + this.request(fixed, options, function (er, parsed, json, res) { var r409 = "must supply latest _rev to update existing package" var r409b = "Document update conflict." var conflict = res && res.statusCode === 409 @@ -90,8 +107,7 @@ function putFirst (registry, data, tarbuffer, stat, creds, cb) { // a 409 is typical here. GET the data and merge in. if (er && !conflict) { - this.log.error("publish", "Failed PUT " - +(res && res.statusCode)) + client.log.error("publish", "Failed PUT "+(res && res.statusCode)) return cb(er) } @@ -99,15 +115,15 @@ function putFirst (registry, data, tarbuffer, stat, creds, cb) { return cb(er, parsed, json, res) // let's see what versions are already published. - this.request("GET", fixed + "?write=true", null, function (er, current) { + client.request(fixed+"?write=true", { auth : auth }, function (er, current) { if (er) return cb(er) - putNext.call(this, registry, data.version, root, current, cb) - }.bind(this)) - }.bind(this)) + putNext.call(client, registry, data.version, root, current, auth, cb) + }) + }) } -function putNext(registry, newVersion, root, current, cb) { +function putNext (registry, newVersion, root, current, auth, cb) { // already have the tardata on the root object // just merge in existing stuff var curVers = Object.keys(current.versions || {}).map(function (v) { @@ -128,15 +144,15 @@ function putNext(registry, newVersion, root, current, cb) { for (var i in root) { switch (i) { // objects that copy over the new stuffs - case 'dist-tags': - case 'versions': - case '_attachments': + case "dist-tags": + case "versions": + case "_attachments": for (var j in root[i]) current[i][j] = root[i][j] break // ignore these - case 'maintainers': + case "maintainers": break // copy @@ -148,7 +164,12 @@ function putNext(registry, newVersion, root, current, cb) { root.versions[newVersion].maintainers = maint var uri = url.resolve(registry, escaped(root.name)) - this.request("PUT", uri, { body : current }, cb) + var options = { + method : "PUT", + body : current, + auth : auth + } + this.request(uri, options, cb) } function conflictError (pkgid, version) { diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 910fe013142c2e..ec39cc25d82a2d 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -1,105 +1,72 @@ -var assert = require("assert") - , url = require("url") - , zlib = require("zlib") - , Stream = require("stream").Stream - -var rm = require("rimraf") - , request = require("request") - , once = require("once") - module.exports = regRequest // npm: means // 1. https // 2. send authorization // 3. content-type is 'application/json' -- metadata -function regRequest (method, uri, options, cb_) { - assert(uri, "must pass resource to load") - assert(cb_, "must pass callback") +// +var assert = require("assert") + , url = require("url") + , zlib = require("zlib") + , Stream = require("stream").Stream - options = options || {} +var request = require("request") + , once = require("once") - var parsed = url.parse(uri) - var where = parsed.pathname - var what = options.body - var follow = (typeof options.follow === "boolean" ? options.follow : true) - this.log.verbose("request", "on initialization, where is", where) - - if (parsed.search) { - where = where + parsed.search - parsed.search = "" - } - parsed.pathname = "/" - this.log.verbose("request", "after pass 1, where is", where) +function regRequest (uri, params, cb_) { + assert(typeof uri === "string", "must pass uri to request") + assert(params && typeof params === "object", "must pass params to request") + assert(typeof cb_ === "function", "must pass callback to request") + + params.method = params.method || "GET" + this.log.verbose("request", "uri", uri) // Since there are multiple places where an error could occur, // don't let the cb be called more than once. var cb = once(cb_) - if (where.match(/^\/?favicon.ico/)) { + if (uri.match(/^\/?favicon.ico/)) { return cb(new Error("favicon.ico isn't a package, it's a picture.")) } - var adduserChange = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)\/-rev/ - , isUserChange = where.match(adduserChange) - , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)$/ - , isNewUser = where.match(adduserNew) - , registry = url.format(parsed) - , alwaysAuth = this.conf.getCredentialsByURI(registry).alwaysAuth - , isDelete = method === "DELETE" - , isWrite = what || isDelete + var adduserChange = /\/?-\/user\/org\.couchdb\.user:([^/]+)\/-rev/ + , isUserChange = uri.match(adduserChange) + , adduserNew = /\/?-\/user\/org\.couchdb\.user:([^/?]+)$/ + , isNewUser = uri.match(adduserNew) + , alwaysAuth = params.auth && params.auth.alwaysAuth + , isDelete = params.method === "DELETE" + , isWrite = params.body || isDelete if (isUserChange && !isWrite) { return cb(new Error("trying to change user document without writing(?!)")) } - // resolve to a full url on the registry - if (!where.match(/^https?:\/\//)) { - this.log.verbose("request", "url raw", where) - - var q = where.split("?") - where = q.shift() - q = q.join("?") - - if (where.charAt(0) !== "/") where = "/" + where - where = "." + where.split("/").map(function (p) { - p = p.trim() - if (p.match(/^org.couchdb.user/)) { - return p.replace(/\//g, encodeURIComponent("/")) - } - return p - }).join("/") - if (q) where += "?" + q - - this.log.verbose("request", "resolving registry", [registry, where]) - where = url.resolve(registry, where) - this.log.verbose("request", "after pass 2, where is", where) - } - - var authed // new users can *not* use auth, because they don't *have* auth yet - if (isNewUser) { + if (isUserChange) { + this.log.verbose("request", "updating existing user; sending authorization") + params.authed = true + } + else if (isNewUser) { this.log.verbose("request", "new user, so can't send auth") - authed = false + params.authed = false } else if (alwaysAuth) { this.log.verbose("request", "always-auth set; sending authorization") - authed = true + params.authed = true } else if (isWrite) { this.log.verbose("request", "sending authorization for write operation") - authed = true + params.authed = true } else { // most of the time we don't want to auth this.log.verbose("request", "no auth needed") - authed = false + params.authed = false } var self = this this.attempt(function (operation) { - makeRequest.call(self, method, where, what, options.etag, follow, authed - , function (er, parsed, raw, response) { + makeRequest.call(self, uri, params, function (er, parsed, raw, response) { if (!er || (er.message && er.message.match(/^SSL Error/))) { if (er) er.code = "ESSL" @@ -127,51 +94,58 @@ function regRequest (method, uri, options, cb_) { }) } -function makeRequest (method, where, what, etag, follow, authed, cb_) { +function makeRequest (uri, params, cb_) { var cb = once(cb_) - var parsed = url.parse(where) + var parsed = url.parse(uri) var headers = {} // metadata should be compressed headers["accept-encoding"] = "gzip" - var er = this.authify(authed, parsed, headers) + var er = this.authify(params.authed, parsed, headers, params.auth) if (er) return cb_(er) var opts = this.initialize( parsed, - method, + params.method, "application/json", headers ) - opts.followRedirect = follow + opts.followRedirect = (typeof params.follow === "boolean" ? params.follow : true) opts.encoding = null // tell request let body be Buffer instance - if (etag) { - this.log.verbose("etag", etag) - headers[method === "GET" ? "if-none-match" : "if-match"] = etag + if (params.etag) { + this.log.verbose("etag", params.etag) + headers[params.method === "GET" ? "if-none-match" : "if-match"] = params.etag } - // figure out wth "what" is - if (what) { - if (Buffer.isBuffer(what) || typeof what === "string") { - opts.body = what + // figure out wth body is + if (params.body) { + if (Buffer.isBuffer(params.body)) { + opts.body = params.body headers["content-type"] = "application/json" - headers["content-length"] = Buffer.byteLength(what) - } else if (what instanceof Stream) { + headers["content-length"] = params.body.length + } + else if (typeof params.body === "string") { + opts.body = params.body + headers["content-type"] = "application/json" + headers["content-length"] = Buffer.byteLength(params.body) + } + else if (params.body instanceof Stream) { headers["content-type"] = "application/octet-stream" - if (what.size) headers["content-length"] = what.size - } else { - delete what._etag - opts.json = what + if (params.body.size) headers["content-length"] = params.body.size + } + else { + delete params.body._etag + opts.json = params.body } } - this.log.http("request", method, parsed.href || "/") + this.log.http("request", params.method, parsed.href || "/") - var done = requestDone.call(this, method, where, cb) + var done = requestDone.call(this, params.method, uri, cb) var req = request(opts, decodeResponseBody(done)) req.on("error", cb) @@ -179,8 +153,8 @@ function makeRequest (method, where, what, etag, follow, authed, cb_) { s.on("error", cb) }) - if (what && (what instanceof Stream)) { - what.pipe(req) + if (params.body && (params.body instanceof Stream)) { + params.body.pipe(req) } } @@ -194,7 +168,9 @@ function decodeResponseBody(cb) { response.socket.destroy() } - if (response.headers["content-encoding"] !== "gzip") return cb(er, response, data) + if (response.headers["content-encoding"] !== "gzip") { + return cb(er, response, data) + } zlib.gunzip(data, function (er, buf) { if (er) return cb(er, response, data) @@ -210,16 +186,14 @@ function requestDone (method, where, cb) { if (er) return cb(er) var urlObj = url.parse(where) - if (urlObj.auth) - urlObj.auth = "***" + if (urlObj.auth) urlObj.auth = "***" this.log.http(response.statusCode, url.format(urlObj)) - var parsed - if (Buffer.isBuffer(data)) { data = data.toString() } + var parsed if (data && typeof data === "string" && response.statusCode !== 304) { try { parsed = JSON.parse(data) @@ -246,7 +220,9 @@ function requestDone (method, where, cb) { parsed._etag = response.headers.etag } - if (parsed && parsed.error && response.statusCode >= 400) { + // for the search endpoint, the "error" property can be an object + if (parsed && parsed.error && typeof parsed.error !== "object" || + response.statusCode >= 400) { var w = url.parse(where).pathname.substr(1) var name if (!w.match(/^-/)) { @@ -254,24 +230,24 @@ function requestDone (method, where, cb) { name = w[w.indexOf("_rewrite") + 1] } - if (name && parsed.error === "not_found") { + if (!parsed.error) { + er = new Error( + "Registry returned " + response.statusCode + + " for " + method + + " on " + where + ) + } + else if (name && parsed.error === "not_found") { er = new Error("404 Not Found: " + name) - } else { + } + else { er = new Error( - parsed.error + " " + (parsed.reason || "") + ": " + w) + parsed.error + " " + (parsed.reason || "") + ": " + w + ) } if (name) er.pkgid = name er.statusCode = response.statusCode er.code = "E" + er.statusCode - - } else if (method !== "HEAD" && method !== "GET") { - // invalidate cache - // This is irrelevant for commands that do etag caching, but - // ls and view also have a timed cache, so this keeps the user - // from thinking that it didn't work when it did. - // Note that failure is an acceptable option here, since the - // only result will be a stale cache for some helper commands. - rm(this.cacheFile(where), function() {}) } return cb(er, parsed, data, response) }.bind(this) diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js index 97745851ea1cf3..aa707e1592ac4b 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ b/deps/npm/node_modules/npm-registry-client/lib/star.js @@ -1,32 +1,48 @@ - module.exports = star -function star (uri, starred, cb) { - var c = this.conf.getCredentialsByURI(uri) - if (c.token) { +var assert = require("assert") + +function star (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to star") + assert(params && typeof params === "object", "must pass params to star") + assert(typeof cb === "function", "must pass callback to star") + + var starred = params.starred ? true : false + + var auth = params.auth + assert(auth && typeof auth === "object", "must pass auth to star") + if (auth.token) { return cb(new Error("This operation is unsupported for token-based auth")) } - else if (!c.auth) { + else if (!(auth.username && auth.password)) { return cb(new Error("Must be logged in to star/unstar packages")) } - this.request("GET", uri + "?write=true", null, function (er, fullData) { + var client = this + this.request(uri+"?write=true", { auth : auth }, function (er, fullData) { if (er) return cb(er) - fullData = { _id: fullData._id - , _rev: fullData._rev - , users: fullData.users || {} } + fullData = { + _id : fullData._id, + _rev : fullData._rev, + users : fullData.users || {} + } if (starred) { - this.log.info("starring", fullData._id) - fullData.users[c.username] = true - this.log.verbose("starring", fullData) + client.log.info("starring", fullData._id) + fullData.users[auth.username] = true + client.log.verbose("starring", fullData) } else { - delete fullData.users[c.username] - this.log.info("unstarring", fullData._id) - this.log.verbose("unstarring", fullData) + delete fullData.users[auth.username] + client.log.info("unstarring", fullData._id) + client.log.verbose("unstarring", fullData) } - return this.request("PUT", uri, { body : fullData }, cb) - }.bind(this)) + var options = { + method : "PUT", + body : fullData, + auth : auth + } + return client.request(uri, options, cb) + }) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/stars.js b/deps/npm/node_modules/npm-registry-client/lib/stars.js index 86a252efbb71e2..f5555124255345 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/stars.js +++ b/deps/npm/node_modules/npm-registry-client/lib/stars.js @@ -1,9 +1,18 @@ +module.exports = stars + +var assert = require("assert") var url = require("url") -module.exports = stars +function stars (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to stars") + assert(params && typeof params === "object", "must pass params to stars") + assert(typeof cb === "function", "must pass callback to stars") + + var auth = params.auth + var name = params.username || (auth && auth.username) + if (!name) return cb(new Error("must pass either username or auth to stars")) + var encoded = encodeURIComponent(name) + var path = "-/_view/starredByUser?key=\""+encoded+"\"" -function stars (base, name, cb) { - name = encodeURIComponent(name) - var path = "/-/_view/starredByUser?key=\""+name+"\"" - this.request("GET", url.resolve(base, path), null, cb) + this.request(url.resolve(uri, path), { auth : auth }, cb) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/tag.js b/deps/npm/node_modules/npm-registry-client/lib/tag.js index 65430fe9307e56..8b42199075c611 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/tag.js +++ b/deps/npm/node_modules/npm-registry-client/lib/tag.js @@ -1,5 +1,20 @@ module.exports = tag -function tag (uri, version, tagName, cb) { - this.request("PUT", uri+"/"+tagName, { body : JSON.stringify(version) }, cb) +var assert = require("assert") + +function tag (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to tag") + assert(params && typeof params === "object", "must pass params to tag") + assert(typeof cb === "function", "must pass callback to tag") + + assert(typeof params.version === "string", "must pass version to tag") + assert(typeof params.tag === "string", "must pass tag name to tag") + assert(params.auth && typeof params.auth === "object", "must pass auth to tag") + + var options = { + method : "PUT", + body : JSON.stringify(params.version), + auth : params.auth + } + this.request(uri+"/"+params.tag, options, cb) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js index 346d537fe6fd31..e6e954935c3da4 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js @@ -1,3 +1,4 @@ +module.exports = unpublish // fetch the data // modify to remove the version in question @@ -5,16 +6,26 @@ // else, PUT the modified data // delete the tarball -module.exports = unpublish - var semver = require("semver") , url = require("url") , chain = require("slide").chain + , assert = require("assert") -function unpublish (uri, ver, cb) { - if (typeof cb !== "function") cb = ver, ver = null +function unpublish (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to unpublish") + assert(params && typeof params === "object", "must pass params to unpublish") + assert(typeof cb === "function", "must pass callback to unpublish") - this.get(uri + "?write=true", { timeout : -1, follow : false }, function (er, data) { + var ver = params.version + var auth = params.auth + assert(auth && typeof auth === "object", "must pass auth to unpublish") + + var options = { + timeout : -1, + follow : false, + auth : auth + } + this.get(uri + "?write=true", options, function (er, data) { if (er) { this.log.info("unpublish", uri+" not published") return cb() @@ -22,7 +33,7 @@ function unpublish (uri, ver, cb) { // remove all if no version specified if (!ver) { this.log.info("unpublish", "No version specified, removing all") - return this.request("DELETE", uri+"/-rev/"+data._rev, null, cb) + return this.request(uri+"/-rev/"+data._rev, { method : "DELETE", auth : auth }, cb) } var versions = data.versions || {} @@ -40,7 +51,7 @@ function unpublish (uri, ver, cb) { // if it was the only version, then delete the whole package. if (!Object.keys(versions).length) { this.log.info("unpublish", "No versions remain, removing entire package") - return this.request("DELETE", uri + "/-rev/" + data._rev, null, cb) + return this.request(uri+"/-rev/"+data._rev, { method : "DELETE", auth : auth }, cb) } if (!versionPublic) return cb() @@ -58,9 +69,9 @@ function unpublish (uri, ver, cb) { var rev = data._rev delete data._revisions delete data._attachments - var cb_ = detacher.call(this, uri, data, dist, cb) + var cb_ = detacher.call(this, uri, data, dist, auth, cb) - this.request("PUT", uri + "/-rev/" + rev, { body : data }, function (er) { + this.request(uri+"/-rev/"+rev, { method : "PUT", body : data, auth : auth }, function (er) { if (er) { this.log.error("unpublish", "Failed to update data") } @@ -69,20 +80,20 @@ function unpublish (uri, ver, cb) { }.bind(this)) } -function detacher (uri, data, dist, cb) { +function detacher (uri, data, dist, credentials, cb) { return function (er) { if (er) return cb(er) - this.get(escape(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), { auth : credentials }, function (er, data) { if (er) return cb(er) var tb = url.parse(dist.tarball) - detach.call(this, uri, data, tb.pathname, data._rev, function (er) { + detach.call(this, uri, data, tb.pathname, data._rev, credentials, function (er) { if (er || !dist.bin) return cb(er) chain(Object.keys(dist.bin).map(function (bt) { return function (cb) { var d = dist.bin[bt] - detach.call(this, uri, data, url.parse(d.tarball).pathname, null, cb) + detach.call(this, uri, data, url.parse(d.tarball).pathname, null, credentials, cb) }.bind(this) }, this), cb) }.bind(this)) @@ -90,13 +101,13 @@ function detacher (uri, data, dist, cb) { }.bind(this) } -function detach (uri, data, path, rev, cb) { +function detach (uri, data, path, rev, credentials, cb) { if (rev) { path += "/-rev/" + rev this.log.info("detach", path) - return this.request("DELETE", url.resolve(uri, path), null, cb) + return this.request(url.resolve(uri, path), { method : "DELETE", auth : credentials }, cb) } - this.get(escape(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), { auth : credentials }, function (er, data) { rev = data._rev if (!rev) return cb(new Error( "No _rev found in "+data._id)) diff --git a/deps/npm/node_modules/npm-registry-client/lib/upload.js b/deps/npm/node_modules/npm-registry-client/lib/upload.js deleted file mode 100644 index f624a266c42389..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/upload.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = upload - -var fs = require('fs') -, Stream = require("stream").Stream - -function upload (uri, file, etag, nofollow, cb) { - if (typeof nofollow === "function") cb = nofollow, nofollow = false - if (typeof etag === "function") cb = etag, etag = null - - if (file instanceof Stream) { - return this.request("PUT", uri, { body : file, etag : etag, follow : !nofollow }, cb) - } - - fs.stat(file, function (er, stat) { - if (er) return cb(er) - var s = fs.createReadStream(file) - s.size = stat.size - s.on("error", cb) - - this.request("PUT", uri, { body : s, etag : etag, follow : !nofollow }, cb) - }.bind(this)) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js b/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js deleted file mode 100644 index 3b26a56c65f1cc..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js +++ /dev/null @@ -1,21 +0,0 @@ -var url = require("url") - -module.exports = toNerfDart - -/** - * Maps a URL to an identifier. - * - * Name courtesy schiffertronix media LLC, a New Jersey corporation - * - * @param {String} uri The URL to be nerfed. - * - * @returns {String} A nerfed URL. - */ -function toNerfDart(uri) { - var parsed = url.parse(uri) - parsed.pathname = "/" - delete parsed.protocol - delete parsed.auth - - return url.format(parsed) -} diff --git a/deps/npm/node_modules/npm-registry-client/lib/whoami.js b/deps/npm/node_modules/npm-registry-client/lib/whoami.js index ffa7bd704e6a3d..684ce7bfbfb201 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/whoami.js +++ b/deps/npm/node_modules/npm-registry-client/lib/whoami.js @@ -1,13 +1,17 @@ module.exports = whoami var url = require("url") + , assert = require("assert") -function whoami (uri, cb) { - if (!this.conf.getCredentialsByURI(uri)) { - return cb(new Error("Must be logged in to see who you are")) - } +function whoami (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to whoami") + assert(params && typeof params === "object", "must pass params to whoami") + assert(typeof cb === "function", "must pass callback to whoami") - this.request("GET", url.resolve(uri, "whoami"), null, function (er, userdata) { + var auth = params.auth + assert(auth && typeof auth === "object", "must pass auth to whoami") + + this.request(url.resolve(uri, "whoami"), { auth : auth }, function (er, userdata) { if (er) return cb(er) cb(null, userdata.username) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/.npmignore new file mode 100644 index 00000000000000..b512c09d476623 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE new file mode 100644 index 00000000000000..1e836b4760025f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2013 Max Ogden + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js new file mode 100644 index 00000000000000..7511eed8ab7ae3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js @@ -0,0 +1,132 @@ +var Writable = require('readable-stream').Writable +var inherits = require('inherits') +var TA = require('typedarray') +var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array + +function ConcatStream(opts, cb) { + if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb) + + if (typeof opts === 'function') { + cb = opts + opts = {} + } + if (!opts) opts = {} + + var encoding = opts.encoding + var shouldInferEncoding = false + + if (!encoding) { + shouldInferEncoding = true + } else { + encoding = String(encoding).toLowerCase() + if (encoding === 'u8' || encoding === 'uint8') { + encoding = 'uint8array' + } + } + + Writable.call(this, { objectMode: true }) + + this.encoding = encoding + this.shouldInferEncoding = shouldInferEncoding + + if (cb) this.on('finish', function () { cb(this.getBody()) }) + this.body = [] +} + +module.exports = ConcatStream +inherits(ConcatStream, Writable) + +ConcatStream.prototype._write = function(chunk, enc, next) { + this.body.push(chunk) + next() +} + +ConcatStream.prototype.inferEncoding = function (buff) { + var firstBuffer = buff === undefined ? this.body[0] : buff; + if (Buffer.isBuffer(firstBuffer)) return 'buffer' + if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array' + if (Array.isArray(firstBuffer)) return 'array' + if (typeof firstBuffer === 'string') return 'string' + if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object' + return 'buffer' +} + +ConcatStream.prototype.getBody = function () { + if (!this.encoding && this.body.length === 0) return [] + if (this.shouldInferEncoding) this.encoding = this.inferEncoding() + if (this.encoding === 'array') return arrayConcat(this.body) + if (this.encoding === 'string') return stringConcat(this.body) + if (this.encoding === 'buffer') return bufferConcat(this.body) + if (this.encoding === 'uint8array') return u8Concat(this.body) + return this.body +} + +var isArray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]' +} + +function isArrayish (arr) { + return /Array\]$/.test(Object.prototype.toString.call(arr)) +} + +function stringConcat (parts) { + var strings = [] + var needsToString = false + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (typeof p === 'string') { + strings.push(p) + } else if (Buffer.isBuffer(p)) { + strings.push(p) + } else { + strings.push(Buffer(p)) + } + } + if (Buffer.isBuffer(parts[0])) { + strings = Buffer.concat(strings) + strings = strings.toString('utf8') + } else { + strings = strings.join('') + } + return strings +} + +function bufferConcat (parts) { + var bufs = [] + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (Buffer.isBuffer(p)) { + bufs.push(p) + } else if (typeof p === 'string' || isArrayish(p) + || (p && typeof p.subarray === 'function')) { + bufs.push(Buffer(p)) + } else bufs.push(Buffer(String(p))) + } + return Buffer.concat(bufs) +} + +function arrayConcat (parts) { + var res = [] + for (var i = 0; i < parts.length; i++) { + res.push.apply(res, parts[i]) + } + return res +} + +function u8Concat (parts) { + var len = 0 + for (var i = 0; i < parts.length; i++) { + if (typeof parts[i] === 'string') { + parts[i] = Buffer(parts[i]) + } + len += parts[i].length + } + var u8 = new U8(len) + for (var i = 0, offset = 0; i < parts.length; i++) { + var part = parts[i] + for (var j = 0; j < part.length; j++) { + u8[offset++] = part[j] + } + } + return u8 +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000000000..38344f87a62766 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..e3d4e695a4cff2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..9e9b6eee9f349f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md @@ -0,0 +1,14 @@ +# readable-stream + +***Node-core streams for userland*** + +[![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/) + +This package is a mirror of the Streams2 and Streams3 implementations in Node-core. + +If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. + +**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. + +**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..ca807af87620dd --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/float.patch b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/float.patch new file mode 100644 index 00000000000000..7abb6dc30b21bf --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/float.patch @@ -0,0 +1,922 @@ +diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js +index c5a741c..a2e0d8e 100644 +--- a/lib/_stream_duplex.js ++++ b/lib/_stream_duplex.js +@@ -26,8 +26,8 @@ + + module.exports = Duplex; + var util = require('util'); +-var Readable = require('_stream_readable'); +-var Writable = require('_stream_writable'); ++var Readable = require('./_stream_readable'); ++var Writable = require('./_stream_writable'); + + util.inherits(Duplex, Readable); + +diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js +index a5e9864..330c247 100644 +--- a/lib/_stream_passthrough.js ++++ b/lib/_stream_passthrough.js +@@ -25,7 +25,7 @@ + + module.exports = PassThrough; + +-var Transform = require('_stream_transform'); ++var Transform = require('./_stream_transform'); + var util = require('util'); + util.inherits(PassThrough, Transform); + +diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js +index 0c3fe3e..90a8298 100644 +--- a/lib/_stream_readable.js ++++ b/lib/_stream_readable.js +@@ -23,10 +23,34 @@ module.exports = Readable; + Readable.ReadableState = ReadableState; + + var EE = require('events').EventEmitter; ++if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { ++ return emitter.listeners(type).length; ++}; ++ ++if (!global.setImmediate) global.setImmediate = function setImmediate(fn) { ++ return setTimeout(fn, 0); ++}; ++if (!global.clearImmediate) global.clearImmediate = function clearImmediate(i) { ++ return clearTimeout(i); ++}; ++ + var Stream = require('stream'); + var util = require('util'); ++if (!util.isUndefined) { ++ var utilIs = require('core-util-is'); ++ for (var f in utilIs) { ++ util[f] = utilIs[f]; ++ } ++} + var StringDecoder; +-var debug = util.debuglog('stream'); ++var debug; ++if (util.debuglog) ++ debug = util.debuglog('stream'); ++else try { ++ debug = require('debuglog')('stream'); ++} catch (er) { ++ debug = function() {}; ++} + + util.inherits(Readable, Stream); + +@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) { + + + function onEofChunk(stream, state) { +- if (state.decoder && !state.ended) { ++ if (state.decoder && !state.ended && state.decoder.end) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); +diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js +index b1f9fcc..b0caf57 100644 +--- a/lib/_stream_transform.js ++++ b/lib/_stream_transform.js +@@ -64,8 +64,14 @@ + + module.exports = Transform; + +-var Duplex = require('_stream_duplex'); ++var Duplex = require('./_stream_duplex'); + var util = require('util'); ++if (!util.isUndefined) { ++ var utilIs = require('core-util-is'); ++ for (var f in utilIs) { ++ util[f] = utilIs[f]; ++ } ++} + util.inherits(Transform, Duplex); + + +diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js +index ba2e920..f49288b 100644 +--- a/lib/_stream_writable.js ++++ b/lib/_stream_writable.js +@@ -27,6 +27,12 @@ module.exports = Writable; + Writable.WritableState = WritableState; + + var util = require('util'); ++if (!util.isUndefined) { ++ var utilIs = require('core-util-is'); ++ for (var f in utilIs) { ++ util[f] = utilIs[f]; ++ } ++} + var Stream = require('stream'); + + util.inherits(Writable, Stream); +@@ -119,7 +125,7 @@ function WritableState(options, stream) { + function Writable(options) { + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. +- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex)) ++ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) + return new Writable(options); + + this._writableState = new WritableState(options, this); +diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js +index e3787e4..8cd2127 100644 +--- a/test/simple/test-stream-big-push.js ++++ b/test/simple/test-stream-big-push.js +@@ -21,7 +21,7 @@ + + var common = require('../common'); + var assert = require('assert'); +-var stream = require('stream'); ++var stream = require('../../'); + var str = 'asdfasdfasdfasdfasdf'; + + var r = new stream.Readable({ +diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js +index bb73777..d40efc7 100644 +--- a/test/simple/test-stream-end-paused.js ++++ b/test/simple/test-stream-end-paused.js +@@ -25,7 +25,7 @@ var gotEnd = false; + + // Make sure we don't miss the end event for paused 0-length streams + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + var stream = new Readable(); + var calledRead = false; + stream._read = function() { +diff --git a/test/simple/test-stream-pipe-after-end.js b/test/simple/test-stream-pipe-after-end.js +index b46ee90..0be8366 100644 +--- a/test/simple/test-stream-pipe-after-end.js ++++ b/test/simple/test-stream-pipe-after-end.js +@@ -22,8 +22,8 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('_stream_readable'); +-var Writable = require('_stream_writable'); ++var Readable = require('../../lib/_stream_readable'); ++var Writable = require('../../lib/_stream_writable'); + var util = require('util'); + + util.inherits(TestReadable, Readable); +diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js +deleted file mode 100644 +index f689358..0000000 +--- a/test/simple/test-stream-pipe-cleanup.js ++++ /dev/null +@@ -1,122 +0,0 @@ +-// Copyright Joyent, Inc. and other Node contributors. +-// +-// Permission is hereby granted, free of charge, to any person obtaining a +-// copy of this software and associated documentation files (the +-// "Software"), to deal in the Software without restriction, including +-// without limitation the rights to use, copy, modify, merge, publish, +-// distribute, sublicense, and/or sell copies of the Software, and to permit +-// persons to whom the Software is furnished to do so, subject to the +-// following conditions: +-// +-// The above copyright notice and this permission notice shall be included +-// in all copies or substantial portions of the Software. +-// +-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +-// USE OR OTHER DEALINGS IN THE SOFTWARE. +- +-// This test asserts that Stream.prototype.pipe does not leave listeners +-// hanging on the source or dest. +- +-var common = require('../common'); +-var stream = require('stream'); +-var assert = require('assert'); +-var util = require('util'); +- +-function Writable() { +- this.writable = true; +- this.endCalls = 0; +- stream.Stream.call(this); +-} +-util.inherits(Writable, stream.Stream); +-Writable.prototype.end = function() { +- this.endCalls++; +-}; +- +-Writable.prototype.destroy = function() { +- this.endCalls++; +-}; +- +-function Readable() { +- this.readable = true; +- stream.Stream.call(this); +-} +-util.inherits(Readable, stream.Stream); +- +-function Duplex() { +- this.readable = true; +- Writable.call(this); +-} +-util.inherits(Duplex, Writable); +- +-var i = 0; +-var limit = 100; +- +-var w = new Writable(); +- +-var r; +- +-for (i = 0; i < limit; i++) { +- r = new Readable(); +- r.pipe(w); +- r.emit('end'); +-} +-assert.equal(0, r.listeners('end').length); +-assert.equal(limit, w.endCalls); +- +-w.endCalls = 0; +- +-for (i = 0; i < limit; i++) { +- r = new Readable(); +- r.pipe(w); +- r.emit('close'); +-} +-assert.equal(0, r.listeners('close').length); +-assert.equal(limit, w.endCalls); +- +-w.endCalls = 0; +- +-r = new Readable(); +- +-for (i = 0; i < limit; i++) { +- w = new Writable(); +- r.pipe(w); +- w.emit('close'); +-} +-assert.equal(0, w.listeners('close').length); +- +-r = new Readable(); +-w = new Writable(); +-var d = new Duplex(); +-r.pipe(d); // pipeline A +-d.pipe(w); // pipeline B +-assert.equal(r.listeners('end').length, 2); // A.onend, A.cleanup +-assert.equal(r.listeners('close').length, 2); // A.onclose, A.cleanup +-assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup +-assert.equal(d.listeners('close').length, 3); // A.cleanup, B.onclose, B.cleanup +-assert.equal(w.listeners('end').length, 0); +-assert.equal(w.listeners('close').length, 1); // B.cleanup +- +-r.emit('end'); +-assert.equal(d.endCalls, 1); +-assert.equal(w.endCalls, 0); +-assert.equal(r.listeners('end').length, 0); +-assert.equal(r.listeners('close').length, 0); +-assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup +-assert.equal(d.listeners('close').length, 2); // B.onclose, B.cleanup +-assert.equal(w.listeners('end').length, 0); +-assert.equal(w.listeners('close').length, 1); // B.cleanup +- +-d.emit('end'); +-assert.equal(d.endCalls, 1); +-assert.equal(w.endCalls, 1); +-assert.equal(r.listeners('end').length, 0); +-assert.equal(r.listeners('close').length, 0); +-assert.equal(d.listeners('end').length, 0); +-assert.equal(d.listeners('close').length, 0); +-assert.equal(w.listeners('end').length, 0); +-assert.equal(w.listeners('close').length, 0); +diff --git a/test/simple/test-stream-pipe-error-handling.js b/test/simple/test-stream-pipe-error-handling.js +index c5d724b..c7d6b7d 100644 +--- a/test/simple/test-stream-pipe-error-handling.js ++++ b/test/simple/test-stream-pipe-error-handling.js +@@ -21,7 +21,7 @@ + + var common = require('../common'); + var assert = require('assert'); +-var Stream = require('stream').Stream; ++var Stream = require('../../').Stream; + + (function testErrorListenerCatches() { + var source = new Stream(); +diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js +index cb9d5fe..56f8d61 100644 +--- a/test/simple/test-stream-pipe-event.js ++++ b/test/simple/test-stream-pipe-event.js +@@ -20,7 +20,7 @@ + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var common = require('../common'); +-var stream = require('stream'); ++var stream = require('../../'); + var assert = require('assert'); + var util = require('util'); + +diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js +index f2e6ec2..a5c9bf9 100644 +--- a/test/simple/test-stream-push-order.js ++++ b/test/simple/test-stream-push-order.js +@@ -20,7 +20,7 @@ + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var common = require('../common.js'); +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + var assert = require('assert'); + + var s = new Readable({ +diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js +index 06f43dc..1701a9a 100644 +--- a/test/simple/test-stream-push-strings.js ++++ b/test/simple/test-stream-push-strings.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + var util = require('util'); + + util.inherits(MyStream, Readable); +diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js +index ba6a577..a8e6f7b 100644 +--- a/test/simple/test-stream-readable-event.js ++++ b/test/simple/test-stream-readable-event.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + + (function first() { + // First test, not reading when the readable is added. +diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js +index 2891ad6..11689ba 100644 +--- a/test/simple/test-stream-readable-flow-recursion.js ++++ b/test/simple/test-stream-readable-flow-recursion.js +@@ -27,7 +27,7 @@ var assert = require('assert'); + // more data continuously, but without triggering a nextTick + // warning or RangeError. + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + + // throw an error if we trigger a nextTick warning. + process.throwDeprecation = true; +diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js +index 0c96476..7827538 100644 +--- a/test/simple/test-stream-unshift-empty-chunk.js ++++ b/test/simple/test-stream-unshift-empty-chunk.js +@@ -24,7 +24,7 @@ var assert = require('assert'); + + // This test verifies that stream.unshift(Buffer(0)) or + // stream.unshift('') does not set state.reading=false. +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + + var r = new Readable(); + var nChunks = 10; +diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js +index 83fd9fa..17c18aa 100644 +--- a/test/simple/test-stream-unshift-read-race.js ++++ b/test/simple/test-stream-unshift-read-race.js +@@ -29,7 +29,7 @@ var assert = require('assert'); + // 3. push() after the EOF signaling null is an error. + // 4. _read() is not called after pushing the EOF null chunk. + +-var stream = require('stream'); ++var stream = require('../../'); + var hwm = 10; + var r = stream.Readable({ highWaterMark: hwm }); + var chunks = 10; +@@ -51,7 +51,14 @@ r._read = function(n) { + + function push(fast) { + assert(!pushedNull, 'push() after null push'); +- var c = pos >= data.length ? null : data.slice(pos, pos + n); ++ var c; ++ if (pos >= data.length) ++ c = null; ++ else { ++ if (n + pos > data.length) ++ n = data.length - pos; ++ c = data.slice(pos, pos + n); ++ } + pushedNull = c === null; + if (fast) { + pos += n; +diff --git a/test/simple/test-stream-writev.js b/test/simple/test-stream-writev.js +index 5b49e6e..b5321f3 100644 +--- a/test/simple/test-stream-writev.js ++++ b/test/simple/test-stream-writev.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var stream = require('stream'); ++var stream = require('../../'); + + var queue = []; + for (var decode = 0; decode < 2; decode++) { +diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js +index 3814bf0..248c1be 100644 +--- a/test/simple/test-stream2-basic.js ++++ b/test/simple/test-stream2-basic.js +@@ -21,7 +21,7 @@ + + + var common = require('../common.js'); +-var R = require('_stream_readable'); ++var R = require('../../lib/_stream_readable'); + var assert = require('assert'); + + var util = require('util'); +diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js +index 6cdd4e9..f0fa84b 100644 +--- a/test/simple/test-stream2-compatibility.js ++++ b/test/simple/test-stream2-compatibility.js +@@ -21,7 +21,7 @@ + + + var common = require('../common.js'); +-var R = require('_stream_readable'); ++var R = require('../../lib/_stream_readable'); + var assert = require('assert'); + + var util = require('util'); +diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js +index 39b274f..006a19b 100644 +--- a/test/simple/test-stream2-finish-pipe.js ++++ b/test/simple/test-stream2-finish-pipe.js +@@ -20,7 +20,7 @@ + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var common = require('../common.js'); +-var stream = require('stream'); ++var stream = require('../../'); + var Buffer = require('buffer').Buffer; + + var r = new stream.Readable(); +diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js +deleted file mode 100644 +index e162406..0000000 +--- a/test/simple/test-stream2-fs.js ++++ /dev/null +@@ -1,72 +0,0 @@ +-// Copyright Joyent, Inc. and other Node contributors. +-// +-// Permission is hereby granted, free of charge, to any person obtaining a +-// copy of this software and associated documentation files (the +-// "Software"), to deal in the Software without restriction, including +-// without limitation the rights to use, copy, modify, merge, publish, +-// distribute, sublicense, and/or sell copies of the Software, and to permit +-// persons to whom the Software is furnished to do so, subject to the +-// following conditions: +-// +-// The above copyright notice and this permission notice shall be included +-// in all copies or substantial portions of the Software. +-// +-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +-// USE OR OTHER DEALINGS IN THE SOFTWARE. +- +- +-var common = require('../common.js'); +-var R = require('_stream_readable'); +-var assert = require('assert'); +- +-var fs = require('fs'); +-var FSReadable = fs.ReadStream; +- +-var path = require('path'); +-var file = path.resolve(common.fixturesDir, 'x1024.txt'); +- +-var size = fs.statSync(file).size; +- +-var expectLengths = [1024]; +- +-var util = require('util'); +-var Stream = require('stream'); +- +-util.inherits(TestWriter, Stream); +- +-function TestWriter() { +- Stream.apply(this); +- this.buffer = []; +- this.length = 0; +-} +- +-TestWriter.prototype.write = function(c) { +- this.buffer.push(c.toString()); +- this.length += c.length; +- return true; +-}; +- +-TestWriter.prototype.end = function(c) { +- if (c) this.buffer.push(c.toString()); +- this.emit('results', this.buffer); +-} +- +-var r = new FSReadable(file); +-var w = new TestWriter(); +- +-w.on('results', function(res) { +- console.error(res, w.length); +- assert.equal(w.length, size); +- var l = 0; +- assert.deepEqual(res.map(function (c) { +- return c.length; +- }), expectLengths); +- console.log('ok'); +-}); +- +-r.pipe(w); +diff --git a/test/simple/test-stream2-httpclient-response-end.js b/test/simple/test-stream2-httpclient-response-end.js +deleted file mode 100644 +index 15cffc2..0000000 +--- a/test/simple/test-stream2-httpclient-response-end.js ++++ /dev/null +@@ -1,52 +0,0 @@ +-// Copyright Joyent, Inc. and other Node contributors. +-// +-// Permission is hereby granted, free of charge, to any person obtaining a +-// copy of this software and associated documentation files (the +-// "Software"), to deal in the Software without restriction, including +-// without limitation the rights to use, copy, modify, merge, publish, +-// distribute, sublicense, and/or sell copies of the Software, and to permit +-// persons to whom the Software is furnished to do so, subject to the +-// following conditions: +-// +-// The above copyright notice and this permission notice shall be included +-// in all copies or substantial portions of the Software. +-// +-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +-// USE OR OTHER DEALINGS IN THE SOFTWARE. +- +-var common = require('../common.js'); +-var assert = require('assert'); +-var http = require('http'); +-var msg = 'Hello'; +-var readable_event = false; +-var end_event = false; +-var server = http.createServer(function(req, res) { +- res.writeHead(200, {'Content-Type': 'text/plain'}); +- res.end(msg); +-}).listen(common.PORT, function() { +- http.get({port: common.PORT}, function(res) { +- var data = ''; +- res.on('readable', function() { +- console.log('readable event'); +- readable_event = true; +- data += res.read(); +- }); +- res.on('end', function() { +- console.log('end event'); +- end_event = true; +- assert.strictEqual(msg, data); +- server.close(); +- }); +- }); +-}); +- +-process.on('exit', function() { +- assert(readable_event); +- assert(end_event); +-}); +- +diff --git a/test/simple/test-stream2-large-read-stall.js b/test/simple/test-stream2-large-read-stall.js +index 2fbfbca..667985b 100644 +--- a/test/simple/test-stream2-large-read-stall.js ++++ b/test/simple/test-stream2-large-read-stall.js +@@ -30,7 +30,7 @@ var PUSHSIZE = 20; + var PUSHCOUNT = 1000; + var HWM = 50; + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + var r = new Readable({ + highWaterMark: HWM + }); +@@ -39,23 +39,23 @@ var rs = r._readableState; + r._read = push; + + r.on('readable', function() { +- console.error('>> readable'); ++ //console.error('>> readable'); + do { +- console.error(' > read(%d)', READSIZE); ++ //console.error(' > read(%d)', READSIZE); + var ret = r.read(READSIZE); +- console.error(' < %j (%d remain)', ret && ret.length, rs.length); ++ //console.error(' < %j (%d remain)', ret && ret.length, rs.length); + } while (ret && ret.length === READSIZE); + +- console.error('<< after read()', +- ret && ret.length, +- rs.needReadable, +- rs.length); ++ //console.error('<< after read()', ++ // ret && ret.length, ++ // rs.needReadable, ++ // rs.length); + }); + + var endEmitted = false; + r.on('end', function() { + endEmitted = true; +- console.error('end'); ++ //console.error('end'); + }); + + var pushes = 0; +@@ -64,11 +64,11 @@ function push() { + return; + + if (pushes++ === PUSHCOUNT) { +- console.error(' push(EOF)'); ++ //console.error(' push(EOF)'); + return r.push(null); + } + +- console.error(' push #%d', pushes); ++ //console.error(' push #%d', pushes); + if (r.push(new Buffer(PUSHSIZE))) + setTimeout(push); + } +diff --git a/test/simple/test-stream2-objects.js b/test/simple/test-stream2-objects.js +index 3e6931d..ff47d89 100644 +--- a/test/simple/test-stream2-objects.js ++++ b/test/simple/test-stream2-objects.js +@@ -21,8 +21,8 @@ + + + var common = require('../common.js'); +-var Readable = require('_stream_readable'); +-var Writable = require('_stream_writable'); ++var Readable = require('../../lib/_stream_readable'); ++var Writable = require('../../lib/_stream_writable'); + var assert = require('assert'); + + // tiny node-tap lookalike. +diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js +index cf7531c..e3f3e4e 100644 +--- a/test/simple/test-stream2-pipe-error-handling.js ++++ b/test/simple/test-stream2-pipe-error-handling.js +@@ -21,7 +21,7 @@ + + var common = require('../common'); + var assert = require('assert'); +-var stream = require('stream'); ++var stream = require('../../'); + + (function testErrorListenerCatches() { + var count = 1000; +diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js +index 5e8e3cb..53b2616 100755 +--- a/test/simple/test-stream2-pipe-error-once-listener.js ++++ b/test/simple/test-stream2-pipe-error-once-listener.js +@@ -24,7 +24,7 @@ var common = require('../common.js'); + var assert = require('assert'); + + var util = require('util'); +-var stream = require('stream'); ++var stream = require('../../'); + + + var Read = function() { +diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js +index b63edc3..eb2b0e9 100644 +--- a/test/simple/test-stream2-push.js ++++ b/test/simple/test-stream2-push.js +@@ -20,7 +20,7 @@ + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var common = require('../common.js'); +-var stream = require('stream'); ++var stream = require('../../'); + var Readable = stream.Readable; + var Writable = stream.Writable; + var assert = require('assert'); +diff --git a/test/simple/test-stream2-read-sync-stack.js b/test/simple/test-stream2-read-sync-stack.js +index e8a7305..9740a47 100644 +--- a/test/simple/test-stream2-read-sync-stack.js ++++ b/test/simple/test-stream2-read-sync-stack.js +@@ -21,7 +21,7 @@ + + var common = require('../common'); + var assert = require('assert'); +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + var r = new Readable(); + var N = 256 * 1024; + +diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js +index cd30178..4b1659d 100644 +--- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js ++++ b/test/simple/test-stream2-readable-empty-buffer-no-eof.js +@@ -22,10 +22,9 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('stream').Readable; ++var Readable = require('../../').Readable; + + test1(); +-test2(); + + function test1() { + var r = new Readable(); +@@ -88,31 +87,3 @@ function test1() { + console.log('ok'); + }); + } +- +-function test2() { +- var r = new Readable({ encoding: 'base64' }); +- var reads = 5; +- r._read = function(n) { +- if (!reads--) +- return r.push(null); // EOF +- else +- return r.push(new Buffer('x')); +- }; +- +- var results = []; +- function flow() { +- var chunk; +- while (null !== (chunk = r.read())) +- results.push(chunk + ''); +- } +- r.on('readable', flow); +- r.on('end', function() { +- results.push('EOF'); +- }); +- flow(); +- +- process.on('exit', function() { +- assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); +- console.log('ok'); +- }); +-} +diff --git a/test/simple/test-stream2-readable-from-list.js b/test/simple/test-stream2-readable-from-list.js +index 7c96ffe..04a96f5 100644 +--- a/test/simple/test-stream2-readable-from-list.js ++++ b/test/simple/test-stream2-readable-from-list.js +@@ -21,7 +21,7 @@ + + var assert = require('assert'); + var common = require('../common.js'); +-var fromList = require('_stream_readable')._fromList; ++var fromList = require('../../lib/_stream_readable')._fromList; + + // tiny node-tap lookalike. + var tests = []; +diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js +index 675da8e..51fd3d5 100644 +--- a/test/simple/test-stream2-readable-legacy-drain.js ++++ b/test/simple/test-stream2-readable-legacy-drain.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Stream = require('stream'); ++var Stream = require('../../'); + var Readable = Stream.Readable; + + var r = new Readable(); +diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js +index 7314ae7..c971898 100644 +--- a/test/simple/test-stream2-readable-non-empty-end.js ++++ b/test/simple/test-stream2-readable-non-empty-end.js +@@ -21,7 +21,7 @@ + + var assert = require('assert'); + var common = require('../common.js'); +-var Readable = require('_stream_readable'); ++var Readable = require('../../lib/_stream_readable'); + + var len = 0; + var chunks = new Array(10); +diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js +index 2e5cf25..fd8a3dc 100644 +--- a/test/simple/test-stream2-readable-wrap-empty.js ++++ b/test/simple/test-stream2-readable-wrap-empty.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('_stream_readable'); ++var Readable = require('../../lib/_stream_readable'); + var EE = require('events').EventEmitter; + + var oldStream = new EE(); +diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js +index 90eea01..6b177f7 100644 +--- a/test/simple/test-stream2-readable-wrap.js ++++ b/test/simple/test-stream2-readable-wrap.js +@@ -22,8 +22,8 @@ + var common = require('../common'); + var assert = require('assert'); + +-var Readable = require('_stream_readable'); +-var Writable = require('_stream_writable'); ++var Readable = require('../../lib/_stream_readable'); ++var Writable = require('../../lib/_stream_writable'); + var EE = require('events').EventEmitter; + + var testRuns = 0, completedRuns = 0; +diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js +index 5d2c32a..685531b 100644 +--- a/test/simple/test-stream2-set-encoding.js ++++ b/test/simple/test-stream2-set-encoding.js +@@ -22,7 +22,7 @@ + + var common = require('../common.js'); + var assert = require('assert'); +-var R = require('_stream_readable'); ++var R = require('../../lib/_stream_readable'); + var util = require('util'); + + // tiny node-tap lookalike. +diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js +index 9c9ddd8..a0cacc6 100644 +--- a/test/simple/test-stream2-transform.js ++++ b/test/simple/test-stream2-transform.js +@@ -21,8 +21,8 @@ + + var assert = require('assert'); + var common = require('../common.js'); +-var PassThrough = require('_stream_passthrough'); +-var Transform = require('_stream_transform'); ++var PassThrough = require('../../').PassThrough; ++var Transform = require('../../').Transform; + + // tiny node-tap lookalike. + var tests = []; +diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js +index d66dc3c..365b327 100644 +--- a/test/simple/test-stream2-unpipe-drain.js ++++ b/test/simple/test-stream2-unpipe-drain.js +@@ -22,7 +22,7 @@ + + var common = require('../common.js'); + var assert = require('assert'); +-var stream = require('stream'); ++var stream = require('../../'); + var crypto = require('crypto'); + + var util = require('util'); +diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js +index 99f8746..17c92ae 100644 +--- a/test/simple/test-stream2-unpipe-leak.js ++++ b/test/simple/test-stream2-unpipe-leak.js +@@ -22,7 +22,7 @@ + + var common = require('../common.js'); + var assert = require('assert'); +-var stream = require('stream'); ++var stream = require('../../'); + + var chunk = new Buffer('hallo'); + +diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js +index 704100c..209c3a6 100644 +--- a/test/simple/test-stream2-writable.js ++++ b/test/simple/test-stream2-writable.js +@@ -20,8 +20,8 @@ + // USE OR OTHER DEALINGS IN THE SOFTWARE. + + var common = require('../common.js'); +-var W = require('_stream_writable'); +-var D = require('_stream_duplex'); ++var W = require('../../').Writable; ++var D = require('../../').Duplex; + var assert = require('assert'); + + var util = require('util'); +diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js +index b91bde3..2f72c15 100644 +--- a/test/simple/test-stream3-pause-then-read.js ++++ b/test/simple/test-stream3-pause-then-read.js +@@ -22,7 +22,7 @@ + var common = require('../common'); + var assert = require('assert'); + +-var stream = require('stream'); ++var stream = require('../../'); + var Readable = stream.Readable; + var Writable = stream.Writable; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..b513d61a963a40 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,89 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +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. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..895ca50a1d208a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,46 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..19ab3588984252 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,951 @@ +// 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. + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +var Stream = require('stream'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var StringDecoder; + + +/**/ +var debug = require('util'); +if (debug && debug.debuglog) { + debug = debug.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = options.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // 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; + + + // 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; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + var Duplex = require('./_stream_duplex'); + + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + 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 (util.isString(chunk) && !state.objectMode) { + 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); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (util.isNullOrUndefined(chunk)) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + if (!addToFront) + state.reading = false; + + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + + if (state.needReadable) + emitReadable(stream); + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (isNaN(n) || util.isNull(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (!util.isNumber(n) || 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 (util.isNull(ret)) { + 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 (!util.isNull(ret)) + this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!util.isBuffer(chunk) && + !util.isString(chunk) && + !util.isNullOrUndefined(chunk) && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + 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) + process.nextTick(function() { + 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; + process.nextTick(function() { + 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) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && + (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + debug('false write response, pause', + src._readableState.awaitDrain); + src._readableState.awaitDrain++; + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + var self = this; + process.nextTick(function() { + debug('readable nexttick read 0'); + self.read(0); + }); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// 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; + if (!state.reading) { + debug('resume read 0'); + this.read(0); + } + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(function() { + resume_(stream, state); + }); + } +} + +function resume_(stream, state) { + 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); + if (!chunk || !state.objectMode && !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 (util.isFunction(stream[i]) && util.isUndefined(this[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) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..905c5e450758b3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,209 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// 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. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (!util.isNullOrUndefined(data)) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(options, 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; + + this.once('prefinish', function() { + if (util.isFunction(this._flush)) + 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 (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..db8539cd5b818d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,477 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = options.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + + // 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.buffer = []; + + // 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; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + 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, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// 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 (!util.isBuffer(chunk) && + !util.isString(chunk) && + !util.isNullOrUndefined(chunk) && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (util.isFunction(encoding)) { + cb = encoding; + encoding = null; + } + + if (util.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (!util.isFunction(cb)) + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, 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.buffer.length) + clearBuffer(this, state); + } +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + util.isString(chunk)) { + 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 (util.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) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + 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) { + if (sync) + process.nextTick(function() { + state.pendingcb--; + cb(er); + }); + else { + state.pendingcb--; + 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(stream, state); + + if (!finished && + !state.corked && + !state.bufferProcessing && + state.buffer.length) { + clearBuffer(stream, state); + } + + if (sync) { + process.nextTick(function() { + 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; + + if (stream._writev && state.buffer.length > 1) { + // Fast case, write everything using _writev() + var cbs = []; + for (var c = 0; c < state.buffer.length; c++) + cbs.push(state.buffer[c].callback); + + // count the one we are adding, as well. + // TODO(isaacs) clean this up + state.pendingcb++; + doWrite(stream, state, true, state.length, state.buffer, '', function(err) { + for (var i = 0; i < cbs.length; i++) { + state.pendingcb--; + cbs[i](err); + } + }); + + // Clear buffer + state.buffer = []; + } else { + // Slow case, write chunks one-by-one + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + 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); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; + } + + 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 (util.isFunction(chunk)) { + cb = chunk; + chunk = null; + encoding = null; + } else if (util.isFunction(encoding)) { + cb = encoding; + encoding = null; + } + + if (!util.isNullOrUndefined(chunk)) + 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(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, 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) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000000000..9074e8ebcb61e9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000000000..4eb9ce4f3c1bf8 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,54 @@ +{ + "name": "core-util-is", + "version": "1.0.1", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/isaacs/core-util-is", + "_id": "core-util-is@1.0.1", + "dist": { + "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + }, + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_npmVersion": "1.3.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", + "scripts": {} +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js new file mode 100644 index 00000000000000..007fa10575636d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js @@ -0,0 +1,106 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return arg instanceof Buffer; +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000000000..052a62b8d7b7ae --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,54 @@ + +# isarray + +`Array#isArray` for older browsers. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js new file mode 100644 index 00000000000000..e1856ef0943728 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,208 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000000000..9e31b683889015 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000000000..5f5ad45d46dda9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000000000..fc7904b67b9191 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,54 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "*" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "isarray@0.0.1", + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "_from": "isarray@0.0.1", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000000000..206320cc1d21b9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..6de584a48f5c89 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..4d2aa001501107 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000000000..b00e54fb790982 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..0364d54ba46af6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..295adce7133f66 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json @@ -0,0 +1,70 @@ +{ + "name": "readable-stream", + "version": "1.1.13", + "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, + "devDependencies": { + "tap": "~0.2.6" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "gitHead": "3b672fd7ae92acf5b4ffdbabf74b372a0a56b051", + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "homepage": "https://github.com/isaacs/readable-stream", + "_id": "readable-stream@1.1.13", + "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", + "_from": "readable-stream@>=1.1.9 <1.2.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..27e8d8a55165f9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..09b8bf5091a82e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = require('stream'); +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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..5d482f0780e993 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..e1e9efdf3c12e9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml new file mode 100644 index 00000000000000..cc4dba29d959a2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE new file mode 100644 index 00000000000000..11adfaec9e7f95 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE @@ -0,0 +1,35 @@ +/* + Copyright (c) 2010, Linden Research, Inc. + Copyright (c) 2012, Joshua Bell + + 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. + $/LicenseInfo$ + */ + +// Original can be found at: +// https://bitbucket.org/lindenlab/llsd +// Modifications by Joshua Bell inexorabletash@gmail.com +// https://github.com/inexorabletash/polyfill + +// ES3/ES5 implementation of the Krhonos Typed Array Specification +// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ +// Date: 2011-02-01 +// +// Variations: +// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js new file mode 100644 index 00000000000000..8423d7c9b1c327 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js @@ -0,0 +1,4 @@ +var Uint8Array = require('../').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js new file mode 100644 index 00000000000000..5e540841f43241 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js @@ -0,0 +1,630 @@ +var undefined = (void 0); // Paranoia + +// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to +// create, and consume so much memory, that the browser appears frozen. +var MAX_ARRAY_LENGTH = 1e5; + +// Approximations of internal ECMAScript conversion functions +var ECMAScript = (function() { + // Stash a copy in case other scripts modify these + var opts = Object.prototype.toString, + ophop = Object.prototype.hasOwnProperty; + + return { + // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: + Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, + HasProperty: function(o, p) { return p in o; }, + HasOwnProperty: function(o, p) { return ophop.call(o, p); }, + IsCallable: function(o) { return typeof o === 'function'; }, + ToInt32: function(v) { return v >> 0; }, + ToUint32: function(v) { return v >>> 0; } + }; +}()); + +// Snapshot intrinsics +var LN2 = Math.LN2, + abs = Math.abs, + floor = Math.floor, + log = Math.log, + min = Math.min, + pow = Math.pow, + round = Math.round; + +// ES5: lock down object properties +function configureProperties(obj) { + if (getOwnPropNames && defineProp) { + var props = getOwnPropNames(obj), i; + for (i = 0; i < props.length; i += 1) { + defineProp(obj, props[i], { + value: obj[props[i]], + writable: false, + enumerable: false, + configurable: false + }); + } + } +} + +// emulate ES5 getter/setter API using legacy APIs +// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx +// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but +// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) +var defineProp +if (Object.defineProperty && (function() { + try { + Object.defineProperty({}, 'x', {}); + return true; + } catch (e) { + return false; + } + })()) { + defineProp = Object.defineProperty; +} else { + defineProp = function(o, p, desc) { + if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); + if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } + if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } + if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } + return o; + }; +} + +var getOwnPropNames = Object.getOwnPropertyNames || function (o) { + if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); + var props = [], p; + for (p in o) { + if (ECMAScript.HasOwnProperty(o, p)) { + props.push(p); + } + } + return props; +}; + +// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) +// for index in 0 ... obj.length +function makeArrayAccessors(obj) { + if (!defineProp) { return; } + + if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); + + function makeArrayAccessor(index) { + defineProp(obj, index, { + 'get': function() { return obj._getter(index); }, + 'set': function(v) { obj._setter(index, v); }, + enumerable: true, + configurable: false + }); + } + + var i; + for (i = 0; i < obj.length; i += 1) { + makeArrayAccessor(i); + } +} + +// Internal conversion functions: +// pack() - take a number (interpreted as Type), output a byte array +// unpack() - take a byte array, output a Type-like number + +function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } +function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } + +function packI8(n) { return [n & 0xff]; } +function unpackI8(bytes) { return as_signed(bytes[0], 8); } + +function packU8(n) { return [n & 0xff]; } +function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } + +function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } + +function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } + +function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } + +function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packIEEE754(v, ebits, fbits) { + + var bias = (1 << (ebits - 1)) - 1, + s, e, f, ln, + i, bits, str, bytes; + + function roundToEven(n) { + var w = floor(n), f = n - w; + if (f < 0.5) + return w; + if (f > 0.5) + return w + 1; + return w % 2 ? w + 1 : w; + } + + // Compute sign, exponent, fraction + if (v !== v) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; + } else if (v === Infinity || v === -Infinity) { + e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; + } else if (v === 0) { + e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; + } else { + s = v < 0; + v = abs(v); + + if (v >= pow(2, 1 - bias)) { + e = min(floor(log(v) / LN2), 1023); + f = roundToEven(v / pow(2, e) * pow(2, fbits)); + if (f / pow(2, fbits) >= 2) { + e = e + 1; + f = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + f = 0; + } else { + // Normalized + e = e + bias; + f = f - pow(2, fbits); + } + } else { + // Denormalized + e = 0; + f = roundToEven(v / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } + for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } + bits.push(s ? 1 : 0); + bits.reverse(); + str = bits.join(''); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +} + +function unpackIEEE754(bytes, ebits, fbits) { + + // Bytes to bits + var bits = [], i, j, b, str, + bias, s, e, f; + + for (i = bytes.length; i; i -= 1) { + b = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(b % 2 ? 1 : 0); b = b >> 1; + } + } + bits.reverse(); + str = bits.join(''); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + s = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + f = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) { + return f !== 0 ? NaN : s * Infinity; + } else if (e > 0) { + // Normalized + return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); + } else if (f !== 0) { + // Denormalized + return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); + } else { + return s < 0 ? -0 : 0; + } +} + +function unpackF64(b) { return unpackIEEE754(b, 11, 52); } +function packF64(v) { return packIEEE754(v, 11, 52); } +function unpackF32(b) { return unpackIEEE754(b, 8, 23); } +function packF32(v) { return packIEEE754(v, 8, 23); } + + +// +// 3 The ArrayBuffer Type +// + +(function() { + + /** @constructor */ + var ArrayBuffer = function ArrayBuffer(length) { + length = ECMAScript.ToInt32(length); + if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); + + this.byteLength = length; + this._bytes = []; + this._bytes.length = length; + + var i; + for (i = 0; i < this.byteLength; i += 1) { + this._bytes[i] = 0; + } + + configureProperties(this); + }; + + exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; + + // + // 4 The ArrayBufferView Type + // + + // NOTE: this constructor is not exported + /** @constructor */ + var ArrayBufferView = function ArrayBufferView() { + //this.buffer = null; + //this.byteOffset = 0; + //this.byteLength = 0; + }; + + // + // 5 The Typed Array View Types + // + + function makeConstructor(bytesPerElement, pack, unpack) { + // Each TypedArray type requires a distinct constructor instance with + // identical logic, which this produces. + + var ctor; + ctor = function(buffer, byteOffset, length) { + var array, sequence, i, s; + + if (!arguments.length || typeof arguments[0] === 'number') { + // Constructor(unsigned long length) + this.length = ECMAScript.ToInt32(arguments[0]); + if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); + + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { + // Constructor(TypedArray array) + array = arguments[0]; + + this.length = array.length; + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + this._setter(i, array._getter(i)); + } + } else if (typeof arguments[0] === 'object' && + !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(sequence array) + sequence = arguments[0]; + + this.length = ECMAScript.ToUint32(sequence.length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + s = sequence[i]; + this._setter(i, Number(s)); + } + } else if (typeof arguments[0] === 'object' && + (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, optional unsigned long length) + this.buffer = buffer; + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (this.byteOffset % this.BYTES_PER_ELEMENT) { + // The given byteOffset must be a multiple of the element + // size of the specific type, otherwise an exception is raised. + throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + + if (this.byteLength % this.BYTES_PER_ELEMENT) { + throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); + } + this.length = this.byteLength / this.BYTES_PER_ELEMENT; + } else { + this.length = ECMAScript.ToUint32(length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + + this.constructor = ctor; + + configureProperties(this); + makeArrayAccessors(this); + }; + + ctor.prototype = new ArrayBufferView(); + ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; + ctor.prototype._pack = pack; + ctor.prototype._unpack = unpack; + ctor.BYTES_PER_ELEMENT = bytesPerElement; + + // getter type (unsigned long index); + ctor.prototype._getter = function(index) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = [], i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + bytes.push(this.buffer._bytes[o]); + } + return this._unpack(bytes); + }; + + // NONSTANDARD: convenience alias for getter: type get(unsigned long index); + ctor.prototype.get = ctor.prototype._getter; + + // setter void (unsigned long index, type value); + ctor.prototype._setter = function(index, value) { + if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = this._pack(value), i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + this.buffer._bytes[o] = bytes[i]; + } + }; + + // void set(TypedArray array, optional unsigned long offset); + // void set(sequence array, optional unsigned long offset); + ctor.prototype.set = function(index, value) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + var array, sequence, offset, len, + i, s, d, + byteOffset, byteLength, tmp; + + if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { + // void set(TypedArray array, optional unsigned long offset); + array = arguments[0]; + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + array.length > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; + byteLength = array.length * this.BYTES_PER_ELEMENT; + + if (array.buffer === this.buffer) { + tmp = []; + for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { + tmp[i] = array.buffer._bytes[s]; + } + for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { + this.buffer._bytes[d] = tmp[i]; + } + } else { + for (i = 0, s = array.byteOffset, d = byteOffset; + i < byteLength; i += 1, s += 1, d += 1) { + this.buffer._bytes[d] = array.buffer._bytes[s]; + } + } + } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { + // void set(sequence array, optional unsigned long offset); + sequence = arguments[0]; + len = ECMAScript.ToUint32(sequence.length); + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + len > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + for (i = 0; i < len; i += 1) { + s = sequence[i]; + this._setter(offset + i, Number(s)); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + }; + + // TypedArray subarray(long begin, optional long end); + ctor.prototype.subarray = function(start, end) { + function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } + + start = ECMAScript.ToInt32(start); + end = ECMAScript.ToInt32(end); + + if (arguments.length < 1) { start = 0; } + if (arguments.length < 2) { end = this.length; } + + if (start < 0) { start = this.length + start; } + if (end < 0) { end = this.length + end; } + + start = clamp(start, 0, this.length); + end = clamp(end, 0, this.length); + + var len = end - start; + if (len < 0) { + len = 0; + } + + return new this.constructor( + this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); + }; + + return ctor; + } + + var Int8Array = makeConstructor(1, packI8, unpackI8); + var Uint8Array = makeConstructor(1, packU8, unpackU8); + var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); + var Int16Array = makeConstructor(2, packI16, unpackI16); + var Uint16Array = makeConstructor(2, packU16, unpackU16); + var Int32Array = makeConstructor(4, packI32, unpackI32); + var Uint32Array = makeConstructor(4, packU32, unpackU32); + var Float32Array = makeConstructor(4, packF32, unpackF32); + var Float64Array = makeConstructor(8, packF64, unpackF64); + + exports.Int8Array = exports.Int8Array || Int8Array; + exports.Uint8Array = exports.Uint8Array || Uint8Array; + exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; + exports.Int16Array = exports.Int16Array || Int16Array; + exports.Uint16Array = exports.Uint16Array || Uint16Array; + exports.Int32Array = exports.Int32Array || Int32Array; + exports.Uint32Array = exports.Uint32Array || Uint32Array; + exports.Float32Array = exports.Float32Array || Float32Array; + exports.Float64Array = exports.Float64Array || Float64Array; +}()); + +// +// 6 The DataView View Type +// + +(function() { + function r(array, index) { + return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; + } + + var IS_BIG_ENDIAN = (function() { + var u16array = new(exports.Uint16Array)([0x1234]), + u8array = new(exports.Uint8Array)(u16array.buffer); + return r(u8array, 0) === 0x12; + }()); + + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, + // optional unsigned long byteLength) + /** @constructor */ + var DataView = function DataView(buffer, byteOffset, byteLength) { + if (arguments.length === 0) { + buffer = new exports.ArrayBuffer(0); + } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { + throw new TypeError("TypeError"); + } + + this.buffer = buffer || new exports.ArrayBuffer(0); + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + } else { + this.byteLength = ECMAScript.ToUint32(byteLength); + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + + configureProperties(this); + }; + + function makeGetter(arrayType) { + return function(byteOffset, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + byteOffset += this.byteOffset; + + var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), + bytes = [], i; + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(uint8Array, i)); + } + + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); + }; + } + + DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); + DataView.prototype.getInt8 = makeGetter(exports.Int8Array); + DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); + DataView.prototype.getInt16 = makeGetter(exports.Int16Array); + DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); + DataView.prototype.getInt32 = makeGetter(exports.Int32Array); + DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); + DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); + + function makeSetter(arrayType) { + return function(byteOffset, value, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + + // Get bytes + var typeArray = new arrayType([value]), + byteArray = new exports.Uint8Array(typeArray.buffer), + bytes = [], i, byteView; + + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(byteArray, i)); + } + + // Flip if necessary + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + // Write them + byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); + byteView.set(bytes); + }; + } + + DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); + DataView.prototype.setInt8 = makeSetter(exports.Int8Array); + DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); + DataView.prototype.setInt16 = makeSetter(exports.Int16Array); + DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); + DataView.prototype.setInt32 = makeSetter(exports.Int32Array); + DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); + DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); + + exports.DataView = exports.DataView || DataView; + +}()); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json new file mode 100644 index 00000000000000..b8b59f5c303991 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json @@ -0,0 +1,79 @@ +{ + "name": "typedarray", + "version": "0.0.6", + "description": "TypedArray polyfill for old browsers", + "main": "index.js", + "devDependencies": { + "tape": "~2.3.2" + }, + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/typedarray.git" + }, + "homepage": "https://github.com/substack/typedarray", + "keywords": [ + "ArrayBuffer", + "DataView", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "typed", + "array", + "polyfill" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "bugs": { + "url": "https://github.com/substack/typedarray/issues" + }, + "_id": "typedarray@0.0.6", + "dist": { + "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + }, + "_from": "typedarray@>=0.0.5 <0.1.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown new file mode 100644 index 00000000000000..d18f6f7197e6a5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown @@ -0,0 +1,61 @@ +# typedarray + +TypedArray polyfill ripped from [this +module](https://raw.github.com/inexorabletash/polyfill). + +[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) + +[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) + +# example + +``` js +var Uint8Array = require('typedarray').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); +``` + +output: + +``` +55 +``` + +# methods + +``` js +var TA = require('typedarray') +``` + +The `TA` object has the following constructors: + +* TA.ArrayBuffer +* TA.DataView +* TA.Float32Array +* TA.Float64Array +* TA.Int8Array +* TA.Int16Array +* TA.Int32Array +* TA.Uint8Array +* TA.Uint8ClampedArray +* TA.Uint16Array +* TA.Uint32Array + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install typedarray +``` + +To use this module in the browser, compile with +[browserify](http://browserify.org) +or download a UMD build from browserify CDN: + +http://wzrd.in/standalone/typedarray@latest + +# license + +MIT diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js new file mode 100644 index 00000000000000..e57dabdcebc9c1 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -0,0 +1,19 @@ +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/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js new file mode 100644 index 00000000000000..df596a34f23c0e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js @@ -0,0 +1,10 @@ +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/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json new file mode 100644 index 00000000000000..0cdb8416da0cef --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -0,0 +1,78 @@ +{ + "name": "concat-stream", + "version": "1.4.7", + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "tags": [ + "stream", + "simple", + "util", + "utility" + ], + "author": { + "name": "Max Ogden", + "email": "max@maxogden.com" + }, + "repository": { + "type": "git", + "url": "http://github.com/maxogden/concat-stream.git" + }, + "bugs": { + "url": "http://github.com/maxogden/concat-stream/issues" + }, + "engines": [ + "node >= 0.8" + ], + "main": "index.js", + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "license": "MIT", + "dependencies": { + "inherits": "~2.0.1", + "typedarray": "~0.0.5", + "readable-stream": "~1.1.9" + }, + "devDependencies": { + "tape": "~2.3.2" + }, + "testling": { + "files": "test/*.js", + "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" + ] + }, + "gitHead": "41edc57536490dce9f015131c29a6470c9412b27", + "homepage": "https://github.com/maxogden/concat-stream", + "_id": "concat-stream@1.4.7", + "_shasum": "0ceaa47b87a581d2a7a782b92b81d5020c3f9925", + "_from": "concat-stream@>=1.4.6 <2.0.0", + "_npmVersion": "2.1.8", + "_nodeVersion": "0.10.28", + "_npmUser": { + "name": "maxogden", + "email": "max@maxogden.com" + }, + "maintainers": [ + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "dist": { + "shasum": "0ceaa47b87a581d2a7a782b92b81d5020c3f9925", + "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md new file mode 100644 index 00000000000000..487b5000b7e0c6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -0,0 +1,84 @@ +# concat-stream + +Writable stream that concatenates strings or binary data and calls a callback with the result. Not a transform stream -- more of a stream sink. + +[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/) + +### examples + +#### Buffers + +```js +var fs = require('fs') +var concat = require('concat-stream') + +var readStream = fs.createReadStream('cat.png') +var concatStream = concat(gotPicture) + +readStream.on('error', handleError) +readStream.pipe(concatStream) + +function gotPicture(imageBuffer) { + // imageBuffer is all of `cat.png` as a node.js Buffer +} + +function handleError(err) { + // handle your error appropriately here, e.g.: + console.error(err) // print the error to STDERR + process.exit(1) // exit program with non-zero exit code +} + +``` + +#### Arrays + +```js +var write = concat(function(data) {}) +write.write([1,2,3]) +write.write([4,5,6]) +write.end() +// data will be [1,2,3,4,5,6] in the above callback +``` + +#### Uint8Arrays + +```js +var write = concat(function(data) {}) +var a = new Uint8Array(3) +a[0] = 97; a[1] = 98; a[2] = 99 +write.write(a) +write.write('!') +write.end(Buffer('!!1')) +``` + +See `test/` for more examples + +# methods + +```js +var concat = require('concat-stream') +``` + +## var writable = concat(opts={}, cb) + +Return a `writable` stream that will fire `cb(data)` with all of the data that +was written to the stream. Data can be written to `writable` as strings, +Buffers, arrays of byte integers, and Uint8Arrays. + +By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. + +* `string` - get a string +* `buffer` - get back a Buffer +* `array` - get an array of byte integers +* `uint8array`, `u8`, `uint8` - get back a Uint8Array +* `object`, get back an array of Objects + +If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't int he list above), it will try to convert concat them into a `Buffer`. + +# error handling + +`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. + +# license + +MIT LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/array.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/array.js new file mode 100644 index 00000000000000..86e7dd43bf35bd --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/array.js @@ -0,0 +1,12 @@ +var concat = require('../') +var test = require('tape') + +test('array stream', function (t) { + t.plan(1) + var arrays = concat({ encoding: 'array' }, function(out) { + t.deepEqual(out, [1,2,3,4,5,6]) + }) + arrays.write([1,2,3]) + arrays.write([4,5,6]) + arrays.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/buffer.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/buffer.js new file mode 100644 index 00000000000000..d28f5f9c1e2da3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/buffer.js @@ -0,0 +1,31 @@ +var concat = require('../') +var test = require('tape') +var TA = require('typedarray') +var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array + +test('buffer stream', function (t) { + t.plan(2) + var buffers = concat(function(out) { + t.ok(Buffer.isBuffer(out)) + t.equal(out.toString('utf8'), 'pizza Array is not a stringy cat') + }) + buffers.write(new Buffer('pizza Array is not a ', 'utf8')) + buffers.write(new Buffer('stringy cat')) + buffers.end() +}) + +test('buffer mixed writes', function (t) { + t.plan(2) + var buffers = concat(function(out) { + t.ok(Buffer.isBuffer(out)) + t.equal(out.toString('utf8'), 'pizza Array is not a stringy cat555') + }) + buffers.write(new Buffer('pizza')) + buffers.write(' Array is not a ') + buffers.write([ 115, 116, 114, 105, 110, 103, 121 ]) + var u8 = new U8(4) + u8[0] = 32; u8[1] = 99; u8[2] = 97; u8[3] = 116 + buffers.write(u8) + buffers.write(555) + buffers.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/infer.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/infer.js new file mode 100644 index 00000000000000..91ab933f458098 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/infer.js @@ -0,0 +1,15 @@ +var concat = require('../') +var test = require('tape') + +test('type inference works as expected', function(t) { + var stream = concat() + t.equal(stream.inferEncoding(['hello']), 'array', 'array') + t.equal(stream.inferEncoding(new Buffer('hello')), 'buffer', 'buffer') + t.equal(stream.inferEncoding(undefined), 'buffer', 'buffer') + t.equal(stream.inferEncoding(new Uint8Array(1)), 'uint8array', 'uint8array') + t.equal(stream.inferEncoding('hello'), 'string', 'string') + t.equal(stream.inferEncoding(''), 'string', 'string') + t.equal(stream.inferEncoding({hello: "world"}), 'object', 'object') + t.equal(stream.inferEncoding(1), 'buffer', 'buffer') + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/nothing.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/nothing.js new file mode 100644 index 00000000000000..6ac60496582ae3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/nothing.js @@ -0,0 +1,25 @@ +var concat = require('../') +var test = require('tape') + +test('no callback stream', function (t) { + var stream = concat() + stream.write('space') + stream.end(' cats') + t.end() +}) + +test('no encoding set, no data', function (t) { + var stream = concat(function(data) { + t.deepEqual(data, []) + t.end() + }) + stream.end() +}) + +test('encoding set to string, no data', function (t) { + var stream = concat({ encoding: 'string' }, function(data) { + t.deepEqual(data, '') + t.end() + }) + stream.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/objects.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/objects.js new file mode 100644 index 00000000000000..ad921ed25b9852 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/objects.js @@ -0,0 +1,29 @@ +var concat = require('../') +var test = require('tape') + +test('writing objects', function (t) { + var stream = concat({encoding: "objects"}, concatted) + function concatted(objs) { + t.equal(objs.length, 2) + t.deepEqual(objs[0], {"foo": "bar"}) + t.deepEqual(objs[1], {"baz": "taco"}) + } + stream.write({"foo": "bar"}) + stream.write({"baz": "taco"}) + stream.end() + t.end() +}) + + +test('switch to objects encoding if no encoding specified and objects are written', function (t) { + var stream = concat(concatted) + function concatted(objs) { + t.equal(objs.length, 2) + t.deepEqual(objs[0], {"foo": "bar"}) + t.deepEqual(objs[1], {"baz": "taco"}) + } + stream.write({"foo": "bar"}) + stream.write({"baz": "taco"}) + stream.end() + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/server/ls.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/server/ls.js new file mode 100644 index 00000000000000..3258d8ddcbe38b --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/server/ls.js @@ -0,0 +1,16 @@ +var concat = require('../../') +var spawn = require('child_process').spawn +var exec = require('child_process').exec +var test = require('tape') + +test('ls command', function (t) { + t.plan(1) + var cmd = spawn('ls', [ __dirname ]) + cmd.stdout.pipe( + concat(function(out) { + exec('ls ' + __dirname, function (err, body) { + t.equal(out.toString('utf8'), body.toString('utf8')) + }) + }) + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/string.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/string.js new file mode 100644 index 00000000000000..b20d4dd5777dc5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/string.js @@ -0,0 +1,76 @@ +var concat = require('../') +var test = require('tape') +var TA = require('typedarray') +var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array + +test('string -> buffer stream', function (t) { + t.plan(2) + var strings = concat({ encoding: 'buffer'}, function(out) { + t.ok(Buffer.isBuffer(out)) + t.equal(out.toString('utf8'), 'nacho dogs') + }) + strings.write("nacho ") + strings.write("dogs") + strings.end() +}) + +test('string stream', function (t) { + t.plan(2) + var strings = concat({ encoding: 'string' }, function(out) { + t.equal(typeof out, 'string') + t.equal(out, 'nacho dogs') + }) + strings.write("nacho ") + strings.write("dogs") + strings.end() +}) + +test('end chunk', function (t) { + t.plan(1) + var endchunk = concat({ encoding: 'string' }, function(out) { + t.equal(out, 'this is the end') + }) + endchunk.write("this ") + endchunk.write("is the ") + endchunk.end("end") +}) + +test('string from mixed write encodings', function (t) { + t.plan(2) + var strings = concat({ encoding: 'string' }, function(out) { + t.equal(typeof out, 'string') + t.equal(out, 'nacho dogs') + }) + strings.write('na') + strings.write(Buffer('cho')) + strings.write([ 32, 100 ]) + var u8 = new U8(3) + u8[0] = 111; u8[1] = 103; u8[2] = 115; + strings.end(u8) +}) + +test('string from buffers with multibyte characters', function (t) { + t.plan(2) + var strings = concat({ encoding: 'string' }, function(out) { + t.equal(typeof out, 'string') + t.equal(out, '☃☃☃☃☃☃☃☃') + }) + var snowman = new Buffer('☃') + for (var i = 0; i < 8; i++) { + strings.write(snowman.slice(0, 1)) + strings.write(snowman.slice(1)) + } + strings.end() +}) + +test('string infer encoding with empty string chunk', function (t) { + t.plan(2) + var strings = concat(function(out) { + t.equal(typeof out, 'string') + t.equal(out, 'nacho dogs') + }) + strings.write("") + strings.write("nacho ") + strings.write("dogs") + strings.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/typedarray.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/typedarray.js new file mode 100644 index 00000000000000..ee07110828a9ac --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/test/typedarray.js @@ -0,0 +1,33 @@ +var concat = require('../') +var test = require('tape') +var TA = require('typedarray') +var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array + +test('typed array stream', function (t) { + t.plan(2) + var a = new U8(5) + a[0] = 97; a[1] = 98; a[2] = 99; a[3] = 100; a[4] = 101; + var b = new U8(3) + b[0] = 32; b[1] = 102; b[2] = 103; + var c = new U8(4) + c[0] = 32; c[1] = 120; c[2] = 121; c[3] = 122; + + var arrays = concat({ encoding: 'Uint8Array' }, function(out) { + t.equal(typeof out.subarray, 'function') + t.deepEqual(Buffer(out).toString('utf8'), 'abcde fg xyz') + }) + arrays.write(a) + arrays.write(b) + arrays.end(c) +}) + +test('typed array from strings, buffers, and arrays', function (t) { + t.plan(2) + var arrays = concat({ encoding: 'Uint8Array' }, function(out) { + t.equal(typeof out.subarray, 'function') + t.deepEqual(Buffer(out).toString('utf8'), 'abcde fg xyz') + }) + arrays.write('abcde') + arrays.write(Buffer(' fg ')) + arrays.end([ 120, 121, 122 ]) +}) diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index f9c447ee2be5a3..e98b732f7f4755 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -6,7 +6,7 @@ }, "name": "npm-registry-client", "description": "Client for the npm registry", - "version": "3.2.4", + "version": "4.0.5", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -16,12 +16,12 @@ }, "dependencies": { "chownr": "0", + "concat-stream": "^1.4.6", "graceful-fs": "^3.0.0", "mkdirp": "^0.5.0", "normalize-package-data": "~1.0.1", - "npm-cache-filename": "^1.0.0", "once": "^1.3.0", - "request": "2 >=2.25.0", + "request": "^2.47.0", "retry": "^0.6.1", "rimraf": "2", "semver": "2 >=2.2.1 || 3.x || 4", @@ -29,22 +29,21 @@ "npmlog": "" }, "devDependencies": { - "concat-stream": "^1.4.6", - "npmconf": "^2.1.0", + "negotiator": "^0.4.9", "tap": "" }, "optionalDependencies": { "npmlog": "" }, "license": "ISC", - "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"npm://registry.npmjs.org/npm\"\nvar options = {timeout: 1000}\n\nclient.get(uri, options, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (for the base URL, any path\nwill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\n`npm` URLs are `https` URLs with the additional restrictions that they will\nalways include authorization credentials, and the response is always registry\nmetadata (and not tarballs or other attachments).\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `cert` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates\n* `key` {String} Private key (PEM encoded) for client certificate 'cert'\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, uri, options, cb)\n\n* `method` {String} HTTP method\n* `uri` {String} URI pointing to the resource to request\n* `options` {Object} Object containing optional per-request properties.\n * `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n * `etag` {String} The cached ETag\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers around\n`request`.\n\n# client.adduser(base, username, password, email, cb)\n\n* `base` {String} Base registry URL\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.deprecate(uri, version, message, cb)\n\n* `uri` {String} Full registry URI for the deprecated package\n* `version` {String} Semver version range\n* `message` {String} The message to use as a deprecation warning\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n# client.bugs(uri, cb)\n\n* `uri` {String} Full registry URI for the package\n* `cb` {Function}\n\nGet the url for bugs of a package\n\n# client.get(uri, options, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `options` {Object} Object containing optional per-request properties.\n * `timeout` {Number} Duration before the request times out.\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n * `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag.\n\n# client.publish(uri, data, tarball, cb)\n\n* `uri` {String} The registry URI to publish to\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it can\naccept a gzipped tar stream or a filename to a tarball.\n\n# client.star(uri, starred, cb)\n\n* `uri` {String} The complete registry URI to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n# client.stars(base, username, cb)\n\n* `base` {String} The base URL for the registry\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(uri, version, tag, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n# client.unpublish(uri, [ver], cb)\n\n* `uri` {String} The complete registry URI to unpublish\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n# client.upload(uri, file, [etag], [nofollow], cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", + "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"npm://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Cerficate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n", "readmeFilename": "README.md", - "gitHead": "ddafd4913bdca30a1f9111660767f71653604b57", + "gitHead": "33bd08aa65bb26ba1b956d2f119b5e952f4d3141", "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" }, "homepage": "https://github.com/isaacs/npm-registry-client", - "_id": "npm-registry-client@3.2.4", - "_shasum": "8659b3449e1c9a9f8181dad142cadb048bfe521f", - "_from": "npm-registry-client@>=3.2.4 <3.3.0" + "_id": "npm-registry-client@4.0.5", + "_shasum": "27d37ca0c7bbd5df14f4ae35223a4d588dd4fea6", + "_from": "npm-registry-client@>=4.0.5 <4.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js index 57dca0b520d3e5..3789fc954b880d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js @@ -5,20 +5,27 @@ var common = require("./lib/common.js") var client = common.freshClient() var password = "%1234@asdf%" -, username = "username" -, email = "i@izs.me" -, userdata = { - name: username, - email: email, - _id: "org.couchdb.user:username", - type: "user", - roles: [], - date: "2012-06-07T04:11:21.591Z" } -, SD = require("string_decoder").StringDecoder -, decoder = new SD() + , username = "username" + , email = "i@izs.me" + , userdata = { + name: username, + email: email, + _id: "org.couchdb.user:username", + type: "user", + roles: [], + date: "2012-06-07T04:11:21.591Z" } + , SD = require("string_decoder").StringDecoder + , decoder = new SD() tap.test("create new user account", function (t) { - server.expect("/-/user/org.couchdb.user:username", function (req, res) { + var auth = { + username : username, + password : password, + email : email + } + var params = { auth : auth } + + server.expect("/registry/_design/app/_rewrite/-/user/org.couchdb.user:username", function (req, res) { t.equal(req.method, "PUT") var b = "" req.on("data", function (d) { @@ -32,13 +39,17 @@ tap.test("create new user account", function (t) { t.deepEqual(o, userdata) res.statusCode = 201 - res.json({created:true}) + res.json(auth) }) }) - client.adduser("http://localhost:1337/", username, password, email, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - t.end() - }) + client.adduser( + "http://localhost:1337/registry/_design/app/_rewrite", + params, + function (er, data) { + if (er) throw er + t.deepEqual(data, auth, "received expected auth data") + t.end() + } + ) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js index 2c5ccde6eadf11..6732f7ba0e5489 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js @@ -19,6 +19,13 @@ var password = "%1234@asdf%" tap.test("update a user acct", function (t) { + var auth = { + username : username, + password : password, + email : email + } + var params = { auth : auth } + server.expect("PUT", "/-/user/org.couchdb.user:username", function (req, res) { t.equal(req.method, "PUT") res.statusCode = 409 @@ -45,13 +52,17 @@ tap.test("update a user acct", function (t) { t.deepEqual(o, userdata) res.statusCode = 201 - res.json({created:true}) + res.json(auth) }) }) - client.adduser("http://localhost:1337/", username, password, email, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - t.end() - }) + client.adduser( + "http://localhost:1337/", + params, + function (er, data) { + if (er) throw er + t.deepEqual(data, auth, "got expected auth data") + t.end() + } + ) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser.js b/deps/npm/node_modules/npm-registry-client/test/adduser.js new file mode 100644 index 00000000000000..fccb037afe19a7 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/adduser.js @@ -0,0 +1,162 @@ +var test = require("tap").test + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() + +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var USERNAME = "username" +var PASSWORD = "password" +var EMAIL = "n@p.m" +var AUTH = { + auth : { + username : USERNAME, + password : PASSWORD, + email : EMAIL + } +} + +test("adduser call contract", function (t) { + t.throws(function () { + client.adduser(undefined, AUTH, nop) + }, "requires a URI") + + t.throws(function () { + client.adduser([], AUTH, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.adduser(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.adduser(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.adduser(URI, AUTH, undefined) + }, "requires callback") + + t.throws(function () { + client.adduser(URI, AUTH, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + auth : { + password : PASSWORD, + email : EMAIL + } + } + client.adduser(URI, params, nop) + }, + { name : "AssertionError", message : "must include username in auth" }, + "auth must include username" + ) + + t.throws( + function () { + var params = { + auth : { + username : USERNAME, + email : EMAIL + } + } + client.adduser(URI, params, nop) + }, + { name : "AssertionError", message : "must include password in auth" }, + "auth must include password" + ) + + t.throws( + function () { + var params = { + auth : { + username : USERNAME, + password : PASSWORD + } + } + client.adduser(URI, params, nop) + }, + { name : "AssertionError", message : "must include email in auth" }, + "auth must include email" + ) + + t.test("username missing", function (t) { + var params = { + auth : { + username : "", + password : PASSWORD, + email : EMAIL + } + } + client.adduser(URI, params, function (err) { + t.equal(err && err.message, "No username supplied.", "username must not be empty") + t.end() + }) + }) + + t.test("password missing", function (t) { + var params = { + auth : { + username : USERNAME, + password : "", + email : EMAIL + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + "No password supplied.", + "password must not be empty" + ) + t.end() + }) + }) + + t.test("email missing", function (t) { + var params = { + auth : { + username : USERNAME, + password : PASSWORD, + email : "" + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + "No email address supplied.", + "email must not be empty" + ) + t.end() + }) + }) + + t.test("email malformed", function (t) { + var params = { + auth : { + username : USERNAME, + password : PASSWORD, + email : "lolbutts" + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + "Please use a real email address.", + "email must look like email" + ) + t.end() + }) + }) + + t.end() +}) + +test("cleanup", function (t) { + server.close() + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/bugs.js b/deps/npm/node_modules/npm-registry-client/test/bugs.js deleted file mode 100644 index 799445295d3a1c..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/test/bugs.js +++ /dev/null @@ -1,28 +0,0 @@ -var tap = require("tap") - -var server = require("./lib/server.js") -var common = require("./lib/common.js") -var client = common.freshClient() - -tap.test("get the URL for the bugs page on a package", function (t) { - server.expect("GET", "/sample/latest", function (req, res) { - t.equal(req.method, "GET") - - res.json({ - bugs : { - url : "http://github.com/example/sample/issues", - email : "sample@example.com" - } - }) - }) - - client.bugs("http://localhost:1337/sample", function (error, info) { - t.ifError(error) - - t.ok(info.url, "got the URL") - t.ok(info.email, "got the email address") - - t.end() - }) -}) - diff --git a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js new file mode 100644 index 00000000000000..46756297a33ef5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js @@ -0,0 +1,42 @@ +var test = require("tap").test + +require("./lib/server.js").close() +var common = require("./lib/common.js") + +test("config defaults", function (t) { + var client = common.freshClient() + + var proxy = client.config.proxy + t.notOk(proxy.http, "no default value for HTTP proxy") + t.notOk(proxy.https, "no default value for HTTPS proxy") + t.notOk(proxy.localAddress, "no default value for local address") + + var ssl = client.config.ssl + t.notOk(ssl.ca, "no default value for SSL certificate authority bundle") + t.notOk(ssl.certificate, "no default value for SSL client certificate") + t.notOk(ssl.key, "no default value for SSL client certificate key") + t.equal(ssl.strict, true, "SSL is strict by default") + + var retry = client.config.retry + t.equal(retry.retries, 2, "default retry count is 2") + t.equal(retry.factor, 10, "default retry factor is 10") + t.equal(retry.minTimeout, 10000, "retry minimum timeout is 10000 (10 seconds)") + t.equal(retry.maxTimeout, 60000, "retry maximum timeout is 60000 (60 seconds)") + + t.equal(client.config.userAgent, "node/"+process.version, "default userAgent") + t.ok(client.log.info, "there's a default logger") + t.equal(client.config.defaultTag, "latest", "default tag is 'latest'") + t.notOk(client.config.couchToken, "no couchToken by default") + t.notOk(client.config.sessionToken, "no sessionToken by default") + + t.end() +}) + +test("missing HTTPS proxy defaults to HTTP proxy", function (t) { + var client = common.freshClient({ proxy : { http : "http://proxy.npm:8088/" }}) + + t.equal(client.config.proxy.http, "http://proxy.npm:8088/", "HTTP proxy set") + t.equal(client.config.proxy.http, client.config.proxy.https, "HTTP === HTTPS") + + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/config-override.js b/deps/npm/node_modules/npm-registry-client/test/config-override.js new file mode 100644 index 00000000000000..4e124069255df4 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/config-override.js @@ -0,0 +1,57 @@ +var test = require("tap").test + +require("./lib/server.js").close() +var common = require("./lib/common.js") +var config = { + proxy : { + http : "http://proxy.npm:8088/", + https : "https://proxy.npm:8043/", + localAddress : "localhost.localdomain" + }, + ssl : { + ca : "not including a PEM", + certificate : "still not including a PEM", + key : "nope", + strict : false + }, + retry : { + count : 1, + factor : 9001, + minTimeout : -1, + maxTimeout : Infinity + }, + userAgent : "npm-awesome/4 (Mozilla 5.0)", + log : { fake : function () {} }, + defaultTag : "next", + couchToken : { object : true }, + sessionToken : "hamchunx" +} + +test("config defaults", function (t) { + var client = common.freshClient(config) + + var proxy = client.config.proxy + t.equal(proxy.http, "http://proxy.npm:8088/") + t.equal(proxy.https, "https://proxy.npm:8043/") + t.equal(proxy.localAddress, "localhost.localdomain") + + var ssl = client.config.ssl + t.equal(ssl.ca, "not including a PEM") + t.equal(ssl.certificate, "still not including a PEM") + t.equal(ssl.key, "nope") + t.equal(ssl.strict, false) + + var retry = client.config.retry + t.equal(retry.count, 1) + t.equal(retry.factor, 9001) + t.equal(retry.minTimeout, -1) + t.equal(retry.maxTimeout, Infinity) + + t.equal(client.config.userAgent, "npm-awesome/4 (Mozilla 5.0)") + t.ok(client.log.fake) + t.equal(client.config.defaultTag, "next") + t.ok(client.config.couchToken.object) + t.equal(client.config.sessionToken, "hamchunx") + + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js index 76a5ba128d8fcd..84b82b919c7306 100644 --- a/deps/npm/node_modules/npm-registry-client/test/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/test/deprecate.js @@ -1,21 +1,107 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") +var cache = require("./fixtures/underscore/cache.json") -var nerfed = "//localhost:" + server.port + "/:" - -var configuration = {} -configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" - -var client = common.freshClient(configuration) +var client = common.freshClient() -var cache = require("./fixtures/underscore/cache.json") +function nop () {} +var URI = "https://npm.registry:8043/rewrite" var VERSION = "1.3.2" var MESSAGE = "uhhh" +var TOKEN = "lolbutts" +var AUTH = { + token : TOKEN +} +var PARAMS = { + version : VERSION, + message : MESSAGE, + auth : AUTH +} + +test("deprecate call contract", function (t) { + t.throws(function () { + client.deprecate(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + client.deprecate([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.deprecate(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.deprecate(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.deprecate(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.deprecate(URI, PARAMS, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + message : MESSAGE, + auth : AUTH + } + client.deprecate(URI, params, nop) + }, + { name : "AssertionError", message : "must pass version to deprecate" }, + "params must include version to deprecate" + ) -tap.test("deprecate a package", function (t) { + t.throws( + function () { + var params = { + version : VERSION, + auth : AUTH + } + client.deprecate(URI, params, nop) + }, + { name : "AssertionError", message : "must pass message to deprecate" }, + "params must include deprecation message" + ) + + t.throws( + function () { + var params = { + version : VERSION, + message : MESSAGE + } + client.deprecate(URI, params, nop) + }, + { name : "AssertionError", message : "must pass auth to deprecate" }, + "params must include auth" + ) + + t.test("malformed semver in deprecation", function (t) { + var params = { + version : "-9001", + message : MESSAGE, + auth : AUTH + } + client.deprecate(URI, params, function (err) { + t.equal( + err && err.message, + "invalid version range: -9001", + "got expected semver validation failure" + ) + t.end() + }) + }) + + t.end() +}) + +test("deprecate a package", function (t) { server.expect("GET", "/underscore?write=true", function (req, res) { t.equal(req.method, "GET") @@ -57,10 +143,14 @@ tap.test("deprecate a package", function (t) { }) }) - client.deprecate(common.registry + "/underscore", VERSION, MESSAGE, function (er, data) { - t.ifError(er) - t.ok(data.deprecated, "was deprecated") + client.deprecate( + common.registry + "/underscore", + PARAMS, + function (er, data) { + t.ifError(er) + t.ok(data.deprecated, "was deprecated") - t.end() - }) + t.end() + } + ) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js index 2ce3b212b04f26..25def1bec8c9a2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js @@ -10,7 +10,7 @@ var common = require("./lib/common.js") var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") -tap.test("basic fetch", function (t) { +tap.test("fetch with a 404 response", function (t) { server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { t.equal(req.method, "GET", "got expected method") @@ -23,9 +23,10 @@ tap.test("basic fetch", function (t) { }) var client = common.freshClient() + var defaulted = {} client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - null, + defaulted, function (er, res) { t.ifError(er, "loaded successfully") diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js index bdd8bf070344b5..1e48bd42e69e7f 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js @@ -30,10 +30,11 @@ tap.test("fetch with retry on timeout", function (t) { }) var client = common.freshClient() - client.conf.set("fetch-retry-mintimeout", 100) + var defaulted = {} + client.config.retry.minTimeout = 100 client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - {}, + defaulted, function (er, res) { t.ifError(er, "loaded successfully") diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js index 91cd6754daf610..239e2e7740ef7b 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js @@ -30,10 +30,11 @@ tap.test("fetch with retry on server error", function (t) { }) var client = common.freshClient() - client.conf.set("fetch-retry-mintimeout", 100) + var defaulted = {} + client.config.retry.minTimeout = 100 client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - {}, + defaulted, function (er, res) { t.ifError(er, "loaded successfully") diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js index da359296c41d56..e3171a55947c0b 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js @@ -27,17 +27,18 @@ tap.test("basic fetch with scoped always-auth enabled", function (t) { createReadStream(tgz).pipe(res) }) - var nerfed = "//localhost:" + server.port + "/:" - var configuration = {} - configuration[nerfed + "username"] = "username" - configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") - configuration[nerfed + "email"] = "i@izs.me" - configuration[nerfed + "always-auth"] = true - - var client = common.freshClient(configuration) + var auth = { + username : "username", + password : "%1234@asdf%", + email : "i@izs.me", + alwaysAuth : true + } + + var client = common.freshClient() + var authed = { auth : auth } client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - null, + authed, function (er, res) { t.ifError(er, "loaded successfully") diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js index 2ce3b212b04f26..68e67f023dd1fa 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js @@ -2,15 +2,63 @@ var resolve = require("path").resolve var createReadStream = require("graceful-fs").createReadStream var readFileSync = require("graceful-fs").readFileSync -var tap = require("tap") -var cat = require("concat-stream") +var test = require("tap").test +var concat = require("concat-stream") var server = require("./lib/server.js") var common = require("./lib/common.js") +var client = common.freshClient() var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") -tap.test("basic fetch", function (t) { +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var USERNAME = "username" +var PASSWORD = "hi" +var EMAIL = "n@p.m" +var HEADERS = { + "npm-custom" : "lolbutts" +} +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + headers : HEADERS, + auth : AUTH +} + +test("fetch call contract", function (t) { + t.throws(function () { + client.get(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + client.get([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.get(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.get(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.get(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.get(URI, PARAMS, "callback") + }, "callback must be function") + + t.end() +}) + +test("basic fetch", function (t) { server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { t.equal(req.method, "GET", "got expected method") @@ -22,14 +70,14 @@ tap.test("basic fetch", function (t) { createReadStream(tgz).pipe(res) }) - var client = common.freshClient() + var defaulted = {} client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - null, + defaulted, function (er, res) { t.ifError(er, "loaded successfully") - var sink = cat(function (data) { + var sink = concat(function (data) { t.deepEqual(data, readFileSync(tgz)) t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js b/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js new file mode 100644 index 00000000000000..643ac9927a8f05 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js @@ -0,0 +1,68 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") +var Negotiator = require("negotiator") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("fetch accepts github api's json", function (t) { + server.expect("/underscore/-/underscore-1.3.3", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + var negotiator = new Negotiator(req) + + // fetching a tarball from `api.github.com` returns a 415 error if json is + // not accepted + if (negotiator.mediaTypes().indexOf("application/vnd.github+json") === -1) { + res.writeHead(415, { + "Content-Type" : "application/json" + }) + } + else { + res.writeHead(302, { + "Content-Type" : "text/html", + "Location" : "/underscore/-/underscore-1.3.3.tgz" + }) + } + + res.end() + }) + + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "Content-Type" : "application/x-tar", + "Content-Encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + var defaulted = {} + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3", + defaulted, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js index 0275dc2b96be3d..4133770447c421 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js @@ -23,17 +23,18 @@ tap.test("basic fetch with scoped always-auth disabled", function (t) { createReadStream(tgz).pipe(res) }) - var nerfed = "//localhost:" + server.port + "/:" - var configuration = {} - configuration[nerfed + "username"] = "username" - configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") - configuration[nerfed + "email"] = "i@izs.me" - configuration[nerfed + "always-auth"] = false - - var client = common.freshClient(configuration) + var auth = { + username : "username", + password : "%1234@asdf%", + email : "i@izs.me", + alwaysAuth : false + } + + var client = common.freshClient() + var authed = { auth : auth } client.fetch( "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", - null, + authed, function (er, res) { t.ifError(er, "loaded successfully") diff --git a/deps/npm/node_modules/npm-registry-client/test/get-all.js b/deps/npm/node_modules/npm-registry-client/test/get-all.js deleted file mode 100644 index 75570fcbb6cc26..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/test/get-all.js +++ /dev/null @@ -1,16 +0,0 @@ -var tap = require("tap") - -var server = require("./lib/server.js") -var common = require("./lib/common.js") -var client = common.freshClient() - -tap.test("basic request", function (t) { - server.expect("/-/all", function (req, res) { - res.json([]) - }) - - client.get("http://localhost:1337/-/all", null, function (er) { - t.ifError(er, "no error") - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js index 240dc87622185d..1f28bdfbfaebc3 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-basic.js @@ -1,4 +1,4 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") @@ -7,7 +7,52 @@ var client = common.freshClient() var us = require("./fixtures/underscore/1.3.3/cache.json") var usroot = require("./fixtures/underscore/cache.json") -tap.test("basic request", function (t) { +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var TIMEOUT = 3600 +var FOLLOW = false +var STALE_OK = true +var TOKEN = "lolbutts" +var AUTH = { + token : TOKEN +} +var PARAMS = { + timeout : TIMEOUT, + follow : FOLLOW, + staleOk : STALE_OK, + auth : AUTH +} + +test("get call contract", function (t) { + t.throws(function () { + client.get(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + client.get([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.get(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.get(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.get(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.get(URI, PARAMS, "callback") + }, "callback must be function") + + t.end() +}) + +test("basic request", function (t) { server.expect("/underscore/1.3.3", function (req, res) { res.json(us) }) @@ -21,15 +66,15 @@ tap.test("basic request", function (t) { }) t.plan(3) - client.get("http://localhost:1337/underscore/1.3.3", null, function (er, data) { + client.get("http://localhost:1337/underscore/1.3.3", PARAMS, function (er, data) { t.deepEqual(data, us) }) - client.get("http://localhost:1337/underscore", null, function (er, data) { + client.get("http://localhost:1337/underscore", PARAMS, function (er, data) { t.deepEqual(data, usroot) }) - client.get("http://localhost:1337/@bigco%2funderscore", null, function (er, data) { + client.get("http://localhost:1337/@bigco%2funderscore", PARAMS, function (er, data) { t.deepEqual(data, usroot) }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js index 27406b1680c228..dc20a8caf70701 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js @@ -12,7 +12,7 @@ tap.test("get fails with 403", function (t) { }) var client = common.freshClient() - client.conf.set("fetch-retry-mintimeout", 100) + client.config.retry.minTimeout = 100 client.get( "http://localhost:1337/habanero", {}, diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index 712f6632f299ba..178a75bb5eb62e 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -1,78 +1,12 @@ -var resolve = require("path").resolve - var server = require("./server.js") var RC = require("../../") -var toNerfDart = require("../../lib/util/nerf-dart.js") - var REGISTRY = "http://localhost:" + server.port module.exports = { port : server.port, registry : REGISTRY, freshClient : function freshClient(config) { - config = config || {} - config.cache = resolve(__dirname, "../fixtures/cache") - config.registry = REGISTRY - var container = { - get: function (k) { return config[k] }, - set: function (k, v) { config[k] = v }, - del: function (k) { delete config[k] }, - getCredentialsByURI: function(uri) { - var nerfed = toNerfDart(uri) - var c = {scope : nerfed} - - if (this.get(nerfed + ":_authToken")) { - c.token = this.get(nerfed + ":_authToken") - // the bearer token is enough, don't confuse things - return c - } - - if (this.get(nerfed + ":_password")) { - c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") - } - - if (this.get(nerfed + ":username")) { - c.username = this.get(nerfed + ":username") - } - - if (this.get(nerfed + ":email")) { - c.email = this.get(nerfed + ":email") - } - - if (this.get(nerfed + ":always-auth") !== undefined) { - c.alwaysAuth = this.get(nerfed + ":always-auth") - } - - if (c.username && c.password) { - c.auth = new Buffer(c.username + ":" + c.password).toString("base64") - } - - return c - }, - setCredentialsByURI: function (uri, c) { - var nerfed = toNerfDart(uri) - - if (c.token) { - this.set(nerfed + ":_authToken", c.token, "user") - this.del(nerfed + ":_password", "user") - this.del(nerfed + ":username", "user") - this.del(nerfed + ":email", "user") - } - else if (c.username || c.password || c.email) { - this.del(nerfed + ":_authToken", "user") - - var encoded = new Buffer(c.password, "utf8").toString("base64") - this.set(nerfed + ":_password", encoded, "user") - this.set(nerfed + ":username", c.username, "user") - this.set(nerfed + ":email", c.email, "user") - } - else { - throw new Error("No credentials to set.") - } - } - } - - var client = new RC(container) + var client = new RC(config) server.log = client.log client.log.level = "silent" diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js index 97838ca44dc2fc..10b1275053975d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js @@ -4,19 +4,20 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var nerfed = "//localhost:" + server.port + "/:" +var auth = { + username : "username", + password : "%1234@asdf%", + email : "i@izs.me", + alwaysAuth : true +} -var configuration = {} -configuration[nerfed + "username"] = "username" -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "i@izs.me" - -var client = common.freshClient(configuration) +var client = common.freshClient() tap.test("publish again", function (t) { // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") + var bodyPath = require.resolve("../package.json") + var tarball = fs.createReadStream(bodyPath, "base64") + var pd = fs.readFileSync(bodyPath, "base64") var pkg = require("../package.json") var lastTime = null @@ -74,7 +75,13 @@ tap.test("publish again", function (t) { }) pkg.name = "@npm/npm-registry-client" - client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { + + var params = { + metadata : pkg, + body : tarball, + auth : auth + } + client.publish("http://localhost:1337/", params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js index 39c368fd35b762..9c547ca010cad5 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js @@ -4,19 +4,20 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var nerfed = "//localhost:" + server.port + "/:" +var auth = { + username : "username", + password : "%1234@asdf%", + email : "i@izs.me", + alwaysAuth : true +} -var configuration = {} -configuration[nerfed + "username"] = "username" -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "i@izs.me" - -var client = common.freshClient(configuration) +var client = common.freshClient() tap.test("publish again", function (t) { // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") + var bodyPath = require.resolve("../package.json") + var tarball = fs.createReadStream(bodyPath, "base64") + var pd = fs.readFileSync(bodyPath, "base64") var pkg = require("../package.json") var lastTime = null @@ -73,7 +74,12 @@ tap.test("publish again", function (t) { }) }) - client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { + var params = { + metadata : pkg, + body : tarball, + auth : auth + } + client.publish("http://localhost:1337/", params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js b/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js new file mode 100644 index 00000000000000..cce6fcbc7da70f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js @@ -0,0 +1,41 @@ +var createReadStream = require("fs").createReadStream + +var test = require("tap").test + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var config = { retry : { retries : 0 } } +var client = common.freshClient(config) + +var URI = "http://localhost:1337/" +var USERNAME = "username" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var METADATA = require("../package.json") +// not really a tarball, but doesn't matter +var BODY_PATH = require.resolve("../package.json") +var BODY = createReadStream(BODY_PATH, "base64") +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + metadata : METADATA, + body : BODY, + auth : AUTH +} + +test("publish with a 500 response but no message", function (t){ + server.expect("/npm-registry-client", function (req, res) { + res.statusCode = 500 + res.json({ success : false }) + }) + + client.publish(URI, PARAMS, function (er, data) { + t.ok(er, "got expected error") + t.notOk(data, "no payload on failure") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js index e1bb7dd1ee2a99..70ff1e93f1e192 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js @@ -5,17 +5,15 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var nerfed = "//localhost:" + server.port + "/:" +var auth = { token : "of-glad-tidings" } -var configuration = {} -configuration[nerfed + "_authToken"] = "of-glad-tidings" - -var client = common.freshClient(configuration) +var client = common.freshClient() tap.test("publish", function (t) { // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") + var bodyPath = require.resolve("../package.json") + var tarball = fs.createReadStream(bodyPath, "base64") + var pd = fs.readFileSync(bodyPath, "base64") var pkg = require("../package.json") pkg.name = "@npm/npm-registry-client" @@ -44,7 +42,12 @@ tap.test("publish", function (t) { }) }) - client.publish(common.registry, pkg, tarball, function (er, data) { + var params = { + metadata : pkg, + body : tarball, + auth : auth + } + client.publish(common.registry, params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js index b5dea3649c3a05..b21e33f417becf 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js @@ -5,21 +5,21 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var nerfed = "//localhost:" + server.port + "/:" +var auth = { + username : "username", + password : "%1234@asdf%", + email : "ogd@aoaioxxysz.net" +} -var configuration = {} -configuration[nerfed + "username"] = "username" -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "ogd@aoaioxxysz.net" - -var client = common.freshClient(configuration) +var client = common.freshClient() var _auth = new Buffer("username:%1234@asdf%").toString("base64") tap.test("publish", function (t) { // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") + var bodyPath = require.resolve("../package.json") + var tarball = fs.createReadStream(bodyPath, "base64") + var pd = fs.readFileSync(bodyPath, "base64") var pkg = require("../package.json") pkg.name = "@npm/npm-registry-client" @@ -49,7 +49,12 @@ tap.test("publish", function (t) { }) }) - client.publish(common.registry, pkg, tarball, function (er, data) { + var params = { + metadata : pkg, + body : tarball, + auth : auth + } + client.publish(common.registry, params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js index 2d76dfae2021fb..9292a94c7a1226 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish.js @@ -1,24 +1,145 @@ -var tap = require("tap") +var test = require("tap").test var crypto = require("crypto") var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") +var client = common.freshClient() -var nerfed = "//localhost:" + server.port + "/:" +function nop () {} -var configuration = {} -configuration[nerfed + "username"] = "username" -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "i@izs.me" +var URI = "http://localhost:1337/" +var USERNAME = "username" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var METADATA = require("../package.json") +// not really a tarball, but doesn't matter +var BODY_PATH = require.resolve("../package.json") +var BODY = fs.createReadStream(BODY_PATH, "base64") +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + metadata : METADATA, + body : BODY, + auth : AUTH +} -var client = common.freshClient(configuration) +test("publish call contract", function (t) { + t.throws(function () { + client.publish(undefined, PARAMS, nop) + }, "requires a URI") -tap.test("publish", function (t) { - // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") - var pkg = require("../package.json") + t.throws(function () { + client.publish([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.publish(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.publish(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.publish(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.publish(URI, PARAMS, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + body : BODY, + auth : AUTH + } + client.publish(URI, params, nop) + }, + { name : "AssertionError", message : "must pass package metadata to publish" }, + "params must include metadata for package" + ) + + t.throws( + function () { + var params = { + metadata : METADATA, + auth : AUTH + } + client.publish(URI, params, nop) + }, + { name : "AssertionError", message : "must pass package body to publish" }, + "params must include body of package to publish" + ) + + t.throws( + function () { + var params = { + metadata : METADATA, + body : BODY + } + client.publish(URI, params, nop) + }, + { name : "AssertionError", message : "must pass auth to publish" }, + "params must include auth" + ) + + t.throws( + function () { + var params = { + metadata : -1, + body : BODY, + auth : AUTH + } + client.publish(URI, params, nop) + }, + { name : "AssertionError", message : "must pass package metadata to publish" }, + "metadata must be object" + ) + + t.throws( + function () { + var params = { + metadata : METADATA, + body : -1, + auth : AUTH + } + client.publish(URI, params, nop) + }, + { + name : "AssertionError", + message : "package body passed to publish must be a stream" + }, + "body must be a Stream" + ) + + t.test("malformed semver in publish", function (t) { + var metadata = JSON.parse(JSON.stringify(METADATA)) + metadata.version = "%!@#$" + var params = { + metadata : metadata, + message : BODY, + auth : AUTH + } + client.publish(URI, params, function (err) { + t.equal( + err && err.message, + "invalid semver: %!@#$", + "got expected semver validation failure" + ) + t.end() + }) + }) + + t.end() +}) + +test("publish", function (t) { + var pd = fs.readFileSync(BODY_PATH, "base64") server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") @@ -31,22 +152,26 @@ tap.test("publish", function (t) { req.on("end", function () { var o = JSON.parse(b) t.equal(o._id, "npm-registry-client") - t.equal(o["dist-tags"].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: "username", email: "i@izs.me" } ]) - t.same(o.maintainers, o.versions[pkg.version].maintainers) - var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.equal(o["dist-tags"].latest, METADATA.version) + t.has(o.versions[METADATA.version], METADATA) + t.same(o.maintainers, [{ name : "username", email : "i@izs.me" }]) + t.same(o.maintainers, o.versions[METADATA.version].maintainers) + + var att = o._attachments[METADATA.name+"-"+METADATA.version+".tgz"] t.same(att.data, pd) + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") - t.equal(o.versions[pkg.version].dist.shasum, hash) + t.equal(o.versions[METADATA.version].dist.shasum, hash) + res.statusCode = 201 - res.json({created:true}) + res.json({ created : true }) }) }) - client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { + client.publish(URI, PARAMS, function (er, data) { if (er) throw er - t.deepEqual(data, { created: true }) + + t.deepEqual(data, { created : true }) t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/redirects.js b/deps/npm/node_modules/npm-registry-client/test/redirects.js index b7ead8795fab8f..ba38143495a602 100644 --- a/deps/npm/node_modules/npm-registry-client/test/redirects.js +++ b/deps/npm/node_modules/npm-registry-client/test/redirects.js @@ -31,18 +31,21 @@ tap.test("basic request", function (t) { res.json(pkg) }) - t.plan(2); - - client.get("http://localhost:1337/-/some-package/1.2.3", { - follow: false - }, function(er, data) { - t.assert(er, "Error must be set"); - }) - - client.get("http://localhost:1337/-/some-package/1.2.3", { - follow: true - }, function(er, data) { - t.deepEqual(data, pkg) - }) + t.plan(2) + + client.get( + "http://localhost:1337/-/some-package/1.2.3", + { follow : false }, + function (er) { + t.ok(er, "Error must be set") + } + ) + + client.get( + "http://localhost:1337/-/some-package/1.2.3", + { follow : true }, + function (er, data) { + t.deepEqual(data, pkg) + } + ) }) - diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js index 1085bfaca205ab..4463de9a74264d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -4,9 +4,11 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") var client = common.freshClient({ - "fetch-retries" : 1, - "fetch-retry-mintimeout" : 10, - "fetch-retry-maxtimeout" : 100 + retry : { + count : 1, + minTimeout : 10, + maxTimeout : 100 + } }) var TEST_URL = "http://localhost:1337/some-package-gzip/1.2.3" @@ -28,7 +30,7 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { res.end(pkgGzip) }) - client.get(TEST_URL, null, function (er, data) { + client.get(TEST_URL, {}, function (er, data) { if (er) throw er t.deepEqual(data, pkg) t.end() @@ -43,7 +45,7 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { res.end(new Buffer("wrong gzip content")) }) - client.get(TEST_URL, null, function (er) { + client.get(TEST_URL, {}, function (er) { t.ok(er) t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/request.js b/deps/npm/node_modules/npm-registry-client/test/request.js new file mode 100644 index 00000000000000..799a626eaea685 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/request.js @@ -0,0 +1,233 @@ +var Readable = require("stream").Readable +var inherits = require("util").inherits + +var test = require("tap").test +var concat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() + +function OneA() { + Readable.call(this) + this.push("A") + this.push(null) +} +inherits(OneA, Readable) + +function nop () {} + +var URI = "http://localhost:1337/" +var USERNAME = "username" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { auth : AUTH } + +test("request call contract", function (t) { + t.throws( + function () { + client.request(undefined, PARAMS, nop) + }, + { name : "AssertionError", message : "must pass uri to request" }, + "requires a URI" + ) + + t.throws( + function () { + client.request([], PARAMS, nop) + }, + { name : "AssertionError", message : "must pass uri to request" }, + "requires URI to be a string" + ) + + t.throws( + function () { + client.request(URI, undefined, nop) + }, + { name : "AssertionError", message : "must pass params to request" }, + "requires params object" + ) + + t.throws( + function () { + client.request(URI, "", nop) + }, + { name : "AssertionError", message : "must pass params to request" }, + "params must be object" + ) + + t.throws( + function () { + client.request(URI, PARAMS, undefined) + }, + { name : "AssertionError", message : "must pass callback to request" }, + "requires callback" + ) + + t.throws( + function () { + client.request(URI, PARAMS, "callback") + }, + { name : "AssertionError", message : "must pass callback to request" }, + "callback must be function" + ) + + t.end() +}) + +test("run request through its paces", function (t) { + t.plan(24) + + server.expect("/request-defaults", function (req, res) { + t.equal(req.method, "GET", "uses GET by default") + + req.pipe(concat(function (d) { + t.notOk(d.toString("utf7"), "no data included in request") + + res.statusCode = 200 + res.json({ fetched : "defaults" }) + })) + }) + + server.expect("/etag", function (req, res) { + t.equal(req.headers["if-none-match"], "test-etag", "got test etag") + + res.statusCode = 200 + res.json({ fetched : "etag" }) + }) + + server.expect("POST", "/etag-post", function (req, res) { + t.equal(req.headers["if-match"], "post-etag", "got test post etag") + + res.statusCode = 200 + res.json({ posted : "etag" }) + }) + + server.expect("PUT", "/body-stream", function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString("utf8"), "A", "streamed expected data") + + res.statusCode = 200 + res.json({ put : "stream" }) + })) + }) + + server.expect("PUT", "/body-buffer", function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString("utf8"), "hi", "streamed expected data") + + res.statusCode = 200 + res.json({ put : "buffer" }) + })) + }) + + server.expect("PUT", "/body-string", function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString("utf8"), "erp", "streamed expected data") + + res.statusCode = 200 + res.json({ put : "string" }) + })) + }) + + server.expect("PUT", "/body-object", function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString("utf8"), '["tricky"]', "streamed expected data") + + res.statusCode = 200 + res.json({ put : "object" }) + })) + }) + + server.expect("GET", "/body-error-string", function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.json({ "error" : "not really an error", "reason" : "unknown" }) + })) + }) + + server.expect("GET", "/body-error-object", function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.json({ "error" : {} }) + })) + }) + + var defaults = {} + client.request(common.registry+"/request-defaults", defaults, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { fetched : "defaults" }, "confirmed defaults work") + }) + + var etagged = { etag : "test-etag" } + client.request(common.registry+"/etag", etagged, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { fetched : "etag" }, "etag request sent") + }) + + var postEtagged = { + method : "post", + etag : "post-etag" + } + client.request(common.registry+"/etag-post", postEtagged, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { posted : "etag" }, "POST etag request sent") + }) + + var putStream = { + method : "PUT", + body : new OneA(), + auth : AUTH + } + client.request(common.registry+"/body-stream", putStream, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { put : "stream" }, "PUT request with stream sent") + }) + + var putBuffer = { + method : "PUT", + body : new Buffer("hi"), + auth : AUTH + } + client.request(common.registry+"/body-buffer", putBuffer, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { put : "buffer" }, "PUT request with buffer sent") + }) + + var putString = { + method : "PUT", + body : "erp", + auth : AUTH + } + client.request(common.registry+"/body-string", putString, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { put : "string" }, "PUT request with string sent") + }) + + var putObject = { + method : "PUT", + body : { toJSON : function () { return [ "tricky" ] } }, + auth : AUTH + } + client.request(common.registry+"/body-object", putObject, function (er, data) { + t.ifError(er, "call worked") + t.deepEquals(data, { put : "object" }, "PUT request with object sent") + }) + + client.request(common.registry+"/body-error-string", defaults, function (er) { + t.equal( + er && er.message, + "not really an error unknown: body-error-string", + "call worked" + ) + }) + + client.request(common.registry+"/body-error-object", defaults, function (er) { + t.ifError(er, "call worked") + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js index f30f6808018fda..0f0fa36673c532 100644 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ b/deps/npm/node_modules/npm-registry-client/test/retries.js @@ -3,9 +3,11 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") var client = common.freshClient({ - "fetch-retries": 6, - "fetch-retry-mintimeout": 10, - "fetch-retry-maxtimeout": 100 + retry : { + retries : 6, + minTimeout : 10, + maxTimeout : 100 + } }) var pkg = { @@ -41,7 +43,7 @@ tap.test("create new user account", function (t) { res.json(pkg) }) - client.get("http://localhost:1337/some-package/1.2.3", null, function (er, data) { + client.get("http://localhost:1337/some-package/1.2.3", {}, function (er, data) { if (er) throw er t.deepEqual(data, pkg) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js index 43c8888ef207f1..1a8576f8548eed 100644 --- a/deps/npm/node_modules/npm-registry-client/test/star.js +++ b/deps/npm/node_modules/npm-registry-client/test/star.js @@ -1,22 +1,83 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") +var client = common.freshClient() +var cache = require("./fixtures/underscore/cache.json") -var DEP_USER = "username" +function nop () {} -var nerfed = "//localhost:" + server.port + "/:" +var URI = "https://npm.registry:8043/rewrite" +var STARRED = true +var USERNAME = "username" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + starred : STARRED, + auth : AUTH +} -var configuration = {} -configuration[nerfed + "username"] = DEP_USER -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "i@izs.me" +test("star call contract", function (t) { + t.throws(function () { + client.star(undefined, PARAMS, nop) + }, "requires a URI") -var client = common.freshClient(configuration) + t.throws(function () { + client.star([], PARAMS, nop) + }, "requires URI to be a string") -var cache = require("./fixtures/underscore/cache.json") + t.throws(function () { + client.star(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.star(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.star(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.star(URI, PARAMS, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + starred : STARRED + } + client.star(URI, params, nop) + }, + { name : "AssertionError", message : "must pass auth to star" }, + "params must include auth" + ) + + t.test("token auth disallowed in star", function (t) { + var params = { + auth : { + token : "lol" + } + } + client.star(URI, params, function (err) { + t.equal( + err && err.message, + "This operation is unsupported for token-based auth", + "star doesn't support token-based auth" + ) + t.end() + }) + }) + + t.end() +}) -tap.test("star a package", function (t) { +test("star a package", function (t) { server.expect("GET", "/underscore?write=true", function (req, res) { t.equal(req.method, "GET") @@ -46,14 +107,18 @@ tap.test("star a package", function (t) { current + " still likes this package" ) } - t.ok(updated.users[DEP_USER], "user is in the starred list") + t.ok(updated.users[USERNAME], "user is in the starred list") res.statusCode = 201 res.json({starred:true}) }) }) - client.star("http://localhost:1337/underscore", true, function (error, data) { + var params = { + starred : STARRED, + auth : AUTH + } + client.star("http://localhost:1337/underscore", params, function (error, data) { t.ifError(error, "no errors") t.ok(data.starred, "was starred") diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js index 28f8a98d7669a6..cd1c28686a874e 100644 --- a/deps/npm/node_modules/npm-registry-client/test/stars.js +++ b/deps/npm/node_modules/npm-registry-client/test/stars.js @@ -1,25 +1,79 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") var client = common.freshClient() -var users = [ +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var USERNAME = "sample" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + username : USERNAME, + auth : AUTH +} +var USERS = [ "benjamincoe", "seldo", "ceejbot" ] -tap.test("get the URL for the bugs page on a package", function (t) { +test("stars call contract", function (t) { + t.throws(function () { + client.stars(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + client.stars([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.stars(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.stars(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.stars(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + client.stars(URI, PARAMS, "callback") + }, "callback must be function") + + t.test("no username anywhere", function (t) { + var params = {} + client.stars(URI, params, function (err) { + t.equal( + err && err.message, + "must pass either username or auth to stars", + "username must not be empty") + t.end() + }) + }) + + t.end() +}) + +test("get the stars for a package", function (t) { server.expect("GET", "/-/_view/starredByUser?key=%22sample%22", function (req, res) { t.equal(req.method, "GET") - res.json(users) + res.json(USERS) }) - client.stars("http://localhost:1337/", "sample", function (error, info) { - t.ifError(error, "no errors") - t.deepEqual(info, users, "got the list of users") + client.stars("http://localhost:1337/", PARAMS, function (er, info) { + t.ifError(er, "no errors") + t.deepEqual(info, USERS, "got the list of users") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js index 7551569307be70..687df5d7d52bd1 100644 --- a/deps/npm/node_modules/npm-registry-client/test/tag.js +++ b/deps/npm/node_modules/npm-registry-client/test/tag.js @@ -1,18 +1,93 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") +var client = common.freshClient() -var nerfed = "//localhost:" + server.port + "/:" +function nop () {} -var configuration = {} -configuration[nerfed + "username"] = "username" -configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") -configuration[nerfed + "email"] = "i@izs.me" +var URI = "http://localhost:1337/underscore" +var USERNAME = "username" +var PASSWORD = "%1234@asdf%" +var EMAIL = "i@izs.me" +var VERSION = "1.3.2" +var TAG = "not-lodash" +var AUTH = { + username : USERNAME, + password : PASSWORD, + email : EMAIL +} +var PARAMS = { + tag : TAG, + version : VERSION, + auth : AUTH +} -var client = common.freshClient(configuration) +test("tag call contract", function (t) { + t.throws(function () { + client.tag(undefined, AUTH, nop) + }, "requires a URI") -tap.test("tag a package", function (t) { + t.throws(function () { + client.tag([], AUTH, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.tag(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.tag(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.tag(URI, AUTH, undefined) + }, "requires callback") + + t.throws(function () { + client.tag(URI, AUTH, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + tag : TAG, + auth : AUTH + } + client.tag(URI, params, nop) + }, + { name : "AssertionError", message : "must pass version to tag" }, + "auth must include username" + ) + + t.throws( + function () { + var params = { + version : VERSION, + auth : AUTH + } + client.tag(URI, params, nop) + }, + { name : "AssertionError", message : "must pass tag name to tag" }, + "auth must include username" + ) + + t.throws( + function () { + var params = { + version : VERSION, + tag : TAG + } + client.tag(URI, params, nop) + }, + { name : "AssertionError", message : "must pass auth to tag" }, + "auth must include username" + ) + + t.end() +}) + +test("tag a package", function (t) { server.expect("PUT", "/underscore/not-lodash", function (req, res) { t.equal(req.method, "PUT") @@ -25,14 +100,14 @@ tap.test("tag a package", function (t) { req.on("end", function () { var updated = JSON.parse(b) - t.deepEqual(updated, {"1.3.2":{}}) + t.deepEqual(updated, "1.3.2") res.statusCode = 201 res.json({tagged:true}) }) }) - client.tag("http://localhost:1337/underscore", {"1.3.2":{}}, "not-lodash", function (error, data) { + client.tag(URI, PARAMS, function (error, data) { t.ifError(error, "no errors") t.ok(data.tagged, "was tagged") diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js index 0e5cb8606d1ea1..88ee13f3771f67 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -2,18 +2,22 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") - -var nerfed = "//localhost:" + server.port + "/:" - -var configuration = {} -configuration[nerfed + "_authToken"] = "of-glad-tidings" - -var client = common.freshClient(configuration) +var client = common.freshClient() var cache = require("./fixtures/@npm/npm-registry-client/cache.json") -var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var PACKAGE = "/@npm%2fnpm-registry-client" +var URI = common.registry + PACKAGE +var TOKEN = "of-glad-tidings" var VERSION = "3.0.6" +var AUTH = { + token : TOKEN +} +var PARAMS = { + version : VERSION, + auth : AUTH +} tap.test("unpublish a package", function (t) { server.expect("GET", "/@npm%2fnpm-registry-client?write=true", function (req, res) { @@ -39,20 +43,20 @@ tap.test("unpublish a package", function (t) { res.json(cache) }) - server.expect("GET", "/@npm%2fnpm-registry-client", function (req, res) { + server.expect("GET", PACKAGE, function (req, res) { t.equal(req.method, "GET") res.json(cache) }) - server.expect("DELETE", "/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-" + VERSION + ".tgz" + REV, function (req, res) { + server.expect("DELETE", PACKAGE+"/-"+PACKAGE+"-"+VERSION+".tgz"+REV, function (req, res) { t.equal(req.method, "DELETE") res.json({unpublished:true}) }) - client.unpublish("http://localhost:1337/@npm%2fnpm-registry-client", VERSION, function (error) { - t.ifError(error, "no errors") + client.unpublish(URI, PARAMS, function (er) { + t.ifError(er, "no errors") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js index 7a60431faca573..edc42699e9d731 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish.js @@ -1,21 +1,65 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") - -var nerfed = "//localhost:" + server.port + "/:" - -var configuration = {} -configuration[nerfed + "_authToken"] = "of-glad-tidings" - -var client = common.freshClient(configuration) +var client = common.freshClient() var cache = require("./fixtures/underscore/cache.json") -var REV = "/-rev/72-47f2986bfd8e8b55068b204588bbf484" -var VERSION = "1.3.2" +function nop () {} + +var REV = "/-rev/72-47f2986bfd8e8b55068b204588bbf484" +var URI = "http://localhost:1337/underscore" +var TOKEN = "of-glad-tidings" +var VERSION = "1.3.2" +var AUTH = { + token : TOKEN +} +var PARAMS = { + version : VERSION, + auth : AUTH +} + +test("unpublish call contract", function (t) { + t.throws(function () { + client.unpublish(undefined, AUTH, nop) + }, "requires a URI") + + t.throws(function () { + client.unpublish([], AUTH, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.unpublish(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.unpublish(URI, "", nop) + }, "params must be object") + + t.throws(function () { + client.unpublish(URI, AUTH, undefined) + }, "requires callback") + + t.throws(function () { + client.unpublish(URI, AUTH, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = { + version : VERSION + } + client.unpublish(URI, params, nop) + }, + { name : "AssertionError", message : "must pass auth to unpublish" }, + "must pass auth to unpublish" + ) + + t.end() +}) -tap.test("unpublish a package", function (t) { +test("unpublish a package", function (t) { server.expect("GET", "/underscore?write=true", function (req, res) { t.equal(req.method, "GET") @@ -51,7 +95,7 @@ tap.test("unpublish a package", function (t) { res.json({unpublished:true}) }) - client.unpublish("http://localhost:1337/underscore", VERSION, function (error) { + client.unpublish(URI, PARAMS, function (error) { t.ifError(error, "no errors") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/upload.js b/deps/npm/node_modules/npm-registry-client/test/upload.js deleted file mode 100644 index fa197e3681df92..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/test/upload.js +++ /dev/null @@ -1,36 +0,0 @@ -var tap = require("tap") -var Readable = require("stream").Readable -var inherits = require("util").inherits - -var common = require("./lib/common.js") -var server = require("./lib/server.js") - -var cache = require("./fixtures/underscore/cache.json") - -var nerfed = "//localhost:" + server.port + "/:" - -var configuration = {} -configuration[nerfed + "_authToken"] = "of-glad-tidings" - -var client = common.freshClient(configuration) - -function OneA() { - Readable.call(this) - this.push("A") - this.push(null) -} -inherits(OneA, Readable) - -tap.test("uploading a tarball", function (t) { - server.expect("PUT", "/underscore", function (req, res) { - t.equal(req.method, "PUT") - - res.json(cache) - }) - - client.upload("http://localhost:1337/underscore", new OneA(), "daedabeefa", true, function (error) { - t.ifError(error, "no errors") - - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/whoami.js b/deps/npm/node_modules/npm-registry-client/test/whoami.js index f9c817684f2098..ccb173a09c00b2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/whoami.js +++ b/deps/npm/node_modules/npm-registry-client/test/whoami.js @@ -1,18 +1,54 @@ -var tap = require("tap") +var test = require("tap").test var server = require("./lib/server.js") var common = require("./lib/common.js") +var client = common.freshClient() -var nerfed = "//localhost:" + server.port + "/:" +function nop () {} -var configuration = {} -configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" +var WHOIAM = "wombat" +var TOKEN = "not-bad-meaning-bad-but-bad-meaning-wombat" +var AUTH = { token : TOKEN } +var PARAMS = { auth : AUTH } -var client = common.freshClient(configuration) +test("whoami call contract", function (t) { + t.throws(function () { + client.whoami(undefined, AUTH, nop) + }, "requires a URI") -var WHOIAM = "wombat" + t.throws(function () { + client.whoami([], AUTH, nop) + }, "requires URI to be a string") + + t.throws(function () { + client.whoami(common.registry, undefined, nop) + }, "requires params object") + + t.throws(function () { + client.whoami(common.registry, "", nop) + }, "params must be object") + + t.throws(function () { + client.whoami(common.registry, AUTH, undefined) + }, "requires callback") + + t.throws(function () { + client.whoami(common.registry, AUTH, "callback") + }, "callback must be function") + + t.throws( + function () { + var params = {} + client.whoami(common.registry, params, nop) + }, + { name : "AssertionError", message : "must pass auth to whoami" }, + "must pass auth to whoami" + ) + + t.end() +}) -tap.test("whoami", function (t) { +test("whoami", function (t) { server.expect("GET", "/whoami", function (req, res) { t.equal(req.method, "GET") // only available for token-based auth for now @@ -21,7 +57,7 @@ tap.test("whoami", function (t) { res.json({username : WHOIAM}) }) - client.whoami(common.registry, function (error, wombat) { + client.whoami(common.registry, PARAMS, function (error, wombat) { t.ifError(error, "no errors") t.equal(wombat, WHOIAM, "im a wombat") diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json index 3966625621e501..4a8257c9810dfe 100644 --- a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json @@ -27,7 +27,7 @@ "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" }, - "_from": "debuglog@>=1.0.1-0 <2.0.0-0", + "_from": "debuglog@>=1.0.1 <2.0.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "octet", @@ -41,5 +41,6 @@ ], "directories": {}, "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", - "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.eslintrc b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.eslintrc new file mode 100644 index 00000000000000..ba3315042102ff --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.eslintrc @@ -0,0 +1,17 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "semi": [2, "never"], + "strict": 0, + "quotes": [1, "double", "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/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json index 84b91e75a5555e..c33c391c2b295a 100644 --- a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json @@ -1,6 +1,6 @@ { "name": "readdir-scoped-modules", - "version": "1.0.0", + "version": "1.0.1", "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", "main": "readdir.js", "directories": { @@ -9,6 +9,7 @@ "dependencies": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", + "graceful-fs": "^3.0.4", "once": "^1.3.0" }, "devDependencies": { @@ -31,24 +32,10 @@ "url": "https://github.com/npm/readdir-scoped-modules/issues" }, "homepage": "https://github.com/npm/readdir-scoped-modules", - "gitHead": "35a4a7a2325d12ed25ed322cd61f976b740f7fb7", - "_id": "readdir-scoped-modules@1.0.0", - "_shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", - "_from": "readdir-scoped-modules@>=1.0.0-0 <2.0.0-0", - "_npmVersion": "2.0.0-alpha.6.0", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", - "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" - }, - "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" + "readme": "# readdir-scoped-modules\n\nLike `fs.readdir` but handling `@org/module` dirs as if they were\na single entry.\n\nUsed by npm.\n\n## USAGE\n\n```javascript\nvar readdir = require('readdir-scoped-modules')\n\nreaddir('node_modules', function (er, entries) {\n // entries will be something like\n // ['a', '@org/foo', '@org/bar']\n})\n```\n", + "readmeFilename": "README.md", + "gitHead": "451d38946c5b6b6c0db33a890f33536a11ed79f7", + "_id": "readdir-scoped-modules@1.0.1", + "_shasum": "5c2a77f3e08250a8fddf53fa58cdc17900b808b9", + "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js index 91978a739db3fe..efbe5526d8ccf1 100644 --- a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js @@ -1,4 +1,4 @@ -var fs = require ('fs') +var fs = require ('graceful-fs') var dz = require ('dezalgo') var once = require ('once') var path = require ('path') diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json index 0bab48d3297f37..942b786046c717 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -22,7 +22,7 @@ "shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" }, - "_from": "util-extend@>=1.0.1-0 <2.0.0-0", + "_from": "util-extend@>=1.0.1 <2.0.0", "_npmVersion": "1.3.4", "_npmUser": { "name": "isaacs", @@ -36,5 +36,6 @@ ], "directories": {}, "_shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", - "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz", + "homepage": "https://github.com/isaacs/util-extend" } diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index 2c50225534f0fb..145205fcc1b72c 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "3.1.3", + "version": "3.1.5", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -33,33 +33,14 @@ "rimraf": "^2.2.8", "tap": "~0.4.8" }, - "gitHead": "50e45af7581b1a879c62146fafbfa1b92842f7df", + "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n", + "readmeFilename": "README.md", + "gitHead": "577c3f3f4f1e435f9bd944b8f99ce3f7552709ef", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" }, "homepage": "https://github.com/isaacs/read-installed", - "_id": "read-installed@3.1.3", - "_shasum": "c09092a13c2117f22842cad16804f3b059129d11", - "_from": "read-installed@>=3.1.2-0 <3.2.0-0", - "_npmVersion": "2.0.0-beta.3", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "dist": { - "shasum": "c09092a13c2117f22842cad16804f3b059129d11", - "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" + "_id": "read-installed@3.1.5", + "_shasum": "4ae36081afd3e2204dc2e279807aaa52c30c8c0c", + "_from": "read-installed@>=3.1.5 <3.2.0" } diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js index a92ed3fbee34af..2e299445bcdd72 100644 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ b/deps/npm/node_modules/read-installed/read-installed.js @@ -345,7 +345,7 @@ function unmarkExtraneous (obj, opts) { obj.extraneous = false - var deps = obj._dependencies + var deps = obj._dependencies || [] if (opts.dev && obj.devDependencies && (obj.root || obj.link)) { Object.keys(obj.devDependencies).forEach(function (k) { deps[k] = obj.devDependencies[k] diff --git a/deps/npm/node_modules/read-installed/test/empty.js b/deps/npm/node_modules/read-installed/test/empty.js new file mode 100644 index 00000000000000..09ace074f5cb21 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/empty.js @@ -0,0 +1,16 @@ +var readInstalled = require("../read-installed.js"); +var test = require("tap").test; +var path = require("path"); + +test("Handle bad path", function (t) { + readInstalled(path.join(__dirname, "../unknown"), { + dev: true, + log: console.error + }, function (er, map) { + t.notOk(er, "er should be null"); + t.ok(map, "map should be data"); + t.equal(Object.keys(map.dependencies).length, 0, "Dependencies should have no keys"); + if (er) return console.error(er.stack || er.message); + t.end(); + }); +}); diff --git a/deps/npm/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/readable-stream/LICENSE index 0c44ae716db8f3..e3d4e695a4cff2 100644 --- a/deps/npm/node_modules/readable-stream/LICENSE +++ b/deps/npm/node_modules/readable-stream/LICENSE @@ -1,27 +1,18 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +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 BSD License +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +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/README.md b/deps/npm/node_modules/readable-stream/README.md index 34c11897927949..3fb3e8023eb3bd 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -2,8 +2,8 @@ ***Node-core streams for userland*** -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png)](https://nodei.co/npm/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/) This package is a mirror of the Streams2 and Streams3 implementations in Node-core. diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index 2fbd99751fb870..8d32bee918e527 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -1,6 +1,6 @@ { "name": "readable-stream", - "version": "1.0.32", + "version": "1.0.33", "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", "main": "readable.js", "dependencies": { @@ -33,16 +33,15 @@ "url": "http://blog.izs.me/" }, "license": "MIT", - "gitHead": "2024ad52b1e475465488b4ad39eb41d067ffcbb9", + "gitHead": "0bf97a117c5646556548966409ebc57a6dda2638", "bugs": { "url": "https://github.com/isaacs/readable-stream/issues" }, "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.0.32", - "_shasum": "6b44a88ba984cd0ec0834ae7d59a47c39aef48ec", - "_from": "readable-stream@*", - "_npmVersion": "2.0.2", - "_nodeVersion": "0.10.31", + "_id": "readable-stream@1.0.33", + "_shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", + "_from": "readable-stream@>=1.0.33 <1.1.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" @@ -62,10 +61,10 @@ } ], "dist": { - "shasum": "6b44a88ba984cd0ec0834ae7d59a47c39aef48ec", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.32.tgz" + "shasum": "3a360dd66c1b1d7fd4705389860eda1d0f61126c", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.32.tgz", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/readable-stream/readable.js b/deps/npm/node_modules/readable-stream/readable.js index 4d1ddfc734e26f..8b5337b5c500f3 100644 --- a/deps/npm/node_modules/readable-stream/readable.js +++ b/deps/npm/node_modules/readable-stream/readable.js @@ -1,4 +1,6 @@ +var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/realize-package-specifier/index.js b/deps/npm/node_modules/realize-package-specifier/index.js index 261ad663077f74..30214b2da37a4d 100644 --- a/deps/npm/node_modules/realize-package-specifier/index.js +++ b/deps/npm/node_modules/realize-package-specifier/index.js @@ -14,6 +14,7 @@ module.exports = function (spec, where, cb) { catch (e) { return cb(e) } + 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) diff --git a/deps/npm/node_modules/realize-package-specifier/package.json b/deps/npm/node_modules/realize-package-specifier/package.json index 53645763748ce3..b04c49a35e9f99 100644 --- a/deps/npm/node_modules/realize-package-specifier/package.json +++ b/deps/npm/node_modules/realize-package-specifier/package.json @@ -1,6 +1,6 @@ { "name": "realize-package-specifier", - "version": "1.2.0", + "version": "1.3.0", "description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.", "main": "index.js", "scripts": { @@ -25,29 +25,13 @@ "require-inject": "^1.1.0", "tap": "^0.4.12" }, - "gitHead": "39016343d5bd5572ab39374323e9588e54985910", + "gitHead": "d05d49409e28404473a292cf99df05642a24c08f", + "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* 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 Objects\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 * `github` - A github shorthand, like `user/project`\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* `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", "bugs": { "url": "https://github.com/npm/realize-package-specifier/issues" }, - "_id": "realize-package-specifier@1.2.0", - "_shasum": "93364e40dee38369f92e9b0c76124500342132f2", - "_from": "realize-package-specifier@>=1.2.0 <1.3.0", - "_npmVersion": "2.1.2", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "dist": { - "shasum": "93364e40dee38369f92e9b0c76124500342132f2", - "tarball": "http://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-1.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-1.2.0.tgz" + "_id": "realize-package-specifier@1.3.0", + "_shasum": "23374a84e6a9188483f346cc939eb58eec85efa5", + "_from": "realize-package-specifier@~1.3.0" } 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 d5d8fc6c07f5df..b371826e7db879 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/basic.js +++ b/deps/npm/node_modules/realize-package-specifier/test/basic.js @@ -4,15 +4,17 @@ var requireInject = require("require-inject") var path = require("path") var re = { - tarball: /[\/\\]a.tar.gz$/, - packagedir: /[\/\\]b$/, - packagejson: /[\/\\]b[\/\\]package.json$/, - nonpackagedir: /[\/\\]c$/, - nopackagejson: /[\/\\]c[\/\\]package.json$/, - remotename: /[\/\\]d$/, - packagedirlikegithub: /[\/\\]e[\/\\]1$/, - packagejsonlikegithub: /[\/\\]e[\/\\]1[\/\\]package.json$/, - github: /[\/\\]e[\/\\]2$/ + tarball: /[/\\]a.tar.gz$/, + packagedir: /[/\\]b$/, + packagejson: /[/\\]b[/\\]package.json$/, + nonpackagedir: /[/\\]c$/, + nopackagejson: /[/\\]c[/\\]package.json$/, + remotename: /[/\\]d$/, + packagedirlikegithub: /[/\\]e[/\\]1$/, + packagejsonlikegithub: /[/\\]e[/\\]1[/\\]package.json$/, + github: /[/\\]e[/\\]2$/, + localrangefile: /[/\\]1[.]0[.]0$/, + localverfile: /[/\\]1$/ } var rps = requireInject("../index", { @@ -45,6 +47,12 @@ var rps = requireInject("../index", { else if (re.github.test(path)) { callback(new Error("EFILENOTFOUND")) } + else if (re.localverfile.test(path)) { + callback(null,{isDirectory:function(){ return false }}) + } + else if (re.localrangefile.test(path)) { + callback(null,{isDirectory:function(){ return false }}) + } else { throw new Error("Unknown stat fixture path: "+path) } @@ -53,7 +61,7 @@ var rps = requireInject("../index", { }) test("realize-package-specifier", function (t) { - t.plan(10) + t.plan(12) rps("a.tar.gz", function (err, result) { t.is(result.type, "local", "local tarball") }) @@ -84,9 +92,15 @@ test("realize-package-specifier", function (t) { rps("e/2", function (err, result) { t.is(result.type, "github", "github package dependency") }) + rps("1", function (err, result) { + t.is(result.type, "local", "range like local file is still a local file") + }) + rps("1.0.0", function (err, result) { + t.is(result.type, "local", "version like local file is still a local file") + }) }) test("named realize-package-specifier", function (t) { - t.plan(10) + t.plan(12) rps("a@a.tar.gz", function (err, result) { t.is(result.type, "local", "named local tarball") @@ -118,4 +132,10 @@ test("named realize-package-specifier", function (t) { rps("e@e/2", function (err, result) { t.is(result.type, "github", "github package dependency") }) + rps("e@1", function (err, result) { + t.is(result.type, "range", "range like specifier is never a local file") + }) + rps("e@1.0.0", function (err, result) { + t.is(result.type, "version", "version like specifier is never a local file") + }) }) diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml index 742c7dfa0c5f2b..90e06c13e3c01b 100644 --- a/deps/npm/node_modules/request/.travis.yml +++ b/deps/npm/node_modules/request/.travis.yml @@ -2,6 +2,8 @@ language: node_js node_js: - "0.8" - "0.10" +before_install: npm install -g npm@~1.4.6 +after_script: ./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js --report lcovonly && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose webhooks: urls: https://webhooks.gitter.im/e/237280ed4796c19cc626 on_success: change # options: [always|never|change] default: always diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index 11f571f23af585..f4e5431b427dec 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,954 +1,394 @@ ## Change Log -### upcoming (2014/07/09 12:10 +00:00) -- [#946](https://github.com/mikeal/request/pull/946) defaults: merge headers (@aj0strow) -- [#844](https://github.com/mikeal/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy) +### v2.51.0 (2014/12/10) +- [#1310](https://github.com/request/request/pull/1310) Revert changes introduced in https://github.com/request/request/pull/1282 (@simov) -### v2.37.1 (2014/07/07 17:25 +00:00) -- [8711b2f](https://github.com/mikeal/request/commit/8711b2f3489553a7ddae69fa8c9f538182c9d5c8) 2.37.1 (@mikeal) +### v2.50.0 (2014/12/09) +- [#1308](https://github.com/request/request/pull/1308) Add browser test to keep track of browserify compability. (@eiriksm) +- [#1299](https://github.com/request/request/pull/1299) Add optional support for jsonReviver (@poislagarde) +- [#1277](https://github.com/request/request/pull/1277) Add Coveralls configuration (@simov) +- [#1307](https://github.com/request/request/pull/1307) Upgrade form-data, add back browserify compability. Fixes #455. (@eiriksm) +- [#1305](https://github.com/request/request/pull/1305) Fix typo in README.md (@LewisJEllis) +- [#1288](https://github.com/request/request/pull/1288) Update README.md to explain custom file use case (@cliffcrosland) -### v2.37.0 (2014/07/07 17:25 +00:00) -- [79472b2](https://github.com/mikeal/request/commit/79472b263cde77504a354913a16bdc9fbdc9ed5d) append secureOptions to poolKey (@medovob) -- [#907](https://github.com/mikeal/request/pull/907) append secureOptions to poolKey (@medovob) -- [b223a8a](https://github.com/mikeal/request/commit/b223a8add0cbdd4e699a52da66aeb0f0cb17a0c3) expose tough-cookie's getCookiesSync (@charlespwd) -- [f4dcad0](https://github.com/mikeal/request/commit/f4dcad0fa6e2f2388abae508ad7256a1e1214ab2) test getCookies method (@charlespwd) -- [adcf62b](https://github.com/mikeal/request/commit/adcf62bf45ec19a28198ca8d3f37e7d7babc883a) update readme (@charlespwd) -- [4fdf13b](https://github.com/mikeal/request/commit/4fdf13b57dcd20b9fe03c0956f5df70c82d6e4a3) Merge branch 'charlespwd-master' (@lalitkapoor) -- [83e370d](https://github.com/mikeal/request/commit/83e370d54ca2a5fb162e40e7e705e1e9d702ba0a) Bump version of hawk dep. (@samccone) -- [#927](https://github.com/mikeal/request/pull/927) Bump version of hawk dep. (@samccone) -- [c42dcec](https://github.com/mikeal/request/commit/c42dcec10a307cb2299861f87720d491a89142b4) package.json: use OSI-style license name (@isaacs) -- [8892cb7](https://github.com/mikeal/request/commit/8892cb7bb8945807ff25038e888222d4e902acc8) Swap mime module. (@eiriksm) -- [d92395e](https://github.com/mikeal/request/commit/d92395e638cbfe5c31eb4ff54941b98b09057486) Make package.json so node .8 understands it. (@eiriksm) -- [6ebd748](https://github.com/mikeal/request/commit/6ebd748a02a49976d41ebbc4f8396acf8fda1c14) Add some additional hacks to work in the browser. (@eiriksm) -- [#943](https://github.com/mikeal/request/pull/943) New mime module (@eiriksm) -- [561454d](https://github.com/mikeal/request/commit/561454d18a68b7a03163308f6d29e127afe97426) Add some code comments about why we do the extra checks. (@eiriksm) -- [#944](https://github.com/mikeal/request/pull/944) Make request work with browserify (@eiriksm) -- [6a0add7](https://github.com/mikeal/request/commit/6a0add70b2687cf751b3446a15a513a1fd141738) defaults: merge headers (@aj0strow) -- [407c1ad](https://github.com/mikeal/request/commit/407c1ada61afca4d4ba50155c6d9430754541df1) prefer late return statement (@aj0strow) -- [4ab40ba](https://github.com/mikeal/request/commit/4ab40ba2f9aca8958cab149eb9cfbd9edb5534aa) Added support for manual querystring in form option (@charlespwd) -- [a55627c](https://github.com/mikeal/request/commit/a55627cd9f468cefb2971bb501ebc0c2fc27aa8b) Updated README (@charlespwd) -- [#949](https://github.com/mikeal/request/pull/949) Manually enter querystring in form option (@charlespwd) -- [10246c8](https://github.com/mikeal/request/commit/10246c84819db14b32fccca040029b06449242a3) [PATCH v2] Add support for gzip content decoding (@kevinoid) -- [6180c5f](https://github.com/mikeal/request/commit/6180c5f45c01fb2158b9a44f894a34263479fa84) check for content-length header before setting it in nextTick (@camilleanne) -- [#951](https://github.com/mikeal/request/pull/951) Add support for gzip content decoding (@kevinoid) -- [849c681](https://github.com/mikeal/request/commit/849c681846ce3b5492bd47261de391377a3ac19b) Silence EventEmitter memory leak warning #311 (@watson) -- [#955](https://github.com/mikeal/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne) -- [#957](https://github.com/mikeal/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson) -- [c1d951e](https://github.com/mikeal/request/commit/c1d951e536bd41c957f0cade41d051c9d41d1462) Fixing for 0.8 (@mikeal) -- [4851118](https://github.com/mikeal/request/commit/48511186495888a5f0cb15a107325001ac91990e) 2.37.0 (@mikeal) +### v2.49.0 (2014/11/28) +- [#1295](https://github.com/request/request/pull/1295) fix(proxy): no-proxy false positive (@oliamb) +- [#1292](https://github.com/request/request/pull/1292) Upgrade `caseless` to 0.8.1 (@mmalecki) +- [#1276](https://github.com/request/request/pull/1276) Set transfer encoding for multipart/related to chunked by default (@simov) +- [#1275](https://github.com/request/request/pull/1275) Fix multipart content-type headers detection (@simov) +- [#1269](https://github.com/request/request/pull/1269) adds streams example for review (@tbuchok) +- [#1238](https://github.com/request/request/pull/1238) Add examples README.md (@simov) -### v2.36.1 (2014/05/19 20:59 +00:00) -- [c3914fc](https://github.com/mikeal/request/commit/c3914fcd4a74faf6dbf0fb6a4a188e871e0c51b8) 2.36.1 (@mikeal) +### v2.48.0 (2014/11/12) +- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2) +- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen) +- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen) +- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen) +- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos) +- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen) +- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel) +- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen) +- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem) +- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen) +- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov) +- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser) -### v2.36.0 (2014/05/19 20:59 +00:00) -- [76a96de](https://github.com/mikeal/request/commit/76a96de75580042aa780e9587ff7a22522119c3f) Reventing lodash merge change. (@mikeal) -- [b8bb57e](https://github.com/mikeal/request/commit/b8bb57efb17e72e2ac6d957c05c3f2570c7ba6a0) 2.36.0 (@mikeal) +### v2.47.0 (2014/10/26) +- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen) +- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott) +- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen) +- [#1219](https://github.com/request/request/pull/1219) remove old globalAgent workaround for node 0.4 (@request) +- [#1214](https://github.com/request/request/pull/1214) Remove cruft left over from optional dependencies (@nylen) +- [#1215](https://github.com/request/request/pull/1215) Add proxyHeaderExclusiveList option for proxy-only headers. (@RReverser) +- [#1211](https://github.com/request/request/pull/1211) Allow 'Host' header instead of 'host' and remember case across redirects (@nylen) +- [#1208](https://github.com/request/request/pull/1208) Improve release script (@nylen) +- [#1213](https://github.com/request/request/pull/1213) Support for custom cookie store (@nylen, @mitsuru) +- [#1197](https://github.com/request/request/pull/1197) Clean up some code around setting the agent (@FredKSchott) +- [#1209](https://github.com/request/request/pull/1209) Improve multipart form append test (@simov) +- [#1207](https://github.com/request/request/pull/1207) Update changelog (@nylen) +- [#1185](https://github.com/request/request/pull/1185) Stream multipart/related bodies (@simov) -### v2.35.1 (2014/05/17 20:57 +00:00) -- [4bbd153](https://github.com/mikeal/request/commit/4bbd1532a68cadf1a88dd69c277645e9b781f364) 2.35.1 (@mikeal) +### v2.46.0 (2014/10/23) +- [#1198](https://github.com/request/request/pull/1198) doc for TLS/SSL protocol options (@shawnzhu) +- [#1200](https://github.com/request/request/pull/1200) Add a Gitter chat badge to README.md (@gitter-badger) +- [#1196](https://github.com/request/request/pull/1196) Upgrade taper test reporter to v0.3.0 (@nylen) +- [#1199](https://github.com/request/request/pull/1199) Fix lint error: undeclared var i (@nylen) +- [#1191](https://github.com/request/request/pull/1191) Move self.proxy decision logic out of init and into a helper (@FredKSchott) +- [#1190](https://github.com/request/request/pull/1190) Move _buildRequest() logic back into init (@FredKSchott) +- [#1186](https://github.com/request/request/pull/1186) Support Smarter Unix URL Scheme (@FredKSchott) +- [#1178](https://github.com/request/request/pull/1178) update form documentation for new usage (@FredKSchott) +- [#1180](https://github.com/request/request/pull/1180) Enable no-mixed-requires linting rule (@nylen) +- [#1184](https://github.com/request/request/pull/1184) Don't forward authorization header across redirects to different hosts (@nylen) +- [#1183](https://github.com/request/request/pull/1183) Correct README about pre and postamble CRLF using multipart and not mult... (@netpoetica) +- [#1179](https://github.com/request/request/pull/1179) Lint tests directory (@nylen) +- [#1169](https://github.com/request/request/pull/1169) add metadata for form-data file field (@dotcypress) +- [#1173](https://github.com/request/request/pull/1173) remove optional dependencies (@seanstrom) +- [#1165](https://github.com/request/request/pull/1165) Cleanup event listeners and remove function creation from init (@FredKSchott) +- [#1174](https://github.com/request/request/pull/1174) update the request.cookie docs to have a valid cookie example (@seanstrom) +- [#1168](https://github.com/request/request/pull/1168) create a detach helper and use detach helper in replace of nextTick (@seanstrom) +- [#1171](https://github.com/request/request/pull/1171) in post can send form data and use callback (@MiroRadenovic) +- [#1159](https://github.com/request/request/pull/1159) accept charset for x-www-form-urlencoded content-type (@seanstrom) +- [#1157](https://github.com/request/request/pull/1157) Update README.md: body with json=true (@Rob--W) +- [#1164](https://github.com/request/request/pull/1164) Disable tests/test-timeout.js on Travis (@nylen) +- [#1153](https://github.com/request/request/pull/1153) Document how to run a single test (@nylen) +- [#1144](https://github.com/request/request/pull/1144) adds documentation for the "response" event within the streaming section (@tbuchok) +- [#1162](https://github.com/request/request/pull/1162) Update eslintrc file to no longer allow past errors (@FredKSchott) +- [#1155](https://github.com/request/request/pull/1155) Support/use self everywhere (@seanstrom) +- [#1161](https://github.com/request/request/pull/1161) fix no-use-before-define lint warnings (@emkay) +- [#1156](https://github.com/request/request/pull/1156) adding curly brackets to get rid of lint errors (@emkay) +- [#1151](https://github.com/request/request/pull/1151) Fix localAddress test on OS X (@nylen) +- [#1145](https://github.com/request/request/pull/1145) documentation: fix outdated reference to setCookieSync old name in README (@FredKSchott) +- [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott) +- [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen) +- [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund) +- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock) +- [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey) +- [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott) +- [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom) +- [#1129](https://github.com/request/request/pull/1129) linting fix: convert double quote strings to use single quotes (@FredKSchott) +- [#1124](https://github.com/request/request/pull/1124) linting fix: remove unneccesary semi-colons (@FredKSchott) -### v2.35.0 (2014/05/17 20:57 +00:00) -- [2833da3](https://github.com/mikeal/request/commit/2833da3c3c1c34f4130ad1ba470354fc32410691) initial changelog (@lalitkapoor) -- [49319e6](https://github.com/mikeal/request/commit/49319e6c09a8a169c95a8d282c900f9fecd50371) Merge branch 'master' of https://github.com/mikeal/request into create-changelog-based-on-pull-requests (@lalitkapoor) -- [#815](https://github.com/mikeal/request/pull/815) Create changelog based on pull requests (@lalitkapoor) -- [4b6ce1a](https://github.com/mikeal/request/commit/4b6ce1ac0f79cb8fa633e281d3eb4c0cb61794e1) It appears that secureOptions is an undocumented feature to fix issues with broken server. See joynet/node #5119 (@nw) -- [#821](https://github.com/mikeal/request/pull/821) added secureOptions back (@nw) -- [eddd488](https://github.com/mikeal/request/commit/eddd4889fb1bc95c741749e79d9749aab3e103fc) Fixing #825 (@mikeal) -- [4627a7a](https://github.com/mikeal/request/commit/4627a7a14078494ded8c66c19c43efd07324cbd8) improve error reporting for invalid protocols (@FND) -- [#840](https://github.com/mikeal/request/pull/840) improve error reporting for invalid protocols (@FND) -- [#810](https://github.com/mikeal/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil) -- [8a0e2d6](https://github.com/mikeal/request/commit/8a0e2d65351560858275c73505df12b537f4d001) Added support for HTTP_PROXY and HTTPS_PROXY environment variables, if the proxy option isn't already set. (@jvmccarthy) -- [f60d348](https://github.com/mikeal/request/commit/f60d348dc1840ee6d7b709efcc2b3cd1a03aef63) Fix word consistency -- [#850](https://github.com/mikeal/request/pull/850) Fix word consistency in readme (@0xNobody) -- [#809](https://github.com/mikeal/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700) -- [e86377c](https://github.com/mikeal/request/commit/e86377c0c1e7695c3997f7802175ca37f5a5113b) Won't use HTTP(S)_PROXY env var if proxy explicitly set to null. (@jvmccarthy) -- [f1bb537](https://github.com/mikeal/request/commit/f1bb537ee2440bd664ea8c445ac3a2c6e31e9932) Add support for RFC 6750 Bearer Tokens -- [ba51a26](https://github.com/mikeal/request/commit/ba51a26079ec52c0a9145fbe8b6796d46e79bb8e) Add documentation about auth.bearer (@phedny) -- [#861](https://github.com/mikeal/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny) -- [b8ee579](https://github.com/mikeal/request/commit/b8ee5790ace95440a56074f6afe866f4662e9e88) Fix typo (@dandv) -- [#866](https://github.com/mikeal/request/pull/866) Fix typo (@dandv) -- [b292b59](https://github.com/mikeal/request/commit/b292b59fadecb35dac3bee0959c4b4b782e772e3) Clean code syntax in test-pipes.js (@tgohn) -- [f7996d5](https://github.com/mikeal/request/commit/f7996d5fcfed85e03f293a7c9739e385b64ecaad) Add test for request.pipefilter (@tgohn) -- [#869](https://github.com/mikeal/request/pull/869) Pipefilter test (@tgohn) -- [86b99b6](https://github.com/mikeal/request/commit/86b99b671a3c86f4f963a6c67047343fd8edae8f) Fix typo in form example (@mscdex) -- [2ba4808](https://github.com/mikeal/request/commit/2ba48083ddf2607f85e2c479e0d254483c2610fe) failing test (@lalitkapoor) -- [39396b0](https://github.com/mikeal/request/commit/39396b0bb2e90eb7ec4dfcf5d2e731a2cb156f5c) extend passed in options (@lalitkapoor) -- [#891](https://github.com/mikeal/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor) -- [54a51c6](https://github.com/mikeal/request/commit/54a51c665887e162ccb9f6b17b9c1f3b017ccc29) merge options (@vohof) -- [25b95db](https://github.com/mikeal/request/commit/25b95dbdddf874f014386a0a9fe35a7c903b7415) tilde? (@vohof) -- [#897](https://github.com/mikeal/request/pull/897) merge with default options (@vohof) -- [a1e4b1a](https://github.com/mikeal/request/commit/a1e4b1a9c2f39ce565fd023bb604da139f689d43) Fixes #555 (@pigulla) -- [#901](https://github.com/mikeal/request/pull/901) Fixes #555 (@pigulla) -- [6498a5f](https://github.com/mikeal/request/commit/6498a5f1ae68050cfeabf8f34f75bc72b08f1805) 2.35.0 (@mikeal) +### v2.45.0 (2014/10/06) +- [#1128](https://github.com/request/request/pull/1128) Add test for setCookie regression (@nylen) +- [#1127](https://github.com/request/request/pull/1127) added tests around using objects as values in a query string (@bcoe) +- [#1103](https://github.com/request/request/pull/1103) Support/refactor request constructor (@nylen, @seanstrom) +- [#1119](https://github.com/request/request/pull/1119) add basic linting to request library (@FredKSchott) +- [#1121](https://github.com/request/request/pull/1121) Revert "Explicitly use sync versions of cookie functions" (@nylen) +- [#1118](https://github.com/request/request/pull/1118) linting fix: Restructure bad empty if statement (@FredKSchott) +- [#1117](https://github.com/request/request/pull/1117) Fix a bad check for valid URIs (@FredKSchott) +- [#1113](https://github.com/request/request/pull/1113) linting fix: space out operators (@FredKSchott) +- [#1116](https://github.com/request/request/pull/1116) Fix typo in `noProxyHost` definition (@FredKSchott) +- [#1114](https://github.com/request/request/pull/1114) linting fix: Added a `new` operator that was missing when creating and throwing a new error (@FredKSchott) +- [#1096](https://github.com/request/request/pull/1096) No_proxy support (@samcday) +- [#1107](https://github.com/request/request/pull/1107) linting-fix: remove unused variables (@FredKSchott) +- [#1112](https://github.com/request/request/pull/1112) linting fix: Make return values consistent and more straitforward (@FredKSchott) +- [#1111](https://github.com/request/request/pull/1111) linting fix: authPieces was getting redeclared (@FredKSchott) +- [#1105](https://github.com/request/request/pull/1105) Use strict mode in request (@FredKSchott) +- [#1110](https://github.com/request/request/pull/1110) linting fix: replace lazy '==' with more strict '===' (@FredKSchott) +- [#1109](https://github.com/request/request/pull/1109) linting fix: remove function call from if-else conditional statement (@FredKSchott) +- [#1102](https://github.com/request/request/pull/1102) Fix to allow setting a `requester` on recursive calls to `request.defaults` (@tikotzky) +- [#1095](https://github.com/request/request/pull/1095) Tweaking engines in package.json (@pdehaan) +- [#1082](https://github.com/request/request/pull/1082) Forward the socket event from the httpModule request (@seanstrom) +- [#972](https://github.com/request/request/pull/972) Clarify gzip handling in the README (@kevinoid) +- [#1089](https://github.com/request/request/pull/1089) Mention that encoding defaults to utf8, not Buffer (@stuartpb) +- [#1088](https://github.com/request/request/pull/1088) Fix cookie example in README.md and make it more clear (@pipi32167) +- [#1027](https://github.com/request/request/pull/1027) Add support for multipart form data in request options. (@crocket) +- [#1076](https://github.com/request/request/pull/1076) use Request.abort() to abort the request when the request has timed-out (@seanstrom) +- [#1068](https://github.com/request/request/pull/1068) add optional postamble required by .NET multipart requests (@netpoetica) -### v2.34.1 (2014/02/18 19:35 +00:00) -- [aefea20](https://github.com/mikeal/request/commit/aefea20b215ff1a48f0d8d27dcac0186604e3b2d) 2.34.1 (@mikeal) +### v2.43.0 (2014/09/18) +- [#1057](https://github.com/request/request/pull/1057) Defaults should not overwrite defined options (@davidwood) +- [#1046](https://github.com/request/request/pull/1046) Propagate datastream errors, useful in case gzip fails. (@ZJONSSON, @Janpot) +- [#1063](https://github.com/request/request/pull/1063) copy the input headers object #1060 (@finnp) +- [#1031](https://github.com/request/request/pull/1031) Explicitly use sync versions of cookie functions (@ZJONSSON) +- [#1056](https://github.com/request/request/pull/1056) Fix redirects when passing url.parse(x) as URL to convenience method (@nylen) -### v2.34.0 (2014/02/18 19:35 +00:00) -- [46edc90](https://github.com/mikeal/request/commit/46edc902e6ffdee39038a6702021728cb9d9b8fa) simpler (@joaojeronimo) -- [#781](https://github.com/mikeal/request/pull/781) simpler isReadStream function (@joaojeronimo) -- [fe2f59f](https://github.com/mikeal/request/commit/fe2f59fdc72de5c86404e51ab6bc4e0e8ece95f2) Provide ability to override content-type when `json` option used (@vvo) -- [#785](https://github.com/mikeal/request/pull/785) Provide ability to override content-type when `json` option used (@vvo) -- [d134f01](https://github.com/mikeal/request/commit/d134f012e64702e8f4070d61504b39524e1a07ba) Adds content-length calculation when submitting forms using form-data library. This is related to issue 345. (@Juul) -- [#793](https://github.com/mikeal/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul) -- [3ebf25c](https://github.com/mikeal/request/commit/3ebf25c5af1194d8f7b3a3330fe89e729532809b) adding failing test (@lalitkapoor) -- [0f57a90](https://github.com/mikeal/request/commit/0f57a90384588727a5446bb1f5bf4e0be2d85780) accept options in arguments (@lalitkapoor) -- [7fb1647](https://github.com/mikeal/request/commit/7fb164731a5aad80c6539e33eda4ad4a51bb7871) silently ignore errors when adding cookie to jar (@lalitkapoor) -- [d6b2b1c](https://github.com/mikeal/request/commit/d6b2b1c279d12cdddc6593060672d49b12e63fea) add additional header test (@lalitkapoor) -- [f29e6df](https://github.com/mikeal/request/commit/f29e6dfadc6c3a45b6190998b6608059f87f3c32) Added the Apache license to the package.json. (@keskival) -- [#802](https://github.com/mikeal/request/pull/802) Added the Apache license to the package.json. (@keskival) -- [#801](https://github.com/mikeal/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor) -- [54e6dfb](https://github.com/mikeal/request/commit/54e6dfb77d57757d4006982f813ebaab9e005cd5) Rewrite UNIX Domain Socket support into 2.33.1. Add test. (@lyuzashi) -- [3eaed2f](https://github.com/mikeal/request/commit/3eaed2f2e82d9d17a583bcc54270c16a7b674206) Use setImmediate when available, otherwise fallback to nextTick (@lyuzashi) -- [746ca75](https://github.com/mikeal/request/commit/746ca757da24d5011e92e04cb00c90098a7680fd) Indent wrapped buildRequest function (@lyuzashi) -- [#516](https://github.com/mikeal/request/pull/516) UNIX Socket URL Support (@native-digital) -- [9a5b0a8](https://github.com/mikeal/request/commit/9a5b0a81eca9836f05b0192c05c0d41e79034461) initial format (@lalitkapoor) -- [9380a49](https://github.com/mikeal/request/commit/9380a49779ddb081eba5d0ee51e4396d72d52066) upgrade tunnel-proxy to 0.4.0 (@ksato9700) -- [1efea37](https://github.com/mikeal/request/commit/1efea374286c728c3c988ee2264fb44cd8c41d88) add some exposition to mpu example in README.md (@mikermcneil) -- [ba0d63a](https://github.com/mikeal/request/commit/ba0d63ae23a3fc95dfe012df0bd6c8d7e87b1df7) made the language clearer (@mikermcneil) -- [b43aa81](https://github.com/mikeal/request/commit/b43aa81789c0b8c7ae90d2b983f79dde4a125470) 2.34.0 (@mikeal) +### v2.42.0 (2014/09/04) +- [#1053](https://github.com/request/request/pull/1053) Fix #1051 Parse auth properly when using non-tunneling proxy (@isaacs) -### v2.33.1 (2014/01/16 19:48 +00:00) -- [afcf827](https://github.com/mikeal/request/commit/afcf827559b3223c96ac1bbd19bd1e4a6d7771e3) 2.33.1 (@mikeal) +### v2.41.0 (2014/09/04) +- [#1050](https://github.com/request/request/pull/1050) Pass whitelisted headers to tunneling proxy. Organize all tunneling logic. (@isaacs, @Feldhacker) +- [#1035](https://github.com/request/request/pull/1035) souped up nodei.co badge (@rvagg) +- [#1048](https://github.com/request/request/pull/1048) Aws is now possible over a proxy (@steven-aerts) +- [#1039](https://github.com/request/request/pull/1039) extract out helper functions to a helper file (@seanstrom) +- [#1021](https://github.com/request/request/pull/1021) Support/refactor indexjs (@seanstrom) +- [#1033](https://github.com/request/request/pull/1033) Improve and document debug options (@nylen) +- [#1034](https://github.com/request/request/pull/1034) Fix readme headings (@nylen) +- [#1030](https://github.com/request/request/pull/1030) Allow recursive request.defaults (@tikotzky) +- [#1029](https://github.com/request/request/pull/1029) Fix a couple of typos (@nylen) +- [#675](https://github.com/request/request/pull/675) Checking for SSL fault on connection before reading SSL properties (@VRMink) +- [#989](https://github.com/request/request/pull/989) Added allowRedirect function. Should return true if redirect is allowed or false otherwise (@doronin) +- [#1025](https://github.com/request/request/pull/1025) [fixes #1023] Set self._ended to true once response has ended (@mridgway) +- [#1020](https://github.com/request/request/pull/1020) Add back removed debug metadata (@FredKSchott) +- [#1008](https://github.com/request/request/pull/1008) Moving to module instead of cutomer buffer concatenation. (@mikeal) +- [#770](https://github.com/request/request/pull/770) Added dependency badge for README file; (@timgluz) +- [#1016](https://github.com/request/request/pull/1016) toJSON no longer results in an infinite loop, returns simple objects (@FredKSchott) +- [#1018](https://github.com/request/request/pull/1018) Remove pre-0.4.4 HTTPS fix (@mmalecki) +- [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal) +- [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19) +- [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm) +- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl) -### v2.33.0 (2014/01/16 19:48 +00:00) -- [7f1cc8f](https://github.com/mikeal/request/commit/7f1cc8ff5a8d9443e7a793f4655487e722b75b0d) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [3e43d3d](https://github.com/mikeal/request/commit/3e43d3d5175f5f18d1e97b2f5d4ca6ac6c216e4a) 2.33.0 (@mikeal) +### v2.40.0 (2014/08/06) +- [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja) +- [#988](https://github.com/request/request/pull/988) “--” -> “—” (@upisfree) +- [#987](https://github.com/request/request/pull/987) Show optional modules as being loaded by the module that reqeusted them (@iarna) -### v2.32.1 (2014/01/16 19:33 +00:00) -- [dd44f39](https://github.com/mikeal/request/commit/dd44f39d37daacbbeb21f9e960f13adbb44eea0a) 2.32.1 (@mikeal) +### v2.39.0 (2014/07/24) +- [#976](https://github.com/request/request/pull/976) Update README.md (@fosco-maestro) -### v2.32.0 (2014/01/16 19:33 +00:00) -- [#757](https://github.com/mikeal/request/pull/757) require aws-sign2 (@mafintosh) -- [#744](https://github.com/mikeal/request/pull/744) Use Cookie.parse (@lalitkapoor) -- [5eaee1c](https://github.com/mikeal/request/commit/5eaee1ce4008ede1df15201622ac478c892d6a8a) Upgrade tough-cookie to 0.10.0 (@stash) -- [#763](https://github.com/mikeal/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash) -- [d2489d0](https://github.com/mikeal/request/commit/d2489d0e24d9a538224f5c8c090dcdeb1f8d4969) Fixed auth error for some servers like twisted. According to rfc 2617 auth scheme token should be case-insensitive. (@bobyrizov) -- [#764](https://github.com/mikeal/request/pull/764) Case-insensitive authentication scheme (@bobyrizov) -- [cbee3d0](https://github.com/mikeal/request/commit/cbee3d04ee9f704501a64edb7b9b6d201e98494b) Use tough-cookie CookieJar sync API (@stash) -- [3eeaf6a](https://github.com/mikeal/request/commit/3eeaf6a90df7b806d91ae1e8e2f56862ece2ea33) Emit error, not cookieError (@stash) -- [#767](https://github.com/mikeal/request/pull/767) Use tough-cookie CookieJar sync API (@stash) -- [9eac534](https://github.com/mikeal/request/commit/9eac534dd11e40bba65456491cb62ad68d8f41fa) 2.32.0 (@mikeal) +### v2.38.0 (2014/07/22) +- [#952](https://github.com/request/request/pull/952) Adding support to client certificate with proxy use case (@ofirshaked) +- [#884](https://github.com/request/request/pull/884) Documented tough-cookie installation. (@wbyoung) +- [#935](https://github.com/request/request/pull/935) Correct repository url (@fritx) +- [#963](https://github.com/request/request/pull/963) Update changelog (@nylen) +- [#960](https://github.com/request/request/pull/960) Support gzip with encoding on node pre-v0.9.4 (@kevinoid) +- [#953](https://github.com/request/request/pull/953) Add async Content-Length computation when using form-data (@LoicMahieu) +- [#844](https://github.com/request/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy) +- [#946](https://github.com/request/request/pull/946) defaults: merge headers (@aj0strow) -### v2.31.1 (2014/01/08 02:57 +00:00) -- [b1b5e91](https://github.com/mikeal/request/commit/b1b5e9161e149574ba5528c401a70bfadef1a98a) 2.31.1 (@mikeal) +### v2.37.0 (2014/07/07) +- [#957](https://github.com/request/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson) +- [#955](https://github.com/request/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne) +- [#951](https://github.com/request/request/pull/951) Add support for gzip content decoding (@kevinoid) +- [#949](https://github.com/request/request/pull/949) Manually enter querystring in form option (@charlespwd) +- [#944](https://github.com/request/request/pull/944) Make request work with browserify (@eiriksm) +- [#943](https://github.com/request/request/pull/943) New mime module (@eiriksm) +- [#927](https://github.com/request/request/pull/927) Bump version of hawk dep. (@samccone) +- [#907](https://github.com/request/request/pull/907) append secureOptions to poolKey (@medovob) -### v2.31.0 (2014/01/08 02:57 +00:00) -- [dd2577f](https://github.com/mikeal/request/commit/dd2577f8264d4d4b07484dec7094b72c00c8416f) Removing s3 test. (@mikeal) -- [fef5bf3](https://github.com/mikeal/request/commit/fef5bf34258e3695b61c048c683f1d4a7f99b368) Fix callback arguments documentation (@mmalecki) -- [#736](https://github.com/mikeal/request/pull/736) Fix callback arguments documentation (@mmalecki) -- [5531c20](https://github.com/mikeal/request/commit/5531c208678145ef35b06e948190be2fd6a8a1c8) updating README example: cookie jar api changed cookie module changed to tough-cookie (@emkay) -- [#741](https://github.com/mikeal/request/pull/741) README example is using old cookie jar api (@emkay) -- [9d73e5a](https://github.com/mikeal/request/commit/9d73e5a277af141a6e4fa9dbcae5d0c3b755d277) add note about JSON output body type (@iansltx) -- [#742](https://github.com/mikeal/request/pull/742) Add note about JSON output body type (@iansltx) -- [41e20a4](https://github.com/mikeal/request/commit/41e20a4d288e30101e493b383a0e4852a3271a98) Use Cookie.parse (@lalitkapoor) -- [4d09556](https://github.com/mikeal/request/commit/4d095562a5c42ffb41b0ff194e9e6f32c0f44372) updating setCookie example to make it clear that the callback is required (@emkay) -- [#745](https://github.com/mikeal/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay) -- [b7ede1d](https://github.com/mikeal/request/commit/b7ede1d56f9a2764e4bf764687b81419df817e5a) README: Markdown code highlight (@weakish) -- [#746](https://github.com/mikeal/request/pull/746) README: Markdown code highlight (@weakish) -- [#645](https://github.com/mikeal/request/pull/645) update twitter api url to v1.1 (@mick) -- [20dcd18](https://github.com/mikeal/request/commit/20dcd18ce8e3397ba7e0213da9c760b048ca5b49) require aws-sign2 (@mafintosh) -- [df2c426](https://github.com/mikeal/request/commit/df2c4264321c3db1387ddf9a945d63b9ae7d57b8) 2.31.0 (@mikeal) +### v2.35.0 (2014/05/17) +- [#901](https://github.com/request/request/pull/901) Fixes #555 (@pigulla) +- [#897](https://github.com/request/request/pull/897) merge with default options (@vohof) +- [#891](https://github.com/request/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor) +- [#869](https://github.com/request/request/pull/869) Pipefilter test (@tgohn) +- [#866](https://github.com/request/request/pull/866) Fix typo (@dandv) +- [#861](https://github.com/request/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny) +- [#809](https://github.com/request/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700) +- [#850](https://github.com/request/request/pull/850) Fix word consistency in readme (@0xNobody) +- [#810](https://github.com/request/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil) +- [#840](https://github.com/request/request/pull/840) improve error reporting for invalid protocols (@FND) +- [#821](https://github.com/request/request/pull/821) added secureOptions back (@nw) +- [#815](https://github.com/request/request/pull/815) Create changelog based on pull requests (@lalitkapoor) -### v2.30.1 (2013/12/13 19:17 +00:00) -- [eba2d40](https://github.com/mikeal/request/commit/eba2d402fcdcf1ac878de8672b1c9f5da856dcc1) 2.30.1 (@mikeal) +### v2.34.0 (2014/02/18) +- [#516](https://github.com/request/request/pull/516) UNIX Socket URL Support (@lyuzashi) +- [#801](https://github.com/request/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor) +- [#802](https://github.com/request/request/pull/802) Added the Apache license to the package.json. (@keskival) +- [#793](https://github.com/request/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul) +- [#785](https://github.com/request/request/pull/785) Provide ability to override content-type when `json` option used (@vvo) +- [#781](https://github.com/request/request/pull/781) simpler isReadStream function (@joaojeronimo) -### v2.30.0 (2013/12/13 19:17 +00:00) -- [aee3819](https://github.com/mikeal/request/commit/aee38191557574ef570fd9c764af0af7072cc92a) Fix TypeError when calling request.cookie -- [#728](https://github.com/mikeal/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) -- [628ef76](https://github.com/mikeal/request/commit/628ef768b1f52710b8eb4e14be4db69d174d1dcb) better DIGEST support (@dai-shi) -- [d919bc1](https://github.com/mikeal/request/commit/d919bc1ce97fa461c365437a0c739bbaa6b86de7) ignore null authValues (DIGEST) (@dai-shi) -- [75fc209](https://github.com/mikeal/request/commit/75fc209c5a9e6c647a04e42048c30f46c66fc103) DIGEST support: pass algoritm and opaque, add TODO items, test case for compatible mode (@dai-shi) -- [#730](https://github.com/mikeal/request/pull/730) better HTTP DIGEST support (@dai-shi) -- [937a24a](https://github.com/mikeal/request/commit/937a24a168a126f406ee8eb55eb78169ddc53497) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. -- [#732](https://github.com/mikeal/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) -- [f03be23](https://github.com/mikeal/request/commit/f03be2309bd85a89d2e3c208b2fb4be1a2b95c79) Make digest qop regex more robust (see #730) (@nylen) -- [c7d97ae](https://github.com/mikeal/request/commit/c7d97aefaebf773ce62c72e9ec656f0250b7a1e7) 2.30.0 (@mikeal) +### v2.32.0 (2014/01/16) +- [#767](https://github.com/request/request/pull/767) Use tough-cookie CookieJar sync API (@stash) +- [#764](https://github.com/request/request/pull/764) Case-insensitive authentication scheme (@bobyrizov) +- [#763](https://github.com/request/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash) +- [#744](https://github.com/request/request/pull/744) Use Cookie.parse (@lalitkapoor) +- [#757](https://github.com/request/request/pull/757) require aws-sign2 (@mafintosh) -### v2.29.1 (2013/12/06 20:05 +00:00) -- [e0f2c41](https://github.com/mikeal/request/commit/e0f2c41bd4e15518e97dd2f4c134be51ed4cb68b) 2.29.1 (@mikeal) +### v2.31.0 (2014/01/08) +- [#645](https://github.com/request/request/pull/645) update twitter api url to v1.1 (@mick) +- [#746](https://github.com/request/request/pull/746) README: Markdown code highlight (@weakish) +- [#745](https://github.com/request/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay) +- [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx) +- [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay) +- [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki) -### v2.29.0 (2013/12/06 20:05 +00:00) -- [3c2cad1](https://github.com/mikeal/request/commit/3c2cad11301380f4056eb3ca4c0c124f7f7f72f5) make request.defaults(options, requester) run the requester for all methods (@jchris) -- [#727](https://github.com/mikeal/request/pull/727) fix requester bug (@jchris) -- [0c9f875](https://github.com/mikeal/request/commit/0c9f87542cd1f919751d3ed1f00208ce7705f8e7) 2.29.0 (@mikeal) +### v2.30.0 (2013/12/13) +- [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) +- [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi) +- [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) -### v2.28.1 (2013/12/04 19:42 +00:00) -- [3e6a300](https://github.com/mikeal/request/commit/3e6a300121586da81b871f759a9feec52810474a) 2.28.1 (@mikeal) +### v2.29.0 (2013/12/06) +- [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris) -### v2.28.0 (2013/12/04 19:42 +00:00) -- [ac26f43](https://github.com/mikeal/request/commit/ac26f43d9a8212289f92056d3029c207f755cef4) Update request.js (@wprl) -- [adc2cb6](https://github.com/mikeal/request/commit/adc2cb6721e5980e8ed667a3f558cce8c89ee6c2) Use random cnonce (@wprl) -- [ff16a9d](https://github.com/mikeal/request/commit/ff16a9daf93e01cecee7fabec64c3e1b423f7db5) Add test for random cnonce (@wprl) -- [df64c2b](https://github.com/mikeal/request/commit/df64c2bc8f691ecc6f6c214e2254bab439830b88) Restore whitespace (@wprl) -- [#630](https://github.com/mikeal/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl) -- [aca5a16](https://github.com/mikeal/request/commit/aca5a169c44cc658e8310691a2ae1cfc4c2b0958) update twitter api url to v1.1 (@mick) -- [abcbadd](https://github.com/mikeal/request/commit/abcbadd1b2a113c34a37b62d36ddcfd74452850e) Test case for #304. (@diversario) -- [b8cf874](https://github.com/mikeal/request/commit/b8cf8743b66d8eee4048561a7d81659f053393c8) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) -- [e6c7d1f](https://github.com/mikeal/request/commit/e6c7d1f6d23922480c09427d5f54f84eec60b7af) quiet, but check that stderr output has something reasonable for debug (@jrgm) -- [#659](https://github.com/mikeal/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) -- [23164e4](https://github.com/mikeal/request/commit/23164e4f33bd0837d796037c3d0121db23653c34) option.tunnel to explicitly disable tunneling (@seanmonstar) -- [#662](https://github.com/mikeal/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar) -- [#656](https://github.com/mikeal/request/pull/656) Test case for #304. (@diversario) -- [da16120](https://github.com/mikeal/request/commit/da16120a8f0751b305a341c012dbdcfd62e83585) Change `secureOptions' to `secureProtocol' for HTTPS request (@richarddong) -- [43d9d0a](https://github.com/mikeal/request/commit/43d9d0a76974d2c61681ddee04479d514ebfa320) add `ciphers' and `secureProtocol' to `options' in `getAgent' (@richarddong) -- [#666](https://github.com/mikeal/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong) -- [524e035](https://github.com/mikeal/request/commit/524e0356b73240409a11989d369511419526b5ed) change cookie module (@sxyizhiren) -- [#674](https://github.com/mikeal/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren) -- [e8dbcc8](https://github.com/mikeal/request/commit/e8dbcc83d4eff3c14e03bd754174e2c5d45f2872) tests: Fixed test-timeout.js events unit test (@Turbo87) -- [aed1c71](https://github.com/mikeal/request/commit/aed1c71fac0047b66a236a990a5569445cfe995d) Added Travis CI configuration file (@Turbo87) -- [#683](https://github.com/mikeal/request/pull/683) Travis CI support (@Turbo87) -- [8bfa640](https://github.com/mikeal/request/commit/8bfa6403ce03cbd3f3de6b82388bfcc314e56c61) dependencies: Set `tough-cookie` as optional dependency (@Turbo87) -- [bcc138d](https://github.com/mikeal/request/commit/bcc138da67b7e1cf29dc7d264a73d8b1d1f4b0e4) dependencies: Set `form-data` as optional dependency (@Turbo87) -- [751ac28](https://github.com/mikeal/request/commit/751ac28b7f13bfeff2a0e920ca2926a005dcb6f0) dependencies: Set `tunnel-agent` as optional dependency (@Turbo87) -- [6d7c1c9](https://github.com/mikeal/request/commit/6d7c1c9d8e3a300ff6f2a93e7f3361799acf716b) dependencies: Set `http-signature` as optional dependency (@Turbo87) -- [733f1e3](https://github.com/mikeal/request/commit/733f1e3ae042a513a18cde1c6e444b18ee07ad66) Added .npmignore file (@Turbo87) -- [e2fc346](https://github.com/mikeal/request/commit/e2fc346b7e5e470fcd36189bcadf63c53feebb22) dependencies: Set `hawk` as optional dependency (@Turbo87) -- [e87d45f](https://github.com/mikeal/request/commit/e87d45fe89ea220035bf07696a70292763f7135f) dependencies: Set `aws-sign` as optional dependency (@Turbo87) -- [1cd81ba](https://github.com/mikeal/request/commit/1cd81ba30908b77cff2fa618aeb232fefaa53ada) lib: Added optional() function (@Turbo87) -- [28c2c38](https://github.com/mikeal/request/commit/28c2c3820feab0cc719df213a60838db019f3e1a) dependencies: Set `oauth-sign` as optional dependency (@Turbo87) -- [2ceddf7](https://github.com/mikeal/request/commit/2ceddf7e793feb99c5b6a76998efe238965b22cd) TravisCI: Test with and without optional dependencies (@Turbo87) -- [#682](https://github.com/mikeal/request/pull/682) Optional dependencies (@Turbo87) -- [2afab5b](https://github.com/mikeal/request/commit/2afab5b665a2e03becbc4a42ad481bb737405655) Handle blank password in basic auth. (@diversario) -- [cabe5a6](https://github.com/mikeal/request/commit/cabe5a62dc71282ce8725672184efe9d97ba79a5) Handle `auth.password` and `auth.username`. (@diversario) -- [#690](https://github.com/mikeal/request/pull/690) Handle blank password in basic auth. (@diversario) -- [33100c3](https://github.com/mikeal/request/commit/33100c3c7fa678f592374f7b2526fe9a0499b6f6) Typo (@VRMink) -- [#694](https://github.com/mikeal/request/pull/694) Typo in README (@ExxKA) -- [9072ff1](https://github.com/mikeal/request/commit/9072ff1556bcb002772838a94e1541585ef68f02) Edited README.md for formatting and clarity of phrasing (@Zearin) -- [#696](https://github.com/mikeal/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin) -- [07ee58d](https://github.com/mikeal/request/commit/07ee58d3a8145740ba34cc724f123518e4b3d1c3) Fixing listing in callback part of docs. (@lukasz-zak) -- [#710](https://github.com/mikeal/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak) -- [8ee21d0](https://github.com/mikeal/request/commit/8ee21d0dcc637090f98251eba22b9f4fd1602f0e) Request.multipart no longer crashes when header 'Content-type' is present (@pastaclub) -- [#715](https://github.com/mikeal/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) -- [8b04ca6](https://github.com/mikeal/request/commit/8b04ca6ad8d025c275e40b806a69112ac53bd416) doc: Removed use of gendered pronouns (@oztu) -- [#719](https://github.com/mikeal/request/pull/719) Made a comment gender neutral. (@oztu) -- [8795fc6](https://github.com/mikeal/request/commit/8795fc68cce26b9a45d10db9eaffd4bc943aca3a) README.md: add custom HTTP Headers example. (@tcort) -- [#724](https://github.com/mikeal/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) -- [c5d5b1f](https://github.com/mikeal/request/commit/c5d5b1fcf348e768943fe632a9a313d704d35c65) Changing dep. (@mikeal) -- [bf04163](https://github.com/mikeal/request/commit/bf04163883fa9c62d4e1a9fdd64d6efd7723d5f8) 2.28.0 (@mikeal) +### v2.28.0 (2013/12/04) +- [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) +- [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@oztu) +- [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) +- [#710](https://github.com/request/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak) +- [#696](https://github.com/request/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin) +- [#694](https://github.com/request/request/pull/694) Typo in README (@VRMink) +- [#690](https://github.com/request/request/pull/690) Handle blank password in basic auth. (@diversario) +- [#682](https://github.com/request/request/pull/682) Optional dependencies (@Turbo87) +- [#683](https://github.com/request/request/pull/683) Travis CI support (@Turbo87) +- [#674](https://github.com/request/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren) +- [#666](https://github.com/request/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong) +- [#656](https://github.com/request/request/pull/656) Test case for #304. (@diversario) +- [#662](https://github.com/request/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar) +- [#659](https://github.com/request/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) +- [#630](https://github.com/request/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl) -### v2.27.1 (2013/08/15 21:30 +00:00) -- [a80a026](https://github.com/mikeal/request/commit/a80a026e362a9462d6948adc1b0d2831432147d2) 2.27.1 (@mikeal) +### v2.27.0 (2013/08/15) +- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo) -### v2.27.0 (2013/08/15 21:30 +00:00) -- [3627b9c](https://github.com/mikeal/request/commit/3627b9cc7752cfe57ac609ed613509ff61017045) rename Request and remove .DS_Store (@joaojeronimo) -- [920f9b8](https://github.com/mikeal/request/commit/920f9b88f7dd8f8d153e72371b1bf2d16d5e4160) rename Request (@joaojeronimo) -- [c243cc6](https://github.com/mikeal/request/commit/c243cc66131216bb57bcc0fd79c250a7927ee424) for some reason it removed request.js (@joaojeronimo) -- [#619](https://github.com/mikeal/request/pull/619) decouple things a bit (@CrowdProcess) -- [ed4ecc5](https://github.com/mikeal/request/commit/ed4ecc5ae5cd1d9559a937e84638c9234244878b) Try normal stringify first, then fall back to safe stringify (@mikeal) -- [5642ff5](https://github.com/mikeal/request/commit/5642ff56e64c19e8183dcd5b6f9d07cca295a79e) 2.27.0 (@mikeal) +### v2.26.0 (2013/08/07) +- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) +- [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) -### v2.26.1 (2013/08/07 16:31 +00:00) -- [b422510](https://github.com/mikeal/request/commit/b422510ba16315c3e0e1293a17f3a8fa7a653a77) 2.26.1 (@mikeal) +### v2.24.0 (2013/07/23) +- [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) +- [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK) +- [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko) -### v2.26.0 (2013/08/07 16:31 +00:00) -- [3b5b62c](https://github.com/mikeal/request/commit/3b5b62cdd4f3b92e63a65d3a7265f5a85b11c4c9) Only include :password in Basic Auth if it's defined (fixes #602) (@bendrucker) -- [#605](https://github.com/mikeal/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) -- [cce2c2c](https://github.com/mikeal/request/commit/cce2c2c8ea5b0136932b2432e4e25c0124d58d5a) Moved init of self.uri.pathname (@lexander) -- [08793ec](https://github.com/mikeal/request/commit/08793ec2f266ef88fbe6c947e6b334e04d4b9dc9) Fix all header casing issues forever. (@mikeal) -- [#613](https://github.com/mikeal/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) -- [f98ff99](https://github.com/mikeal/request/commit/f98ff990d294165498c9fbf79b2de12722e5c842) Update this old ass readme with some new HOTNESS! (@mikeal) -- [3312010](https://github.com/mikeal/request/commit/3312010f72d035f22b87a6d8d463f0d91b88fea1) markdown badge instead. (@mikeal) -- [9cf657c](https://github.com/mikeal/request/commit/9cf657c1f08bf460911b8bb0a8c5c0d3ae6135c7) Shorter title. (@mikeal) -- [2c61d66](https://github.com/mikeal/request/commit/2c61d66f1dc323bb612729c7320797b79b22034c) put Request out (@joaojeronimo) -- [28513a1](https://github.com/mikeal/request/commit/28513a1b371452699438c0eb73471f8969146264) 2.26.0 (@mikeal) +### v2.23.0 (2013/07/23) +- [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek) +- [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone) -### v2.25.1 (2013/07/23 21:51 +00:00) -- [6387b21](https://github.com/mikeal/request/commit/6387b21a9fb2e16ee4dd2ab73b757eca298587b5) 2.25.1 (@mikeal) +### v2.22.0 (2013/07/05) +- [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn) +- [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy) +- [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) +- [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz) +- [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub) +- [#542](https://github.com/request/request/pull/542) Expose Request class (@regality) -### v2.25.0 (2013/07/23 21:51 +00:00) -- [828f12a](https://github.com/mikeal/request/commit/828f12a1ae0f187deee4d531b2eaf7531169aaf2) 2.25.0 (@mikeal) +### v2.21.0 (2013/04/30) +- [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) +- [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) +- [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) +- [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) +- [#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.24.1 (2013/07/23 20:51 +00:00) -- [29ae1bc](https://github.com/mikeal/request/commit/29ae1bc454c03216beeea69d65b538ce4f61e8c1) 2.24.1 (@mikeal) - -### v2.24.0 (2013/07/23 20:51 +00:00) -- [f667318](https://github.com/mikeal/request/commit/f66731870d5f3e0e5655cd89612049b540c34714) Fixed a small typo (@michalstanko) -- [#601](https://github.com/mikeal/request/pull/601) Fixed a small typo (@michalstanko) -- [#594](https://github.com/mikeal/request/pull/594) Emit complete event when there is no callback (@RomainLK) -- [#596](https://github.com/mikeal/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) -- [41ce492](https://github.com/mikeal/request/commit/41ce4926fb08242f19135fd3ae10b18991bc3ee0) New deps. (@mikeal) -- [8176c94](https://github.com/mikeal/request/commit/8176c94d5d17bd14ef4bfe459fbfe9cee5cbcc6f) 2.24.0 (@mikeal) - -### v2.23.1 (2013/07/23 02:45 +00:00) -- [63f31cb](https://github.com/mikeal/request/commit/63f31cb1d170a4af498fbdd7566f867423caf8e3) 2.23.1 (@mikeal) - -### v2.23.0 (2013/07/23 02:44 +00:00) -- [758f598](https://github.com/mikeal/request/commit/758f598de8d6024db3fa8ee7d0a1fc3e45c50f53) Initial commit. Request package. (@mikeal) -- [104cc94](https://github.com/mikeal/request/commit/104cc94839d4b71aaf3681142daefba7ace78c94) Removing unnecessary markup. (@mikeal) -- [12a4cb8](https://github.com/mikeal/request/commit/12a4cb88b949cb4a81d51189d432c25c08522a87) Matching node documentation style. (@mikeal) -- [ab96993](https://github.com/mikeal/request/commit/ab969931106b10b5f8658dc9e0f512c5dfc2a7da) Release tarball. (@mikeal) -- [e7e37ad](https://github.com/mikeal/request/commit/e7e37ad537081a040ea3e527aac23ae859b40b2c) Removing old tarball. (@mikeal) -- [e66e90d](https://github.com/mikeal/request/commit/e66e90dd814ae7bfbcd52003609d7bde9eafea57) Adding automatic redirect following. (@mikeal) -- [2fc5b84](https://github.com/mikeal/request/commit/2fc5b84832ae42f6ddb081b1909d0a6ca00c8d51) Adding SSL support. (@mikeal) -- [a3ac375](https://github.com/mikeal/request/commit/a3ac375d4b5800a038ae26233425fadc26866fbc) Fixing bug where callback fired for every redirect. (@mikeal) -- [1139efe](https://github.com/mikeal/request/commit/1139efedb5aad4a328c1d8ff45fe77839a69169f) Cleaning up tests. (@mikeal) -- [bb49fe6](https://github.com/mikeal/request/commit/bb49fe6709fa06257f4b7aadc2e450fd45a41328) Rolling version. (@mikeal) -- [4ff3493](https://github.com/mikeal/request/commit/4ff349371931ec837339aa9082c4ac7ddd4c7c35) Updates to README.md (@mikeal) -- [1c9cf71](https://github.com/mikeal/request/commit/1c9cf719c92b02ba85c4e47bd2b92a3303cbe1cf) Adding optional body buffer. (@mikeal) -- [49dfef4](https://github.com/mikeal/request/commit/49dfef42630c4fda6fb208534c00638dc0f06a6b) Rolling version. (@mikeal) -- [ab40cc8](https://github.com/mikeal/request/commit/ab40cc850652e325fcc3b0a44ee7303ae0a7b77f) Preserve the original full path. (@mikeal) -- [6d70f62](https://github.com/mikeal/request/commit/6d70f62c356f18098ca738b3dbedcf212ac3d8d8) Rolling version. (@mikeal) -- [e2ca15a](https://github.com/mikeal/request/commit/e2ca15a0f7e986e3063977ee9bd2eb69e86bdb1f) Fixing bugs and rolling version. (@mikeal) -- [8165254](https://github.com/mikeal/request/commit/81652543d3a09553cbf33095a7932dec53ccecc2) Cleanup. Fixing '' === '/' path bug. (@mikeal) -- [a0536a4](https://github.com/mikeal/request/commit/a0536a46d0b91e204fbde1e4341461bc827c9542) Rolling version. (@mikeal) -- [9ccaad7](https://github.com/mikeal/request/commit/9ccaad7dce05e5dcc3eacaf1500404622a0d8067) Adding stream support for request and response bodies. (@mikeal) -- [585166d](https://github.com/mikeal/request/commit/585166d979d4476e460e9835cc0516d04a9a3e11) Rolling version. (@mikeal) -- [41111c8](https://github.com/mikeal/request/commit/41111c88d711da80ea123df238d62038b89769bf) Bugfix release for response stream. (@mikeal) -- [86e375d](https://github.com/mikeal/request/commit/86e375d093700affe4d6d2b76a7acedbe8da140c) Remove host header when we add it. (@mikeal) -- [3a6277c](https://github.com/mikeal/request/commit/3a6277c81cfd3457c760f2aaea44852ef832a1e8) Rolling version. (@mikeal) -- [7a11f69](https://github.com/mikeal/request/commit/7a11f69d5353ecc1319e2e91ca4aefbaf0338136) writing requestBodyStream into request (@beanieboi) -- [186e9cf](https://github.com/mikeal/request/commit/186e9cf692511d768f8016d311609a0a0a315af6) Using sys.pump (@mikeal) -- [09e7ade](https://github.com/mikeal/request/commit/09e7ade541e1d40316a3f153128871a353e707b1) Fixing host port addition. Rolling version. (@mikeal) -- [cec3f3f](https://github.com/mikeal/request/commit/cec3f3f619322f27e2a82c7fd8971722f98d04d6) Using builtin base64. (@mikeal) -- [2a2e2a2](https://github.com/mikeal/request/commit/2a2e2a2f5c4760d4da3caa1a0f2d14c31a4222dc) new structure. new convenience methods (@mikeal) -- [f835b5f](https://github.com/mikeal/request/commit/f835b5fb605506b8ecd3c17bebe9ed54f0066cfc) removing old files. (@mikeal) -- [91616c4](https://github.com/mikeal/request/commit/91616c4e4f488f75a8b04b5b6f0ceef7e814cffd) Adding better redirect handling. (@mikeal) -- [3a95433](https://github.com/mikeal/request/commit/3a95433cbec9693a16ff365148489a058720ae7c) Fixing tests. (@mikeal) -- [38eb1d2](https://github.com/mikeal/request/commit/38eb1d2fa8dea582bb7c3fb37a7b05ff91857a46) By popular demand, proxy support! Not really tested yet but it seems to kinda work. (@mikeal) -- [45d41df](https://github.com/mikeal/request/commit/45d41dff63f36b25b3403e59c8b172b7aa9ed373) Added proxy auth. (@mikeal) -- [85e3d97](https://github.com/mikeal/request/commit/85e3d97e0dced39a3769c4e3f2707ba3aaab1eaa) Fixing for non-proxy case. (@mikeal) -- [f796da7](https://github.com/mikeal/request/commit/f796da74849d2b0732bd1bae1d2dcaf1243142c1) Fixing relative uri's for forwards. (@mikeal) -- [dead30e](https://github.com/mikeal/request/commit/dead30ebef9c3ff806b895e2bd32f52ba3988c69) Adding support for specifying an encoding for the response body. (@mikeal) -- [9433344](https://github.com/mikeal/request/commit/943334488dcc8e7f90727b86f9eb1bc502c33b4f) Removing debugging statement (@mikeal) -- [41efb7a](https://github.com/mikeal/request/commit/41efb7a7dcca3b47e97c23c6cdbd3e860d3bd82b) Error on maxRedirects exceeded. (@mikeal) -- [9549570](https://github.com/mikeal/request/commit/95495701fa4e99a3ab85acdab71ecdaabe0dbd45) Allow options.url, people do it all the time, might as well just support it. (@mikeal) -- [21a53c0](https://github.com/mikeal/request/commit/21a53c016edcc113e809219639807b46d29dba36) Pumping version. (@mikeal) -- [aca9782](https://github.com/mikeal/request/commit/aca9782285fe1d727570fe8d799561f45d49048e) Fixing byteLength !== string lenght issues. (@mikeal) -- [a77c296](https://github.com/mikeal/request/commit/a77c296431eda2a211f59bdb88654c4a64ed4ef3) Don't rely on automatic semicolon insertion (pretty please :) (@papandreou) -- [8b02f29](https://github.com/mikeal/request/commit/8b02f29c9019dd1d1dd291dd85889b26f592a137) Also set content-length when options.body is the empty string. (@papandreou) -- [023281c](https://github.com/mikeal/request/commit/023281ca9b4414a9bc0170c2b08aaf886a7a08f7) Simplified boolean logic. (@papandreou) -- [4f897fd](https://github.com/mikeal/request/commit/4f897fdd6c7c93bea73dbf34623f09af63bb1ed4) Simplified check for whether response.headers.location starts with "http:" or "https:". (@papandreou) -- [6d7db85](https://github.com/mikeal/request/commit/6d7db85cadf401dffdec07a4d66822207898c69e) Fixed double var declaration. (@papandreou) -- [97255cf](https://github.com/mikeal/request/commit/97255cfd2a4aa8f34d307e7cd96fe1c1f13cb26a) Process redirects as soon as the response arrives. Prevents the uninteresting redirect response from being pumped into responseBodyStream. (@papandreou) -- [b2af15f](https://github.com/mikeal/request/commit/b2af15f4fcbe1115cf8b53c5ae89fbf2365bfffc) New feature: If options.noBuffer is true, don't buffer up the response, just return it. Most of the time getting a readable stream is much more flexible than having the option to pipe the response into a writable stream. For one thing, the stream can be paused. (@papandreou) -- [fee5f89](https://github.com/mikeal/request/commit/fee5f89159a8f36b25df509c55093bf7ebd1c993) A few fixes/changes from papandreou's code, also added new semantics for onResponse. (@mikeal) -- [fa72fcb](https://github.com/mikeal/request/commit/fa72fcb950029b222f0621e2d49304e35d08c380) Updated documentation. (@mikeal) -- [4fc7209](https://github.com/mikeal/request/commit/4fc72098e7eeb9518951b9306115340ffdcce7ce) Fix for both onResponse and callback (@mikeal) -- [3153436](https://github.com/mikeal/request/commit/3153436404fca865a65649d46eb22d9797128c9d) Adding license information. (@mikeal) -- [59570de](https://github.com/mikeal/request/commit/59570dec37913c7e530303a83f03781d9aca958c) Fix for unescaping passwords for basic auth. (@notmatt) -- [0d771ab](https://github.com/mikeal/request/commit/0d771ab7882b97d776179972c51c59386f91b953) require querystring (@notmatt) -- [875f79b](https://github.com/mikeal/request/commit/875f79b6a40340457fafafdadac813cfa5343689) Allow request's body to be an object. (@Stanley) -- [86895b9](https://github.com/mikeal/request/commit/86895b9c37f7b412b7df963c2a75361ff402d8c5) Merge branch 'master' of github.com:Stanley/request (@Stanley) -- [4c9c984](https://github.com/mikeal/request/commit/4c9c984cb37bfd4e901ce24b0e9b283604c27bf4) Better tests. (@mikeal) -- [02f6b38](https://github.com/mikeal/request/commit/02f6b38c1697a55ed43940d1fd0bef6225d4faa2) Added specs for body option (@Stanley) -- [af66607](https://github.com/mikeal/request/commit/af666072a22b8df4d75fe71885139059f56ea5ee) Made specs pass (@Stanley) -- [641ec05](https://github.com/mikeal/request/commit/641ec052dd95797816e781b2c3ac2524841db7cb) Merge branch 'master' of https://github.com/Stanley/request into jsonbody (@mikeal) -- [ab4c96b](https://github.com/mikeal/request/commit/ab4c96be1c002c10806d967a4b266543f8b0267c) Moved spec tests to normal node script tests. Style changes to code and docs. (@mikeal) -- [fc2a7ef](https://github.com/mikeal/request/commit/fc2a7ef301c1266938a5aeb539e4f3fc3b5191dd) Clearer wording for json option. (@mikeal) -- [01371d7](https://github.com/mikeal/request/commit/01371d728082e22aabeb840da82a30aec62d7d8a) Removing specs loader. (@mikeal) -- [560dadd](https://github.com/mikeal/request/commit/560dadd6cbd293622c66cd82b5506704c9850b13) Adding newline to end of test files, makes for cleaner diffs in the future. (@mikeal) -- [a0348dd](https://github.com/mikeal/request/commit/a0348dd0fef462c3c678a639619c27101c757035) Add pass message when tests finish. (@mikeal) -- [da77a0e](https://github.com/mikeal/request/commit/da77a0e152c1dd43f5c1e698110d23e4d32280db) Adding better debug message on failures for GET tests. (@mikeal) -- [6aade82](https://github.com/mikeal/request/commit/6aade822a90724a47176771d137e30b0a702e7ef) throw on error. (@mikeal) -- [4f41b8d](https://github.com/mikeal/request/commit/4f41b8dbbf9a93c53d5ccdf483c9d7803e279916) Rolling version. (@mikeal) -- [7cf01f0](https://github.com/mikeal/request/commit/7cf01f0481afb367b5d0d4878645ac535cfe9a2e) master is moving to node v0.3.6+ (@mikeal) -- [cb403a4](https://github.com/mikeal/request/commit/cb403a4cfdbe3d98feb9151fdbdae1e1436e59ab) Initial support for 0.3.6+.\n\nExperimental support for Request objects as streams. It's untested and requires a pending patch to node.js (@mikeal) -- [a3c80f9](https://github.com/mikeal/request/commit/a3c80f98f42f25d4cb02d5d9e34ba0e67cc89293) Adding defaults call. (@mikeal) -- [55f22f9](https://github.com/mikeal/request/commit/55f22f96365c57aa8687de951e3f9ed982eba408) Request will keep it's own agent pool so that it can expose a maxSockets setting for easy pool sizing. (@mikeal) -- [004741c](https://github.com/mikeal/request/commit/004741c23dc0eaf61f111161bb913ba418e033e4) Fixing reference error. (@mikeal) -- [8548541](https://github.com/mikeal/request/commit/85485414150fbac58b08126b3684f81dcb930bf1) Simplified pool implementation. (@mikeal) -- [9121c47](https://github.com/mikeal/request/commit/9121c47e4cbe47bccc20a75e0e6c6c098dce04fb) Default to globalPool. (@mikeal) -- [9ec3490](https://github.com/mikeal/request/commit/9ec3490aefd52f05b57e6db13730ace54b4439d1) Support for https. Requires pending patch in node core for consistent Agent API. (@mikeal) -- [146b154](https://github.com/mikeal/request/commit/146b154a1a31ae7a30aa9f28e891e4824af548fa) Fixes for reference errors. (@mikeal) -- [8756120](https://github.com/mikeal/request/commit/8756120f83ceb94f8ba600acba274ba512696eef) Only create an agent when a relevant option is passed. (@mikeal) -- [cc3cf03](https://github.com/mikeal/request/commit/cc3cf0322847982875ff32a7cef25c39c29630ba) New HTTP client doesn't require such explicit error listener management. (@mikeal) -- [f7c0379](https://github.com/mikeal/request/commit/f7c0379b99ac7989df7f934be67cc3ae979591bb) Fixing bug in .pipe() handling. Thanks tanepiper. (@mikeal) -- [897a7ef](https://github.com/mikeal/request/commit/897a7ef020cefcb7a36c04a11e286238df8ecdaa) Fixes for streams, docs, and convenience methods. (@mikeal) -- [7c2899a](https://github.com/mikeal/request/commit/7c2899a046b750eda495b23b2d58604260deddbc) Doc fixes. (@mikeal) -- [f535fe1](https://github.com/mikeal/request/commit/f535fe1008c8f11bb37e16f95fe287ed93343704) Doc fixes. (@mikeal) -- [d1deb5b](https://github.com/mikeal/request/commit/d1deb5b4dda4474fe9d480ad42ace664d89e73ee) Pipe tests, all passing! (@mikeal) -- [d67a041](https://github.com/mikeal/request/commit/d67a041783df8d724662d82f9fb792db1be3f4f0) Moving basic example to the top. (@mikeal) -- [6a98b9e](https://github.com/mikeal/request/commit/6a98b9e4a561b516b14d325c48785a9d6f40c514) Do not mix encoding option with pipeing. (@mikeal) -- [06b67ef](https://github.com/mikeal/request/commit/06b67ef01f73572a6a9b586854d4c21be427bdb2) Disable pooling with {pool:false} (@mikeal) -- [1c24881](https://github.com/mikeal/request/commit/1c248815b5dfffda43541e367bd4d66955ca0325) Send all arguments passed to stream methods. (@mikeal) -- [7946393](https://github.com/mikeal/request/commit/7946393893e75df24b390b7ab19eb5b9d6c23891) Better errors and warnings for different pipe conditions. (@mikeal) -- [ee2108d](https://github.com/mikeal/request/commit/ee2108db592113a0fe3840c361277fdd89f0c89c) Removing commented out legacy code. (@mikeal) -- [5f838b3](https://github.com/mikeal/request/commit/5f838b3582eda465f366d7df89c6dd69920405f2) Fixing redirect issue, thanks @linus (@mikeal) -- [c08758e](https://github.com/mikeal/request/commit/c08758e25290ee12278b3eb95d502645e0d66e4e) Adding del alias, thanks tanepiper. (@mikeal) -- [0b7d675](https://github.com/mikeal/request/commit/0b7d6756c120ebf17ce6c70fc1ff4ecd6850e704) Keep require('https') from throwing if node is compiled with --without-ssl. This will still throw for Invalid Protocol if https is used. Which makes more sense and makes request work without SSl support. (@davglass) -- [02fc9f7](https://github.com/mikeal/request/commit/02fc9f7cc8912402a5a98ddefaffa5f6da870562) Rolling version. Pushed new version to npm. (@mikeal) -- [0b30532](https://github.com/mikeal/request/commit/0b30532ee1a3cabb177017acfa7885b157031df2) Sent a patch today to fix this in core but this hack will fix node that predates that fix to core. (@mikeal) -- [5d5d8f4](https://github.com/mikeal/request/commit/5d5d8f43156b04fd3ceb312cfdf47cc2b0c4104d) Rolling version. Pushed new version to npm. (@mikeal) -- [1c00080](https://github.com/mikeal/request/commit/1c000809f1795d2e21635a626cf730aba2049d3e) Fixing reference to tls. (@mikeal) -- [4c355d1](https://github.com/mikeal/request/commit/4c355d1f87fced167e4b21770bfe6f8208f32b53) Be a better stream. (@mikeal) -- [9bed22f](https://github.com/mikeal/request/commit/9bed22f22e007201d4faeebdb486603c3bb088c3) Rolled version and pushed to npm (@mikeal) -- [34df8e2](https://github.com/mikeal/request/commit/34df8e2301dcfd10705b9ff3b257741b0816c8a1) typo in `request.defaults` (@clement) -- [4d7a6d4](https://github.com/mikeal/request/commit/4d7a6d46fa481e43fe873b8c8fad2f7dd816dbb5) default value only if undefined in `request.defaults` + misplaced `return` statement (@clement) -- [243a565](https://github.com/mikeal/request/commit/243a56563f1014318a467e46113b2c61b485f377) Adding support for request(url) (@mikeal) -- [83a9cec](https://github.com/mikeal/request/commit/83a9cec3cb2f7a43a1e10c13da8d0dd72b937965) Fixing case where + is in user or password. (@mikeal) -- [8bb7f98](https://github.com/mikeal/request/commit/8bb7f98ba8b78c217552c979811c07f1299318fe) making Request a duplex stream rather than adding special handling for pipes out. (@mikeal) -- [55a1fde](https://github.com/mikeal/request/commit/55a1fdedcad1e291502ce10010dda7e478a1b503) pause and resume should act on response instead of request (@tobowers) -- [63125a3](https://github.com/mikeal/request/commit/63125a33523e72e449ceef76da57b63522998282) Making request really smart about pipeing to itself so that we can do simple proxy cats (@mikeal) -- [2f9e257](https://github.com/mikeal/request/commit/2f9e257bc39eb329eec660c6d675fb40172fc5a5) Rolling version since master right now has some pretty hot new code in it. (@mikeal) -- [#31](https://github.com/mikeal/request/pull/31) Error on piping a request to a destination (@tobowers) -- [b1f3d54](https://github.com/mikeal/request/commit/b1f3d5439d24b848b2bf3a6459eea74cb0e43df3) The "end" event that was supposed to be emitted to fix a core bug in NodeJS wasn't fired because it wasn't emitted on the response object. (@voxpelli) -- [#35](https://github.com/mikeal/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli) -- [40b1c67](https://github.com/mikeal/request/commit/40b1c676e1d3a292719ad2dd9cf9354c101bad47) Rolling version. (@mikeal) -- [9a28022](https://github.com/mikeal/request/commit/9a28022d0e438d0028e61a53e897689470025e50) Fixing bug in forwarding with new pipes logic. (@mikeal) -- [44e4e56](https://github.com/mikeal/request/commit/44e4e5605b0a9e02036393bcbd3a8d91280f5611) Fixing big bug in forwarding logic. (@mikeal) -- [b0cff72](https://github.com/mikeal/request/commit/b0cff72d63689d96e0b1d49a8a5aef9ccc71cb8b) Added timeout option to abort the request before the response starts responding (@mbrevoort) -- [cc76b10](https://github.com/mikeal/request/commit/cc76b109590437bfae54116e3424b2c6e44a3b3e) corrected spelling error in README (@mbrevoort) -- [#45](https://github.com/mikeal/request/pull/45) Added timeout option (@mbrevoort) -- [1cca56b](https://github.com/mikeal/request/commit/1cca56b29bb670c53d5995e76c0b075a747b5ad7) Fixing for node http client refactor. (@mikeal) -- [2a78aa3](https://github.com/mikeal/request/commit/2a78aa3f827e76c548e001fa519448b24466b518) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [ce12273](https://github.com/mikeal/request/commit/ce12273d3990c1446d3166bbd9e35c0e2435f137) New fs.ReadStream handling hotness. (@mikeal) -- [535e30a](https://github.com/mikeal/request/commit/535e30a4bd4a8e41d97ffa6a4e99630ac09a4bcb) Adding pipe support to HTTP ServerResponse objects. (@mikeal) -- [2f0cf6b](https://github.com/mikeal/request/commit/2f0cf6bf44edbaec4c0a0cb15a679302de7f0aff) Setting proper statusCode. (@mikeal) -- [6e3ecb1](https://github.com/mikeal/request/commit/6e3ecb106c3a32101d80ac0f87968fddd3ac5e2c) Adding test for pipeing file to disc. (@mikeal) -- [bbbb52e](https://github.com/mikeal/request/commit/bbbb52e406b65100b557caa3687a1aa04fab6ff3) Pumping version. (@mikeal) -- [a10b6e4](https://github.com/mikeal/request/commit/a10b6e4c08478364b8079801fdb23f3530fcc85f) Adding reference to Request instance on response to make it easier on inline callbacks. fixes #43. (@mikeal) -- [b9aff1f](https://github.com/mikeal/request/commit/b9aff1fe007dab3f93e666f047fa03a4e8f5f8b7) Add body property to resp when we have it as a shorthand. fixes #28 (@mikeal) -- [411b30d](https://github.com/mikeal/request/commit/411b30dab1fe5b20880113aa801a2fdbb7c35c40) If the error is handled and not throw we would still process redirects. Fixes #34. (@mikeal) -- [8f3c2b4](https://github.com/mikeal/request/commit/8f3c2b4f6dee8838f30e2430a23d5071128148f0) w00t! request 2.0 (@mikeal) -- [9957542](https://github.com/mikeal/request/commit/9957542cc6928443f3a7769510673665b5a90040) valid semver. (@mikeal) -- [31f5ee2](https://github.com/mikeal/request/commit/31f5ee28726ac7e14355cad0c6d2785f9ca422c6) Drastically improved header handling. (@mikeal) -- [c99b8fc](https://github.com/mikeal/request/commit/c99b8fcd706ae035f6248669b017ac2995e45f31) Return destination stream from pipe(). (@mikeal) -- [cba588c](https://github.com/mikeal/request/commit/cba588cec1e204d70f40f8bd11df0e27dc78ef0c) Style fixes. Bye Bye semi-colons. Mostly lined up with npm style. (@mikeal) -- [8515a51](https://github.com/mikeal/request/commit/8515a510ccc0a661d7c28fce6e513a7d71be7f8f) Clearer spacing. Slightly more consistent. (@mikeal) -- [3acd82a](https://github.com/mikeal/request/commit/3acd82a10e7d973fc5dbaa574c2e8906e48e1ee9) add failing test for issue #51 (@benatkin) -- [68c17f6](https://github.com/mikeal/request/commit/68c17f6c9a3d7217368b3b8bc61203e6a14eb4f0) implement parsing json response when json is truthy (@benatkin) -- [1cb1ec1](https://github.com/mikeal/request/commit/1cb1ec114b03394a0a530f245a857d8424cad02d) allow empty string (@benatkin) -- [4f8d2df](https://github.com/mikeal/request/commit/4f8d2df9f845690667a56e7698dbaf23b5028177) support JSON APIs that don't set the write content type (@benatkin) -- [#53](https://github.com/mikeal/request/pull/53) Parse json: Issue #51 (@benatkin) -- [c63e6e9](https://github.com/mikeal/request/commit/c63e6e96378a2b050bddbe1b39337662f304dc95) Adding proxy to docs, don't know why this wasn't already in. (@mikeal) -- [ef767d1](https://github.com/mikeal/request/commit/ef767d12f13a9c78d3df89add7556f5421204843) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [1b12d3a](https://github.com/mikeal/request/commit/1b12d3a9f48a6142d75fa1790c80eb313388ca44) Emit a proper error. (@mikeal) -- [47314d7](https://github.com/mikeal/request/commit/47314d7cb41fe9c3a7717a502bed9cf1b6074ffc) Greatly expanded documentation. (@mikeal) -- [e477369](https://github.com/mikeal/request/commit/e477369b4bbc271248ee8b686c556567570a6cca) Doc refinements. (@mikeal) -- [fe4d221](https://github.com/mikeal/request/commit/fe4d22109bc1411c29b253756d609856327ff146) Fix for newer npm (@mikeal) -- [7b2f788](https://github.com/mikeal/request/commit/7b2f788293e205edc7b46a7fd5304296b5e800e3) More doc cleanup. (@mikeal) -- [f8eb2e2](https://github.com/mikeal/request/commit/f8eb2e229aca38547236d48066a0b3f9f8f67638) Copy headers so that they survive mutation. (@mikeal) -- [59eab0e](https://github.com/mikeal/request/commit/59eab0e5e49c6d32697822f712ed725843e70010) Rolling version. (@mikeal) -- [76bf5f6](https://github.com/mikeal/request/commit/76bf5f6c6e37f6cb972b3d4f1ac495a4ceaaa00d) Improvements to json handling and defaults. (@mikeal) -- [81e2c40](https://github.com/mikeal/request/commit/81e2c4040a9911a242148e1d4a482ac6c745d8eb) Rolling version. (@mikeal) -- [76d8924](https://github.com/mikeal/request/commit/76d8924cab295f80518a71d5903f1e815618414f) Proper checking and handling of json bodies (@mikeal) -- [a8422a8](https://github.com/mikeal/request/commit/a8422a80895ed70e3871c7826a51933a75c51b69) Rolling version. (@mikeal) -- [f236376](https://github.com/mikeal/request/commit/f2363760782c3d532900a86d383c34f3c94f6d5f) Adding pipefilter. (@mikeal) -- [dd85f8d](https://github.com/mikeal/request/commit/dd85f8da969c2cc1825a7dfec6eac430de36440c) Rolling version. (@mikeal) -- [#66](https://github.com/mikeal/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod) -- [b09212f](https://github.com/mikeal/request/commit/b09212f38fe736c2c92a1ee076cae9d0f4c612c3) Do not overwrite established content-type headers for read stream deliveries. (@voodootikigod) -- [01bc25d](https://github.com/mikeal/request/commit/01bc25d25343d73e9f5731b3d0df1cf5923398d4) Only apply workaround on pre-0.5 node.js and move test to assert.equal (@mikeal) -- [d487131](https://github.com/mikeal/request/commit/d487131ebc2f7a4bf265061845f7f3ea2fd3ed34) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [1200df5](https://github.com/mikeal/request/commit/1200df52bd334f9a44a43846159146b8f938fd9e) Rolling version. (@mikeal) -- [8279362](https://github.com/mikeal/request/commit/82793626f6965884a3720d66f5a276d7d4d30873) fix global var leaks (@aheckmann) -- [#67](https://github.com/mikeal/request/pull/67) fixed global variable leaks (@aheckmann) -- [ab91204](https://github.com/mikeal/request/commit/ab9120495a89536c7152e3cdf17d684323b40474) Test that chunked responses are properly toString'ed (@isaacs) -- [9bff39f](https://github.com/mikeal/request/commit/9bff39fa485f28d7f1754e72f026418ca1186783) Properly flatten chunked responses (@isaacs) -- [8e4e956](https://github.com/mikeal/request/commit/8e4e95654391c71c22933ffd422fdc82d20ac059) Fix #52 Make the tests runnable with npm (@isaacs) -- [a9aa9d6](https://github.com/mikeal/request/commit/a9aa9d6d50ef0481553da3e50e40e723a58de10a) Fix #71 Respect the strictSSL flag (@isaacs) -- [#69](https://github.com/mikeal/request/pull/69) Flatten chunked requests properly (@isaacs) -- [#73](https://github.com/mikeal/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs) -- [#70](https://github.com/mikeal/request/pull/70) add test script to package.json (@isaacs) -- [08ca561](https://github.com/mikeal/request/commit/08ca5617e0d8bcadee98f10f94a49cbf2dd02862) Fixing case where encoding is set. Also cleaning up trailing whitespace because my editor likes to do that now. (@mikeal) -- [0be269f](https://github.com/mikeal/request/commit/0be269f7d9da6c3a14a59d5579546fee9d038960) Fixing case where no body exists. (@mikeal) -- [2f37bbc](https://github.com/mikeal/request/commit/2f37bbc51ff84c3c28ae419138a19bd33a9f0103) Fixing timeout tests. (@mikeal) -- [f551a2f](https://github.com/mikeal/request/commit/f551a2f02a87994249c2fd37dc8f20a29e8bf529) Fixing legacy naming of self as options. (@mikeal) -- [717789e](https://github.com/mikeal/request/commit/717789ec9f690e9d5216ce1c27688eef822940cc) Avoid duplicate emit when using a timeout (@Marsup) -- [#76](https://github.com/mikeal/request/pull/76) Bug when a request fails and a timeout is set (@Marsup) -- [c1d255e](https://github.com/mikeal/request/commit/c1d255e5bcc5791ab69809913fe6d917ab93c8b7) global leakage in request.defaults (@isaacs) -- [14070f2](https://github.com/mikeal/request/commit/14070f269c79cae6ef9e7f7a415867150599bb8e) Don't require SSL for non-SSL requests (@isaacs) -- [4b8f696](https://github.com/mikeal/request/commit/4b8f6965e14c6fb704cf16f5bc011e4787cf32b2) Set proxy auth instead of just setting auth a second time (@isaacs) -- [cd22fbd](https://github.com/mikeal/request/commit/cd22fbdb00b90c5c75187ecf41373cfbb4af5bcd) Merge branch 'proxy-auth-bug' (@isaacs) -- [#78](https://github.com/mikeal/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs) -- [d8c53fc](https://github.com/mikeal/request/commit/d8c53fceca3af385753880395c680f6ec3d4d560) Removing legacy call to sys.puts (@mikeal) -- [731b32b](https://github.com/mikeal/request/commit/731b32b654bb217de3466b8d149ce480988bb24b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [9c897df](https://github.com/mikeal/request/commit/9c897dffc7e238f10eb7e14c61978d6821c70f56) Enhance redirect handling: (1) response._redirectsFollowed reports the total number of redirects followed instead of being reset to 0; (2) add response.redirects, an array of the response.statusCode and response.headers.location for each redirect. (@danmactough) -- [#81](https://github.com/mikeal/request/pull/81) Enhance redirect handling (@danmactough) -- [4c84001](https://github.com/mikeal/request/commit/4c8400103ec18a0729e29e9ffb17dda65ce02f6d) Document strictSSL option (@isaacs) -- [d517ac0](https://github.com/mikeal/request/commit/d517ac03278b3ebd9a46ca9f263bea68d655822b) allow passing in buffers as multipart bodies (@kkaefer) -- [6563865](https://github.com/mikeal/request/commit/6563865b80573ad3c68834a6633aff6d322b59d5) bugs[web] should be bugs[url] (@isaacs) -- [2625854](https://github.com/mikeal/request/commit/262585480c148c56772dfc8386cfc59d5d262ca0) add option followAllRedirects to follow post/put redirects -- [bc057af](https://github.com/mikeal/request/commit/bc057affb58272d9152766956e5cde4ea51ca043) fix typo, force redirects to always use GET -- [d68b434](https://github.com/mikeal/request/commit/d68b434693dbf848dff4c570c4249a35329cc24f) Support node 0.5.11-style url parsing (@isaacs) -- [#96](https://github.com/mikeal/request/pull/96) Authless parsed url host support (@isaacs) -- [9f66c6d](https://github.com/mikeal/request/commit/9f66c6d79bc6515d870b906df39bd9d6d9164994) Typo, causing 'TypeError: Cannot read property 'length' of undefined' (@isaacs) -- [#97](https://github.com/mikeal/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs) -- [b320e05](https://github.com/mikeal/request/commit/b320e05f2d84510f47a6b6857d091c8cd4d3ae2e) When no request body is being sent set 'content-length':0. fixes #89 (@mikeal) -- [059916c](https://github.com/mikeal/request/commit/059916c545a0faa953cb8ac66b8c3ae243b1c8ce) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [248e9d6](https://github.com/mikeal/request/commit/248e9d65e73ac868948a82d07feaf33387723a1d) Fix for pipe() after response. Added response event, fixed and updated tests, removed deprecated stream objects. (@mikeal) -- [a2e5d6e](https://github.com/mikeal/request/commit/a2e5d6e30d3e101f8c5a034ef0401fdde8608ccf) Fixing double callback firing. node 0.5 is much better about calling errors on the client object which, when aborting on timeout, predictable emits an error which then triggers a double callback. (@mikeal) -- [5f80577](https://github.com/mikeal/request/commit/5f805775e6aeaaf229cc781439b29108fb69f373) Release for 0.6 (@mikeal) -- [bf906de](https://github.com/mikeal/request/commit/bf906de601121b52c433b0af208550f1db892cde) Adding some oauth support, tested with Twitter. (@mikeal) -- [8869b2e](https://github.com/mikeal/request/commit/8869b2e88cc305e224556c5ca75b7b59311911d9) Removing irrelevant comments. (@mikeal) -- [8323eed](https://github.com/mikeal/request/commit/8323eed4915bb73b33544bc276f3840c13969134) Closed issue 82 : handling cookies - added tests too -- [739f841](https://github.com/mikeal/request/commit/739f84166d619778ab96fd0b0f4f1f43e8b0fdda) Closed issue 82 : handling cookies - added tests too -- [7daf841](https://github.com/mikeal/request/commit/7daf8415fb1a4e707ec54eb413169e49d8bbe521) Closed issue 82 : handling cookies - added tests too -- [6c22041](https://github.com/mikeal/request/commit/6c22041a4719bf081c827dda8f35e7b79b4c39d9) changed README -- [3db7f7d](https://github.com/mikeal/request/commit/3db7f7d38e95406b84f06fed52b69038b0250904) Updated README -- [6181b7a](https://github.com/mikeal/request/commit/6181b7a8a4be75bcf75cd3ff6dacb8e910737e92) Documented request.cookie() and request.jar() -- [fc44260](https://github.com/mikeal/request/commit/fc44260d13f0094bfe96d18878a11c6fe88b69e5) Tiny cookie example error on README -- [366831b](https://github.com/mikeal/request/commit/366831b705b5d5ebfbec5f63b4b140cbafcb4515) Remove instanceof check for CookieJar (mikeal suggestion) -- [88488cf](https://github.com/mikeal/request/commit/88488cf076efbd916b0326e0981e280c993963a7) Also add cookie to the user defined cookie jar (mikeal's suggestion) -- [f6fef5b](https://github.com/mikeal/request/commit/f6fef5bfa4ba8e1dfa3022df8991716e5cba7264) Updated cookie documentation in README file -- [b519044](https://github.com/mikeal/request/commit/b5190441a889164dfeb4148fac643fd7a87cfb51) request.defaults({jar: false}) disables cookies && also updated README -- [856a65c](https://github.com/mikeal/request/commit/856a65cd28402efbe3831a68d73937564a27ea9b) Update jar documentation in the options also -- [#102](https://github.com/mikeal/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex) -- [62592e7](https://github.com/mikeal/request/commit/62592e7fe9ee5ecaee80b8f5bc2400e4a277e694) Cookie bugs (@janjongboom) -- [a06ad2f](https://github.com/mikeal/request/commit/a06ad2f955270974409e75c088e1f5d1f5298ff5) Follow redirects should work on PUT and POST requests as well. This is more consistent to other frameworks, e.g. .NET (@janjongboom) -- [bf3f5d3](https://github.com/mikeal/request/commit/bf3f5d30fdabf6946096623fc3398bb66ed19a1f) Cookies shouldn't be discarded when followRedirect = true (@janjongboom) -- [16db85c](https://github.com/mikeal/request/commit/16db85c07e6c2516269299640fdddca6db7bc051) Revert "Follow redirects should work on PUT and POST requests as well. This is more consistent to other frameworks, e.g. .NET" (@janjongboom) -- [841664e](https://github.com/mikeal/request/commit/841664e309f329be98c1a011c634f5291af1eebc) Add test for proxy option (@dominictarr) -- [#105](https://github.com/mikeal/request/pull/105) added test for proxy option. (@dominictarr) -- [50d2d39](https://github.com/mikeal/request/commit/50d2d3934cd86d7142a4aab66017bb1ef82329cf) Fixing test, emitter matches on req.url so it needs the full url. (@mikeal) -- [668a291](https://github.com/mikeal/request/commit/668a291013380af305eba12b1d5c7a5376a74c76) Adding some documentation for OAuth signing support. (@mikeal) -- [04faa3b](https://github.com/mikeal/request/commit/04faa3bf2b1f4ec710414c6ec7231b24767b2f89) Minor improvements in example (@mikeal) -- [0fddc17](https://github.com/mikeal/request/commit/0fddc1798dcd9b213e3f8aec504c61cecf4d7997) Another small fix to the url in the docs. (@mikeal) -- [337649a](https://github.com/mikeal/request/commit/337649a08b4263c0d108cd4621475c8ff9cf8dd0) Add oauth to options. (@mikeal) -- [#86](https://github.com/mikeal/request/pull/86) Can't post binary to multipart requests (@developmentseed) -- [4e4d428](https://github.com/mikeal/request/commit/4e4d4285490be20abf89ff1fb54fb5088c01c00e) Update to Iris Couch URL (@jhs) -- [#110](https://github.com/mikeal/request/pull/110) Update to Iris Couch URL (@iriscouch) -- [d7af099](https://github.com/mikeal/request/commit/d7af0994b382466367f2cafc5376150e661eeb9d) Remove the global `i` as it's causing my test suites to fail with leak detection turned on. (@3rd-Eden) -- [#117](https://github.com/mikeal/request/pull/117) Remove the global `i` (@3rd-Eden) -- [b2a4ad1](https://github.com/mikeal/request/commit/b2a4ad1e7d7553230e932ea093d7f77f38147ef9) Force all cookie keys into lower case as suggested by LinusU (@jhurliman) -- [055a726](https://github.com/mikeal/request/commit/055a7268b40425643d23bd6a4f09c7268dbab680) Applying a modified version of pull request #106 as suggested by janjongboom (@jhurliman) -- [#121](https://github.com/mikeal/request/pull/121) Another patch for cookie handling regression (@jhurliman) -- [a353f4e](https://github.com/mikeal/request/commit/a353f4eeb312ea378d34b624f5c4df33eefa152c) Merge remote-tracking branch 'upstream/master' (@janjongboom) -- [#104](https://github.com/mikeal/request/pull/104) Cookie handling contains bugs (@janjongboom) -- [a3be5ad](https://github.com/mikeal/request/commit/a3be5ad5ea112422ed00da632530b93bcf54727c) Fix encoding of characters like ( (@mikeal) -- [dd2067b](https://github.com/mikeal/request/commit/dd2067bbbf77d1132c9ed480848645136b8a5521) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [ddc4e45](https://github.com/mikeal/request/commit/ddc4e453c3b9a0e11da4df156c5e15206abfc1ef) Pushed new version to npm (@mikeal) -- [feee5eb](https://github.com/mikeal/request/commit/feee5ebd2ca8c09db25b5cb13cd951f7c4322a49) Real fix for encoding issues in javascript and oauth. (@mikeal) -- [23896cd](https://github.com/mikeal/request/commit/23896cdc66d75ec176876167ff21da72b7ff181b) Pushed new version to npm. (@mikeal) -- [a471ed2](https://github.com/mikeal/request/commit/a471ed2ca8acdca1010a0fc20434c5c9956b0d0c) HTTP redirect tests (@jhs) -- [a4a9aa1](https://github.com/mikeal/request/commit/a4a9aa199ff958630791e131092ec332ada00a49) A self-signed certificate for upcoming HTTPS testing (@jhs) -- [10ac6b9](https://github.com/mikeal/request/commit/10ac6b9db40263bec1bf63ee7e057000ffd2d7e9) HTTPS tests, for now a copy of the test-body tests (@jhs) -- [105aed1](https://github.com/mikeal/request/commit/105aed1ff99add1957f91df7efabf406e262f463) Support an "httpModules" object for custom http/https module behavior (@jhs) -- [#112](https://github.com/mikeal/request/pull/112) Support using a custom http-like module (@iriscouch) -- [d05a875](https://github.com/mikeal/request/commit/d05a8753af576fc1adccc7ffe9633690371c05ee) Test for #129 (@mikeal) -- [06cdfaa](https://github.com/mikeal/request/commit/06cdfaa3c29233dac3f47e156f2b5b3a0f0ae4b8) return body as buffer when encoding is null -- [#132](https://github.com/mikeal/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson) -- [4882e51](https://github.com/mikeal/request/commit/4882e519ed6b8d08795da5de37166148ce0ee440) fixed cookies parsing, updated tests (@afanasy) -- [2be228e](https://github.com/mikeal/request/commit/2be228ec8b48a60028bd1d80c8cbebf23964f913) Change `host` to `hostname` in request hash -- [#135](https://github.com/mikeal/request/pull/135) host vs hostname (@iangreenleaf) -- [e24abc5](https://github.com/mikeal/request/commit/e24abc5cc2c6fa154ae04fe58a16d135eeba4951) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [c99c809](https://github.com/mikeal/request/commit/c99c809bb48b9c0193aae3789c5c844f7f6cbe92) Reverting host -> hostname because it breaks in pre-0.6. (@mikeal) -- [a1134d8](https://github.com/mikeal/request/commit/a1134d855f928fde5c4fe9ee255c111da0195bfc) adding logging (@mikeal) -- [#133](https://github.com/mikeal/request/pull/133) Fixed cookies parsing (@afanasy) -- [9179471](https://github.com/mikeal/request/commit/9179471f9f63b6ba9c9078a35cb888337ce295e8) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [cbb180b](https://github.com/mikeal/request/commit/cbb180b0399074995c235a555e3e3e162d738f7c) Fixes to oauth test. (@mikeal) -- [e1c351f](https://github.com/mikeal/request/commit/e1c351f92958634ccf3fbe78aa2f5b06d9c9a5fa) Published new version. (@mikeal) -- [3ceee86](https://github.com/mikeal/request/commit/3ceee86f1f3aad3a6877d6d3813e087549f3b485) Formatting fixes. (@mikeal) -- [18e1af5](https://github.com/mikeal/request/commit/18e1af5e38168dcb95c8ae29bb234f1ad9bbbdf9) Fixing log error. (@mikeal) -- [edc19b5](https://github.com/mikeal/request/commit/edc19b5249f655714efa0f8fa110cf663b742921) Pushed new version. (@mikeal) -- [f51c32b](https://github.com/mikeal/request/commit/f51c32bd6f4da0419ed8404b610c43ee3f21cf92) added "form" option to readme. (@petejkim) -- [#144](https://github.com/mikeal/request/pull/144) added "form" option to readme (@petejkim) -- [b58022e](https://github.com/mikeal/request/commit/b58022ecda782af93e35e5f9601013b90b09ca73) add "forever" method (@thejh) -- [79d4651](https://github.com/mikeal/request/commit/79d46510ddff2e2c12c69f7ae4072ec489e27b0e) remove logging (@thejh) -- [f87cbf6](https://github.com/mikeal/request/commit/f87cbf6ec6fc0fc2869c340114514c887b304a80) retry on ECONNRESET on reused socket (@thejh) -- [1a91675](https://github.com/mikeal/request/commit/1a916757f4ec48b1282fddfa0aaa0fa6a1bf1267) Multipart requests should respect content-type if set; Issue #145 (@apeace) -- [#146](https://github.com/mikeal/request/pull/146) Multipart should respect content-type if previously set (@apeace) -- [#148](https://github.com/mikeal/request/pull/148) Retry Agent (@thejh) -- [70c5b63](https://github.com/mikeal/request/commit/70c5b63aca29a7d1629fa2909ff5b7199bbf0fd1) Publishing new version to npm. (@mikeal) -- [fc0f04b](https://github.com/mikeal/request/commit/fc0f04bab5d6be56a2c19d47d3e8386bd9a0b29e) Fix: timeout on socket, timeout after redirect -- [ef79e59](https://github.com/mikeal/request/commit/ef79e59bbb88ed3e7d4368fe3ca5eee411bda345) Fix: timeout after redirect 2 -- [c32a218](https://github.com/mikeal/request/commit/c32a218da2296e89a269f1832d95b12c4aa10852) merge master (@jroes) -- [d2d9b54](https://github.com/mikeal/request/commit/d2d9b545e5679b829d33deeba0b22f9050fd78b1) add line to docs describing followAllRedirects option (@jroes) -- [#90](https://github.com/mikeal/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes) -- [c08ab7e](https://github.com/mikeal/request/commit/c08ab7efaefd39c04deb6986716efe5a6069528e) Emit an event after we create the request object so that people can manipulate it before nextTick(). (@mikeal) -- [#162](https://github.com/mikeal/request/pull/162) Fix issue #159 (@dpetukhov) -- [e77a169](https://github.com/mikeal/request/commit/e77a1695c5c632c067857e99274f28a1d74301fe) fixing streaming example. fixes #164 (@mikeal) -- [ee53386](https://github.com/mikeal/request/commit/ee53386d85975c79b801edbb4f5bb7ff4c5dc90b) fixes #127 (@mikeal) -- [e2cd9de](https://github.com/mikeal/request/commit/e2cd9de9a9d10e1aa4cf4e26006bb30fa5086f0b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [a0ab977](https://github.com/mikeal/request/commit/a0ab9770a8fb89f970bb3783ed4e6dde9e33511b) Added failing test for #125. (@papandreou) -- [c80800a](https://github.com/mikeal/request/commit/c80800a834b0f8bc0fb40d1fad4d4165a83369fd) Fix cookie jar/headers.cookie collision. Closes #125. (@papandreou) -- [1ac9e2d](https://github.com/mikeal/request/commit/1ac9e2d1bf776728a1fe676dd3693ef66f50f7f7) Redirect test: Also assert that the request cookie doesn't get doubled in the request for the landing page. (@papandreou) -- [07bbf33](https://github.com/mikeal/request/commit/07bbf331e2a0d40d261487f6222e8cafee0e50e3) Fixes #150 (@mikeal) -- [c640eed](https://github.com/mikeal/request/commit/c640eed292c06eac3ec89f60031ddf0fc0add732) Cookie jar handling: Don't double the cookies on each redirect (see discussion on #139). (@papandreou) -- [808de8b](https://github.com/mikeal/request/commit/808de8b0ba49d4bb81590ec37a873e6be4d9a416) Adding some missing mime types #138 (@serby) -- [#161](https://github.com/mikeal/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou) -- [#168](https://github.com/mikeal/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby) -- [2a30487](https://github.com/mikeal/request/commit/2a304879f4218c1e46195d882bc81c0f874be329) bugfix - allow add cookie to wrapped request (defaults) (@fabianonunes) -- [a18b4f1](https://github.com/mikeal/request/commit/a18b4f14559f56cf52ca1b421daa6a934d28d51b) Making pipeDest a public prototype method rather than keeping it private. (@mikeal) -- [#170](https://github.com/mikeal/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes) -- [49a0f60](https://github.com/mikeal/request/commit/49a0f604779c91dd1759a02cbb195ccbd8d73f5d) Structural refactor, getting read for composable API. (@mikeal) -- [5daa0b2](https://github.com/mikeal/request/commit/5daa0b28b06cf109614f19e76b0e0b9b25ee3baf) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [e4df85c](https://github.com/mikeal/request/commit/e4df85c72221bf09ee7e1eb54f6c881851bd4164) Composable API for OAuth. (@mikeal) -- [945ec40](https://github.com/mikeal/request/commit/945ec40baef968ddd468c3b4dfce01621e4a0e31) Composable form API (@mikeal) -- [c30b47f](https://github.com/mikeal/request/commit/c30b47f229522a75af85da269157377b4a7dc37d) Use this, return this. (@mikeal) -- [e908644](https://github.com/mikeal/request/commit/e908644a69f9107b954f13635736f1e640216aec) Composable multipart API. (@mikeal) -- [e115677](https://github.com/mikeal/request/commit/e115677b1a03576eb96386986c350f211a4f38cd) Composable jar. Guard against overwrites on retry. (@mikeal) -- [a482e48](https://github.com/mikeal/request/commit/a482e4802e11fd122b12e18d1b18b49850fef823) Updating copyright for the new year. (@mikeal) -- [3c6581a](https://github.com/mikeal/request/commit/3c6581a9d4508fe5d75e111ae0fb94c5e0078404) Adding clobber argument for appending to headers. thanks @isaacs (@mikeal) -- [54e6aca](https://github.com/mikeal/request/commit/54e6aca0ab5982621fc9b35500f2154e50c0c95d) Fixes #144. (@mikeal) -- [12f4997](https://github.com/mikeal/request/commit/12f4997ed83bfbfefa3fc5b5635bc9a6829aa0d7) Fixing clobber. (@mikeal) -- [2f34fd1](https://github.com/mikeal/request/commit/2f34fd13b7ec86cb1c67e0a58664b9e060a34a50) Added support for a "query" option value that is a hash of querystring values that is merged (taking precedence over) with the querystring passed in the uri string. (@csainty) -- [a32d9e7](https://github.com/mikeal/request/commit/a32d9e7069533fb727a71730dbaa0f62ebefb731) Added a js based test runner so I can run tests on windows. (@csainty) -- [e0b6ce0](https://github.com/mikeal/request/commit/e0b6ce063de0c4223c97982128bb8203caf4a331) Tidied up an issue where ?> was being appended to URLs. (@csainty) -- [d47150d](https://github.com/mikeal/request/commit/d47150d6748a452df336d8de9743218028a876db) Refactored to match the composable style (@csainty) -- [b7e0929](https://github.com/mikeal/request/commit/b7e0929837873a8132476bb2b4d2e2a0fdc7cd0f) implemented issue #173 allow uri to be first argument (@twilson63) -- [b7264a6](https://github.com/mikeal/request/commit/b7264a6626481d5da50a28c91ea0be7b688c9daf) removed debug line and reset ports (@twilson63) -- [76598c9](https://github.com/mikeal/request/commit/76598c92bee64376e5d431285ac1bf6783140dbb) removed npm-debug (@twilson63) -- [#177](https://github.com/mikeal/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63) -- [0f24051](https://github.com/mikeal/request/commit/0f240517dea65337636a49cb1cc2b5327504430e) Renamed query to qs. It was actually my first choice, but there appeared to be conflicts with the qs = require('querystring'). These are no longer present though and must have been unrelated. (@csainty) -- [becedaa](https://github.com/mikeal/request/commit/becedaaa7681b0c4ad5c0a9b9922fc950f091af2) Changed test structure to no longer require a server, modeled on the oauth tests. This also lets me revert some of the changes I had to make to the test server and proxy tests (@csainty) -- [9b2bbf0](https://github.com/mikeal/request/commit/9b2bbf0c12e87a59320efac67759041cd4af913f) Modified how the qs function works, it now no longer tweaks the existing request uri, instead it recreates a new one. This allows me to revert all the other changes I had to make previously and gives a nice clean commit that is self contained. (@csainty) -- [5ac7e26](https://github.com/mikeal/request/commit/5ac7e26ce4f7bf5a334df91df83699891171c0ae) failing test for .pipe(dst, opts) (@substack) -- [3b2422e](https://github.com/mikeal/request/commit/3b2422e62fbd6359b841e59a2c1888db71a22c2c) fix for failing pipe opts test (@substack) -- [8788c8b](https://github.com/mikeal/request/commit/8788c8b8cba96662e9d94a96eb04d96b904adea3) added uri param for post, put, head, del shortcuts (@twilson63) -- [#179](https://github.com/mikeal/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack) -- [#180](https://github.com/mikeal/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63) -- [37d0699](https://github.com/mikeal/request/commit/37d0699eb681e85b7df4896b0a68b6865e596cb3) Fixing end bug i introduced being stupid. (@mikeal) -- [3a97292](https://github.com/mikeal/request/commit/3a97292f45273fa2cc937c0698ba19964780b4bb) fixed defaults functionality to support (uri, options, callback) (@twilson63) -- [#182](https://github.com/mikeal/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63) -- [c94b200](https://github.com/mikeal/request/commit/c94b200258fa48697e386121a3e114ab7bed2ecf) Switched npm test from the bash script to a node script so that it is cross-platform. (@csainty) -- [#176](https://github.com/mikeal/request/pull/176) Querystring option (@csainty) -- [3b1e609](https://github.com/mikeal/request/commit/3b1e6094451e8d34c93353177de9d76e9a805e43) Adding defaults test back in. (@mikeal) -- [b4ae0c2](https://github.com/mikeal/request/commit/b4ae0c2d50f018a90a3ec8daa1d14c92a99873b9) Fixing idiotic bug I introduced. (@mikeal) -- [32f76c8](https://github.com/mikeal/request/commit/32f76c8baaf784dc2f4f1871153b1796bcebdcfe) Pushed new version to npm. (@mikeal) -- [00d0d9f](https://github.com/mikeal/request/commit/00d0d9f432182f13a5b8aa2e3a2a144b5c179015) Adding accept header to json support. (@mikeal) -- [0f580e6](https://github.com/mikeal/request/commit/0f580e6f6317c5301a52c0b6963d58e27112abca) Add abort support to the returned request (@itay) -- [4505e6d](https://github.com/mikeal/request/commit/4505e6d39a44229bfe5dc4d9a920233e05a7dfdb) Fixing some edge streaming cases with redirects by reusing the Request object. (@mikeal) -- [eed57af](https://github.com/mikeal/request/commit/eed57af8fe3e16632e9e0043d4d7f4d147dbfb8f) Published new version. (@mikeal) -- [97386b5](https://github.com/mikeal/request/commit/97386b5d7315b5c83702ffc7d0b09e34ecb67e04) Fixing pretty bad bug from the composable refactor. (@mikeal) -- [b693ce6](https://github.com/mikeal/request/commit/b693ce64e16aaa859d4edc86f82fbb11e00d33c0) Move abort to a prototype method, don't raise error (@itay) -- [1330eef](https://github.com/mikeal/request/commit/1330eef3ec84a651a435c95cf1ff1a4003086440) Merge branch 'master' of git://github.com/mikeal/request (@itay) -- [#188](https://github.com/mikeal/request/pull/188) Add abort support to the returned request (@itay) -- [5ff4645](https://github.com/mikeal/request/commit/5ff46453e713da1ae66a0d510eda4919e4080abe) Style changes. (@mikeal) -- [2dbd1e4](https://github.com/mikeal/request/commit/2dbd1e4350c2941b795b0e5ee7c0a00cd04cce09) Fixing new params style on master for head request. (@mikeal) -- [14989b2](https://github.com/mikeal/request/commit/14989b2dfc6830dbdad5364930fba1d2995aba06) Pushed new version to npm. (@mikeal) -- [0ea2351](https://github.com/mikeal/request/commit/0ea2351ef017ada9b8472f8d73086715ebe30c6a) Fixes #190. outdated check on options.json from before we had boolean support. (@mikeal) -- [21bf78c](https://github.com/mikeal/request/commit/21bf78c264316f75f4e6c571461521cda6ccf088) Adds a block on DELETE requests in status 300-400 (@goatslacker) -- [0c0c201](https://github.com/mikeal/request/commit/0c0c20139b28b21a860f72b8ce0124046fae421d) Adds tests for GH-119 Fix (@goatslacker) -- [#193](https://github.com/mikeal/request/pull/193) Fixes GH-119 (@goatslacker) -- [5815a69](https://github.com/mikeal/request/commit/5815a697347f20658dc2bdfd0d06e41d0aa0dac4) Fixes #194. setTimeout only works on node 0.6+ (@mikeal) -- [1ddcd60](https://github.com/mikeal/request/commit/1ddcd605bc8936c5b3534e1cf9aa1b29fa2b060b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [7b35b4f](https://github.com/mikeal/request/commit/7b35b4ff63bbdf133f0f600a88a87b5723d29bdf) Removing old checks for self.req, it's ensured if start() is called. Implementing early pause/resume for when streams try to pause/resume before any data is emitted. Fixes #195. (@mikeal) -- [f01b79b](https://github.com/mikeal/request/commit/f01b79bb651f64065bac8877739223527f5b5592) Make ForeverAgent work with HTTPS (@isaacs) -- [#197](https://github.com/mikeal/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs) -- [8d85b57](https://github.com/mikeal/request/commit/8d85b57ebb81c9d2d0a6b94aed41bf2ab0e3ad09) Forever inherits bugfix (@isaacs) -- [#198](https://github.com/mikeal/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs) -- [37446f5](https://github.com/mikeal/request/commit/37446f54bb21cf9c83ffa81d354d799ae7ecf9ed) Add a test of HTTPS strict with CA checking (@isaacs) -- [8378d2e](https://github.com/mikeal/request/commit/8378d2ef9b8121a9851d21b3f6ec8304bde61c9d) Support tunneling HTTPS requests over proxies (@isaacs) -- [#199](https://github.com/mikeal/request/pull/199) Tunnel (@isaacs) -- [f0052ac](https://github.com/mikeal/request/commit/f0052ac5e6ca9f3f4aa49f6cda6ba15eb5d8b8e6) Published new version to npm. (@mikeal) -- [cea668f](https://github.com/mikeal/request/commit/cea668f6f7d444831313ccc0e0d301d25f2bd421) Adding more explicit error when undefined is passed as uri or options. (@mikeal) -- [047b7b5](https://github.com/mikeal/request/commit/047b7b52f3b11f4c44a02aeb1c3583940ddb59c7) Fix special method functions that get passed an options object. (@mikeal) -- [746de0e](https://github.com/mikeal/request/commit/746de0ef2f564534b29eeb8f296a59bd2c3086a7) pass through Basic authorization option for HTTPS tunneling -- [6fda9d7](https://github.com/mikeal/request/commit/6fda9d7d75e24cc1302995e41e26a91e03fdfc9a) Always clobber internal objects for qs but preserve old querystring args when clobber is present. (@mikeal) -- [75ca7a2](https://github.com/mikeal/request/commit/75ca7a25bc9c6102e87f3660a25835c7fcd70edb) Merge branch 'master' of https://github.com/mikeal/request -- [3b9f0fd](https://github.com/mikeal/request/commit/3b9f0fd3da4ae74de9ec76e7c66c57a7f8641df2) Fix cookies so that attributes are case insensitive -- [fddbd6e](https://github.com/mikeal/request/commit/fddbd6ee7d531bc4a82f629633b9d1637cb039e8) Properly set cookies during redirects -- [0d0bdb7](https://github.com/mikeal/request/commit/0d0bdb793f908492d4086fae8744f1e33e68d8c6) Remove request body when following non-GET redirects -- [#203](https://github.com/mikeal/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise) -- [b5fa773](https://github.com/mikeal/request/commit/b5fa773994de1799cf53491db7f5f3ba32825b20) Replace all occurrences of special chars in RFC3986 (@chriso) -- [bc6cd6c](https://github.com/mikeal/request/commit/bc6cd6ca6c6157bad76f0b2b23d4993f389ba977) documenting additional behavior of json option (@jphaas) -- [80e4e43](https://github.com/mikeal/request/commit/80e4e43186de1e9dcfaa1c9a921451560b91267c) Fixes #215. (@mikeal) -- [51f343b](https://github.com/mikeal/request/commit/51f343b9adfc11ec1b2ddcfb52a57e1e13feacb2) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [89c0f1d](https://github.com/mikeal/request/commit/89c0f1dd324bc65ad9c07436fb2c8220de388c42) titlecase authorization for oauth (@visnup) -- [#217](https://github.com/mikeal/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup) -- [8c163eb](https://github.com/mikeal/request/commit/8c163eb9349459839fc720658979d5c97a955825) Double quotes are optional, and the space after the ; could be required (@janjongboom) -- [#224](https://github.com/mikeal/request/pull/224) Multipart content-type change (@janjongboom) -- [96f4b9b](https://github.com/mikeal/request/commit/96f4b9b1f7b937a92f3f94f10d6d02f8878b6107) Style changes. (@mikeal) -- [b131c64](https://github.com/mikeal/request/commit/b131c64816f621cf15f8c51e76eb105778b4aad8) Adding safe .toJSON method. fixes #167 (@mikeal) -- [05d6e02](https://github.com/mikeal/request/commit/05d6e02c31ec4e6fcfadbfbe5414e701710f6e55) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [74ca9a4](https://github.com/mikeal/request/commit/74ca9a4852b666d30dd71421e8cc8b8a83177148) Unified error and complete handling. Fixes #171 (@mikeal) -- [a86c7dc](https://github.com/mikeal/request/commit/a86c7dc7d0a7c640c7def4c0215e46e76a11ff56) Fixing followAllRedirects and all the redirect tests. (@mikeal) -- [#211](https://github.com/mikeal/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso) -- [7e24e8a](https://github.com/mikeal/request/commit/7e24e8a48d0dcfe10d0cc08b3c4e9627b9a95a97) New version on npm, first 3.0 release candidate. (@mikeal) -- [22e0f0d](https://github.com/mikeal/request/commit/22e0f0d73459c11b81b0f66a2cde85492dd8e38f) Added test for .toJSON() (@mikeal) -- [df32746](https://github.com/mikeal/request/commit/df32746f157948b6ae05e87a35cf1768e065ef0b) Adding toJSON to npm test. (@mikeal) -- [e65bfba](https://github.com/mikeal/request/commit/e65bfba98f0886a059a268dcdceabf41aec1e5cc) New version in npm. (@mikeal) -- [2b95921](https://github.com/mikeal/request/commit/2b959217151aaff7a6e7cc15e2acfccd1bbb9b85) Fixing defaults when url is passed instead of uri. (@mikeal) -- [e0534d8](https://github.com/mikeal/request/commit/e0534d860b4931a7a6e645b328fd4418a5433057) Pushed new version to npm. (@mikeal) -- [d2dc835](https://github.com/mikeal/request/commit/d2dc83538379e9e1fafb94f5698c56b4a5318d8d) don't error when null is passed for options (@polotek) -- [db80bf0](https://github.com/mikeal/request/commit/db80bf0444bd98c45f635f305154b9da20eed328) expose initParams (@polotek) -- [8cf019c](https://github.com/mikeal/request/commit/8cf019c9f9f719694408840823e92da08ab9dac3) allow request.defaults to override the main request method (@polotek) -- [#240](https://github.com/mikeal/request/pull/240) don't error when null is passed for options (@polotek) -- [69d017d](https://github.com/mikeal/request/commit/69d017de57622429f123235cc5855f36b3e18d1c) added dynamic boundary for multipart requests (@zephrax) -- [fc13e18](https://github.com/mikeal/request/commit/fc13e185f5e28a280d347e61622ba708e1cd7bbc) added dynamic boundary for multipart requests (@zephrax) -- [#243](https://github.com/mikeal/request/pull/243) Dynamic boundary (@zephrax) -- [1764176](https://github.com/mikeal/request/commit/176417698a84c53c0a69bdfd2a05a2942919816c) Fixing the set-cookie header (@jeromegn) -- [#246](https://github.com/mikeal/request/pull/246) Fixing the set-cookie header (@jeromegn) -- [6f9da89](https://github.com/mikeal/request/commit/6f9da89348b848479c23192c04b3c0ddd5a4c8bc) do not set content-length header to 0 when self.method is GET or self.method is undefined (@sethbridges) -- [efc0ea4](https://github.com/mikeal/request/commit/efc0ea44d63372a30011822ad9d37bd3d7b85952) Experimental AWS signing. Signing code from knox. (@mikeal) -- [4c08a1c](https://github.com/mikeal/request/commit/4c08a1c10bc0ebb679e212ad87419f6c4cc341eb) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [fdb10eb](https://github.com/mikeal/request/commit/fdb10eb493110b8e6e4f679524f38cef946e3f08) Adding support for aws in options. (@mikeal) -- [dac6a30](https://github.com/mikeal/request/commit/dac6a301ae03207af88fae6f5017e82157b79b41) Fixing upgraded stat size and supporting content-type and content-md5 properly. (@mikeal) -- [98cb503](https://github.com/mikeal/request/commit/98cb50325e1d7789fd9f44523d2315df5f890d10) Allow body === '' /* the empty string */. (@Filirom1) -- [0e9ac12](https://github.com/mikeal/request/commit/0e9ac12c69aaca370fbca94b41358e1c3a2f6170) fixed just another global leak of i (@sreuter) -- [#260](https://github.com/mikeal/request/pull/260) fixed just another leak of 'i' (@sreuter) -- [#255](https://github.com/mikeal/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1) -- [#249](https://github.com/mikeal/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges) -- [adc9ab1](https://github.com/mikeal/request/commit/adc9ab1f563f3cb4681ac8241fcc75e6099efde2) style changes. making @rwaldron cry (@mikeal) -- [155e6ee](https://github.com/mikeal/request/commit/155e6ee270924d5698d3fea37cefc1926cbaf998) Fixed `pool: false` to not use the global agent (@timshadel) -- [1232a8e](https://github.com/mikeal/request/commit/1232a8e46752619d4d4b51d558e6725faf7bf3aa) JSON test should check for equality (@timshadel) -- [#261](https://github.com/mikeal/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel) -- [#262](https://github.com/mikeal/request/pull/262) JSON test should check for equality (@timshadel) -- [914a723](https://github.com/mikeal/request/commit/914a72300702a78a08263fe98a43d25e25713a70) consumer_key and token_secret need to be encoded for OAuth v1 (@nanodocumet) -- [500e790](https://github.com/mikeal/request/commit/500e790f8773f245ff43dd9c14ec3d5c92fe0b9e) Fix uncontrolled crash when "this.uri" is an invalid URI (@naholyr) -- [#265](https://github.com/mikeal/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr) -- [#263](https://github.com/mikeal/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet) -- [f4b87cf](https://github.com/mikeal/request/commit/f4b87cf439453b3ca1d63e85b3aeb3373ee1f17e) I'm not OCD seriously (@TehShrike) -- [#268](https://github.com/mikeal/request/pull/268) I'm not OCD seriously (@TehShrike) -- [fcab7f1](https://github.com/mikeal/request/commit/fcab7f1953cd6fb141a7d98f60580c50b59fb73f) Adding a line break to the preamble as the first part of a multipart was not recognized by a server I was communicating with. (@proksoup) -- [661b62e](https://github.com/mikeal/request/commit/661b62e5319bf0143312404f1fc81c895c46f6e6) Commenting out failing post test. Need to figure out a way to test this now that the default is to use a UUID for the frontier. (@mikeal) -- [7165c86](https://github.com/mikeal/request/commit/7165c867fa5dea4dcb0aab74d2bf8ab5541e3f1b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [5a7ca9b](https://github.com/mikeal/request/commit/5a7ca9b398c1300c08a28fb7f266054c3ce8c57a) Added drain event and returning the boolean from write to proper handle back pressure when piping. (@mafintosh) -- [#273](https://github.com/mikeal/request/pull/273) Pipe back pressure issue (@mafintosh) -- [f8ae8d1](https://github.com/mikeal/request/commit/f8ae8d18627e4743996d8600f77f4e4c05a2a590) New version in npm. (@mikeal) -- [7ff5dae](https://github.com/mikeal/request/commit/7ff5daef152bcfac5b02e661e5476a57b9693489) Merge remote-tracking branch 'upstream/master' (@proksoup) -- [1f34700](https://github.com/mikeal/request/commit/1f34700e5614ea2a2d78b80dd467c002c3e91cb3) fix tests with boundary by injecting boundry from header (@benatkin) -- [ee2b2c2](https://github.com/mikeal/request/commit/ee2b2c2f7a8625fde4d71d79e19cdc5d98f09955) Like in [node.js](https://github.com/joyent/node/blob/master/lib/net.js#L52) print logs if NODE_DEBUG contains the word request (@Filirom1) -- [#279](https://github.com/mikeal/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin) -- [3daebaf](https://github.com/mikeal/request/commit/3daebaf2551c8d0df7dac1ebff0af4fe08608768) Merge branch 'master' of https://github.com/mikeal/request (@proksoup) -- [dba2ebf](https://github.com/mikeal/request/commit/dba2ebf09552258f37b60122c19b236064b0d216) Updating with corresponding tests. (@proksoup) -- [396531d](https://github.com/mikeal/request/commit/396531d083c94bc807a25f7c3a50a0c92a00c5f7) Removing console.log of multipart (@proksoup) -- [54226a3](https://github.com/mikeal/request/commit/54226a38816b4169e0a7a5d8b1a7feba78235fec) Okay, trying it as an optional parameter, with a new test in test-body.js to verify (@proksoup) -- [23ae7d5](https://github.com/mikeal/request/commit/23ae7d576cc63d645eecf057112b71d6cb73e7b1) Remove non-"oauth_" parameters from being added into the OAuth Authorization header (@jplock) -- [8b82ef4](https://github.com/mikeal/request/commit/8b82ef4ff0b50b0c8dcfb830f62466fa30662666) Removing guard, there are some cases where this is valid. (@mikeal) -- [82440f7](https://github.com/mikeal/request/commit/82440f76f22a5fca856735af66e2dc3fcf240c0d) Adding back in guard for _started, need to keep some measure of safety but we should defer this restriction for as long as possible. (@mikeal) -- [#282](https://github.com/mikeal/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock) -- [087be3e](https://github.com/mikeal/request/commit/087be3ebbada53699d14839374f1679f63f3138f) Remove stray `console.log()` call in multipart generator. (@bcherry) -- [0a8a5ab](https://github.com/mikeal/request/commit/0a8a5ab6a08eaeffd45ef4e028be2259d61bb0ee) Merge remote-tracking branch 'upstream/master' (@proksoup) -- [#241](https://github.com/mikeal/request/pull/241) Composability updates suggested by issue #239 (@polotek) -- [#284](https://github.com/mikeal/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry) -- [8344666](https://github.com/mikeal/request/commit/8344666f682a302c914cce7ae9cea8de054f9240) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) -- [#272](https://github.com/mikeal/request/pull/272) Boundary begins with CRLF? (@proksoup) -- [#214](https://github.com/mikeal/request/pull/214) documenting additional behavior of json option (@jphaas) -- [#207](https://github.com/mikeal/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) -- [9cadd61](https://github.com/mikeal/request/commit/9cadd61d989e85715ea07da8770a3077db41cca3) Allow parser errors to bubble up to request (@mscdex) -- [6a00fea](https://github.com/mikeal/request/commit/6a00fea09eed99257c0aec2bb66fbf109b0f573a) Only add socket error handler callback once (@mscdex) -- [975ea90](https://github.com/mikeal/request/commit/975ea90bed9503c67055b20e36baf4bcba54a052) Fix style (@mscdex) -- [205dfd2](https://github.com/mikeal/request/commit/205dfd2e21c13407d89d3ed92dc2b44b987d962b) Use .once() when listening for parser error (@mscdex) -- [ff9b564](https://github.com/mikeal/request/commit/ff9b5643d6b5679a9e7d7997ec6275dac10b000e) Add a space after if (@Filirom1) -- [#280](https://github.com/mikeal/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1) -- [d38e57b](https://github.com/mikeal/request/commit/d38e57bbb3d827aa87427f2130aa5a5a3a973161) Test for #289 (@isaacs) -- [820af58](https://github.com/mikeal/request/commit/820af5839f2a193d091d98f23fd588bd919e3e58) A test of POST redirect following with 303 status (@isaacs) -- [7adc5a2](https://github.com/mikeal/request/commit/7adc5a21869bc92cc3b5e84d32c585952c8e5e87) Use self.encoding when calling Buffer.toString() (@isaacs) -- [#290](https://github.com/mikeal/request/pull/290) A test for #289 (@isaacs) -- [#293](https://github.com/mikeal/request/pull/293) Allow parser errors to bubble up to request (@mscdex) -- [ed68b8d](https://github.com/mikeal/request/commit/ed68b8dd024561e9d47d80df255fb79d783c13a7) Updated the twitter oauth dance. The comments weren't clear. Also removed token_key. No longer needed with twitter oauth. (@joemccann) -- [6bc19cd](https://github.com/mikeal/request/commit/6bc19cda351b59f8e45405499a100abd0b456e42) Forgot to remove token_secret; no longer needed for twitter. (@joemccann) -- [1f21b17](https://github.com/mikeal/request/commit/1f21b17fc4ff3a7011b23e3c9261d66effa3aa40) Adding form-data support. (@mikeal) -- [827e950](https://github.com/mikeal/request/commit/827e950500746eb9d3a3fa6f174416b194c9dedf) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b211200](https://github.com/mikeal/request/commit/b2112009a31fc7f9122970d392750f62b6e77111) Test fixes for relative import. Adding to run all (@mikeal) -- [1268195](https://github.com/mikeal/request/commit/1268195b75bd5bb3954b4c4f2d9feb80a97994d1) Bundling mime module rather than keep around our own mime-map. (@mikeal) -- [4f51cec](https://github.com/mikeal/request/commit/4f51cecdc363946b957585c3deccfd8c37e19aa0) Docs for the form API, pumping version. (@mikeal) -- [90245d7](https://github.com/mikeal/request/commit/90245d7199215d7b195cf7e36b203ca0bd0a6bd3) Doc fixes. (@mikeal) -- [d98ef41](https://github.com/mikeal/request/commit/d98ef411c560bd1168f242c524a378914ff8eac4) Pushed new version to npm. (@mikeal) -- [3e11937](https://github.com/mikeal/request/commit/3e119375acda2da225afdb1596f6346dbd551fba) Pass servername to tunneling secure socket creation (@isaacs) -- [7725b23](https://github.com/mikeal/request/commit/7725b235fdec8889c0c91d55c99992dc683e2e22) Declare dependencies more sanely (@isaacs) -- [#317](https://github.com/mikeal/request/pull/317) Workaround for #313 (@isaacs) -- [#318](https://github.com/mikeal/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs) -- [0c470bc](https://github.com/mikeal/request/commit/0c470bccf1ec097ae600b6116e6244cb624dc00e) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [0d98e5b](https://github.com/mikeal/request/commit/0d98e5b7ea6bd9c4f21535d3682bbed2f2e05df4) Pushed new version to npm. (@mikeal) -- [64a4448](https://github.com/mikeal/request/commit/64a44488ac8c792a1f548f305fc5c61efe0d77fb) when setting defaults, the wrapper adds the jar method assuming it has the same signature as get, meaning undefined is passed into initParams, which subsequently fails. now passing jar function directly as it has no need of defaults anyway seeing as it only creates a new cookie jar (@StuartHarris) -- [48c9881](https://github.com/mikeal/request/commit/48c988118bda4691fffbfcf30d5a39b6c1438736) Added test to illustrate #321 (@alexindigo) -- [8ce0f2a](https://github.com/mikeal/request/commit/8ce0f2a3b6929cd0f7998e00d850eaf5401afdb7) Added *src* stream removal on redirect. #321 (@alexindigo) -- [c32f0bb](https://github.com/mikeal/request/commit/c32f0bb9feaa71917843856c23b4aae99f78ad4d) Do not try to remove listener from an undefined connection (@strk) -- [#326](https://github.com/mikeal/request/pull/326) Do not try to remove listener from an undefined connection (@CartoDB) -- [#322](https://github.com/mikeal/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo) -- [85b6a63](https://github.com/mikeal/request/commit/85b6a632ac7d3456485fbf931043f10f5f6344a5) New version in npm. (@mikeal) -- [f462bd3](https://github.com/mikeal/request/commit/f462bd3fa421fa5e5ca6c91852333db90297b80e) Rolling trunk version. (@mikeal) -- [8a82c5b](https://github.com/mikeal/request/commit/8a82c5b0990cc58fa4cb7f81814d13ba7ae35453) Adding url to redirect error for better debugging. (@mikeal) -- [013c986](https://github.com/mikeal/request/commit/013c986d0a8b5b2811cd06dd3733f4a3d37df1cc) Better debugging of max redirect errors. (@mikeal) -- [#320](https://github.com/mikeal/request/pull/320) request.defaults() doesn't need to wrap jar() (@redbadger) -- [4797f88](https://github.com/mikeal/request/commit/4797f88b42c3cf8680cbde09bf473678a5707aed) Fix #296 - Only set Content-Type if body exists (@Marsup) -- [f6bcf3e](https://github.com/mikeal/request/commit/f6bcf3eb51982180e813c69cccb942734f815ffe) fixup aws function to work in more situations (@nlf) -- [ba6c88a](https://github.com/mikeal/request/commit/ba6c88af5e771c2a0e007e6166e037a149561e09) added short blurb on using aws (@nlf) -- [#343](https://github.com/mikeal/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nathan-lafreniere) -- [288c52a](https://github.com/mikeal/request/commit/288c52a2a1579164500c26136552827112801ff1) switch to a case insensitive getter when fetching headers for aws auth signing (@nlf) -- [#332](https://github.com/mikeal/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup) -- [7a16286](https://github.com/mikeal/request/commit/7a162868de65b6de15e00c1f707b5e0f292c5f86) Emit errors for anything in init so that it is catchable in a redirect. (@mikeal) -- [d288d21](https://github.com/mikeal/request/commit/d288d21d709fa81067f5af53737dfde06f842262) fix bug (@azylman) -- [#355](https://github.com/mikeal/request/pull/355) stop sending erroneous headers on redirected requests (@azylman) -- [b0b97f5](https://github.com/mikeal/request/commit/b0b97f53a9e94f3aeaa05e2cda5b820668f6e3b2) delete _form along with everything else on a redirect (@jgautier) -- [#360](https://github.com/mikeal/request/pull/360) Delete self._form along with everything else on redirect (@jgautier) -- [61e3850](https://github.com/mikeal/request/commit/61e3850f0f91ca6732fbd06b46796fbcd2fea1ad) Made it so that if we pass in Content-Length or content-length in the headers, don't make a new version (@danjenkins) -- [#361](https://github.com/mikeal/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins) -- [590452d](https://github.com/mikeal/request/commit/590452d6569e68e480d4f40b88022f1b81914ad6) inside oauth.hmacsign: running rfc3986 on base_uri instead of just encodeURIComponent. -- [#362](https://github.com/mikeal/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall) -- [f7dc90c](https://github.com/mikeal/request/commit/f7dc90c8dae743d5736dc6c807eecde613eb4fd4) Revert "Merge pull request #362 from jeffmarshall/master" (@mikeal) -- [d631a26](https://github.com/mikeal/request/commit/d631a26e263077eca3d4925de9b0a8d57365ba90) reintroducing the WTF escape + encoding, also fixing a typo. -- [#363](https://github.com/mikeal/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall) -- [bfe2791](https://github.com/mikeal/request/commit/bfe2791f596b749eed6961159d41a404c3aba0d0) oauth fix. (@mikeal) -- [#344](https://github.com/mikeal/request/pull/344) Make AWS auth signing find headers correctly (@nathan-lafreniere) -- [e863f25](https://github.com/mikeal/request/commit/e863f25336abc7b9f9936c20e0c06da8db0c6593) style change. (@mikeal) -- [3e5a87c](https://github.com/mikeal/request/commit/3e5a87ce28b3bb45861b32f283cd20d0084d78a7) Don't remove x_auth_type for Twitter reverse auth (@drudge) -- [#369](https://github.com/mikeal/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge) -- [25d4667](https://github.com/mikeal/request/commit/25d466773c43949e2eea4236ffc62841757fd1f0) x_auth_mode not x_auth_type (@drudge) -- [#370](https://github.com/mikeal/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge) -- [cadf4dc](https://github.com/mikeal/request/commit/cadf4dc54f4ee3fae821f6beb1ea6443e528bf6f) massive style commit. (@mikeal) -- [33453a5](https://github.com/mikeal/request/commit/33453a53bc37e4499853b9d929b3603cdf7a31cd) New version in npm. (@mikeal) -- [b638185](https://github.com/mikeal/request/commit/b6381854006470af1d0607f636992c7247b6720f) Setting master version. (@mikeal) -- [8014d2a](https://github.com/mikeal/request/commit/8014d2a5b797f07cf56d2f39a346031436e1b064) correct Host header for proxy tunnel CONNECT (@ypocat) -- [#374](https://github.com/mikeal/request/pull/374) Correct Host header for proxy tunnel CONNECT (@ypocat) -- [8c3e9cb](https://github.com/mikeal/request/commit/8c3e9cb529767cff5e7206e2e76531183085b42a) If one of the request parameters is called "timestamp", the "oauth_timestamp" OAuth parameter will get removed during the parameter cleanup loop. (@jplock) -- [#375](https://github.com/mikeal/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock) -- [69e6dc5](https://github.com/mikeal/request/commit/69e6dc5c80e67bbd7d135c3ceb657a1b2df58763) Fixed headers piping on redirects (@kapetan) -- [#376](https://github.com/mikeal/request/pull/376) Headers lost on redirect (@kapetan) -- [62dbbf3](https://github.com/mikeal/request/commit/62dbbf3d77b0851ba424d4f09d1d0c0be91c1f2d) Resolving the Invalid signature when using "qs" (@landeiro) -- [d4cf4f9](https://github.com/mikeal/request/commit/d4cf4f98e11f9a85b6bdfd0481c85c8ac34061ce) fixes missing host header on retried request when using forever agent -- [#380](https://github.com/mikeal/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-) -- [#381](https://github.com/mikeal/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro) -- [ea2f975](https://github.com/mikeal/request/commit/ea2f975ae83efe956b77cbcd0fd9ad42c0d5192f) Ensure that uuid is treated as a property name, not an index. (@othiym23) -- [#388](https://github.com/mikeal/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23) -- [11a3bc0](https://github.com/mikeal/request/commit/11a3bc0ea3063f6f0071248e03c8595bfa9fd046) Add more reporting to tests (@mmalecki) -- [#398](https://github.com/mikeal/request/pull/398) Add more reporting to tests (@mmalecki) -- [b85bf63](https://github.com/mikeal/request/commit/b85bf633fe8197dc38855f10016a0a76a8ab600a) Optimize environment lookup to happen once only (@mmalecki) -- [#403](https://github.com/mikeal/request/pull/403) Optimize environment lookup to happen once only (@mmalecki) -- [dbb9a20](https://github.com/mikeal/request/commit/dbb9a205fafd7bf5a05d2dbe7eb2c6833b4387dc) renaming tests/googledoodle.png to match it's actual image type of jpeg (@nfriedly) -- [e2d7d4f](https://github.com/mikeal/request/commit/e2d7d4fd35869354ba14a333a4b4989b648e1971) Add more auth options, including digest support (@nylen) -- [d0d536c](https://github.com/mikeal/request/commit/d0d536c1e5a9a342694ffa5f14ef8fbe8dcfa8bd) Add tests for basic and digest auth (@nylen) -- [85fd359](https://github.com/mikeal/request/commit/85fd359890646ef9f55cc6e5c6a32e74f4fbb786) Document new auth options (@nylen) -- [#338](https://github.com/mikeal/request/pull/338) Add more auth options, including digest support (@nylen) -- [fd2e2fa](https://github.com/mikeal/request/commit/fd2e2fa1e6d580cbc34afd3ae1200682cecb3cf9) Fixed a typo. (@jerem) -- [#415](https://github.com/mikeal/request/pull/415) Fixed a typo. (@jerem) -- [53c1508](https://github.com/mikeal/request/commit/53c1508c9c6a58f7d846de82cad36402497a4a4f) Fix for #417 (@mikeal) -- [b23f985](https://github.com/mikeal/request/commit/b23f985e02da4a96f1369541a128c4204a355666) Fixing merge conflict. (@mikeal) -- [28e8be5](https://github.com/mikeal/request/commit/28e8be5175793ac99236df88e26c0139a143e32d) Lost a forever fix in the previous merge. Fixing. (@mikeal) -- [e4d1e25](https://github.com/mikeal/request/commit/e4d1e25c1648ef91f6baf1ef407c712509af4b66) Copy options before adding callback. (@nrn) -- [22bc67d](https://github.com/mikeal/request/commit/22bc67d7ac739e9c9f74c026f875a0a7c686e29d) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) -- [#430](https://github.com/mikeal/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) -- [6b11acf](https://github.com/mikeal/request/commit/6b11acf3e29fb84daef4e940314cae5ac2e580c6) Updating form-data. (@mikeal) -- [d195845](https://github.com/mikeal/request/commit/d195845c3e1de42c9aee752eec8efa4dda87ec74) Updating mime (@mikeal) -- [20ba1d6](https://github.com/mikeal/request/commit/20ba1d6d38191aa7545b927a7262a18c5c63575b) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [0150d9f](https://github.com/mikeal/request/commit/0150d9fa13e51d99880013b9ec29343850b40c2f) Consider `options.rejectUnauthorized` when pooling https agents (@mmalecki) -- [3e07b6d](https://github.com/mikeal/request/commit/3e07b6d4b81037d0e6e595670db483708ffa8698) Use `rejectUnauthorized: false` in tests (@mmalecki) -- [3995878](https://github.com/mikeal/request/commit/3995878d9fff18a8707f27ffeb4ed6401086adce) Support `key` and `cert` options (@mmalecki) -- [#433](https://github.com/mikeal/request/pull/433) Added support for HTTPS cert & key (@indexzero) -- [8b0f4e8](https://github.com/mikeal/request/commit/8b0f4e8fba33d578a891218201d87e3316ea9844) Released 2.14.0 (@mikeal) -- [54172c6](https://github.com/mikeal/request/commit/54172c68cab8360372e1e64e3fa14902662950bd) Rolling master version. (@mikeal) -- [aa4a285](https://github.com/mikeal/request/commit/aa4a28586354901b0c9b298a0aa79abb5ed175af) Add patch convenience method. (@mloar) -- [66501b9](https://github.com/mikeal/request/commit/66501b9872abc9a2065430cd5ed4a34dd45c8bee) protect against double callback (@spollack) -- [#444](https://github.com/mikeal/request/pull/444) protect against double callbacks on error path (@spollack) -- [#448](https://github.com/mikeal/request/pull/448) Convenience method for PATCH (@mloar) -- [6f0f8c5](https://github.com/mikeal/request/commit/6f0f8c5ee2b2fdc7118804664c2215fe9cb5a2f2) No longer doing bundle dependencies (@mikeal) -- [3997f98](https://github.com/mikeal/request/commit/3997f980722241c18454a00aeeda07d701c27a8f) No longer using bundle dependencies (@mikeal) -- [cba36ce](https://github.com/mikeal/request/commit/cba36ce64e68bd26e230b65f81256776ac66e686) Adding hawk signing to request. (@mikeal) -- [c7a8be6](https://github.com/mikeal/request/commit/c7a8be6d174eff05a9cb2fda987979e475d8543f) Fixing bug in empty options. (@mikeal) -- [67d753f](https://github.com/mikeal/request/commit/67d753fec99fa1f5a3b35ec0bbbc98896418d86c) node-uuid is much better. (@mikeal) -- [337718b](https://github.com/mikeal/request/commit/337718baa08cafb3e706d275fd7344a3c92363bb) Smarter test runner. (@mikeal) -- [bcc33ac](https://github.com/mikeal/request/commit/bcc33aca57baf6fe2a81fbf5983048c9220c71b1) Moved the cookie jar in to it's own module. (@mikeal) -- [3261be4](https://github.com/mikeal/request/commit/3261be4b5d6f45f62b9f50bec18af770cbb70957) Put aws signing in its own package. (@mikeal) -- [fbed723](https://github.com/mikeal/request/commit/fbed7234d7b532813105efdc4c54777396a6773b) OAuth signing is now in its own library. (@mikeal) -- [ef5ab90](https://github.com/mikeal/request/commit/ef5ab90277fb00d0e8eb1c565b0f6ef8c52601d3) Forever agent is now it's own package. (@mikeal) -- [ca1ed81](https://github.com/mikeal/request/commit/ca1ed813c62c7493dc77108b3efc907cc36930cb) tunneling agent is now it's own library. (@mikeal) -- [5c75621](https://github.com/mikeal/request/commit/5c75621ba5cea18bcf114117112121d361e5f3c9) Moving from main.js to index. cause it's not 2010 anymore. (@mikeal) -- [#413](https://github.com/mikeal/request/pull/413) rename googledoodle.png to .jpg (@nfriedly) -- [b4c4c28](https://github.com/mikeal/request/commit/b4c4c28424d906cd96a2131010b21d7facf8b666) Merge branch 'master' of github.com:mikeal/request (@nrn) -- [#310](https://github.com/mikeal/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann) -- [8b0e7e8](https://github.com/mikeal/request/commit/8b0e7e8c9d196d7286d1563aa54affcc4c8b0e1d) Comment to explain init() and start(). (@mikeal) -- [43d578d](https://github.com/mikeal/request/commit/43d578dc0206388eeae9584f540d550a06308fc8) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b7c5ed4](https://github.com/mikeal/request/commit/b7c5ed48b618f71f138f9f08f8d705336f907e01) destroy the response if present when destroying the request (@mafintosh) -- [b279277](https://github.com/mikeal/request/commit/b279277dc2fb4b649640322980315d74db0d13f3) response.abort should be response.destroy (@mafintosh) -- [#454](https://github.com/mikeal/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh) -- [#429](https://github.com/mikeal/request/pull/429) Copy options before adding callback. (@nrn) -- [e0e0fb4](https://github.com/mikeal/request/commit/e0e0fb451f17945a02203639e4836aa327b4e30b) hawk 0.9.0 (@hueniverse) -- [#456](https://github.com/mikeal/request/pull/456) hawk 0.9.0 (@hueniverse) -- [2f60bc2](https://github.com/mikeal/request/commit/2f60bc253ff6e28df58a33da24b710b6d506849f) Fixes #453 (@mikeal) -- [805b6e4](https://github.com/mikeal/request/commit/805b6e4fe3afeeb407b4fca2e34e9caabe30f747) Fixing hawk README to match new usage. (@mikeal) -- [8feb957](https://github.com/mikeal/request/commit/8feb957911083bce552d1898b7ffcaa87104cd21) Removing old logref code. (@mikeal) -- [fcf6d67](https://github.com/mikeal/request/commit/fcf6d6765247a2645a233d95468ade2960294074) Safe stringify. (@mikeal) -- [62455bc](https://github.com/mikeal/request/commit/62455bca81e8760f25a2bf1dec2b06c8e915de79) hawk 0.10 (@hueniverse) -- [c361b41](https://github.com/mikeal/request/commit/c361b4140e7e6e4fe2a8f039951b65d54af65f42) hawk 0.10 (@hueniverse) -- [fa1ef30](https://github.com/mikeal/request/commit/fa1ef30dcdac83b271ce38c71975df0ed96b08f7) Strip the UTF8 BOM from a UTF encoded response (@kppullin) -- [9d636c0](https://github.com/mikeal/request/commit/9d636c0b3e882742e15ba989d0c2413f95364680) if query params are empty, then request path shouldn't end with a '?' (@jaipandya) -- [#462](https://github.com/mikeal/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya) -- [#460](https://github.com/mikeal/request/pull/460) hawk 0.10.0 (@hueniverse) -- [#461](https://github.com/mikeal/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin) -- [6d29ed7](https://github.com/mikeal/request/commit/6d29ed72e34f3b2b6d8a5cfadd96dd26b3dd246d) Moving response handlers to onResponse. (@mikeal) -- [885d6eb](https://github.com/mikeal/request/commit/885d6ebeb6130c2ab7624304f4a01a898573390b) Using querystring library from visionmedia (@kbackowski) -- [#471](https://github.com/mikeal/request/pull/471) Using querystring library from visionmedia (@kbackowski) -- [346bb42](https://github.com/mikeal/request/commit/346bb42898c5804576d9e9b3adf40123260bf73b) On strictSSL set rejectUnauthorized. (@mikeal) -- [8a45365](https://github.com/mikeal/request/commit/8a453656a705d2fa98fbf9092b1600d2ddadbb5a) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [32cfd3c](https://github.com/mikeal/request/commit/32cfd3cf7b3f23c2b1d36c5ccb475cbb3a4693ff) Style changes. (@mikeal) -- [ec07ee2](https://github.com/mikeal/request/commit/ec07ee2d3eeb90b6d0ad9f6d7f3a36da72276841) Print debug logs NODE_DEBUG=request in environment (@isaacs) -- [681af64](https://github.com/mikeal/request/commit/681af644a2ebccad8bcccb75984f7f10f909b382) Flow data in v0.10-style streams (@isaacs) -- [#473](https://github.com/mikeal/request/pull/473) V0.10 compat (@isaacs) -- [f07a8ba](https://github.com/mikeal/request/commit/f07a8baebf7001addbc0f7d7c869adddc21768ce) Release. (@mikeal) -- [1f947a1](https://github.com/mikeal/request/commit/1f947a1d2728147fbf4f57aa361d0bedcebfc206) Rolling master version. (@mikeal) -- [7a217bb](https://github.com/mikeal/request/commit/7a217bbdced9a05a786fe6534ab52734df342d3e) Reinstate querystring for `unescape` (@shimaore) -- [b0b4ca9](https://github.com/mikeal/request/commit/b0b4ca913e119337e9313a157eee2f08f77ddc38) Test for `unescape` (@shimaore) -- [#475](https://github.com/mikeal/request/pull/475) Use `unescape` from `querystring` (@shimaore) -- [28fc741](https://github.com/mikeal/request/commit/28fc741fa958a9783031189964ef6f6d7e3f3264) Release. (@mikeal) -- [d3e28ef](https://github.com/mikeal/request/commit/d3e28ef7144da4d9f22f8fb475bd5aa6a80fb947) Rolling master version. (@mikeal) -- [8f8bb9e](https://github.com/mikeal/request/commit/8f8bb9ee8c4dcd9eb815249fbe2a7cf54f61b56f) Changing so if Accept header is explicitly set, sending json does not overwrite. (@RoryH) -- [#479](https://github.com/mikeal/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH) -- [7694372](https://github.com/mikeal/request/commit/7694372f3dc9d57ac29ca7ee5c00146aa5e1e747) Proper version for latest. (@mikeal) -- [aa208cf](https://github.com/mikeal/request/commit/aa208cf5c682262529d749f592db147182cacfaf) 0.8+ only now (@mikeal) -- [16b5ab9](https://github.com/mikeal/request/commit/16b5ab9151823067b05b382241483ef10811c3e1) Upgrading qs. (@mikeal) -- [7d10c1e](https://github.com/mikeal/request/commit/7d10c1e83b4663f592c773e7fece83435585a06f) Merge branch 'master' of github.com:mikeal/request (@mikeal) -- [b8ca4b4](https://github.com/mikeal/request/commit/b8ca4b474b8215cab44ef8ef789303571b3d016f) pumping hawk version. (@mikeal) -- [9c0e484](https://github.com/mikeal/request/commit/9c0e48430e3a9de8715e77c07c98301399eaf6e3) release (@mikeal) -- [a9f1896](https://github.com/mikeal/request/commit/a9f189697e2a813bee9bff31de32a25e99e55cf2) rolling master version. (@mikeal) -- [560a1f8](https://github.com/mikeal/request/commit/560a1f8b927099e44b75274375a690df2a05de67) Set content-type on input. (@mikeal) -- [5fec436](https://github.com/mikeal/request/commit/5fec436b6602bc8c76133664bca23e98f511b096) Release. (@mikeal) -- [88d8d5b](https://github.com/mikeal/request/commit/88d8d5bc80679b78a39cab8e6d8295728a0a150d) Rolling version. (@mikeal) -- [d05b6ba](https://github.com/mikeal/request/commit/d05b6ba72702c2411b4627d4d89190a5f2aba562) Empty body must be passed as empty string, exclude JSON case (@Olegas) -- [#490](https://github.com/mikeal/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas) -- [8aa13cd](https://github.com/mikeal/request/commit/8aa13cd5b5e22b24466ef0e59fa8b5f1d0f0795a) Added redirect event (@Cauldrath) -- [4d63a04](https://github.com/mikeal/request/commit/4d63a042553c90718bf0b90652921b26c52dcb31) Moving response emit above setHeaders on destination streams (@kenperkins) -- [#498](https://github.com/mikeal/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins) -- [c40993f](https://github.com/mikeal/request/commit/c40993fc987b1a8a3cb08cd5699b2f1b2bd4b28b) Fix a regression introduced by cba36ce6 (@nylen) -- [edc2e17](https://github.com/mikeal/request/commit/edc2e17e8154239efa6bd2914435798c18882635) Don't delete headers when retrying a request with proper authentication (@nylen) -- [a375ac1](https://github.com/mikeal/request/commit/a375ac15460f4f3b679f4418d7fc467a5cc94499) Refactor and expand basic auth tests (@nylen) -- [9bc28bf](https://github.com/mikeal/request/commit/9bc28bf912fb0afdd14b36b0ccbafb185a32546a) Cleanup whitespace. (@mikeal) -- [9a35cd2](https://github.com/mikeal/request/commit/9a35cd2248d9492b099c7ee46d68ca017b6a701c) Fix basic auth for passwords that contain colons (@tonistiigi) -- [f724810](https://github.com/mikeal/request/commit/f724810c7b9f82fa1423d0a4d19fcb5aaca98137) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs) -- [95a2558](https://github.com/mikeal/request/commit/95a25580375be1b9c39cc2e88a36a8387395bc13) Add HTTP Signature support. (@davidlehn) -- [921c973](https://github.com/mikeal/request/commit/921c973015721ee0f92ed670f5e88bca057104cc) * Make password optional to support the format: http://username@hostname/ -- [2759ebb](https://github.com/mikeal/request/commit/2759ebbe07e8563fd3ded698d2236309fb28176b) add 'localAddress' support (@yyfrankyy) -- [#513](https://github.com/mikeal/request/pull/513) add 'localAddress' support (@yyfrankyy) -- [#512](https://github.com/mikeal/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1) -- [#508](https://github.com/mikeal/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@iriscouch) -- [5f036e6](https://github.com/mikeal/request/commit/5f036e6f5d3102a89e5401a53090a0627a7850a8) Conflicts: index.js (@nylen) -- [89d2602](https://github.com/mikeal/request/commit/89d2602ef4e3a4e6e51284f6a29b5767c79ffaba) Conflicts: README.md (@davidlehn) -- [#502](https://github.com/mikeal/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) -- [eb3e033](https://github.com/mikeal/request/commit/eb3e033170403832fe7070955db32112ec46005f) Merge branch 'master' of git://github.com/mikeal/request (@davidlehn) -- [#510](https://github.com/mikeal/request/pull/510) Add HTTP Signature support. (@digitalbazaar) -- [227d998](https://github.com/mikeal/request/commit/227d9985426214b6ac68702933346000298d7790) Update the internal path variable when querystring is changed (@jblebrun) -- [#519](https://github.com/mikeal/request/pull/519) Update internal path state on post-creation QS changes (@incredible-labs) -- [428b9c1](https://github.com/mikeal/request/commit/428b9c1ad9831b7dfd6cec4ce68df358590c6d65) Fixing test-tunnel.js (@noway421) -- [2417599](https://github.com/mikeal/request/commit/24175993f6c362f7fca5965feb0a11756f00baf3) Improving test-localAddress.js (@noway421) -- [#520](https://github.com/mikeal/request/pull/520) Fixing test-tunnel.js (@noway421) -- [1e37f1b](https://github.com/mikeal/request/commit/1e37f1bea45174e09e6450bc71dfc081c8cd94de) Some explaining comments (@noway421) -- [909b024](https://github.com/mikeal/request/commit/909b024619c9e47f615749661d610cccd8421d80) Updating dependencies (@noway421) -- [#523](https://github.com/mikeal/request/pull/523) Updating dependencies (@noway421) -- [47191e1](https://github.com/mikeal/request/commit/47191e1a5e29714fb0c5f8b2162b2971570df644) 2.17.0 (@mikeal) -- [14def5a](https://github.com/mikeal/request/commit/14def5af5903d03f66bd6c9be534e6b76f47c063) 2.18.0 (@mikeal) -- [56fd6b7](https://github.com/mikeal/request/commit/56fd6b7ec6da162894df0809126d688f30900d25) 2.18.1 (@mikeal) -- [37dd689](https://github.com/mikeal/request/commit/37dd68989670f8937b537579a4299d9649b8aa16) Fixing dep. (@mikeal) -- [dd7209a](https://github.com/mikeal/request/commit/dd7209a84dd40afe87db31c6ab66885e2015cb8f) 2.19.0 (@mikeal) -- [62f3b92](https://github.com/mikeal/request/commit/62f3b9203690d4ad34486fc506fc78a1c9971e03) 2.19.1 (@mikeal) -- [74c6b2e](https://github.com/mikeal/request/commit/74c6b2e315872980ee9a9a000d25e724138f28b1) Adding test for onelineproxy. (@mikeal) -- [2a01cc0](https://github.com/mikeal/request/commit/2a01cc082f544647f7176a992e02668519a694be) Fixing onelineproxy. (@mikeal) -- [8b4c920](https://github.com/mikeal/request/commit/8b4c9203adb372f2ee99b1b012406b482b27c68d) 2.20.0 (@mikeal) -- [d8d4a33](https://github.com/mikeal/request/commit/d8d4a3311d8d31df88fa8a2ab3265872e5cb97ae) 2.20.1 (@mikeal) -- [5937012](https://github.com/mikeal/request/commit/59370123b22e8c971e4ee48c3d0caf920d890bda) dependencies versions bump (@jodaka) -- [#529](https://github.com/mikeal/request/pull/529) dependencies versions bump (@jodaka) -- [#521](https://github.com/mikeal/request/pull/521) Improving test-localAddress.js (@noway421) -- [#503](https://github.com/mikeal/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) -- [#497](https://github.com/mikeal/request/pull/497) Added redirect event (@Cauldrath) -- [297a9ea](https://github.com/mikeal/request/commit/297a9ea827655e5fb406a86907bb0d89b01deae8) fix typo (@fredericosilva) -- [#532](https://github.com/mikeal/request/pull/532) fix typo (@fredericosilva) -- [3691db5](https://github.com/mikeal/request/commit/3691db5a2d0981d4aeabfda5b988a5c69074e187) Allow explicitly empty user field for basic authentication. (@mikeando) -- [#536](https://github.com/mikeal/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) -- [5d36e32](https://github.com/mikeal/request/commit/5d36e324047f79cbbf3bb9b71fef633f02b36367) 2.21.0 (@mikeal) -- [9bd98d6](https://github.com/mikeal/request/commit/9bd98d6052f222aa348635c1acb2e2c99eed0f8c) 2.21.1 (@mikeal) -- [a918e04](https://github.com/mikeal/request/commit/a918e04a8d767a2948567ea29ed3fdd1650c16b1) The exported request function doesn't have an auth method (@tschaub) -- [1ebe1ac](https://github.com/mikeal/request/commit/1ebe1ac2f78e8a6149c03ce68fcb23d56df2316e) exposing Request class (@regality) -- [#542](https://github.com/mikeal/request/pull/542) Expose Request class (@ifit) -- [467573d](https://github.com/mikeal/request/commit/467573d17b4db5f93ed425ace0594370a7820c7c) Update http-signatures version. (@davidlehn) -- [#541](https://github.com/mikeal/request/pull/541) The exported request function doesn't have an auth method (@tschaub) -- [3040bbe](https://github.com/mikeal/request/commit/3040bbe5de846811151dab8dc09944acc93a338e) Fix redirections, (@criloz) -- [#564](https://github.com/mikeal/request/pull/564) Fix redirections (@NebTex) -- [397b435](https://github.com/mikeal/request/commit/397b4350fcf885460d7dced94cf1db1f5c167f80) handle ciphers and secureOptions in agentOptions (@SamPlacette) -- [65a2778](https://github.com/mikeal/request/commit/65a27782db7d2798b6490ea08efacb8f3b0a401c) tests and fix for null agentOptions case (@SamPlacette) -- [#568](https://github.com/mikeal/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) -- [c116920](https://github.com/mikeal/request/commit/c116920a2cbef25afe2e1bbcf4df074e1e2f9dbb) Let's see how we do with only the main guard. (@mikeal) -- [f54a335](https://github.com/mikeal/request/commit/f54a3358119298634a7b0c29a21bf1471fc23d98) Fix spelling of "ignoring." (@bigeasy) -- [5cd215f](https://github.com/mikeal/request/commit/5cd215f327e113dc6c062634e405c577986cfd3c) Change isUrl regex to accept mixed case (@lexander) -- [02c8e74](https://github.com/mikeal/request/commit/02c8e749360a47d45e3e7b51b7f751fe498d2f25) #583 added tests for isUrl regex change. (@lexander) -- [#581](https://github.com/mikeal/request/pull/581) Fix spelling of "ignoring." (@bigeasy) -- [#544](https://github.com/mikeal/request/pull/544) Update http-signature version. (@digitalbazaar) -- [e77746b](https://github.com/mikeal/request/commit/e77746bf42e974dc91a84d03f44f750dd7ee0989) global cookie jar disabled by default, send jar: true to enable. (@threepointone) -- [46015ac](https://github.com/mikeal/request/commit/46015ac8d5b74f8107a6ec9fd07c133f46c5d833) 2.22.0 (@mikeal) -- [e5da4a5](https://github.com/mikeal/request/commit/e5da4a5e1a20bf4f23681f7b996f22c5fadae91d) 2.22.1 (@mikeal) -- [#587](https://github.com/mikeal/request/pull/587) Global cookie jar disabled by default (@threepointone) -- [fac9da1](https://github.com/mikeal/request/commit/fac9da1cc426bf0a4bcc5f0b7d0d0aea8b1cce38) Prevent setting headers after they are sent (@wpreul) -- [#589](https://github.com/mikeal/request/pull/589) Prevent setting headers after they are sent (@wpreul) -- [bc1537a](https://github.com/mikeal/request/commit/bc1537ab79064cea532b0d14110ce4e49a663bde) Emit complete event when there is no callback -- [de8508e](https://github.com/mikeal/request/commit/de8508e9feac10563596aeee26727567b3c2e33c) Added check to see if the global pool is being used before using the global agent (@Cauldrath) -- [03441ef](https://github.com/mikeal/request/commit/03441ef919e51a742aaf9e168d917e97e2d9eb6b) 2.23.0 (@mikeal) +### v2.17.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) +- [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn) +- [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) +- [#508](https://github.com/request/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs) +- [#512](https://github.com/request/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1) +- [#513](https://github.com/request/request/pull/513) add 'localAddress' support (@yyfrankyy) +- [#498](https://github.com/request/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins) +- [#490](https://github.com/request/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas) +- [#479](https://github.com/request/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH) +- [#475](https://github.com/request/request/pull/475) Use `unescape` from `querystring` (@shimaore) +- [#473](https://github.com/request/request/pull/473) V0.10 compat (@isaacs) +- [#471](https://github.com/request/request/pull/471) Using querystring library from visionmedia (@kbackowski) +- [#461](https://github.com/request/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin) +- [#460](https://github.com/request/request/pull/460) hawk 0.10.0 (@hueniverse) +- [#462](https://github.com/request/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya) +- [#456](https://github.com/request/request/pull/456) hawk 0.9.0 (@hueniverse) +- [#429](https://github.com/request/request/pull/429) Copy options before adding callback. (@nrn) +- [#454](https://github.com/request/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh) +- [#310](https://github.com/request/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann) +- [#413](https://github.com/request/request/pull/413) rename googledoodle.png to .jpg (@nfriedly) +- [#448](https://github.com/request/request/pull/448) Convenience method for PATCH (@mloar) +- [#444](https://github.com/request/request/pull/444) protect against double callbacks on error path (@spollack) +- [#433](https://github.com/request/request/pull/433) Added support for HTTPS cert & key (@mmalecki) +- [#430](https://github.com/request/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) +- [#415](https://github.com/request/request/pull/415) Fixed a typo. (@jerem) +- [#338](https://github.com/request/request/pull/338) Add more auth options, including digest support (@nylen) +- [#403](https://github.com/request/request/pull/403) Optimize environment lookup to happen once only (@mmalecki) +- [#398](https://github.com/request/request/pull/398) Add more reporting to tests (@mmalecki) +- [#388](https://github.com/request/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23) +- [#381](https://github.com/request/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro) +- [#380](https://github.com/request/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-) +- [#376](https://github.com/request/request/pull/376) Headers lost on redirect (@kapetan) +- [#375](https://github.com/request/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock) +- [#374](https://github.com/request/request/pull/374) Correct Host header for proxy tunnel CONNECT (@youurayy) +- [#370](https://github.com/request/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge) +- [#369](https://github.com/request/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge) +- [#344](https://github.com/request/request/pull/344) Make AWS auth signing find headers correctly (@nlf) +- [#363](https://github.com/request/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall) +- [#362](https://github.com/request/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall) +- [#361](https://github.com/request/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins) +- [#360](https://github.com/request/request/pull/360) Delete self._form along with everything else on redirect (@jgautier) +- [#355](https://github.com/request/request/pull/355) stop sending erroneous headers on redirected requests (@azylman) +- [#332](https://github.com/request/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup) +- [#343](https://github.com/request/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nlf) +- [#320](https://github.com/request/request/pull/320) request.defaults() doesn't need to wrap jar() (@StuartHarris) +- [#322](https://github.com/request/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo) +- [#326](https://github.com/request/request/pull/326) Do not try to remove listener from an undefined connection (@strk) +- [#318](https://github.com/request/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs) +- [#317](https://github.com/request/request/pull/317) Workaround for #313 (@isaacs) +- [#293](https://github.com/request/request/pull/293) Allow parser errors to bubble up to request (@mscdex) +- [#290](https://github.com/request/request/pull/290) A test for #289 (@isaacs) +- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1) +- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) +- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas) +- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono) +- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry) +- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek) +- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock) +- [#279](https://github.com/request/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin) +- [#273](https://github.com/request/request/pull/273) Pipe back pressure issue (@mafintosh) +- [#268](https://github.com/request/request/pull/268) I'm not OCD seriously (@TehShrike) +- [#263](https://github.com/request/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet) +- [#265](https://github.com/request/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr) +- [#262](https://github.com/request/request/pull/262) JSON test should check for equality (@timshadel) +- [#261](https://github.com/request/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel) +- [#249](https://github.com/request/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges) +- [#255](https://github.com/request/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1) +- [#260](https://github.com/request/request/pull/260) fixed just another leak of 'i' (@sreuter) +- [#246](https://github.com/request/request/pull/246) Fixing the set-cookie header (@jeromegn) +- [#243](https://github.com/request/request/pull/243) Dynamic boundary (@zephrax) +- [#240](https://github.com/request/request/pull/240) don't error when null is passed for options (@polotek) +- [#211](https://github.com/request/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso) +- [#224](https://github.com/request/request/pull/224) Multipart content-type change (@janjongboom) +- [#217](https://github.com/request/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup) +- [#203](https://github.com/request/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise) +- [#199](https://github.com/request/request/pull/199) Tunnel (@isaacs) +- [#198](https://github.com/request/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs) +- [#197](https://github.com/request/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs) +- [#193](https://github.com/request/request/pull/193) Fixes GH-119 (@goatslacker) +- [#188](https://github.com/request/request/pull/188) Add abort support to the returned request (@itay) +- [#176](https://github.com/request/request/pull/176) Querystring option (@csainty) +- [#182](https://github.com/request/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63) +- [#180](https://github.com/request/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63) +- [#179](https://github.com/request/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack) +- [#177](https://github.com/request/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63) +- [#170](https://github.com/request/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes) +- [#168](https://github.com/request/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby) +- [#161](https://github.com/request/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou) +- [#162](https://github.com/request/request/pull/162) Fix issue #159 (@dpetukhov) +- [#90](https://github.com/request/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes) +- [#148](https://github.com/request/request/pull/148) Retry Agent (@thejh) +- [#146](https://github.com/request/request/pull/146) Multipart should respect content-type if previously set (@apeace) +- [#144](https://github.com/request/request/pull/144) added "form" option to readme (@petejkim) +- [#133](https://github.com/request/request/pull/133) Fixed cookies parsing (@afanasy) +- [#135](https://github.com/request/request/pull/135) host vs hostname (@iangreenleaf) +- [#132](https://github.com/request/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson) +- [#112](https://github.com/request/request/pull/112) Support using a custom http-like module (@jhs) +- [#104](https://github.com/request/request/pull/104) Cookie handling contains bugs (@janjongboom) +- [#121](https://github.com/request/request/pull/121) Another patch for cookie handling regression (@jhurliman) +- [#117](https://github.com/request/request/pull/117) Remove the global `i` (@3rd-Eden) +- [#110](https://github.com/request/request/pull/110) Update to Iris Couch URL (@jhs) +- [#86](https://github.com/request/request/pull/86) Can't post binary to multipart requests (@developmentseed) +- [#105](https://github.com/request/request/pull/105) added test for proxy option. (@dominictarr) +- [#102](https://github.com/request/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex) +- [#97](https://github.com/request/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs) +- [#96](https://github.com/request/request/pull/96) Authless parsed url host support (@isaacs) +- [#81](https://github.com/request/request/pull/81) Enhance redirect handling (@danmactough) +- [#78](https://github.com/request/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs) +- [#76](https://github.com/request/request/pull/76) Bug when a request fails and a timeout is set (@Marsup) +- [#70](https://github.com/request/request/pull/70) add test script to package.json (@isaacs) +- [#73](https://github.com/request/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs) +- [#69](https://github.com/request/request/pull/69) Flatten chunked requests properly (@isaacs) +- [#67](https://github.com/request/request/pull/67) fixed global variable leaks (@aheckmann) +- [#66](https://github.com/request/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod) +- [#53](https://github.com/request/request/pull/53) Parse json: Issue #51 (@benatkin) +- [#45](https://github.com/request/request/pull/45) Added timeout option (@mbrevoort) +- [#35](https://github.com/request/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli) +- [#31](https://github.com/request/request/pull/31) Error on piping a request to a destination (@tobowers) \ No newline at end of file diff --git a/deps/npm/node_modules/request/CONTRIBUTING.md b/deps/npm/node_modules/request/CONTRIBUTING.md index 17d383e8e3dd91..06b1968d974b7e 100644 --- a/deps/npm/node_modules/request/CONTRIBUTING.md +++ b/deps/npm/node_modules/request/CONTRIBUTING.md @@ -26,7 +26,7 @@ There are a few basic ground-rules for contributors: style & testing issues. To diagnose test failures, there are two ways to run a single test file: - `node_modules/.bin/taper tests/test-file.js` - run using the default - [`taper`](/nylen/taper) test reporter. + [`taper`](https://github.com/nylen/taper) test reporter. - `node tests/test-file.js` - view the raw [tap](https://testanything.org/) output. diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index 56604207841e58..59d62c2c1a77e4 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -1,8 +1,8 @@ # Request — Simplified HTTP client -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/mikeal/request?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - [![NPM](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/) +[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/request/request?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + ## Super simple to use Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. @@ -48,6 +48,17 @@ request .pipe(request.put('http://mysite.com/img.png')) ``` +To easily handle errors when streaming requests, listen to the `error` event before piping: + +```javascript +request + .get('http://mysite.com/doodle.png') + .on('error', function(err) { + console.log(err) + }) + .pipe(fs.createWriteStream('doodle.png')) +``` + Now let’s get fancy. ```javascript @@ -147,6 +158,9 @@ to force a tunneling proxy, you may set the `tunnel` option to `true`. If you are using a tunneling proxy, you may set the `proxyHeaderWhiteList` to share certain headers with the proxy. +You can also set the `proxyHeaderExclusiveList` to share certain +headers only with the proxy and not with destination host. + By default, this set is: ``` @@ -177,9 +191,8 @@ via ``` Note that, when using a tunneling proxy, the `proxy-authorization` -header is *never* sent to the endpoint server, but only to the proxy -server. All other headers are sent as-is over the established -connection. +header and any headers from custom `proxyHeaderExclusiveList` are +*never* sent to the endpoint server, but only to the proxy server. ### Controlling proxy behaviour using environment variables @@ -243,10 +256,11 @@ var formData = { my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), // Pass multiple values /w an Array attachments: [ - fs.createReadStream(__dirname + '/attacment1.jpg') + fs.createReadStream(__dirname + '/attachment1.jpg'), fs.createReadStream(__dirname + '/attachment2.jpg') ], // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS} + // Use case: for some types of streams, you'll need to provide "file"-related information manually. // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data custom_file: { value: fs.createReadStream('/dev/urandom'), @@ -264,7 +278,7 @@ request.post({url:'http://service.com/upload', formData: formData}, function opt }); ``` -For advanced cases, you can the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) +For advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) ```javascript // NOTE: Advanced use-case, for normal use see 'formData' usage above @@ -282,25 +296,37 @@ See the [form-data README](https://github.com/felixge/node-form-data) for more i Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options. ```javascript - request( - { method: 'PUT' - , preambleCRLF: true - , postambleCRLF: true - , uri: 'http://service.com/upload' - , multipart: - [ { 'content-type': 'application/json' - , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) - } - , { body: 'I am an attachment' } + request({ + method: 'PUT', + preambleCRLF: true, + postambleCRLF: true, + uri: 'http://service.com/upload', + multipart: [ + { + 'content-type': 'application/json' + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' }, + { body: fs.createReadStream('image.png') } + ], + // alternatively pass an object containing additional options + multipart: { + chunked: false, + data: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' } ] } - , function (error, response, body) { - if (err) { - return console.error('upload failed:', err); - } - console.log('Upload successful! Server responded with:', body); + }, + function (error, response, body) { + if (error) { + return console.error('upload failed:', error); } - ) + console.log('Upload successful! Server responded with:', body); + }) ``` @@ -349,6 +375,10 @@ Bearer authentication is supported, and is activated when the `bearer` value is ## OAuth Signing +[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The +default signing algorithm is +[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2): + ```javascript // Twitter OAuth var qs = require('querystring') @@ -395,6 +425,12 @@ request.post({url:url, oauth:oauth}, function (e, r, body) { }) ``` +For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make +the following changes to the OAuth options object: +* Pass `signature_method : 'RSA-SHA1'` +* Instead of `consumer_secret`, specify a `private_key` string in + [PEM format](http://how2ssl.com/articles/working_with_pem_files/) + ## Custom HTTP Headers HTTP Headers, such as `User-Agent`, can be set in the `options` object. @@ -406,7 +442,7 @@ custom `User-Agent` header as well as https. var request = require('request'); var options = { - url: 'https://api.github.com/repos/mikeal/request', + url: 'https://api.github.com/repos/request/request', headers: { 'User-Agent': 'request' } @@ -440,12 +476,12 @@ var fs = require('fs') var options = { url: 'https://api.some-server.com/', agentOptions: { - 'cert': fs.readFileSync(certFile), - 'key': fs.readFileSync(keyFile), + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format: - // 'pfx': fs.readFileSync(pfxFilePath), - 'passphrase': 'password', - 'securityOptions': 'SSL_OP_NO_SSLv3' + // pfx: fs.readFileSync(pfxFilePath), + passphrase: 'password', + securityOptions: 'SSL_OP_NO_SSLv3' } }; @@ -455,11 +491,23 @@ request.get(options); It is able to force using SSLv3 only by specifying `secureProtocol`: ```javascript +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + secureProtocol: 'SSLv3_method' + } +}); +``` + +It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs). +This can be useful, for example, when using self-signed certificates. +To allow a different certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`: +```javascript request.get({ url: 'https://api.some-server.com/', agentOptions: { - 'secureProtocol': 'SSLv3_method' + ca: fs.readFileSync('ca.cert.pem') } }); ``` @@ -478,11 +526,19 @@ The first argument can be either a `url` or an `options` object. The only requir * `headers` - http headers (default: `{}`) * `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. * `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" section above. -* `multipart` - (experimental) Data to pass for a `multipart/related` request. See "Forms" section above +* `formData` - Data to pass for a `multipart/form-data` request. See + [Forms](#forms) section above. +* `multipart` - array of objects which contain their own headers and `body` + attributes. Sends a `multipart/related` request. See [Forms](#forms) section + above. + * Alternatively you can pass in an object `{chunked: false, data: []}` where + `chunked` is used to specify whether the request is sent in + [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) + (the default is `chunked: true`). In non-chunked requests, data items with + body streams are not allowed. * `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. * `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. -* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below. +* `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. * `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. * `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. * `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise. @@ -491,6 +547,11 @@ The first argument can be either a `url` or an `options` object. The only requir * `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). * `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as [your options allow for it](request.js#L747)). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. * A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). + * Note that if you are sending multiple requests in a loop and creating + multiple new `pool` objects, `maxSockets` will not work as intended. To + work around this, either use [`request.defaults`](#requestdefaultsoptions) + with your pool options or create the pool object with the `maxSockets` + property outside of the loop. * `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request * `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`) * `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. @@ -509,6 +570,8 @@ The first argument can be either a `url` or an `options` object. The only requir chain used a tunneling proxy. * `proxyHeaderWhiteList` - A whitelist of headers to send to a tunneling proxy. +* `proxyHeaderExclusiveList` - A whitelist of headers to send + exclusively to a tunneling proxy and not to destination. The callback argument gets 3 arguments: @@ -523,9 +586,14 @@ There are also shorthand methods for different HTTP METHODs and some other conve ### request.defaults(options) -This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it. +This method **returns a wrapper** around the normal request API that defaults +to whatever options you pass to it. + +**Note:** `request.defaults()` **does not** modify the global request API; +instead, it **returns a wrapper** that has your default settings applied to it. -**Note:** You can call `.defaults()` on the wrapper that is returned from `request.defaults` to add/override defaults that were previously defaulted. +**Note:** You can call `.defaults()` on the wrapper that is returned from +`request.defaults` to add/override defaults that were previously defaulted. For example: ```javascript @@ -595,7 +663,7 @@ Function that creates a new cookie. ```javascript request.cookie('key1=value1') ``` -### request.jar +### request.jar() Function that creates a new cookie jar. @@ -684,7 +752,6 @@ request('http://www.google.com', function () { OR ```javascript -// `npm install --save tough-cookie` before this works var j = request.jar(); var cookie = request.cookie('key1=value1'); var url = 'http://www.google.com'; @@ -694,7 +761,28 @@ request({url: url, jar: j}, function () { }) ``` -To inspect your cookie jar after a request +To use a custom cookie store (such as a +[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore) +which supports saving to and restoring from JSON files), pass it as a parameter +to `request.jar()`: + +```javascript +var FileCookieStore = require('tough-cookie-filestore'); +// NOTE - currently the 'cookies.json' file must already exist! +var j = request.jar(new FileCookieStore('cookies.json')); +request = request.defaults({ jar : j }) +request('http://www.google.com', function() { + request('http://images.google.com') +}) +``` + +The cookie store must be a +[`tough-cookie`](https://github.com/goinstant/tough-cookie) +store and it must support synchronous operations; see the +[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api) +for details. + +To inspect your cookie jar after a request: ```javascript var j = request.jar() diff --git a/deps/npm/node_modules/request/examples/README.md b/deps/npm/node_modules/request/examples/README.md new file mode 100644 index 00000000000000..526d71bba6adb9 --- /dev/null +++ b/deps/npm/node_modules/request/examples/README.md @@ -0,0 +1,115 @@ + +# Authentication + +## OAuth + +### OAuth1.0 Refresh Token + +- http://oauth.googlecode.com/svn/spec/ext/session/1.0/drafts/1/spec.html#anchor4 +- https://developer.yahoo.com/oauth/guide/oauth-refreshaccesstoken.html + +```js +request.post('https://api.login.yahoo.com/oauth/v2/get_token', { + oauth: { + consumer_key: '...', + consumer_secret: '...', + token: '...', + token_secret: '...', + session_handle: '...' + } +}, function (err, res, body) { + var result = require('querystring').parse(body) + // assert.equal(typeof result, 'object') +}) +``` + +### OAuth2 Refresh Token + +- https://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-6 + +```js +request.post('https://accounts.google.com/o/oauth2/token', { + form: { + grant_type: 'refresh_token', + client_id: '...', + client_secret: '...', + refresh_token: '...' + }, + json: true +}, function (err, res, body) { + // assert.equal(typeof body, 'object') +}) +``` + +# Multipart + +## multipart/form-data + +### Flickr Image Upload + +- https://www.flickr.com/services/api/upload.api.html + +```js +request.post('https://up.flickr.com/services/upload', { + oauth: { + consumer_key: '...', + consumer_secret: '...', + token: '...', + token_secret: '...' + }, + // all meta data should be included here for proper signing + qs: { + title: 'My cat is awesome', + description: 'Sent on ' + new Date(), + is_public: 1 + }, + // again the same meta data + the actual photo + formData: { + title: 'My cat is awesome', + description: 'Sent on ' + new Date(), + is_public: 1, + photo:fs.createReadStream('cat.png') + }, + json: true +}, function (err, res, body) { + // assert.equal(typeof body, 'object') +}) +``` + +# Streams + +## `POST` data + +Use Request as a Writable stream to easily `POST` Readable streams (like files, other HTTP requests, or otherwise). + +TL;DR: Pipe a Readable Stream onto Request via: + +``` +READABLE.pipe(request.post(URL)); +``` + +A more detailed example: + +```js +var fs = require('fs') + , path = require('path') + , http = require('http') + , request = require('request') + , TMP_FILE_PATH = path.join(path.sep, 'tmp', 'foo') +; + +// write a temporary file: +fs.writeFileSync(TMP_FILE_PATH, 'foo bar baz quk\n'); + +http.createServer(function(req, res) { + console.log('the server is receiving data!\n'); + req + .on('end', res.end.bind(res)) + .pipe(process.stdout) + ; +}).listen(3000).unref(); + +fs.createReadStream(TMP_FILE_PATH) + .pipe(request.post('http://127.0.0.1:3000')) +; +``` diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js index 033268405dff1f..99b8386b592a76 100755 --- a/deps/npm/node_modules/request/index.js +++ b/deps/npm/node_modules/request/index.js @@ -98,8 +98,8 @@ request.del = function (uri, options, callback) { return requester(params)(params.uri || null, params.options, params.callback) } -request.jar = function () { - return cookies.jar() +request.jar = function (store) { + return cookies.jar(store) } request.cookie = function (str) { diff --git a/deps/npm/node_modules/request/lib/cookies.js b/deps/npm/node_modules/request/lib/cookies.js index 017bdb467e406e..adde7c6012bded 100644 --- a/deps/npm/node_modules/request/lib/cookies.js +++ b/deps/npm/node_modules/request/lib/cookies.js @@ -13,16 +13,13 @@ exports.parse = function(str) { if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } - if (!Cookie) { - return null - } return Cookie.parse(str) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements -function RequestJar() { +function RequestJar(store) { var self = this - self._jar = new CookieJar() + self._jar = new CookieJar(store) } RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { var self = this @@ -37,14 +34,6 @@ RequestJar.prototype.getCookies = function(uri) { return self._jar.getCookiesSync(uri) } -exports.jar = function() { - if (!CookieJar) { - // tough-cookie not loaded, return a stub object: - return { - setCookie: function(){}, - getCookieString: function(){}, - getCookies: function(){} - } - } - return new RequestJar() +exports.jar = function(store) { + return new RequestJar(store) } diff --git a/deps/npm/node_modules/request/node_modules/caseless/README.md b/deps/npm/node_modules/request/node_modules/caseless/README.md index 719584c85b78f8..e5077a21659b25 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/README.md +++ b/deps/npm/node_modules/request/node_modules/caseless/README.md @@ -1,6 +1,6 @@ ## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. -This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manor while also preserving the caseing of headers the first time they are set. +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. ## Usage diff --git a/deps/npm/node_modules/request/node_modules/caseless/index.js b/deps/npm/node_modules/request/node_modules/caseless/index.js index 231a997e0a4def..607eea22bc6114 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/index.js +++ b/deps/npm/node_modules/request/node_modules/caseless/index.js @@ -25,12 +25,12 @@ Caseless.prototype.has = function (name) { return false } Caseless.prototype.get = function (name) { - var result, re, match + name = name.toLowerCase() + var result, _key var headers = this.dict Object.keys(headers).forEach(function (key) { - re = new RegExp(name, 'i') - match = key.match(re) - if (match) result = headers[key] + _key = key.toLowerCase() + if (name === _key) result = headers[key] }) return result } diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 3725c102644cbf..1efd04a975067c 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -1,6 +1,6 @@ { "name": "caseless", - "version": "0.6.0", + "version": "0.8.0", "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "main": "index.js", "scripts": { @@ -27,11 +27,12 @@ "devDependencies": { "tape": "^2.10.2" }, + "gitHead": "1bfbf01d4481c057738a64ba284749222a944176", "homepage": "https://github.com/mikeal/caseless", - "_id": "caseless@0.6.0", - "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4", - "_from": "caseless@>=0.6.0 <0.7.0", - "_npmVersion": "1.4.9", + "_id": "caseless@0.8.0", + "_shasum": "5bca2881d41437f54b2407ebe34888c7b9ad4f7d", + "_from": "caseless@>=0.8.0 <0.9.0", + "_npmVersion": "2.0.0", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -43,10 +44,10 @@ } ], "dist": { - "shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4", - "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz" + "shasum": "5bca2881d41437f54b2407ebe34888c7b9ad4f7d", + "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz", + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.8.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/caseless/test.js b/deps/npm/node_modules/request/node_modules/caseless/test.js index 5604fa0751fc70..084bbaf5e93f27 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/test.js +++ b/deps/npm/node_modules/request/node_modules/caseless/test.js @@ -6,7 +6,7 @@ tape('set get has', function (t) { var headers = {} , c = caseless(headers) ; - t.plan(14) + t.plan(17) c.set('a-Header', 'asdf') t.equal(c.get('a-header'), 'asdf') t.equal(c.has('a-header'), 'a-Header') @@ -30,4 +30,11 @@ tape('set get has', function (t) { t.notOk(c.has('idonotexist')) t.ok(c.del('idonotexist')) + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + }) diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License b/deps/npm/node_modules/request/node_modules/combined-stream/License similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/License rename to deps/npm/node_modules/request/node_modules/combined-stream/License diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/deps/npm/node_modules/request/node_modules/combined-stream/Readme.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md rename to deps/npm/node_modules/request/node_modules/combined-stream/Readme.md diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/deps/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js similarity index 89% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js rename to deps/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js index c18ad980d9c3fe..6b5c21b6b42513 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +++ b/deps/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js @@ -30,7 +30,7 @@ CombinedStream.create = function(options) { CombinedStream.isStreamLike = function(stream) { return (typeof stream !== 'function') && (typeof stream !== 'string') - && (typeof stream !== 'boolean') + && (typeof stream !== 'boolean') && (typeof stream !== 'number') && (!Buffer.isBuffer(stream)); }; @@ -40,12 +40,12 @@ CombinedStream.prototype.append = function(stream) { if (isStreamLike) { if (!(stream instanceof DelayedStream)) { - stream.on('data', this._checkDataSize.bind(this)); - - stream = DelayedStream.create(stream, { + var newStream = DelayedStream.create(stream, { maxDataSize: Infinity, pauseStream: this.pauseStreams, }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; } this._handleErrors(stream); @@ -97,7 +97,7 @@ CombinedStream.prototype._pipeNext = function(stream) { var isStreamLike = CombinedStream.isStreamLike(stream); if (isStreamLike) { - stream.on('end', this._getNext.bind(this)) + stream.on('end', this._getNext.bind(this)); stream.pipe(this, {end: false}); return; } @@ -123,6 +123,7 @@ CombinedStream.prototype.pause = function() { return; } + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); this.emit('pause'); }; @@ -133,6 +134,7 @@ CombinedStream.prototype.resume = function() { this._getNext(); } + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); this.emit('resume'); }; @@ -159,7 +161,7 @@ CombinedStream.prototype._checkDataSize = function() { } var message = - 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; this._emitError(new Error(message)); }; diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile similarity index 98% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile index b4ff85a33b6eb4..2d7580746d0b84 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -4,4 +4,3 @@ test: @./test/run.js .PHONY: test - diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/common.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js similarity index 99% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js index 9ecad5b8ad1c58..787539606e6f58 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js @@ -34,5 +34,3 @@ server.listen(common.PORT, function() { }); }); }); - - diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js rename to deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/test/run.js diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json similarity index 74% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json rename to deps/npm/node_modules/request/node_modules/combined-stream/package.json index 080953f1600bc9..a44fef9845e61f 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json @@ -6,7 +6,7 @@ }, "name": "combined-stream", "description": "A stream that emits multiple other streams one after another.", - "version": "0.0.5", + "version": "0.0.7", "homepage": "https://github.com/felixge/node-combined-stream", "repository": { "type": "git", @@ -25,17 +25,19 @@ "devDependencies": { "far": "~0.0.7" }, - "gitHead": "19d9bdd4c20f6806c2ae8adb00a53fb6fd154740", "bugs": { "url": "https://github.com/felixge/node-combined-stream/issues" }, - "_id": "combined-stream@0.0.5", - "_shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2", - "_from": "combined-stream@>=0.0.4 <0.1.0", - "_npmVersion": "1.4.14", + "_id": "combined-stream@0.0.7", + "dist": { + "shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f", + "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz" + }, + "_from": "combined-stream@>=0.0.5 <0.1.0", + "_npmVersion": "1.4.3", "_npmUser": { - "name": "alexindigo", - "email": "iam@alexindigo.com" + "name": "felixge", + "email": "felix@debuggable.com" }, "maintainers": [ { @@ -51,11 +53,8 @@ "email": "iam@alexindigo.com" } ], - "dist": { - "shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2", - "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz", + "_shasum": "0137e657baa5a7541c57ac37ac5fc07d73b4dc1f", + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", "readme": "ERROR: No README data found!" } 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 b8bd158480dfd8..5b33f554c625d4 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 @@ -5,7 +5,7 @@ var http = require('http'); var https = require('https'); var parseUrl = require('url').parse; var fs = require('fs'); -var mime = require('mime'); +var mime = require('mime-types'); var async = require('async'); module.exports = FormData; diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md new file mode 100644 index 00000000000000..c749c7145b7fea --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/HISTORY.md @@ -0,0 +1,51 @@ +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Add additional compressible + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE similarity index 93% rename from deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE rename to deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE index 451fc4550c2335..a7ae8ee9b8a30e 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/LICENSE @@ -1,4 +1,7 @@ -Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.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 diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md new file mode 100644 index 00000000000000..99d658b8b3fa25 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/README.md @@ -0,0 +1,99 @@ +# mime-types + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [node-mime](https://github.com/broofa/node-mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, + so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db) +- No `.define()` functionality + +Otherwise, the API is compatible. + +## Install + +```sh +$ npm install mime-types +``` + +## Adding Types + +All mime types are based on [mime-db](https://github.com/jshttp/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/x-markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/x-markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/mime-types.svg?style=flat +[npm-url]: https://npmjs.org/package/mime-types +[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/mime-types.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/mime-types +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types +[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg?style=flat +[downloads-url]: https://npmjs.org/package/mime-types diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js new file mode 100644 index 00000000000000..b46a202f53ccc3 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/index.js @@ -0,0 +1,63 @@ + +var db = require('mime-db') + +// types[extension] = type +exports.types = Object.create(null) +// extensions[type] = [extensions] +exports.extensions = Object.create(null) + +Object.keys(db).forEach(function (name) { + var mime = db[name] + var exts = mime.extensions + if (!exts || !exts.length) return + exports.extensions[name] = exts + exts.forEach(function (ext) { + exports.types[ext] = name + }) +}) + +exports.lookup = function (string) { + if (!string || typeof string !== "string") return false + // remove any leading paths, though we should just use path.basename + string = string.replace(/.*[\.\/\\]/, '').toLowerCase() + if (!string) return false + return exports.types[string] || false +} + +exports.extension = function (type) { + if (!type || typeof type !== "string") return false + // to do: use media-typer + type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/) + if (!type) return false + var exts = exports.extensions[type[1].toLowerCase()] + if (!exts || !exts.length) return false + return exts[0] +} + +// type has to be an exact mime type +exports.charset = function (type) { + var mime = db[type] + if (mime && mime.charset) return mime.charset + + // default text/* to utf-8 + if (/^text\//.test(type)) return 'UTF-8' + + return false +} + +// backwards compatibility +exports.charsets = { + lookup: exports.charset +} + +// to do: maybe use set-type module or something +exports.contentType = function (type) { + if (!type || typeof type !== "string") return false + if (!~type.indexOf('/')) type = exports.lookup(type) + if (!type) return false + if (!~type.indexOf('charset')) { + var charset = exports.charset(type) + if (charset) type += '; charset=' + charset.toLowerCase() + } + return type +} diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE new file mode 100644 index 00000000000000..a7ae8ee9b8a30e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.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/form-data/node_modules/mime-types/node_modules/mime-db/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md new file mode 100644 index 00000000000000..3b6364ebb82086 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/README.md @@ -0,0 +1,72 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a database of all mime types. +It consistents of a single, public JSON file and does not include any logic, +allowing it to remain as unopinionated as possible with an API. +It aggregates data from the following sources: + +- http://www.iana.org/assignments/media-types/media-types.xhtml +- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types + +## Usage + +```bash +npm i mime-db +``` + +```js +var db = require('mime-db'); + +// grab data on .js files +var data = db['application/javascript']; +``` + +If you're crazy enough to use this in the browser, +you can just grab the JSON file: + +``` +https://cdn.rawgit.com/jshttp/mime-db/master/db.json +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type is can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Repository Structure + +- `scripts` - these are scripts to run to build the database +- `src/` - this is a folder of files created from remote sources like Apache and IANA +- `lib/` - this is a folder of our own custom sources and db, which will be merged into `db.json` +- `db.json` - the final built JSON file for end-user usage + +## Contributing + +To edit the database, only make PRs against files in the `lib/` folder. +To update the build, run `npm run update`. + +[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg?style=flat +[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg?style=flat +[npm-url]: https://npmjs.org/package/mime-db +[travis-image]: https://img.shields.io/travis/jshttp/mime-db.svg?style=flat +[travis-url]: https://travis-ci.org/jshttp/mime-db +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db.svg?style=flat +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://img.shields.io/node/v/mime-db.svg?style=flat +[node-url]: http://nodejs.org/download/ diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json new file mode 100644 index 00000000000000..f9f7a6b3ccd8af --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/db.json @@ -0,0 +1,6385 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana" + }, + "application/3gpp-ims+xml": { + "source": "iana" + }, + "application/a2l": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana" + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "extensions": ["atomsvc"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana" + }, + "application/bacnet-xdd+zip": { + "source": "iana" + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/beep+xml": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana" + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/cbor": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana" + }, + "application/ccxml+xml": { + "source": "iana", + "extensions": ["ccxml"] + }, + "application/cdfx+xml": { + "source": "iana" + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana" + }, + "application/cellml+xml": { + "source": "iana" + }, + "application/cfw": { + "source": "iana" + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/commonground": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana" + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana" + }, + "application/cstadata+xml": { + "source": "iana" + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "extensions": ["mdp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana" + }, + "application/dicom": { + "source": "iana" + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "extensions": ["dbk"] + }, + "application/dskpp+xml": { + "source": "iana" + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/ecmascript": { + "source": "iana", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/emma+xml": { + "source": "iana", + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana" + }, + "application/encaprtp": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana" + }, + "application/epub+zip": { + "source": "iana", + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/example": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdt+xml": { + "source": "iana" + }, + "application/fits": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false, + "extensions": ["woff"] + }, + "application/font-woff2": { + "compressible": false, + "extensions": ["woff2"] + }, + "application/framework-attributes+xml": { + "source": "iana" + }, + "application/gml+xml": { + "source": "apache", + "extensions": ["gml"] + }, + "application/gpx+xml": { + "source": "apache", + "extensions": ["gpx"] + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana" + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana" + }, + "application/ibe-pkg-reply+xml": { + "source": "iana" + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana" + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana" + }, + "application/java-archive": { + "source": "apache", + "compressible": false, + "extensions": ["jar"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/kpml-request+xml": { + "source": "iana" + }, + "application/kpml-response+xml": { + "source": "iana" + }, + "application/ld+json": { + "source": "iana", + "compressible": true + }, + "application/link-format": { + "source": "iana" + }, + "application/load-control+xml": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana" + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "extensions": ["mads"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana" + }, + "application/mathml-presentation+xml": { + "source": "iana" + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana" + }, + "application/mbms-deregister+xml": { + "source": "iana" + }, + "application/mbms-envelope+xml": { + "source": "iana" + }, + "application/mbms-msk+xml": { + "source": "iana" + }, + "application/mbms-msk-response+xml": { + "source": "iana" + }, + "application/mbms-protection-description+xml": { + "source": "iana" + }, + "application/mbms-reception-report+xml": { + "source": "iana" + }, + "application/mbms-register+xml": { + "source": "iana" + }, + "application/mbms-register-response+xml": { + "source": "iana" + }, + "application/mbms-schedule+xml": { + "source": "iana" + }, + "application/mbms-user-service-description+xml": { + "source": "iana" + }, + "application/mbox": { + "source": "apache", + "extensions": ["mbox"] + }, + "application/mbox+xml": { + "source": "iana" + }, + "application/media-policy-dataset+xml": { + "source": "iana" + }, + "application/media_control+xml": { + "source": "iana" + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mods+xml": { + "source": "iana", + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana" + }, + "application/mrb-publish+xml": { + "source": "iana" + }, + "application/msc-ivr+xml": { + "source": "iana" + }, + "application/msc-mixer+xml": { + "source": "iana" + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana" + }, + "application/news-groupinfo": { + "source": "iana" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana" + }, + "application/nss": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "apache" + }, + "application/octet-stream": { + "source": "iana", + "compressible": false, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/omdoc+xml": { + "source": "apache", + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg"] + }, + "application/oscp-response": { + "source": "iana" + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p2p-overlay+xml": { + "source": "iana" + }, + "application/parityfec": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana" + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["asc","sig"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana" + }, + "application/pidf-diff+xml": { + "source": "iana" + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana" + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/provenance+xml": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.hpub+zip": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana" + }, + "application/pskc+xml": { + "source": "iana", + "extensions": ["pskcxml"] + }, + "application/qsig": { + "source": "iana" + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf"] + }, + "application/reginfo+xml": { + "source": "iana", + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "iana" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resource-lists+xml": { + "source": "iana", + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "extensions": ["rld"] + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana" + }, + "application/rls-services+xml": { + "source": "iana", + "extensions": ["rs"] + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana" + }, + "application/samlmetadata+xml": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana" + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/sep+xml": { + "source": "iana" + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana" + }, + "application/simple-filter+xml": { + "source": "iana" + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "iana" + }, + "application/smil+xml": { + "source": "iana", + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "extensions": ["srx"] + }, + "application/spirits-event+xml": { + "source": "iana" + }, + "application/sql": { + "source": "iana" + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "extensions": ["ssdl"] + }, + "application/ssml+xml": { + "source": "iana", + "extensions": ["ssml"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "extensions": ["tei","teicorpus"] + }, + "application/thraud+xml": { + "source": "iana", + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/ttml+xml": { + "source": "iana" + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana" + }, + "application/urc-ressheet+xml": { + "source": "iana" + }, + "application/urc-targetdesc+xml": { + "source": "iana" + }, + "application/urc-uisocketdesc+xml": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana" + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd-acucobol": { + "source": "iana" + }, + "application/vnd-curl": { + "source": "iana" + }, + "application/vnd-dart": { + "source": "iana" + }, + "application/vnd-dxr": { + "source": "iana" + }, + "application/vnd-fdf": { + "source": "iana" + }, + "application/vnd-mif": { + "source": "iana" + }, + "application/vnd-sema": { + "source": "iana" + }, + "application/vnd-wap-wmlc": { + "source": "iana" + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana" + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acucobol": { + "source": "apache", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "extensions": ["air"] + }, + "application/vnd.adobe.flash-movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.ah-barcode": { + "source": "iana" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "extensions": ["mpkg"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.arastra.swi": { + "source": "iana" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avistar+xml": { + "source": "iana" + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana" + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "extensions": ["cdxml"] + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "extensions": ["wbs"] + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana" + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "apache" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana" + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "apache", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece-zip": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "apache", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume-movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana" + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana" + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "apache", + "extensions": ["svc"] + }, + "application/vnd.dvb_service": { + "source": "iana" + }, + "application/vnd.dxr": { + "source": "apache" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana" + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana" + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana" + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana" + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana" + }, + "application/vnd.etsi.cug+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana" + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana" + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana" + }, + "application/vnd.etsi.sci+xml": { + "source": "iana" + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana" + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana" + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "apache", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.frogans.fnc": { + "source": "iana", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "iana", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.geo+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "iana" + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana" + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana" + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "iana" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "iana", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana" + }, + "application/vnd.informix-visionary": { + "source": "iana" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana" + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana" + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las.las+xml": { + "source": "iana", + "extensions": ["lasxml"] + }, + "application/vnd.liberty-request+xml": { + "source": "iana" + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "extensions": ["lbe"] + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micrografx-igx": { + "source": "iana" + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "apache", + "extensions": ["igx"] + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "apache", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana" + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana" + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache" + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana" + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana" + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana" + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "iana" + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana" + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "iana", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana" + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana" + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana" + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana" + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana" + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana" + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana" + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana" + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana" + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana" + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana" + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana" + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana" + }, + "application/vnd.omads-email+xml": { + "source": "iana" + }, + "application/vnd.omads-file+xml": { + "source": "iana" + }, + "application/vnd.omads-folder+xml": { + "source": "iana" + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "apache", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "apache", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "apache", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana" + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana" + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos+xml": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "apache" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana" + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "apache" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana" + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana" + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "extensions": ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed-doc": { + "source": "iana" + }, + "application/vnd.sealed-eml": { + "source": "iana" + }, + "application/vnd.sealed-mht": { + "source": "iana" + }, + "application/vnd.sealed-ppt": { + "source": "iana" + }, + "application/vnd.sealed-tiff": { + "source": "iana" + }, + "application/vnd.sealed-xls": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "apache" + }, + "application/vnd.sealed.eml": { + "source": "apache" + }, + "application/vnd.sealed.mht": { + "source": "apache" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "apache" + }, + "application/vnd.sealed.tiff": { + "source": "apache" + }, + "application/vnd.sealed.xls": { + "source": "apache" + }, + "application/vnd.sealedmedia.softseal-html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal-pdf": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "apache" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "apache" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.sema": { + "source": "apache", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana" + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana" + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana" + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "extensions": ["uoml"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap-slc": { + "source": "iana" + }, + "application/vnd.wap-wbxml": { + "source": "iana" + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "apache" + }, + "application/vnd.wap.wbxml": { + "source": "apache", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "apache", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana" + }, + "application/vnd.wv.ssp+xml": { + "source": "iana" + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana" + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "extensions": ["vxml"] + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/vwg-multiplexed": { + "source": "iana" + }, + "application/watcherinfo+xml": { + "source": "iana" + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-otf": { + "source": "apache", + "compressible": true, + "extensions": ["otf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-ttf": { + "source": "apache", + "compressible": true, + "extensions": ["ttf","ttc"] + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "apache", + "extensions": ["der","crt"] + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana" + }, + "application/xaml+xml": { + "source": "apache", + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana" + }, + "application/xcap-caps+xml": { + "source": "iana" + }, + "application/xcap-diff+xml": { + "source": "iana", + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana" + }, + "application/xcap-error+xml": { + "source": "iana" + }, + "application/xcap-ns+xml": { + "source": "iana" + }, + "application/xcon-conference-info+xml": { + "source": "iana" + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana" + }, + "application/xenc+xml": { + "source": "iana", + "extensions": ["xenc"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "iana" + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana" + }, + "application/xmpp+xml": { + "source": "iana" + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "extensions": ["xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yin+xml": { + "source": "iana", + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zlib": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana" + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana" + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/example": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g721": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "apache" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/mobile-xmf": { + "source": "iana" + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4a","m4a"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx"] + }, + "audio/opus": { + "source": "apache" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal-mpeg": { + "source": "iana" + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "apache" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/opentype": { + "compressible": true, + "extensions": ["otf"] + }, + "image/bmp": { + "source": "apache", + "compressible": true, + "extensions": ["bmp"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/example": { + "source": "iana" + }, + "image/fits": { + "source": "iana" + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/jp2": { + "source": "iana" + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpeg","jpg","jpe"] + }, + "image/jpm": { + "source": "iana" + }, + "image/jpx": { + "source": "iana" + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif"] + }, + "image/prs.pti": { + "source": "iana" + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana" + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tiff","tif"] + }, + "image/tiff-fx": { + "source": "iana" + }, + "image/vnd-djvu": { + "source": "iana" + }, + "image/vnd-svf": { + "source": "iana" + }, + "image/vnd-wap-wbmp": { + "source": "iana" + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "apache", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana" + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed-png": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "apache" + }, + "image/vnd.sealedmedia.softseal-gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal-jpg": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "apache" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "apache" + }, + "image/vnd.svf": { + "source": "apache" + }, + "image/vnd.tencent.tap": { + "source": "iana" + }, + "image/vnd.valve.source.texture": { + "source": "iana" + }, + "image/vnd.wap.wbmp": { + "source": "apache", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/webp": { + "source": "apache", + "extensions": ["webp"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana" + }, + "message/example": { + "source": "iana" + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana" + }, + "message/global-delivery-status": { + "source": "iana" + }, + "message/global-disposition-notification": { + "source": "iana" + }, + "message/global-headers": { + "source": "iana" + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/news": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime"] + }, + "message/s-http": { + "source": "iana" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "iana" + }, + "message/vnd.wfa.wsc": { + "source": "iana" + }, + "model/example": { + "source": "iana", + "compressible": false + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/vnd-dwf": { + "source": "iana" + }, + "model/vnd.collada+xml": { + "source": "iana", + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "apache", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "iana" + }, + "model/vnd.gs.gdl": { + "source": "apache" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana" + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana" + }, + "model/vnd.parasolid.transmit-binary": { + "source": "iana" + }, + "model/vnd.parasolid.transmit-text": { + "source": "iana" + }, + "model/vnd.parasolid.transmit.binary": { + "source": "apache" + }, + "model/vnd.parasolid.transmit.text": { + "source": "apache" + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana" + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana" + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana" + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/example": { + "source": "iana" + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana", + "compressible": false + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee"] + }, + "text/css": { + "source": "iana", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "iana" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/example": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "compressible": true + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana" + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana" + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd-a": { + "source": "iana" + }, + "text/vnd-curl": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "apache", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana" + }, + "text/vnd.wap-wml": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "apache", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vtt": { + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["markdown","md","mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "apache" + }, + "video/3gpp": { + "source": "apache", + "extensions": ["3gp"] + }, + "video/3gpp-tt": { + "source": "apache" + }, + "video/3gpp2": { + "source": "apache", + "extensions": ["3g2"] + }, + "video/bmpeg": { + "source": "apache" + }, + "video/bt656": { + "source": "apache" + }, + "video/celb": { + "source": "apache" + }, + "video/dv": { + "source": "apache" + }, + "video/example": { + "source": "apache" + }, + "video/h261": { + "source": "apache", + "extensions": ["h261"] + }, + "video/h263": { + "source": "apache", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "apache" + }, + "video/h263-2000": { + "source": "apache" + }, + "video/h264": { + "source": "apache", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "apache" + }, + "video/h264-svc": { + "source": "apache" + }, + "video/jpeg": { + "source": "apache", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "apache" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/mj2": { + "source": "apache", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "apache" + }, + "video/mp2p": { + "source": "apache" + }, + "video/mp2t": { + "source": "apache", + "extensions": ["ts"] + }, + "video/mp4": { + "source": "apache", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "apache" + }, + "video/mpeg": { + "source": "apache", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "apache" + }, + "video/mpv": { + "source": "apache" + }, + "video/nv": { + "source": "apache" + }, + "video/ogg": { + "source": "apache", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "apache" + }, + "video/pointer": { + "source": "apache" + }, + "video/quicktime": { + "source": "apache", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raw": { + "source": "apache" + }, + "video/rtp-enc-aescm128": { + "source": "apache" + }, + "video/rtx": { + "source": "apache" + }, + "video/smpte292m": { + "source": "apache" + }, + "video/ulpfec": { + "source": "apache" + }, + "video/vc1": { + "source": "apache" + }, + "video/vnd.cctv": { + "source": "apache" + }, + "video/vnd.dece.hd": { + "source": "apache", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "apache", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "apache" + }, + "video/vnd.dece.pd": { + "source": "apache", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "apache", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "apache", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "apache" + }, + "video/vnd.directv.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dvb.file": { + "source": "apache", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "apache", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "apache" + }, + "video/vnd.motorola.video": { + "source": "apache" + }, + "video/vnd.motorola.videop": { + "source": "apache" + }, + "video/vnd.mpegurl": { + "source": "apache", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "apache", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "apache" + }, + "video/vnd.nokia.videovoip": { + "source": "apache" + }, + "video/vnd.objectvideo": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "apache" + }, + "video/vnd.sealed.mpeg4": { + "source": "apache" + }, + "video/vnd.sealed.swf": { + "source": "apache" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "apache" + }, + "video/vnd.uvvu.mp4": { + "source": "apache", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "apache", + "extensions": ["viv"] + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js new file mode 100644 index 00000000000000..551031f690b5ca --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/index.js @@ -0,0 +1,11 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json new file mode 100644 index 00000000000000..ff01bd5303eed5 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/node_modules/mime-db/package.json @@ -0,0 +1,78 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.3.0", + "author": { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/jshttp/mime-db" + }, + "devDependencies": { + "co": "3", + "cogent": "1", + "csv-parse": "0", + "gnode": "0.1.0", + "istanbul": "0.3.4", + "mocha": "~1.21.4", + "stream-to-array": "2" + }, + "engines": { + "node": ">= 0.6" + }, + "files": [ + "LICENSE", + "db.json", + "index.js" + ], + "scripts": { + "update": "gnode scripts/extensions && gnode scripts/types && node scripts/build", + "clean": "rm src/*", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "gitHead": "dc3a4d4948e9e6814404712d0f3560f1fffe7d73", + "bugs": { + "url": "https://github.com/jshttp/mime-db/issues" + }, + "homepage": "https://github.com/jshttp/mime-db", + "_id": "mime-db@1.3.0", + "_shasum": "5fefeb25dd9b097c5d45091c60f8149b98d749ec", + "_from": "mime-db@>=1.3.0 <1.4.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "5fefeb25dd9b097c5d45091c60f8149b98d749ec", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.3.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.3.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json new file mode 100644 index 00000000000000..1544629b6b3b0a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime-types/package.json @@ -0,0 +1,80 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "2.0.4", + "contributors": [ + { + "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", + "url": "https://searchbeam.jit.su" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": { + "type": "git", + "url": "https://github.com/jshttp/mime-types" + }, + "dependencies": { + "mime-db": "~1.3.0" + }, + "devDependencies": { + "istanbul": "0", + "mocha": "~1.21.5" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "test": "mocha --reporter spec test/test.js", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" + }, + "gitHead": "63a9b82e6e364d62428ed5459e5486504c489bf2", + "bugs": { + "url": "https://github.com/jshttp/mime-types/issues" + }, + "homepage": "https://github.com/jshttp/mime-types", + "_id": "mime-types@2.0.4", + "_shasum": "855a612979141d806ba5104294a28c731c6ea790", + "_from": "mime-types@>=2.0.3 <2.1.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "855a612979141d806ba5104294a28c731c6ea790", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.0.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md deleted file mode 100644 index 6ca19bd1e859c2..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# mime - -Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. - -## Install - -Install with [npm](http://github.com/isaacs/npm): - - npm install mime - -## API - Queries - -### mime.lookup(path) -Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. - - var mime = require('mime'); - - mime.lookup('/path/to/file.txt'); // => 'text/plain' - mime.lookup('file.txt'); // => 'text/plain' - mime.lookup('.TXT'); // => 'text/plain' - mime.lookup('htm'); // => 'text/html' - -### mime.default_type -Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) - -### mime.extension(type) -Get the default extension for `type` - - mime.extension('text/html'); // => 'html' - mime.extension('application/octet-stream'); // => 'bin' - -### mime.charsets.lookup() - -Map mime-type to charset - - mime.charsets.lookup('text/plain'); // => 'UTF-8' - -(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) - -## API - Defining Custom Types - -The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). - -### mime.define() - -Add custom mime/extension mappings - - mime.define({ - 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], - 'application/x-my-type': ['x-mt', 'x-mtt'], - // etc ... - }); - - mime.lookup('x-sft'); // => 'text/x-some-format' - -The first entry in the extensions array is returned by `mime.extension()`. E.g. - - mime.extension('text/x-some-format'); // => 'x-sf' - -### mime.load(filepath) - -Load mappings from an Apache ".types" format file - - mime.load('./my_project.types'); - -The .types file format is simple - See the `types` dir for examples. diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js deleted file mode 100644 index 48be0c5e42b119..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js +++ /dev/null @@ -1,114 +0,0 @@ -var path = require('path'); -var fs = require('fs'); - -function Mime() { - // Map of extension -> mime type - this.types = Object.create(null); - - // Map of mime type -> extension - this.extensions = Object.create(null); -} - -/** - * Define mimetype -> extension mappings. Each key is a mime-type that maps - * to an array of extensions associated with the type. The first extension is - * used as the default extension for the type. - * - * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); - * - * @param map (Object) type definitions - */ -Mime.prototype.define = function (map) { - for (var type in map) { - var exts = map[type]; - - for (var i = 0; i < exts.length; i++) { - if (process.env.DEBUG_MIME && this.types[exts]) { - console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + - this.types[exts] + ' to ' + type); - } - - this.types[exts[i]] = type; - } - - // Default extension is the first one we encounter - if (!this.extensions[type]) { - this.extensions[type] = exts[0]; - } - } -}; - -/** - * Load an Apache2-style ".types" file - * - * This may be called multiple times (it's expected). Where files declare - * overlapping types/extensions, the last file wins. - * - * @param file (String) path of file to load. - */ -Mime.prototype.load = function(file) { - - this._loading = file; - // Read file and split into lines - var map = {}, - content = fs.readFileSync(file, 'ascii'), - lines = content.split(/[\r\n]+/); - - lines.forEach(function(line) { - // Clean up whitespace/comments, and split into fields - var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); - map[fields.shift()] = fields; - }); - - this.define(map); - - this._loading = null; -}; - -/** - * Lookup a mime type based on extension - */ -Mime.prototype.lookup = function(path, fallback) { - var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); - - return this.types[ext] || fallback || this.default_type; -}; - -/** - * Return file extension associated with a mime type - */ -Mime.prototype.extension = function(mimeType) { - var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); - return this.extensions[type]; -}; - -// Default instance -var mime = new Mime(); - -// Load local copy of -// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types -mime.load(path.join(__dirname, 'types/mime.types')); - -// Load additional types from node.js community -mime.load(path.join(__dirname, 'types/node.types')); - -// Default type -mime.default_type = mime.lookup('bin'); - -// -// Additional API specific to the default instance -// - -mime.Mime = Mime; - -/** - * Lookup a charset based on mime type. - */ -mime.charsets = { - lookup: function(mimeType, fallback) { - // Assume text types are utf8 - return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; - } -}; - -module.exports = mime; diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json deleted file mode 100644 index b666b72a2a1f10..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com", - "url": "http://github.com/broofa" - }, - "contributors": [ - { - "name": "Benjamin Thomas", - "email": "benjamin@benjaminthomas.org", - "url": "http://github.com/bentomas" - } - ], - "dependencies": {}, - "description": "A comprehensive library for mime-type mapping", - "devDependencies": {}, - "keywords": [ - "util", - "mime" - ], - "main": "mime.js", - "name": "mime", - "repository": { - "url": "https://github.com/broofa/node-mime", - "type": "git" - }, - "version": "1.2.11", - "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.\n\n var mime = require('mime');\n\n mime.lookup('/path/to/file.txt'); // => 'text/plain'\n mime.lookup('file.txt'); // => 'text/plain'\n mime.lookup('.TXT'); // => 'text/plain'\n mime.lookup('htm'); // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n mime.extension('text/html'); // => 'html'\n mime.extension('application/octet-stream'); // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n mime.charsets.lookup('text/plain'); // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n mime.define({\n 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n 'application/x-my-type': ['x-mt', 'x-mtt'],\n // etc ...\n });\n\n mime.lookup('x-sft'); // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n mime.load('./my_project.types');\n\nThe .types file format is simple - See the `types` dir for examples.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/broofa/node-mime/issues" - }, - "_id": "mime@1.2.11", - "dist": { - "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", - "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" - }, - "_from": "mime@>=1.2.11 <1.3.0", - "_npmVersion": "1.3.6", - "_npmUser": { - "name": "broofa", - "email": "robert@broofa.com" - }, - "maintainers": [ - { - "name": "broofa", - "email": "robert@broofa.com" - }, - { - "name": "bentomas", - "email": "benjamin@benjaminthomas.org" - } - ], - "directories": {}, - "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", - "homepage": "https://github.com/broofa/node-mime", - "scripts": {} -} diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js deleted file mode 100644 index 2cda1c7ad196a7..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Usage: node test.js - */ - -var mime = require('./mime'); -var assert = require('assert'); -var path = require('path'); - -function eq(a, b) { - console.log('Test: ' + a + ' === ' + b); - assert.strictEqual.apply(null, arguments); -} - -console.log(Object.keys(mime.extensions).length + ' types'); -console.log(Object.keys(mime.types).length + ' extensions\n'); - -// -// Test mime lookups -// - -eq('text/plain', mime.lookup('text.txt')); // normal file -eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase -eq('text/plain', mime.lookup('dir/text.txt')); // dir + file -eq('text/plain', mime.lookup('.text.txt')); // hidden file -eq('text/plain', mime.lookup('.txt')); // nameless -eq('text/plain', mime.lookup('txt')); // extension-only -eq('text/plain', mime.lookup('/txt')); // extension-less () -eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less -eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized -eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default - -// -// Test extensions -// - -eq('txt', mime.extension(mime.types.text)); -eq('html', mime.extension(mime.types.htm)); -eq('bin', mime.extension('application/octet-stream')); -eq('bin', mime.extension('application/octet-stream ')); -eq('html', mime.extension(' text/html; charset=UTF-8')); -eq('html', mime.extension('text/html; charset=UTF-8 ')); -eq('html', mime.extension('text/html; charset=UTF-8')); -eq('html', mime.extension('text/html ; charset=UTF-8')); -eq('html', mime.extension('text/html;charset=UTF-8')); -eq('html', mime.extension('text/Html;charset=UTF-8')); -eq(undefined, mime.extension('unrecognized')); - -// -// Test node.types lookups -// - -eq('application/font-woff', mime.lookup('file.woff')); -eq('application/octet-stream', mime.lookup('file.buffer')); -eq('audio/mp4', mime.lookup('file.m4a')); -eq('font/opentype', mime.lookup('file.otf')); - -// -// Test charsets -// - -eq('UTF-8', mime.charsets.lookup('text/plain')); -eq(undefined, mime.charsets.lookup(mime.types.js)); -eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); - -// -// Test for overlaps between mime.types and node.types -// - -var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); -apacheTypes.load(path.join(__dirname, 'types/mime.types')); -nodeTypes.load(path.join(__dirname, 'types/node.types')); - -var keys = [].concat(Object.keys(apacheTypes.types)) - .concat(Object.keys(nodeTypes.types)); -keys.sort(); -for (var i = 1; i < keys.length; i++) { - if (keys[i] == keys[i-1]) { - console.warn('Warning: ' + - 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + - ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); - } -} - -console.log('\nOK'); diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types deleted file mode 100644 index da8cd691879db7..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types +++ /dev/null @@ -1,1588 +0,0 @@ -# This file maps Internet media types to unique file extension(s). -# Although created for httpd, this file is used by many software systems -# and has been placed in the public domain for unlimited redisribution. -# -# The table below contains both registered and (common) unregistered types. -# A type that has no unique extension can be ignored -- they are listed -# here to guide configurations toward known types and to make it easier to -# identify "new" types. File extensions are also commonly used to indicate -# content languages and encodings, so choose them carefully. -# -# Internet media types should be registered as described in RFC 4288. -# The registry is at . -# -# MIME type (lowercased) Extensions -# ============================================ ========== -# application/1d-interleaved-parityfec -# application/3gpp-ims+xml -# application/activemessage -application/andrew-inset ez -# application/applefile -application/applixware aw -application/atom+xml atom -application/atomcat+xml atomcat -# application/atomicmail -application/atomsvc+xml atomsvc -# application/auth-policy+xml -# application/batch-smtp -# application/beep+xml -# application/calendar+xml -# application/cals-1840 -# application/ccmp+xml -application/ccxml+xml ccxml -application/cdmi-capability cdmia -application/cdmi-container cdmic -application/cdmi-domain cdmid -application/cdmi-object cdmio -application/cdmi-queue cdmiq -# application/cea-2018+xml -# application/cellml+xml -# application/cfw -# application/cnrp+xml -# application/commonground -# application/conference-info+xml -# application/cpl+xml -# application/csta+xml -# application/cstadata+xml -application/cu-seeme cu -# application/cybercash -application/davmount+xml davmount -# application/dca-rft -# application/dec-dx -# application/dialog-info+xml -# application/dicom -# application/dns -application/docbook+xml dbk -# application/dskpp+xml -application/dssc+der dssc -application/dssc+xml xdssc -# application/dvcs -application/ecmascript ecma -# application/edi-consent -# application/edi-x12 -# application/edifact -application/emma+xml emma -# application/epp+xml -application/epub+zip epub -# application/eshop -# application/example -application/exi exi -# application/fastinfoset -# application/fastsoap -# application/fits -application/font-tdpfr pfr -# application/framework-attributes+xml -application/gml+xml gml -application/gpx+xml gpx -application/gxf gxf -# application/h224 -# application/held+xml -# application/http -application/hyperstudio stk -# application/ibe-key-request+xml -# application/ibe-pkg-reply+xml -# application/ibe-pp-data -# application/iges -# application/im-iscomposing+xml -# application/index -# application/index.cmd -# application/index.obj -# application/index.response -# application/index.vnd -application/inkml+xml ink inkml -# application/iotp -application/ipfix ipfix -# application/ipp -# application/isup -application/java-archive jar -application/java-serialized-object ser -application/java-vm class -application/javascript js -application/json json -application/jsonml+json jsonml -# application/kpml-request+xml -# application/kpml-response+xml -application/lost+xml lostxml -application/mac-binhex40 hqx -application/mac-compactpro cpt -# application/macwriteii -application/mads+xml mads -application/marc mrc -application/marcxml+xml mrcx -application/mathematica ma nb mb -# application/mathml-content+xml -# application/mathml-presentation+xml -application/mathml+xml mathml -# application/mbms-associated-procedure-description+xml -# application/mbms-deregister+xml -# application/mbms-envelope+xml -# application/mbms-msk+xml -# application/mbms-msk-response+xml -# application/mbms-protection-description+xml -# application/mbms-reception-report+xml -# application/mbms-register+xml -# application/mbms-register-response+xml -# application/mbms-user-service-description+xml -application/mbox mbox -# application/media_control+xml -application/mediaservercontrol+xml mscml -application/metalink+xml metalink -application/metalink4+xml meta4 -application/mets+xml mets -# application/mikey -application/mods+xml mods -# application/moss-keys -# application/moss-signature -# application/mosskey-data -# application/mosskey-request -application/mp21 m21 mp21 -application/mp4 mp4s -# application/mpeg4-generic -# application/mpeg4-iod -# application/mpeg4-iod-xmt -# application/msc-ivr+xml -# application/msc-mixer+xml -application/msword doc dot -application/mxf mxf -# application/nasdata -# application/news-checkgroups -# application/news-groupinfo -# application/news-transmission -# application/nss -# application/ocsp-request -# application/ocsp-response -application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy -application/oda oda -application/oebps-package+xml opf -application/ogg ogx -application/omdoc+xml omdoc -application/onenote onetoc onetoc2 onetmp onepkg -application/oxps oxps -# application/parityfec -application/patch-ops-error+xml xer -application/pdf pdf -application/pgp-encrypted pgp -# application/pgp-keys -application/pgp-signature asc sig -application/pics-rules prf -# application/pidf+xml -# application/pidf-diff+xml -application/pkcs10 p10 -application/pkcs7-mime p7m p7c -application/pkcs7-signature p7s -application/pkcs8 p8 -application/pkix-attr-cert ac -application/pkix-cert cer -application/pkix-crl crl -application/pkix-pkipath pkipath -application/pkixcmp pki -application/pls+xml pls -# application/poc-settings+xml -application/postscript ai eps ps -# application/prs.alvestrand.titrax-sheet -application/prs.cww cww -# application/prs.nprend -# application/prs.plucker -# application/prs.rdf-xml-crypt -# application/prs.xsf+xml -application/pskc+xml pskcxml -# application/qsig -application/rdf+xml rdf -application/reginfo+xml rif -application/relax-ng-compact-syntax rnc -# application/remote-printing -application/resource-lists+xml rl -application/resource-lists-diff+xml rld -# application/riscos -# application/rlmi+xml -application/rls-services+xml rs -application/rpki-ghostbusters gbr -application/rpki-manifest mft -application/rpki-roa roa -# application/rpki-updown -application/rsd+xml rsd -application/rss+xml rss -application/rtf rtf -# application/rtx -# application/samlassertion+xml -# application/samlmetadata+xml -application/sbml+xml sbml -application/scvp-cv-request scq -application/scvp-cv-response scs -application/scvp-vp-request spq -application/scvp-vp-response spp -application/sdp sdp -# application/set-payment -application/set-payment-initiation setpay -# application/set-registration -application/set-registration-initiation setreg -# application/sgml -# application/sgml-open-catalog -application/shf+xml shf -# application/sieve -# application/simple-filter+xml -# application/simple-message-summary -# application/simplesymbolcontainer -# application/slate -# application/smil -application/smil+xml smi smil -# application/soap+fastinfoset -# application/soap+xml -application/sparql-query rq -application/sparql-results+xml srx -# application/spirits-event+xml -application/srgs gram -application/srgs+xml grxml -application/sru+xml sru -application/ssdl+xml ssdl -application/ssml+xml ssml -# application/tamp-apex-update -# application/tamp-apex-update-confirm -# application/tamp-community-update -# application/tamp-community-update-confirm -# application/tamp-error -# application/tamp-sequence-adjust -# application/tamp-sequence-adjust-confirm -# application/tamp-status-query -# application/tamp-status-response -# application/tamp-update -# application/tamp-update-confirm -application/tei+xml tei teicorpus -application/thraud+xml tfi -# application/timestamp-query -# application/timestamp-reply -application/timestamped-data tsd -# application/tve-trigger -# application/ulpfec -# application/vcard+xml -# application/vemmi -# application/vividence.scriptfile -# application/vnd.3gpp.bsf+xml -application/vnd.3gpp.pic-bw-large plb -application/vnd.3gpp.pic-bw-small psb -application/vnd.3gpp.pic-bw-var pvb -# application/vnd.3gpp.sms -# application/vnd.3gpp2.bcmcsinfo+xml -# application/vnd.3gpp2.sms -application/vnd.3gpp2.tcap tcap -application/vnd.3m.post-it-notes pwn -application/vnd.accpac.simply.aso aso -application/vnd.accpac.simply.imp imp -application/vnd.acucobol acu -application/vnd.acucorp atc acutc -application/vnd.adobe.air-application-installer-package+zip air -application/vnd.adobe.formscentral.fcdt fcdt -application/vnd.adobe.fxp fxp fxpl -# application/vnd.adobe.partial-upload -application/vnd.adobe.xdp+xml xdp -application/vnd.adobe.xfdf xfdf -# application/vnd.aether.imp -# application/vnd.ah-barcode -application/vnd.ahead.space ahead -application/vnd.airzip.filesecure.azf azf -application/vnd.airzip.filesecure.azs azs -application/vnd.amazon.ebook azw -application/vnd.americandynamics.acc acc -application/vnd.amiga.ami ami -# application/vnd.amundsen.maze+xml -application/vnd.android.package-archive apk -application/vnd.anser-web-certificate-issue-initiation cii -application/vnd.anser-web-funds-transfer-initiation fti -application/vnd.antix.game-component atx -application/vnd.apple.installer+xml mpkg -application/vnd.apple.mpegurl m3u8 -# application/vnd.arastra.swi -application/vnd.aristanetworks.swi swi -application/vnd.astraea-software.iota iota -application/vnd.audiograph aep -# application/vnd.autopackage -# application/vnd.avistar+xml -application/vnd.blueice.multipass mpm -# application/vnd.bluetooth.ep.oob -application/vnd.bmi bmi -application/vnd.businessobjects rep -# application/vnd.cab-jscript -# application/vnd.canon-cpdl -# application/vnd.canon-lips -# application/vnd.cendio.thinlinc.clientconf -application/vnd.chemdraw+xml cdxml -application/vnd.chipnuts.karaoke-mmd mmd -application/vnd.cinderella cdy -# application/vnd.cirpack.isdn-ext -application/vnd.claymore cla -application/vnd.cloanto.rp9 rp9 -application/vnd.clonk.c4group c4g c4d c4f c4p c4u -application/vnd.cluetrust.cartomobile-config c11amc -application/vnd.cluetrust.cartomobile-config-pkg c11amz -# application/vnd.collection+json -# application/vnd.commerce-battelle -application/vnd.commonspace csp -application/vnd.contact.cmsg cdbcmsg -application/vnd.cosmocaller cmc -application/vnd.crick.clicker clkx -application/vnd.crick.clicker.keyboard clkk -application/vnd.crick.clicker.palette clkp -application/vnd.crick.clicker.template clkt -application/vnd.crick.clicker.wordbank clkw -application/vnd.criticaltools.wbs+xml wbs -application/vnd.ctc-posml pml -# application/vnd.ctct.ws+xml -# application/vnd.cups-pdf -# application/vnd.cups-postscript -application/vnd.cups-ppd ppd -# application/vnd.cups-raster -# application/vnd.cups-raw -# application/vnd.curl -application/vnd.curl.car car -application/vnd.curl.pcurl pcurl -# application/vnd.cybank -application/vnd.dart dart -application/vnd.data-vision.rdz rdz -application/vnd.dece.data uvf uvvf uvd uvvd -application/vnd.dece.ttml+xml uvt uvvt -application/vnd.dece.unspecified uvx uvvx -application/vnd.dece.zip uvz uvvz -application/vnd.denovo.fcselayout-link fe_launch -# application/vnd.dir-bi.plate-dl-nosuffix -application/vnd.dna dna -application/vnd.dolby.mlp mlp -# application/vnd.dolby.mobile.1 -# application/vnd.dolby.mobile.2 -application/vnd.dpgraph dpg -application/vnd.dreamfactory dfac -application/vnd.ds-keypoint kpxx -application/vnd.dvb.ait ait -# application/vnd.dvb.dvbj -# application/vnd.dvb.esgcontainer -# application/vnd.dvb.ipdcdftnotifaccess -# application/vnd.dvb.ipdcesgaccess -# application/vnd.dvb.ipdcesgaccess2 -# application/vnd.dvb.ipdcesgpdd -# application/vnd.dvb.ipdcroaming -# application/vnd.dvb.iptv.alfec-base -# application/vnd.dvb.iptv.alfec-enhancement -# application/vnd.dvb.notif-aggregate-root+xml -# application/vnd.dvb.notif-container+xml -# application/vnd.dvb.notif-generic+xml -# application/vnd.dvb.notif-ia-msglist+xml -# application/vnd.dvb.notif-ia-registration-request+xml -# application/vnd.dvb.notif-ia-registration-response+xml -# application/vnd.dvb.notif-init+xml -# application/vnd.dvb.pfr -application/vnd.dvb.service svc -# application/vnd.dxr -application/vnd.dynageo geo -# application/vnd.easykaraoke.cdgdownload -# application/vnd.ecdis-update -application/vnd.ecowin.chart mag -# application/vnd.ecowin.filerequest -# application/vnd.ecowin.fileupdate -# application/vnd.ecowin.series -# application/vnd.ecowin.seriesrequest -# application/vnd.ecowin.seriesupdate -# application/vnd.emclient.accessrequest+xml -application/vnd.enliven nml -# application/vnd.eprints.data+xml -application/vnd.epson.esf esf -application/vnd.epson.msf msf -application/vnd.epson.quickanime qam -application/vnd.epson.salt slt -application/vnd.epson.ssf ssf -# application/vnd.ericsson.quickcall -application/vnd.eszigno3+xml es3 et3 -# application/vnd.etsi.aoc+xml -# application/vnd.etsi.cug+xml -# application/vnd.etsi.iptvcommand+xml -# application/vnd.etsi.iptvdiscovery+xml -# application/vnd.etsi.iptvprofile+xml -# application/vnd.etsi.iptvsad-bc+xml -# application/vnd.etsi.iptvsad-cod+xml -# application/vnd.etsi.iptvsad-npvr+xml -# application/vnd.etsi.iptvservice+xml -# application/vnd.etsi.iptvsync+xml -# application/vnd.etsi.iptvueprofile+xml -# application/vnd.etsi.mcid+xml -# application/vnd.etsi.overload-control-policy-dataset+xml -# application/vnd.etsi.sci+xml -# application/vnd.etsi.simservs+xml -# application/vnd.etsi.tsl+xml -# application/vnd.etsi.tsl.der -# application/vnd.eudora.data -application/vnd.ezpix-album ez2 -application/vnd.ezpix-package ez3 -# application/vnd.f-secure.mobile -application/vnd.fdf fdf -application/vnd.fdsn.mseed mseed -application/vnd.fdsn.seed seed dataless -# application/vnd.ffsns -# application/vnd.fints -application/vnd.flographit gph -application/vnd.fluxtime.clip ftc -# application/vnd.font-fontforge-sfd -application/vnd.framemaker fm frame maker book -application/vnd.frogans.fnc fnc -application/vnd.frogans.ltf ltf -application/vnd.fsc.weblaunch fsc -application/vnd.fujitsu.oasys oas -application/vnd.fujitsu.oasys2 oa2 -application/vnd.fujitsu.oasys3 oa3 -application/vnd.fujitsu.oasysgp fg5 -application/vnd.fujitsu.oasysprs bh2 -# application/vnd.fujixerox.art-ex -# application/vnd.fujixerox.art4 -# application/vnd.fujixerox.hbpl -application/vnd.fujixerox.ddd ddd -application/vnd.fujixerox.docuworks xdw -application/vnd.fujixerox.docuworks.binder xbd -# application/vnd.fut-misnet -application/vnd.fuzzysheet fzs -application/vnd.genomatix.tuxedo txd -# application/vnd.geocube+xml -application/vnd.geogebra.file ggb -application/vnd.geogebra.tool ggt -application/vnd.geometry-explorer gex gre -application/vnd.geonext gxt -application/vnd.geoplan g2w -application/vnd.geospace g3w -# application/vnd.globalplatform.card-content-mgt -# application/vnd.globalplatform.card-content-mgt-response -application/vnd.gmx gmx -application/vnd.google-earth.kml+xml kml -application/vnd.google-earth.kmz kmz -application/vnd.grafeq gqf gqs -# application/vnd.gridmp -application/vnd.groove-account gac -application/vnd.groove-help ghf -application/vnd.groove-identity-message gim -application/vnd.groove-injector grv -application/vnd.groove-tool-message gtm -application/vnd.groove-tool-template tpl -application/vnd.groove-vcard vcg -# application/vnd.hal+json -application/vnd.hal+xml hal -application/vnd.handheld-entertainment+xml zmm -application/vnd.hbci hbci -# application/vnd.hcl-bireports -application/vnd.hhe.lesson-player les -application/vnd.hp-hpgl hpgl -application/vnd.hp-hpid hpid -application/vnd.hp-hps hps -application/vnd.hp-jlyt jlt -application/vnd.hp-pcl pcl -application/vnd.hp-pclxl pclxl -# application/vnd.httphone -application/vnd.hydrostatix.sof-data sfd-hdstx -# application/vnd.hzn-3d-crossword -# application/vnd.ibm.afplinedata -# application/vnd.ibm.electronic-media -application/vnd.ibm.minipay mpy -application/vnd.ibm.modcap afp listafp list3820 -application/vnd.ibm.rights-management irm -application/vnd.ibm.secure-container sc -application/vnd.iccprofile icc icm -application/vnd.igloader igl -application/vnd.immervision-ivp ivp -application/vnd.immervision-ivu ivu -# application/vnd.informedcontrol.rms+xml -# application/vnd.informix-visionary -# application/vnd.infotech.project -# application/vnd.infotech.project+xml -# application/vnd.innopath.wamp.notification -application/vnd.insors.igm igm -application/vnd.intercon.formnet xpw xpx -application/vnd.intergeo i2g -# application/vnd.intertrust.digibox -# application/vnd.intertrust.nncp -application/vnd.intu.qbo qbo -application/vnd.intu.qfx qfx -# application/vnd.iptc.g2.conceptitem+xml -# application/vnd.iptc.g2.knowledgeitem+xml -# application/vnd.iptc.g2.newsitem+xml -# application/vnd.iptc.g2.newsmessage+xml -# application/vnd.iptc.g2.packageitem+xml -# application/vnd.iptc.g2.planningitem+xml -application/vnd.ipunplugged.rcprofile rcprofile -application/vnd.irepository.package+xml irp -application/vnd.is-xpr xpr -application/vnd.isac.fcs fcs -application/vnd.jam jam -# application/vnd.japannet-directory-service -# application/vnd.japannet-jpnstore-wakeup -# application/vnd.japannet-payment-wakeup -# application/vnd.japannet-registration -# application/vnd.japannet-registration-wakeup -# application/vnd.japannet-setstore-wakeup -# application/vnd.japannet-verification -# application/vnd.japannet-verification-wakeup -application/vnd.jcp.javame.midlet-rms rms -application/vnd.jisp jisp -application/vnd.joost.joda-archive joda -application/vnd.kahootz ktz ktr -application/vnd.kde.karbon karbon -application/vnd.kde.kchart chrt -application/vnd.kde.kformula kfo -application/vnd.kde.kivio flw -application/vnd.kde.kontour kon -application/vnd.kde.kpresenter kpr kpt -application/vnd.kde.kspread ksp -application/vnd.kde.kword kwd kwt -application/vnd.kenameaapp htke -application/vnd.kidspiration kia -application/vnd.kinar kne knp -application/vnd.koan skp skd skt skm -application/vnd.kodak-descriptor sse -application/vnd.las.las+xml lasxml -# application/vnd.liberty-request+xml -application/vnd.llamagraphics.life-balance.desktop lbd -application/vnd.llamagraphics.life-balance.exchange+xml lbe -application/vnd.lotus-1-2-3 123 -application/vnd.lotus-approach apr -application/vnd.lotus-freelance pre -application/vnd.lotus-notes nsf -application/vnd.lotus-organizer org -application/vnd.lotus-screencam scm -application/vnd.lotus-wordpro lwp -application/vnd.macports.portpkg portpkg -# application/vnd.marlin.drm.actiontoken+xml -# application/vnd.marlin.drm.conftoken+xml -# application/vnd.marlin.drm.license+xml -# application/vnd.marlin.drm.mdcf -application/vnd.mcd mcd -application/vnd.medcalcdata mc1 -application/vnd.mediastation.cdkey cdkey -# application/vnd.meridian-slingshot -application/vnd.mfer mwf -application/vnd.mfmp mfm -application/vnd.micrografx.flo flo -application/vnd.micrografx.igx igx -application/vnd.mif mif -# application/vnd.minisoft-hp3000-save -# application/vnd.mitsubishi.misty-guard.trustweb -application/vnd.mobius.daf daf -application/vnd.mobius.dis dis -application/vnd.mobius.mbk mbk -application/vnd.mobius.mqy mqy -application/vnd.mobius.msl msl -application/vnd.mobius.plc plc -application/vnd.mobius.txf txf -application/vnd.mophun.application mpn -application/vnd.mophun.certificate mpc -# application/vnd.motorola.flexsuite -# application/vnd.motorola.flexsuite.adsi -# application/vnd.motorola.flexsuite.fis -# application/vnd.motorola.flexsuite.gotap -# application/vnd.motorola.flexsuite.kmr -# application/vnd.motorola.flexsuite.ttc -# application/vnd.motorola.flexsuite.wem -# application/vnd.motorola.iprm -application/vnd.mozilla.xul+xml xul -application/vnd.ms-artgalry cil -# application/vnd.ms-asf -application/vnd.ms-cab-compressed cab -# application/vnd.ms-color.iccprofile -application/vnd.ms-excel xls xlm xla xlc xlt xlw -application/vnd.ms-excel.addin.macroenabled.12 xlam -application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb -application/vnd.ms-excel.sheet.macroenabled.12 xlsm -application/vnd.ms-excel.template.macroenabled.12 xltm -application/vnd.ms-fontobject eot -application/vnd.ms-htmlhelp chm -application/vnd.ms-ims ims -application/vnd.ms-lrm lrm -# application/vnd.ms-office.activex+xml -application/vnd.ms-officetheme thmx -# application/vnd.ms-opentype -# application/vnd.ms-package.obfuscated-opentype -application/vnd.ms-pki.seccat cat -application/vnd.ms-pki.stl stl -# application/vnd.ms-playready.initiator+xml -application/vnd.ms-powerpoint ppt pps pot -application/vnd.ms-powerpoint.addin.macroenabled.12 ppam -application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm -application/vnd.ms-powerpoint.slide.macroenabled.12 sldm -application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm -application/vnd.ms-powerpoint.template.macroenabled.12 potm -# application/vnd.ms-printing.printticket+xml -application/vnd.ms-project mpp mpt -# application/vnd.ms-tnef -# application/vnd.ms-wmdrm.lic-chlg-req -# application/vnd.ms-wmdrm.lic-resp -# application/vnd.ms-wmdrm.meter-chlg-req -# application/vnd.ms-wmdrm.meter-resp -application/vnd.ms-word.document.macroenabled.12 docm -application/vnd.ms-word.template.macroenabled.12 dotm -application/vnd.ms-works wps wks wcm wdb -application/vnd.ms-wpl wpl -application/vnd.ms-xpsdocument xps -application/vnd.mseq mseq -# application/vnd.msign -# application/vnd.multiad.creator -# application/vnd.multiad.creator.cif -# application/vnd.music-niff -application/vnd.musician mus -application/vnd.muvee.style msty -application/vnd.mynfc taglet -# application/vnd.ncd.control -# application/vnd.ncd.reference -# application/vnd.nervana -# application/vnd.netfpx -application/vnd.neurolanguage.nlu nlu -application/vnd.nitf ntf nitf -application/vnd.noblenet-directory nnd -application/vnd.noblenet-sealer nns -application/vnd.noblenet-web nnw -# application/vnd.nokia.catalogs -# application/vnd.nokia.conml+wbxml -# application/vnd.nokia.conml+xml -# application/vnd.nokia.isds-radio-presets -# application/vnd.nokia.iptv.config+xml -# application/vnd.nokia.landmark+wbxml -# application/vnd.nokia.landmark+xml -# application/vnd.nokia.landmarkcollection+xml -# application/vnd.nokia.n-gage.ac+xml -application/vnd.nokia.n-gage.data ngdat -application/vnd.nokia.n-gage.symbian.install n-gage -# application/vnd.nokia.ncd -# application/vnd.nokia.pcd+wbxml -# application/vnd.nokia.pcd+xml -application/vnd.nokia.radio-preset rpst -application/vnd.nokia.radio-presets rpss -application/vnd.novadigm.edm edm -application/vnd.novadigm.edx edx -application/vnd.novadigm.ext ext -# application/vnd.ntt-local.file-transfer -# application/vnd.ntt-local.sip-ta_remote -# application/vnd.ntt-local.sip-ta_tcp_stream -application/vnd.oasis.opendocument.chart odc -application/vnd.oasis.opendocument.chart-template otc -application/vnd.oasis.opendocument.database odb -application/vnd.oasis.opendocument.formula odf -application/vnd.oasis.opendocument.formula-template odft -application/vnd.oasis.opendocument.graphics odg -application/vnd.oasis.opendocument.graphics-template otg -application/vnd.oasis.opendocument.image odi -application/vnd.oasis.opendocument.image-template oti -application/vnd.oasis.opendocument.presentation odp -application/vnd.oasis.opendocument.presentation-template otp -application/vnd.oasis.opendocument.spreadsheet ods -application/vnd.oasis.opendocument.spreadsheet-template ots -application/vnd.oasis.opendocument.text odt -application/vnd.oasis.opendocument.text-master odm -application/vnd.oasis.opendocument.text-template ott -application/vnd.oasis.opendocument.text-web oth -# application/vnd.obn -# application/vnd.oftn.l10n+json -# application/vnd.oipf.contentaccessdownload+xml -# application/vnd.oipf.contentaccessstreaming+xml -# application/vnd.oipf.cspg-hexbinary -# application/vnd.oipf.dae.svg+xml -# application/vnd.oipf.dae.xhtml+xml -# application/vnd.oipf.mippvcontrolmessage+xml -# application/vnd.oipf.pae.gem -# application/vnd.oipf.spdiscovery+xml -# application/vnd.oipf.spdlist+xml -# application/vnd.oipf.ueprofile+xml -# application/vnd.oipf.userprofile+xml -application/vnd.olpc-sugar xo -# application/vnd.oma-scws-config -# application/vnd.oma-scws-http-request -# application/vnd.oma-scws-http-response -# application/vnd.oma.bcast.associated-procedure-parameter+xml -# application/vnd.oma.bcast.drm-trigger+xml -# application/vnd.oma.bcast.imd+xml -# application/vnd.oma.bcast.ltkm -# application/vnd.oma.bcast.notification+xml -# application/vnd.oma.bcast.provisioningtrigger -# application/vnd.oma.bcast.sgboot -# application/vnd.oma.bcast.sgdd+xml -# application/vnd.oma.bcast.sgdu -# application/vnd.oma.bcast.simple-symbol-container -# application/vnd.oma.bcast.smartcard-trigger+xml -# application/vnd.oma.bcast.sprov+xml -# application/vnd.oma.bcast.stkm -# application/vnd.oma.cab-address-book+xml -# application/vnd.oma.cab-feature-handler+xml -# application/vnd.oma.cab-pcc+xml -# application/vnd.oma.cab-user-prefs+xml -# application/vnd.oma.dcd -# application/vnd.oma.dcdc -application/vnd.oma.dd2+xml dd2 -# application/vnd.oma.drm.risd+xml -# application/vnd.oma.group-usage-list+xml -# application/vnd.oma.pal+xml -# application/vnd.oma.poc.detailed-progress-report+xml -# application/vnd.oma.poc.final-report+xml -# application/vnd.oma.poc.groups+xml -# application/vnd.oma.poc.invocation-descriptor+xml -# application/vnd.oma.poc.optimized-progress-report+xml -# application/vnd.oma.push -# application/vnd.oma.scidm.messages+xml -# application/vnd.oma.xcap-directory+xml -# application/vnd.omads-email+xml -# application/vnd.omads-file+xml -# application/vnd.omads-folder+xml -# application/vnd.omaloc-supl-init -application/vnd.openofficeorg.extension oxt -# application/vnd.openxmlformats-officedocument.custom-properties+xml -# application/vnd.openxmlformats-officedocument.customxmlproperties+xml -# application/vnd.openxmlformats-officedocument.drawing+xml -# application/vnd.openxmlformats-officedocument.drawingml.chart+xml -# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml -# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml -# application/vnd.openxmlformats-officedocument.extended-properties+xml -# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml -# application/vnd.openxmlformats-officedocument.presentationml.comments+xml -# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml -# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml -application/vnd.openxmlformats-officedocument.presentationml.presentation pptx -# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml -application/vnd.openxmlformats-officedocument.presentationml.slide sldx -# application/vnd.openxmlformats-officedocument.presentationml.slide+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml -# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml -application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx -# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml -# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml -# application/vnd.openxmlformats-officedocument.presentationml.tags+xml -application/vnd.openxmlformats-officedocument.presentationml.template potx -# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml -# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml -application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx -# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml -# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml -# application/vnd.openxmlformats-officedocument.theme+xml -# application/vnd.openxmlformats-officedocument.themeoverride+xml -# application/vnd.openxmlformats-officedocument.vmldrawing -# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.document docx -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml -application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx -# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml -# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml -# application/vnd.openxmlformats-package.core-properties+xml -# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml -# application/vnd.openxmlformats-package.relationships+xml -# application/vnd.quobject-quoxdocument -# application/vnd.osa.netdeploy -application/vnd.osgeo.mapguide.package mgp -# application/vnd.osgi.bundle -application/vnd.osgi.dp dp -application/vnd.osgi.subsystem esa -# application/vnd.otps.ct-kip+xml -application/vnd.palm pdb pqa oprc -# application/vnd.paos.xml -application/vnd.pawaafile paw -application/vnd.pg.format str -application/vnd.pg.osasli ei6 -# application/vnd.piaccess.application-licence -application/vnd.picsel efif -application/vnd.pmi.widget wg -# application/vnd.poc.group-advertisement+xml -application/vnd.pocketlearn plf -application/vnd.powerbuilder6 pbd -# application/vnd.powerbuilder6-s -# application/vnd.powerbuilder7 -# application/vnd.powerbuilder7-s -# application/vnd.powerbuilder75 -# application/vnd.powerbuilder75-s -# application/vnd.preminet -application/vnd.previewsystems.box box -application/vnd.proteus.magazine mgz -application/vnd.publishare-delta-tree qps -application/vnd.pvi.ptid1 ptid -# application/vnd.pwg-multiplexed -# application/vnd.pwg-xhtml-print+xml -# application/vnd.qualcomm.brew-app-res -application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb -# application/vnd.radisys.moml+xml -# application/vnd.radisys.msml+xml -# application/vnd.radisys.msml-audit+xml -# application/vnd.radisys.msml-audit-conf+xml -# application/vnd.radisys.msml-audit-conn+xml -# application/vnd.radisys.msml-audit-dialog+xml -# application/vnd.radisys.msml-audit-stream+xml -# application/vnd.radisys.msml-conf+xml -# application/vnd.radisys.msml-dialog+xml -# application/vnd.radisys.msml-dialog-base+xml -# application/vnd.radisys.msml-dialog-fax-detect+xml -# application/vnd.radisys.msml-dialog-fax-sendrecv+xml -# application/vnd.radisys.msml-dialog-group+xml -# application/vnd.radisys.msml-dialog-speech+xml -# application/vnd.radisys.msml-dialog-transform+xml -# application/vnd.rainstor.data -# application/vnd.rapid -application/vnd.realvnc.bed bed -application/vnd.recordare.musicxml mxl -application/vnd.recordare.musicxml+xml musicxml -# application/vnd.renlearn.rlprint -application/vnd.rig.cryptonote cryptonote -application/vnd.rim.cod cod -application/vnd.rn-realmedia rm -application/vnd.rn-realmedia-vbr rmvb -application/vnd.route66.link66+xml link66 -# application/vnd.rs-274x -# application/vnd.ruckus.download -# application/vnd.s3sms -application/vnd.sailingtracker.track st -# application/vnd.sbm.cid -# application/vnd.sbm.mid2 -# application/vnd.scribus -# application/vnd.sealed.3df -# application/vnd.sealed.csf -# application/vnd.sealed.doc -# application/vnd.sealed.eml -# application/vnd.sealed.mht -# application/vnd.sealed.net -# application/vnd.sealed.ppt -# application/vnd.sealed.tiff -# application/vnd.sealed.xls -# application/vnd.sealedmedia.softseal.html -# application/vnd.sealedmedia.softseal.pdf -application/vnd.seemail see -application/vnd.sema sema -application/vnd.semd semd -application/vnd.semf semf -application/vnd.shana.informed.formdata ifm -application/vnd.shana.informed.formtemplate itp -application/vnd.shana.informed.interchange iif -application/vnd.shana.informed.package ipk -application/vnd.simtech-mindmapper twd twds -application/vnd.smaf mmf -# application/vnd.smart.notebook -application/vnd.smart.teacher teacher -# application/vnd.software602.filler.form+xml -# application/vnd.software602.filler.form-xml-zip -application/vnd.solent.sdkm+xml sdkm sdkd -application/vnd.spotfire.dxp dxp -application/vnd.spotfire.sfs sfs -# application/vnd.sss-cod -# application/vnd.sss-dtf -# application/vnd.sss-ntf -application/vnd.stardivision.calc sdc -application/vnd.stardivision.draw sda -application/vnd.stardivision.impress sdd -application/vnd.stardivision.math smf -application/vnd.stardivision.writer sdw vor -application/vnd.stardivision.writer-global sgl -application/vnd.stepmania.package smzip -application/vnd.stepmania.stepchart sm -# application/vnd.street-stream -application/vnd.sun.xml.calc sxc -application/vnd.sun.xml.calc.template stc -application/vnd.sun.xml.draw sxd -application/vnd.sun.xml.draw.template std -application/vnd.sun.xml.impress sxi -application/vnd.sun.xml.impress.template sti -application/vnd.sun.xml.math sxm -application/vnd.sun.xml.writer sxw -application/vnd.sun.xml.writer.global sxg -application/vnd.sun.xml.writer.template stw -# application/vnd.sun.wadl+xml -application/vnd.sus-calendar sus susp -application/vnd.svd svd -# application/vnd.swiftview-ics -application/vnd.symbian.install sis sisx -application/vnd.syncml+xml xsm -application/vnd.syncml.dm+wbxml bdm -application/vnd.syncml.dm+xml xdm -# application/vnd.syncml.dm.notification -# application/vnd.syncml.ds.notification -application/vnd.tao.intent-module-archive tao -application/vnd.tcpdump.pcap pcap cap dmp -application/vnd.tmobile-livetv tmo -application/vnd.trid.tpt tpt -application/vnd.triscape.mxs mxs -application/vnd.trueapp tra -# application/vnd.truedoc -# application/vnd.ubisoft.webplayer -application/vnd.ufdl ufd ufdl -application/vnd.uiq.theme utz -application/vnd.umajin umj -application/vnd.unity unityweb -application/vnd.uoml+xml uoml -# application/vnd.uplanet.alert -# application/vnd.uplanet.alert-wbxml -# application/vnd.uplanet.bearer-choice -# application/vnd.uplanet.bearer-choice-wbxml -# application/vnd.uplanet.cacheop -# application/vnd.uplanet.cacheop-wbxml -# application/vnd.uplanet.channel -# application/vnd.uplanet.channel-wbxml -# application/vnd.uplanet.list -# application/vnd.uplanet.list-wbxml -# application/vnd.uplanet.listcmd -# application/vnd.uplanet.listcmd-wbxml -# application/vnd.uplanet.signal -application/vnd.vcx vcx -# application/vnd.vd-study -# application/vnd.vectorworks -# application/vnd.verimatrix.vcas -# application/vnd.vidsoft.vidconference -application/vnd.visio vsd vst vss vsw -application/vnd.visionary vis -# application/vnd.vividence.scriptfile -application/vnd.vsf vsf -# application/vnd.wap.sic -# application/vnd.wap.slc -application/vnd.wap.wbxml wbxml -application/vnd.wap.wmlc wmlc -application/vnd.wap.wmlscriptc wmlsc -application/vnd.webturbo wtb -# application/vnd.wfa.wsc -# application/vnd.wmc -# application/vnd.wmf.bootstrap -# application/vnd.wolfram.mathematica -# application/vnd.wolfram.mathematica.package -application/vnd.wolfram.player nbp -application/vnd.wordperfect wpd -application/vnd.wqd wqd -# application/vnd.wrq-hp3000-labelled -application/vnd.wt.stf stf -# application/vnd.wv.csp+wbxml -# application/vnd.wv.csp+xml -# application/vnd.wv.ssp+xml -application/vnd.xara xar -application/vnd.xfdl xfdl -# application/vnd.xfdl.webform -# application/vnd.xmi+xml -# application/vnd.xmpie.cpkg -# application/vnd.xmpie.dpkg -# application/vnd.xmpie.plan -# application/vnd.xmpie.ppkg -# application/vnd.xmpie.xlim -application/vnd.yamaha.hv-dic hvd -application/vnd.yamaha.hv-script hvs -application/vnd.yamaha.hv-voice hvp -application/vnd.yamaha.openscoreformat osf -application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg -# application/vnd.yamaha.remote-setup -application/vnd.yamaha.smaf-audio saf -application/vnd.yamaha.smaf-phrase spf -# application/vnd.yamaha.through-ngn -# application/vnd.yamaha.tunnel-udpencap -application/vnd.yellowriver-custom-menu cmp -application/vnd.zul zir zirz -application/vnd.zzazz.deck+xml zaz -application/voicexml+xml vxml -# application/vq-rtcpxr -# application/watcherinfo+xml -# application/whoispp-query -# application/whoispp-response -application/widget wgt -application/winhlp hlp -# application/wita -# application/wordperfect5.1 -application/wsdl+xml wsdl -application/wspolicy+xml wspolicy -application/x-7z-compressed 7z -application/x-abiword abw -application/x-ace-compressed ace -# application/x-amf -application/x-apple-diskimage dmg -application/x-authorware-bin aab x32 u32 vox -application/x-authorware-map aam -application/x-authorware-seg aas -application/x-bcpio bcpio -application/x-bittorrent torrent -application/x-blorb blb blorb -application/x-bzip bz -application/x-bzip2 bz2 boz -application/x-cbr cbr cba cbt cbz cb7 -application/x-cdlink vcd -application/x-cfs-compressed cfs -application/x-chat chat -application/x-chess-pgn pgn -application/x-conference nsc -# application/x-compress -application/x-cpio cpio -application/x-csh csh -application/x-debian-package deb udeb -application/x-dgc-compressed dgc -application/x-director dir dcr dxr cst cct cxt w3d fgd swa -application/x-doom wad -application/x-dtbncx+xml ncx -application/x-dtbook+xml dtb -application/x-dtbresource+xml res -application/x-dvi dvi -application/x-envoy evy -application/x-eva eva -application/x-font-bdf bdf -# application/x-font-dos -# application/x-font-framemaker -application/x-font-ghostscript gsf -# application/x-font-libgrx -application/x-font-linux-psf psf -application/x-font-otf otf -application/x-font-pcf pcf -application/x-font-snf snf -# application/x-font-speedo -# application/x-font-sunos-news -application/x-font-ttf ttf ttc -application/x-font-type1 pfa pfb pfm afm -application/font-woff woff -# application/x-font-vfont -application/x-freearc arc -application/x-futuresplash spl -application/x-gca-compressed gca -application/x-glulx ulx -application/x-gnumeric gnumeric -application/x-gramps-xml gramps -application/x-gtar gtar -# application/x-gzip -application/x-hdf hdf -application/x-install-instructions install -application/x-iso9660-image iso -application/x-java-jnlp-file jnlp -application/x-latex latex -application/x-lzh-compressed lzh lha -application/x-mie mie -application/x-mobipocket-ebook prc mobi -application/x-ms-application application -application/x-ms-shortcut lnk -application/x-ms-wmd wmd -application/x-ms-wmz wmz -application/x-ms-xbap xbap -application/x-msaccess mdb -application/x-msbinder obd -application/x-mscardfile crd -application/x-msclip clp -application/x-msdownload exe dll com bat msi -application/x-msmediaview mvb m13 m14 -application/x-msmetafile wmf wmz emf emz -application/x-msmoney mny -application/x-mspublisher pub -application/x-msschedule scd -application/x-msterminal trm -application/x-mswrite wri -application/x-netcdf nc cdf -application/x-nzb nzb -application/x-pkcs12 p12 pfx -application/x-pkcs7-certificates p7b spc -application/x-pkcs7-certreqresp p7r -application/x-rar-compressed rar -application/x-research-info-systems ris -application/x-sh sh -application/x-shar shar -application/x-shockwave-flash swf -application/x-silverlight-app xap -application/x-sql sql -application/x-stuffit sit -application/x-stuffitx sitx -application/x-subrip srt -application/x-sv4cpio sv4cpio -application/x-sv4crc sv4crc -application/x-t3vm-image t3 -application/x-tads gam -application/x-tar tar -application/x-tcl tcl -application/x-tex tex -application/x-tex-tfm tfm -application/x-texinfo texinfo texi -application/x-tgif obj -application/x-ustar ustar -application/x-wais-source src -application/x-x509-ca-cert der crt -application/x-xfig fig -application/x-xliff+xml xlf -application/x-xpinstall xpi -application/x-xz xz -application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 -# application/x400-bp -application/xaml+xml xaml -# application/xcap-att+xml -# application/xcap-caps+xml -application/xcap-diff+xml xdf -# application/xcap-el+xml -# application/xcap-error+xml -# application/xcap-ns+xml -# application/xcon-conference-info-diff+xml -# application/xcon-conference-info+xml -application/xenc+xml xenc -application/xhtml+xml xhtml xht -# application/xhtml-voice+xml -application/xml xml xsl -application/xml-dtd dtd -# application/xml-external-parsed-entity -# application/xmpp+xml -application/xop+xml xop -application/xproc+xml xpl -application/xslt+xml xslt -application/xspf+xml xspf -application/xv+xml mxml xhvml xvml xvm -application/yang yang -application/yin+xml yin -application/zip zip -# audio/1d-interleaved-parityfec -# audio/32kadpcm -# audio/3gpp -# audio/3gpp2 -# audio/ac3 -audio/adpcm adp -# audio/amr -# audio/amr-wb -# audio/amr-wb+ -# audio/asc -# audio/atrac-advanced-lossless -# audio/atrac-x -# audio/atrac3 -audio/basic au snd -# audio/bv16 -# audio/bv32 -# audio/clearmode -# audio/cn -# audio/dat12 -# audio/dls -# audio/dsr-es201108 -# audio/dsr-es202050 -# audio/dsr-es202211 -# audio/dsr-es202212 -# audio/dv -# audio/dvi4 -# audio/eac3 -# audio/evrc -# audio/evrc-qcp -# audio/evrc0 -# audio/evrc1 -# audio/evrcb -# audio/evrcb0 -# audio/evrcb1 -# audio/evrcwb -# audio/evrcwb0 -# audio/evrcwb1 -# audio/example -# audio/fwdred -# audio/g719 -# audio/g722 -# audio/g7221 -# audio/g723 -# audio/g726-16 -# audio/g726-24 -# audio/g726-32 -# audio/g726-40 -# audio/g728 -# audio/g729 -# audio/g7291 -# audio/g729d -# audio/g729e -# audio/gsm -# audio/gsm-efr -# audio/gsm-hr-08 -# audio/ilbc -# audio/ip-mr_v2.5 -# audio/isac -# audio/l16 -# audio/l20 -# audio/l24 -# audio/l8 -# audio/lpc -audio/midi mid midi kar rmi -# audio/mobile-xmf -audio/mp4 mp4a -# audio/mp4a-latm -# audio/mpa -# audio/mpa-robust -audio/mpeg mpga mp2 mp2a mp3 m2a m3a -# audio/mpeg4-generic -# audio/musepack -audio/ogg oga ogg spx -# audio/opus -# audio/parityfec -# audio/pcma -# audio/pcma-wb -# audio/pcmu-wb -# audio/pcmu -# audio/prs.sid -# audio/qcelp -# audio/red -# audio/rtp-enc-aescm128 -# audio/rtp-midi -# audio/rtx -audio/s3m s3m -audio/silk sil -# audio/smv -# audio/smv0 -# audio/smv-qcp -# audio/sp-midi -# audio/speex -# audio/t140c -# audio/t38 -# audio/telephone-event -# audio/tone -# audio/uemclip -# audio/ulpfec -# audio/vdvi -# audio/vmr-wb -# audio/vnd.3gpp.iufp -# audio/vnd.4sb -# audio/vnd.audiokoz -# audio/vnd.celp -# audio/vnd.cisco.nse -# audio/vnd.cmles.radio-events -# audio/vnd.cns.anp1 -# audio/vnd.cns.inf1 -audio/vnd.dece.audio uva uvva -audio/vnd.digital-winds eol -# audio/vnd.dlna.adts -# audio/vnd.dolby.heaac.1 -# audio/vnd.dolby.heaac.2 -# audio/vnd.dolby.mlp -# audio/vnd.dolby.mps -# audio/vnd.dolby.pl2 -# audio/vnd.dolby.pl2x -# audio/vnd.dolby.pl2z -# audio/vnd.dolby.pulse.1 -audio/vnd.dra dra -audio/vnd.dts dts -audio/vnd.dts.hd dtshd -# audio/vnd.dvb.file -# audio/vnd.everad.plj -# audio/vnd.hns.audio -audio/vnd.lucent.voice lvp -audio/vnd.ms-playready.media.pya pya -# audio/vnd.nokia.mobile-xmf -# audio/vnd.nortel.vbk -audio/vnd.nuera.ecelp4800 ecelp4800 -audio/vnd.nuera.ecelp7470 ecelp7470 -audio/vnd.nuera.ecelp9600 ecelp9600 -# audio/vnd.octel.sbc -# audio/vnd.qcelp -# audio/vnd.rhetorex.32kadpcm -audio/vnd.rip rip -# audio/vnd.sealedmedia.softseal.mpeg -# audio/vnd.vmx.cvsd -# audio/vorbis -# audio/vorbis-config -audio/webm weba -audio/x-aac aac -audio/x-aiff aif aiff aifc -audio/x-caf caf -audio/x-flac flac -audio/x-matroska mka -audio/x-mpegurl m3u -audio/x-ms-wax wax -audio/x-ms-wma wma -audio/x-pn-realaudio ram ra -audio/x-pn-realaudio-plugin rmp -# audio/x-tta -audio/x-wav wav -audio/xm xm -chemical/x-cdx cdx -chemical/x-cif cif -chemical/x-cmdf cmdf -chemical/x-cml cml -chemical/x-csml csml -# chemical/x-pdb -chemical/x-xyz xyz -image/bmp bmp -image/cgm cgm -# image/example -# image/fits -image/g3fax g3 -image/gif gif -image/ief ief -# image/jp2 -image/jpeg jpeg jpg jpe -# image/jpm -# image/jpx -image/ktx ktx -# image/naplps -image/png png -image/prs.btif btif -# image/prs.pti -image/sgi sgi -image/svg+xml svg svgz -# image/t38 -image/tiff tiff tif -# image/tiff-fx -image/vnd.adobe.photoshop psd -# image/vnd.cns.inf2 -image/vnd.dece.graphic uvi uvvi uvg uvvg -image/vnd.dvb.subtitle sub -image/vnd.djvu djvu djv -image/vnd.dwg dwg -image/vnd.dxf dxf -image/vnd.fastbidsheet fbs -image/vnd.fpx fpx -image/vnd.fst fst -image/vnd.fujixerox.edmics-mmr mmr -image/vnd.fujixerox.edmics-rlc rlc -# image/vnd.globalgraphics.pgb -# image/vnd.microsoft.icon -# image/vnd.mix -image/vnd.ms-modi mdi -image/vnd.ms-photo wdp -image/vnd.net-fpx npx -# image/vnd.radiance -# image/vnd.sealed.png -# image/vnd.sealedmedia.softseal.gif -# image/vnd.sealedmedia.softseal.jpg -# image/vnd.svf -image/vnd.wap.wbmp wbmp -image/vnd.xiff xif -image/webp webp -image/x-3ds 3ds -image/x-cmu-raster ras -image/x-cmx cmx -image/x-freehand fh fhc fh4 fh5 fh7 -image/x-icon ico -image/x-mrsid-image sid -image/x-pcx pcx -image/x-pict pic pct -image/x-portable-anymap pnm -image/x-portable-bitmap pbm -image/x-portable-graymap pgm -image/x-portable-pixmap ppm -image/x-rgb rgb -image/x-tga tga -image/x-xbitmap xbm -image/x-xpixmap xpm -image/x-xwindowdump xwd -# message/cpim -# message/delivery-status -# message/disposition-notification -# message/example -# message/external-body -# message/feedback-report -# message/global -# message/global-delivery-status -# message/global-disposition-notification -# message/global-headers -# message/http -# message/imdn+xml -# message/news -# message/partial -message/rfc822 eml mime -# message/s-http -# message/sip -# message/sipfrag -# message/tracking-status -# message/vnd.si.simp -# model/example -model/iges igs iges -model/mesh msh mesh silo -model/vnd.collada+xml dae -model/vnd.dwf dwf -# model/vnd.flatland.3dml -model/vnd.gdl gdl -# model/vnd.gs-gdl -# model/vnd.gs.gdl -model/vnd.gtw gtw -# model/vnd.moml+xml -model/vnd.mts mts -# model/vnd.parasolid.transmit.binary -# model/vnd.parasolid.transmit.text -model/vnd.vtu vtu -model/vrml wrl vrml -model/x3d+binary x3db x3dbz -model/x3d+vrml x3dv x3dvz -model/x3d+xml x3d x3dz -# multipart/alternative -# multipart/appledouble -# multipart/byteranges -# multipart/digest -# multipart/encrypted -# multipart/example -# multipart/form-data -# multipart/header-set -# multipart/mixed -# multipart/parallel -# multipart/related -# multipart/report -# multipart/signed -# multipart/voice-message -# text/1d-interleaved-parityfec -text/cache-manifest appcache -text/calendar ics ifb -text/css css -text/csv csv -# text/directory -# text/dns -# text/ecmascript -# text/enriched -# text/example -# text/fwdred -text/html html htm -# text/javascript -text/n3 n3 -# text/parityfec -text/plain txt text conf def list log in -# text/prs.fallenstein.rst -text/prs.lines.tag dsc -# text/vnd.radisys.msml-basic-layout -# text/red -# text/rfc822-headers -text/richtext rtx -# text/rtf -# text/rtp-enc-aescm128 -# text/rtx -text/sgml sgml sgm -# text/t140 -text/tab-separated-values tsv -text/troff t tr roff man me ms -text/turtle ttl -# text/ulpfec -text/uri-list uri uris urls -text/vcard vcard -# text/vnd.abc -text/vnd.curl curl -text/vnd.curl.dcurl dcurl -text/vnd.curl.scurl scurl -text/vnd.curl.mcurl mcurl -# text/vnd.dmclientscript -text/vnd.dvb.subtitle sub -# text/vnd.esmertec.theme-descriptor -text/vnd.fly fly -text/vnd.fmi.flexstor flx -text/vnd.graphviz gv -text/vnd.in3d.3dml 3dml -text/vnd.in3d.spot spot -# text/vnd.iptc.newsml -# text/vnd.iptc.nitf -# text/vnd.latex-z -# text/vnd.motorola.reflex -# text/vnd.ms-mediapackage -# text/vnd.net2phone.commcenter.command -# text/vnd.si.uricatalogue -text/vnd.sun.j2me.app-descriptor jad -# text/vnd.trolltech.linguist -# text/vnd.wap.si -# text/vnd.wap.sl -text/vnd.wap.wml wml -text/vnd.wap.wmlscript wmls -text/x-asm s asm -text/x-c c cc cxx cpp h hh dic -text/x-fortran f for f77 f90 -text/x-java-source java -text/x-opml opml -text/x-pascal p pas -text/x-nfo nfo -text/x-setext etx -text/x-sfv sfv -text/x-uuencode uu -text/x-vcalendar vcs -text/x-vcard vcf -# text/xml -# text/xml-external-parsed-entity -# video/1d-interleaved-parityfec -video/3gpp 3gp -# video/3gpp-tt -video/3gpp2 3g2 -# video/bmpeg -# video/bt656 -# video/celb -# video/dv -# video/example -video/h261 h261 -video/h263 h263 -# video/h263-1998 -# video/h263-2000 -video/h264 h264 -# video/h264-rcdo -# video/h264-svc -video/jpeg jpgv -# video/jpeg2000 -video/jpm jpm jpgm -video/mj2 mj2 mjp2 -# video/mp1s -# video/mp2p -# video/mp2t -video/mp4 mp4 mp4v mpg4 -# video/mp4v-es -video/mpeg mpeg mpg mpe m1v m2v -# video/mpeg4-generic -# video/mpv -# video/nv -video/ogg ogv -# video/parityfec -# video/pointer -video/quicktime qt mov -# video/raw -# video/rtp-enc-aescm128 -# video/rtx -# video/smpte292m -# video/ulpfec -# video/vc1 -# video/vnd.cctv -video/vnd.dece.hd uvh uvvh -video/vnd.dece.mobile uvm uvvm -# video/vnd.dece.mp4 -video/vnd.dece.pd uvp uvvp -video/vnd.dece.sd uvs uvvs -video/vnd.dece.video uvv uvvv -# video/vnd.directv.mpeg -# video/vnd.directv.mpeg-tts -# video/vnd.dlna.mpeg-tts -video/vnd.dvb.file dvb -video/vnd.fvt fvt -# video/vnd.hns.video -# video/vnd.iptvforum.1dparityfec-1010 -# video/vnd.iptvforum.1dparityfec-2005 -# video/vnd.iptvforum.2dparityfec-1010 -# video/vnd.iptvforum.2dparityfec-2005 -# video/vnd.iptvforum.ttsavc -# video/vnd.iptvforum.ttsmpeg2 -# video/vnd.motorola.video -# video/vnd.motorola.videop -video/vnd.mpegurl mxu m4u -video/vnd.ms-playready.media.pyv pyv -# video/vnd.nokia.interleaved-multimedia -# video/vnd.nokia.videovoip -# video/vnd.objectvideo -# video/vnd.sealed.mpeg1 -# video/vnd.sealed.mpeg4 -# video/vnd.sealed.swf -# video/vnd.sealedmedia.softseal.mov -video/vnd.uvvu.mp4 uvu uvvu -video/vnd.vivo viv -video/webm webm -video/x-f4v f4v -video/x-fli fli -video/x-flv flv -video/x-m4v m4v -video/x-matroska mkv mk3d mks -video/x-mng mng -video/x-ms-asf asf asx -video/x-ms-vob vob -video/x-ms-wm wm -video/x-ms-wmv wmv -video/x-ms-wmx wmx -video/x-ms-wvx wvx -video/x-msvideo avi -video/x-sgi-movie movie -video/x-smv smv -x-conference/x-cooltalk ice diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types deleted file mode 100644 index 55b2cf794eef92..00000000000000 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types +++ /dev/null @@ -1,77 +0,0 @@ -# What: WebVTT -# Why: To allow formats intended for marking up external text track resources. -# http://dev.w3.org/html5/webvtt/ -# Added by: niftylettuce -text/vtt vtt - -# What: Google Chrome Extension -# Why: To allow apps to (work) be served with the right content type header. -# http://codereview.chromium.org/2830017 -# Added by: niftylettuce -application/x-chrome-extension crx - -# What: HTC support -# Why: To properly render .htc files such as CSS3PIE -# Added by: niftylettuce -text/x-component htc - -# What: HTML5 application cache manifes ('.manifest' extension) -# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps -# per https://developer.mozilla.org/en/offline_resources_in_firefox -# Added by: louisremi -text/cache-manifest manifest - -# What: node binary buffer format -# Why: semi-standard extension w/in the node community -# Added by: tootallnate -application/octet-stream buffer - -# What: The "protected" MP-4 formats used by iTunes. -# Why: Required for streaming music to browsers (?) -# Added by: broofa -application/mp4 m4p -audio/mp4 m4a - -# What: Video format, Part of RFC1890 -# Why: See https://github.com/bentomas/node-mime/pull/6 -# Added by: mjrusso -video/MP2T ts - -# What: EventSource mime type -# Why: mime type of Server-Sent Events stream -# http://www.w3.org/TR/eventsource/#text-event-stream -# Added by: francois2metz -text/event-stream event-stream - -# What: Mozilla App manifest mime type -# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests -# Added by: ednapiranha -application/x-web-app-manifest+json webapp - -# What: Lua file types -# Why: Googling around shows de-facto consensus on these -# Added by: creationix (Issue #45) -text/x-lua lua -application/x-lua-bytecode luac - -# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax -# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown -# Added by: avoidwork -text/x-markdown markdown md mkd - -# What: ini files -# Why: because they're just text files -# Added by: Matthew Kastor -text/plain ini - -# What: DASH Adaptive Streaming manifest -# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video -# Added by: eelcocramer -application/dash+xml mdp - -# What: OpenType font files - http://www.microsoft.com/typography/otspec/ -# Why: Browsers usually ignore the font MIME types and sniff the content, -# but Chrome, shows a warning if OpenType fonts aren't served with -# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. -# Added by: alrra -font/opentype otf 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 7700d99929d572..7f1adae9624580 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 @@ -6,7 +6,7 @@ }, "name": "form-data", "description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", - "version": "0.1.4", + "version": "0.2.0", "repository": { "type": "git", "url": "git://github.com/felixge/node-form-data.git" @@ -19,9 +19,9 @@ "node": ">= 0.8" }, "dependencies": { + "async": "~0.9.0", "combined-stream": "~0.0.4", - "mime": "~1.2.11", - "async": "~0.9.0" + "mime-types": "~2.0.3" }, "licenses": [ { @@ -35,15 +35,15 @@ "formidable": "~1.0.14", "request": "~2.36.0" }, - "gitHead": "5f5f4809ea685f32658809fa0f13d7eface0e45a", + "gitHead": "dfc1a2aef40b97807e2ffe477da06cb2c37e259f", "bugs": { "url": "https://github.com/felixge/node-form-data/issues" }, "homepage": "https://github.com/felixge/node-form-data", - "_id": "form-data@0.1.4", - "_shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "_from": "form-data@>=0.1.0 <0.2.0", - "_npmVersion": "1.4.14", + "_id": "form-data@0.2.0", + "_shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466", + "_from": "form-data@>=0.2.0 <0.3.0", + "_npmVersion": "1.4.28", "_npmUser": { "name": "alexindigo", "email": "iam@alexindigo.com" @@ -71,10 +71,10 @@ } ], "dist": { - "shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz" + "shasum": "26f8bc26da6440e299cbdcfb69035c4f77a6e466", + "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json index 8c68193cd1ed8d..abd8125afc2a22 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json @@ -32,32 +32,14 @@ "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi", "test": "tap ./tst" }, - "_npmUser": { - "name": "mcavage", - "email": "mcavage@gmail.com" + "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why. If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n var Ber = require('asn1').Ber;\n\n var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n reader.readSequence();\n console.log('Sequence len: ' + reader.length);\n if (reader.peek() === Ber.Boolean)\n console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n var Ber = require('asn1').Ber;\n\n var writer = new Ber.Writer();\n\n writer.startSequence();\n writer.writeBoolean(true);\n writer.endSequence();\n\n console.log(writer.buffer);\n\n## Installation\n\n npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee .\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/mcavage/node-asn1/issues" }, + "homepage": "https://github.com/mcavage/node-asn1", "_id": "asn1@0.1.11", - "_engineSupported": true, - "_npmVersion": "1.1.0-beta-4", - "_nodeVersion": "v0.6.6", - "_defaultsLoaded": true, - "dist": { - "shasum": "559be18376d08a4ec4dbe80877d27818639b2df7", - "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" - }, - "maintainers": [ - { - "name": "mcavage", - "email": "mcavage@gmail.com" - } - ], - "directories": {}, "_shasum": "559be18376d08a4ec4dbe80877d27818639b2df7", "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", - "_from": "asn1@0.1.11", - "bugs": { - "url": "https://github.com/mcavage/node-asn1/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/mcavage/node-asn1" + "_from": "asn1@0.1.11" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json index d06cbfd7347cfd..99d9d48ab80cf0 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json @@ -13,26 +13,11 @@ "engines": { "node": ">=0.6" }, + "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing. Like\n`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks\nlike this:\n\n var assert = require('assert-plus');\n\n function fooAccount(options, callback) {\n\t assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n // Do stuff\n\t\tcallback(null, {});\n }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object. (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n function test(foo) {\n\t assert.string(foo, 'foo');\n }\n\nThere you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n function test(foo) {\n\t assert.arrayOfString(foo, 'foo');\n }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\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,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee .\n", + "readmeFilename": "README.md", "_id": "assert-plus@0.1.2", - "dist": { - "shasum": "d93ffdbb67ac5507779be316a7d65146417beef8", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz" - }, - "_npmVersion": "1.1.59", - "_npmUser": { - "name": "mcavage", - "email": "mcavage@gmail.com" - }, - "maintainers": [ - { - "name": "mcavage", - "email": "mcavage@gmail.com" - } - ], - "directories": {}, "_shasum": "d93ffdbb67ac5507779be316a7d65146417beef8", "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz", "_from": "assert-plus@0.1.2", - "readme": "ERROR: No README data found!", "scripts": {} } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md index f039427fa9091a..a43093bf321f2b 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -1,2 +1,21 @@ -Copyright (c) 2010-2012 Robert Kieffer -MIT License - http://opensource.org/licenses/mit-license.php +The MIT License (MIT) + +Copyright (c) 2010-2012 Robert Kieffer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +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/node-uuid/README.md b/deps/npm/node_modules/request/node_modules/node-uuid/README.md index e436a89f82bfe4..b7d04c94071085 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/README.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/README.md @@ -10,6 +10,7 @@ Features: * Cryptographically strong random # generation on supporting platforms * 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) * [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) +* Comes with a Command Line Interface for generating uuids on the command line ## Getting Started @@ -160,13 +161,48 @@ uuid() has become uuid.v4(), and the `format` argument is now implicit in the `b The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. +## Command Line Interface + +To use the executable, it's probably best to install this library globally. + +`npm install -g node-uuid` + +Usage: + +``` +USAGE: uuid [version] [options] + + +options: + +--help Display this message and exit +``` + +`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied. + +### Examples + +``` +> uuid +3a91f950-dec8-4688-ba14-5b7bbfc7a563 +``` + +``` +> uuid v1 +9d0b43e0-7696-11e3-964b-250efa37a98e +``` + +``` +> uuid v4 +6790ac7c-24ac-4f98-8464-42f6d98a53ae +``` + ## Testing In node.js ``` -> cd test -> node test.js +npm test ``` In Browser diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/bin/uuid b/deps/npm/node_modules/request/node_modules/node-uuid/bin/uuid new file mode 100755 index 00000000000000..f732e9918e00b4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/node-uuid/bin/uuid @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var path = require('path'); +var uuid = require(path.join(__dirname, '..')); + +var arg = process.argv[2]; + +if ('--help' === arg) { + console.log('\n USAGE: uuid [version] [options]\n\n'); + console.log(' options:\n'); + console.log(' --help Display this message and exit\n'); + process.exit(0); +} + +if (null == arg) { + console.log(uuid()); + process.exit(0); +} + +if ('v1' !== arg && 'v4' !== arg) { + console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); + process.exit(1); +} + +console.log(uuid[arg]()); +process.exit(0); diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index bead110cc36a33..9753671020d63c 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -17,25 +17,34 @@ "email": "dev@tavan.de" } ], + "bin": { + "uuid": "./bin/uuid" + }, + "scripts": { + "test": "node test/test.js" + }, "lib": ".", "main": "./uuid.js", "repository": { "type": "git", "url": "https://github.com/broofa/node-uuid.git" }, - "version": "1.4.1", - "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", - "readmeFilename": "README.md", + "version": "1.4.2", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" + } + ], + "gitHead": "14c42d2568977f7ddfc02399bd2a6b09e2cfbe5f", "bugs": { "url": "https://github.com/broofa/node-uuid/issues" }, - "_id": "node-uuid@1.4.1", - "dist": { - "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" - }, + "homepage": "https://github.com/broofa/node-uuid", + "_id": "node-uuid@1.4.2", + "_shasum": "907db3d11b7b6a2cf4f905fb7199f14ae7379ba0", "_from": "node-uuid@>=1.4.0 <1.5.0", - "_npmVersion": "1.3.6", + "_npmVersion": "1.4.28", "_npmUser": { "name": "broofa", "email": "robert@broofa.com" @@ -46,9 +55,11 @@ "email": "robert@broofa.com" } ], + "dist": { + "shasum": "907db3d11b7b6a2cf4f905fb7199f14ae7379ba0", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz" + }, "directories": {}, - "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz", - "homepage": "https://github.com/broofa/node-uuid", - "scripts": {} + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js b/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js index 2fac6dc4b97a4c..5e2257f0933119 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js +++ b/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js @@ -14,9 +14,9 @@ // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html // // Moderately fast, high quality - if (typeof(require) == 'function') { + if (typeof(_global.require) == 'function') { try { - var _rb = require('crypto').randomBytes; + var _rb = _global.require('crypto').randomBytes; _rng = _rb && function() {return _rb(16);}; } catch(e) {} } @@ -49,7 +49,7 @@ } // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; + var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array; // Maps for number <-> hex string conversion var _byteToHex = []; diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js index 3a86aca12e772e..bdfd14e1866e31 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js @@ -6,6 +6,10 @@ function sha1 (key, body) { return crypto.createHmac('sha1', key).update(body).digest('base64') } +function rsa (key, body) { + return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64'); +} + function rfc3986 (str) { return encodeURIComponent(str) .replace(/!/g,'%21') @@ -37,7 +41,7 @@ function compare (a, b) { return a > b ? 1 : a < b ? -1 : 0 } -function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { +function generateBase (httpMethod, base_uri, params) { // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature @@ -69,6 +73,11 @@ function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) rfc3986(normalized) ].join('&') + return base +} + +function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { + var base = generateBase(httpMethod, base_uri, params) var key = [ consumer_secret || '', token_secret || '' @@ -77,5 +86,31 @@ function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) return sha1(key, base) } +function rsasign (httpMethod, base_uri, params, private_key, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = private_key || '' + + return rsa(key, base) +} + +function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { + var method + + switch (signMethod) { + case 'RSA-SHA1': + method = rsasign + break + case 'HMAC-SHA1': + method = hmacsign + break + default: + throw new Error("Signature method not supported: " + signMethod) + } + + return method.apply(null, [].slice.call(arguments, 1)) +} + exports.hmacsign = hmacsign +exports.rsasign = rsasign +exports.sign = sign exports.rfc3986 = rfc3986 diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index d8765b6e9faac0..d49bfb746c6356 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -6,7 +6,7 @@ }, "name": "oauth-sign", "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "version": "0.4.0", + "version": "0.5.0", "repository": { "url": "https://github.com/mikeal/oauth-sign" }, @@ -20,18 +20,15 @@ "scripts": { "test": "node test.js" }, - "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n", - "readmeFilename": "README.md", + "gitHead": "6fea86c2d4a38e1b3780ad0cc56f00196e5213c1", "bugs": { "url": "https://github.com/mikeal/oauth-sign/issues" }, - "_id": "oauth-sign@0.4.0", - "dist": { - "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz" - }, - "_from": "oauth-sign@>=0.4.0 <0.5.0", - "_npmVersion": "1.3.2", + "homepage": "https://github.com/mikeal/oauth-sign", + "_id": "oauth-sign@0.5.0", + "_shasum": "d767f5169325620eab2e087ef0c472e773db6461", + "_from": "oauth-sign@>=0.5.0 <0.6.0", + "_npmVersion": "2.0.0", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -42,8 +39,11 @@ "email": "mikeal.rogers@gmail.com" } ], + "dist": { + "shasum": "d767f5169325620eab2e087ef0c472e773db6461", + "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz" + }, "directories": {}, - "_shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz", - "homepage": "https://github.com/mikeal/oauth-sign" + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md new file mode 100644 index 00000000000000..c6214d5da7c384 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md @@ -0,0 +1,67 @@ + +## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=open) +- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/deps/npm/node_modules/request/node_modules/qs/Makefile b/deps/npm/node_modules/request/node_modules/qs/Makefile index 600a700ec64ed7..31cc899d4ad78f 100644 --- a/deps/npm/node_modules/request/node_modules/qs/Makefile +++ b/deps/npm/node_modules/request/node_modules/qs/Makefile @@ -1,8 +1,8 @@ test: - @node node_modules/lab/bin/lab + @node node_modules/lab/bin/lab -a code -L test-cov: - @node node_modules/lab/bin/lab -t 100 + @node node_modules/lab/bin/lab -a code -t 100 -L test-cov-html: - @node node_modules/lab/bin/lab -r html -o coverage.html + @node node_modules/lab/bin/lab -a code -L -r html -o coverage.html -.PHONY: test test-cov test-cov-html \ No newline at end of file +.PHONY: test test-cov test-cov-html diff --git a/deps/npm/node_modules/request/node_modules/qs/Readme.md b/deps/npm/node_modules/request/node_modules/qs/Readme.md index b8618877c03806..21bf3faf3e224e 100755 --- a/deps/npm/node_modules/request/node_modules/qs/Readme.md +++ b/deps/npm/node_modules/request/node_modules/qs/Readme.md @@ -20,7 +20,7 @@ var str = Qs.stringify(obj); // 'a=c' ### Parsing Objects ```javascript -Qs.parse(string, [depth], [delimiter]); +Qs.parse(string, [options]); ``` **qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. @@ -74,22 +74,36 @@ By default, when nesting objects **qs** will only parse up to 5 children deep. T } ``` -This depth can be overridden by passing a `depth` option to `Qs.parse(string, depth)`: +This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`: ```javascript -Qs.parse('a[b][c][d][e][f][g][h][i]=j', 1); +Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); // { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } ``` -The depth limit mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +Qs.parse('a=b&c=d', { parameterLimit: 1 }); +// { a: 'b' } +``` An optional delimiter can also be passed: ```javascript -Qs.parse('a=b;c=d', ';'); +Qs.parse('a=b;c=d', { delimiter: ';' }); // { a: 'b', c: 'd' } ``` +Delimiters can be a regular expression too: + +```javascript +Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +// { a: 'b', c: 'd', e: 'f' } +``` + ### Parsing Arrays **qs** can also parse arrays using a similar `[]` notation: @@ -132,6 +146,15 @@ Qs.parse('a[100]=b'); // { a: { '100': 'b' } } ``` +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +Qs.parse('a[1]=b', { arrayLimit: 0 }); +// { a: { '1': 'b' } } +``` + +To disable array parsing entirely, set `arrayLimit` to `-1`. + If you mix notations, **qs** will merge the two items into an object: ```javascript @@ -149,7 +172,7 @@ Qs.parse('a[][b]=c'); ### Stringifying ```javascript -Qs.stringify(object, [delimiter]); +Qs.stringify(object, [options]); ``` When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: @@ -163,13 +186,20 @@ Qs.stringify({ a: { b: 'c' } }); Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. -When arrays are stringified, they are always given explicit indices: +When arrays are stringified, by default they are given explicit indices: ```javascript Qs.stringify({ a: ['b', 'c', 'd'] }); // 'a[0]=b&a[1]=c&a[2]=d' ``` +You may override this by setting the `indices` option to `false`: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + Empty strings and null values will omit the value, but the equals sign (=) remains in place: ```javascript @@ -187,6 +217,6 @@ Qs.stringify({ a: null, b: undefined }); The delimiter may be overridden with stringify as well: ```javascript -Qs.stringify({ a: 'b', c: 'd' }, ';'); +Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }); // 'a=b;c=d' ``` diff --git a/deps/npm/node_modules/request/node_modules/qs/index.js b/deps/npm/node_modules/request/node_modules/qs/index.js index bb0a047c4f60c5..2291cd85825de4 100644 --- a/deps/npm/node_modules/request/node_modules/qs/index.js +++ b/deps/npm/node_modules/request/node_modules/qs/index.js @@ -1 +1 @@ -module.exports = require('./lib'); +module.exports = require('./lib/'); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js index 4a3fdd974a10b9..4e7d02a1bf68f9 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js @@ -9,16 +9,14 @@ var internals = { delimiter: '&', depth: 5, arrayLimit: 20, - parametersLimit: 1000 + parameterLimit: 1000 }; -internals.parseValues = function (str, delimiter) { - - delimiter = typeof delimiter === 'string' ? delimiter : internals.delimiter; +internals.parseValues = function (str, options) { var obj = {}; - var parts = str.split(delimiter, internals.parametersLimit); + var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); for (var i = 0, il = parts.length; i < il; ++i) { var part = parts[i]; @@ -31,7 +29,7 @@ internals.parseValues = function (str, delimiter) { var key = Utils.decode(part.slice(0, pos)); var val = Utils.decode(part.slice(pos + 1)); - if (!obj[key]) { + if (!obj.hasOwnProperty(key)) { obj[key] = val; } else { @@ -44,7 +42,7 @@ internals.parseValues = function (str, delimiter) { }; -internals.parseObject = function (chain, val) { +internals.parseObject = function (chain, val, options) { if (!chain.length) { return val; @@ -55,20 +53,23 @@ internals.parseObject = function (chain, val) { var obj = {}; if (root === '[]') { obj = []; - obj = obj.concat(internals.parseObject(chain, val)); + obj = obj.concat(internals.parseObject(chain, val, options)); } else { var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; var index = parseInt(cleanRoot, 10); + var indexString = '' + index; if (!isNaN(index) && root !== cleanRoot && - index <= internals.arrayLimit) { + indexString === cleanRoot && + index >= 0 && + index <= options.arrayLimit) { obj = []; - obj[index] = internals.parseObject(chain, val); + obj[index] = internals.parseObject(chain, val, options); } else { - obj[cleanRoot] = internals.parseObject(chain, val); + obj[cleanRoot] = internals.parseObject(chain, val, options); } } @@ -76,7 +77,7 @@ internals.parseObject = function (chain, val) { }; -internals.parseKeys = function (key, val, depth) { +internals.parseKeys = function (key, val, options) { if (!key) { return; @@ -107,7 +108,7 @@ internals.parseKeys = function (key, val, depth) { // Loop through children appending to the array until we hit depth var i = 0; - while ((segment = child.exec(key)) !== null && i < depth) { + while ((segment = child.exec(key)) !== null && i < options.depth) { ++i; if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { @@ -121,11 +122,11 @@ internals.parseKeys = function (key, val, depth) { keys.push('[' + key.slice(segment.index) + ']'); } - return internals.parseObject(keys, val); + return internals.parseObject(keys, val, options); }; -module.exports = function (str, depth, delimiter) { +module.exports = function (str, options) { if (str === '' || str === null || @@ -134,21 +135,22 @@ module.exports = function (str, depth, delimiter) { return {}; } - if (typeof depth !== 'number') { - delimiter = depth; - depth = internals.depth; - } + options = options || {}; + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - var tempObj = typeof str === 'string' ? internals.parseValues(str, delimiter) : Utils.clone(str); + var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; var obj = {}; // Iterate over the keys and setup the new object - // - for (var key in tempObj) { - if (tempObj.hasOwnProperty(key)) { - var newObj = internals.parseKeys(key, tempObj[key], depth); - obj = Utils.merge(obj, newObj); - } + + var keys = Object.keys(tempObj); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var newObj = internals.parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj); } return Utils.compact(obj); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js index 1cc3df9fc34e24..b4411047fd6b2a 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js @@ -1,16 +1,19 @@ // Load modules +var Utils = require('./utils'); + // Declare internals var internals = { - delimiter: '&' + delimiter: '&', + indices: true }; -internals.stringify = function (obj, prefix) { +internals.stringify = function (obj, prefix, options) { - if (Buffer.isBuffer(obj)) { + if (Utils.isBuffer(obj)) { obj = obj.toString(); } else if (obj instanceof Date) { @@ -29,9 +32,20 @@ internals.stringify = function (obj, prefix) { var values = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']')); + if (typeof obj === 'undefined') { + return values; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + if (!options.indices && + Array.isArray(obj)) { + + values = values.concat(internals.stringify(obj[key], prefix, options)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', options)); } } @@ -39,16 +53,24 @@ internals.stringify = function (obj, prefix) { }; -module.exports = function (obj, delimiter) { +module.exports = function (obj, options) { - delimiter = typeof delimiter === 'undefined' ? internals.delimiter : delimiter; + options = options || {}; + var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + options.indices = typeof options.indices === 'boolean' ? options.indices : internals.indices; var keys = []; - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - keys = keys.concat(internals.stringify(obj[key], key)); - } + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var objKeys = Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + keys = keys.concat(internals.stringify(obj[key], key, options)); } return keys.join(delimiter); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js index 3f5c149d50377f..5240bd5b0fa7eb 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js @@ -20,54 +20,32 @@ exports.arrayToObject = function (source) { }; -exports.clone = function (source) { - - if (typeof source !== 'object' || - source === null) { - - return source; - } - - if (Buffer.isBuffer(source)) { - return source.toString(); - } - - var obj = Array.isArray(source) ? [] : {}; - for (var i in source) { - if (source.hasOwnProperty(i)) { - obj[i] = exports.clone(source[i]); - } - } - - return obj; -}; - - exports.merge = function (target, source) { if (!source) { return target; } - var obj = exports.clone(target); - - if (Array.isArray(source)) { - for (var i = 0, il = source.length; i < il; ++i) { - if (typeof source[i] !== 'undefined') { - if (typeof obj[i] === 'object') { - obj[i] = exports.merge(obj[i], source[i]); - } - else { - obj[i] = source[i]; - } - } + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else { + target[source] = true; } - return obj; + return target; } - if (Array.isArray(obj)) { - obj = exports.arrayToObject(obj); + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target); } var keys = Object.keys(source); @@ -75,22 +53,15 @@ exports.merge = function (target, source) { var key = keys[k]; var value = source[key]; - if (value && - typeof value === 'object') { - - if (!obj[key]) { - obj[key] = exports.clone(value); - } - else { - obj[key] = exports.merge(obj[key], value); - } + if (!target[key]) { + target[key] = value; } else { - obj[key] = value; + target[key] = exports.merge(target[key], value); } } - return obj; + return target; }; @@ -104,30 +75,58 @@ exports.decode = function (str) { }; -exports.compact = function (obj) { +exports.compact = function (obj, refs) { + + if (typeof obj !== 'object' || + obj === null) { - if (typeof obj !== 'object' || obj === null) { return obj; } - var compacted = {}; + refs = refs || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); - for (var key in obj) { - if (obj.hasOwnProperty(key)) { - if (Array.isArray(obj[key])) { - compacted[key] = []; + if (Array.isArray(obj)) { + var compacted = []; - for (var i = 0, l = obj[key].length; i < l; i++) { - if (typeof obj[key][i] !== 'undefined') { - compacted[key].push(obj[key][i]); - } - } - } - else { - compacted[key] = exports.compact(obj[key]); + for (var i = 0, il = obj.length; i < il; ++i) { + if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); } } + + return compacted; + } + + var keys = Object.keys(obj); + for (i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + + +exports.isBuffer = function (obj) { + + if (obj === null || + typeof obj === 'undefined') { + + return false; } - return compacted; + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); }; diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json old mode 100755 new mode 100644 index d65387274f20e0..8d17dfce1670ca --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -1,12 +1,13 @@ { "name": "qs", - "version": "1.2.2", + "version": "2.3.3", "description": "A querystring parser that supports nesting and arrays, with a depth limit", "homepage": "https://github.com/hapijs/qs", "main": "index.js", "dependencies": {}, "devDependencies": { - "lab": "3.x.x" + "code": "1.x.x", + "lab": "5.x.x" }, "scripts": { "test": "make test-cov" @@ -19,27 +20,24 @@ "querystring", "qs" ], - "author": { - "name": "Nathan LaFreniere", - "email": "quitlahok@gmail.com" - }, "licenses": [ { "type": "BSD", "url": "http://github.com/hapijs/qs/raw/master/LICENSE" } ], - "gitHead": "bd9455fea88d1c51a80dbf57ef0f99b4e553177d", + "gitHead": "9250c4cda5102fcf72441445816e6d311fc6813d", "bugs": { "url": "https://github.com/hapijs/qs/issues" }, - "_id": "qs@1.2.2", - "_shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "_from": "qs@>=1.2.0 <1.3.0", - "_npmVersion": "1.4.21", + "_id": "qs@2.3.3", + "_shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404", + "_from": "qs@>=2.3.1 <2.4.0", + "_npmVersion": "2.1.6", + "_nodeVersion": "0.10.32", "_npmUser": { - "name": "hueniverse", - "email": "eran@hueniverse.com" + "name": "nlf", + "email": "quitlahok@gmail.com" }, "maintainers": [ { @@ -52,10 +50,10 @@ } ], "dist": { - "shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "tarball": "http://registry.npmjs.org/qs/-/qs-1.2.2.tgz" + "shasum": "e9e85adbe75da0bbe4c8e0476a086290f863b404", + "tarball": "http://registry.npmjs.org/qs/-/qs-2.3.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz", + "_resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/qs/test/parse.js b/deps/npm/node_modules/request/node_modules/qs/test/parse.js index c00e7becfceead..6c20cc1be0dc53 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/parse.js @@ -1,5 +1,7 @@ +/* eslint no-extend-native:0 */ // Load modules +var Code = require('code'); var Lab = require('lab'); var Qs = require('../'); @@ -11,14 +13,13 @@ var internals = {}; // Test shortcuts -var expect = Lab.expect; -var before = Lab.before; -var after = Lab.after; -var describe = Lab.experiment; -var it = Lab.test; +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; -describe('#parse', function () { +describe('parse()', function () { it('parses a simple string', function (done) { @@ -62,8 +63,8 @@ describe('#parse', function () { it('only parses one level when depth = 1', function (done) { - expect(Qs.parse('a[b][c]=d', 1)).to.deep.equal({ a: { b: { '[c]': 'd' } } }); - expect(Qs.parse('a[b][c][d]=e', 1)).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); + expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } }); + expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); done(); }); @@ -81,6 +82,17 @@ describe('#parse', function () { done(); }); + it('parses a mix of simple and explicit arrays', function (done) { + + expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + it('parses a nested array', function (done) { expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); @@ -103,6 +115,12 @@ describe('#parse', function () { done(); }); + it('supports keys that begin with a number', function (done) { + + expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } }); + done(); + }); + it('supports encoded = signs', function (done) { expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); @@ -142,6 +160,12 @@ describe('#parse', function () { done(); }); + it('can add keys to objects', function (done) { + + expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); + done(); + }); + it('correctly prunes undefined values when converting an array to an object', function (done) { expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); @@ -189,6 +213,7 @@ describe('#parse', function () { expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] }); + expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] }); done(); }); @@ -205,10 +230,10 @@ describe('#parse', function () { done(); }); - it('parses buffers to strings', function (done) { + it('parses buffers correctly', function (done) { var b = new Buffer('test'); - expect(Qs.parse({ a: b })).to.deep.equal({ a: b.toString() }); + expect(Qs.parse({ a: b })).to.deep.equal({ a: b }); done(); }); @@ -247,29 +272,55 @@ describe('#parse', function () { done(); }); - it('parses a string with an alternative delimiter', function (done) { + it('parses a string with an alternative string delimiter', function (done) { + + expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('parses a string with an alternative RegExp delimiter', function (done) { + + expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not use non-splittable objects as delimiters', function (done) { - expect(Qs.parse('a=b;c=d', ';')).to.deep.equal({ a: 'b', c: 'd' }); + expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' }); done(); }); - it('does not use non-string objects as delimiters', function (done) { + it('allows overriding parameter limit', function (done) { - expect(Qs.parse('a=b&c=d', {})).to.deep.equal({ a: 'b', c: 'd' }); + expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' }); + done(); + }); + + it('allows setting the parameter limit to Infinity', function (done) { + + expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('allows overriding array limit', function (done) { + + expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); + expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); + expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); done(); }); it('parses an object', function (done) { var input = { - "user[name]": {"pop[bob]": 3}, - "user[email]": null + 'user[name]': {'pop[bob]': 3}, + 'user[email]': null }; var expected = { - "user": { - "name": {"pop[bob]": 3}, - "email": null + 'user': { + 'name': {'pop[bob]': 3}, + 'email': null } }; @@ -282,14 +333,14 @@ describe('#parse', function () { it('parses an object and not child values', function (done) { var input = { - "user[name]": {"pop[bob]": { "test": 3 }}, - "user[email]": null + 'user[name]': {'pop[bob]': { 'test': 3 }}, + 'user[email]': null }; var expected = { - "user": { - "name": {"pop[bob]": { "test": 3 }}, - "email": null + 'user': { + 'name': {'pop[bob]': { 'test': 3 }}, + 'email': null } }; @@ -298,4 +349,65 @@ describe('#parse', function () { expect(result).to.deep.equal(expected); done(); }); + + it('does not blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = Qs.parse('a=b&c=d'); + global.Buffer = tempBuffer; + expect(result).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not crash when using invalid dot notation', function (done) { + + expect(Qs.parse('roomInfoList[0].childrenAges[0]=15&roomInfoList[0].numberOfAdults=2')).to.deep.equal({ roomInfoList: [['15', '2']] }); + done(); + }); + + it('does not crash when parsing circular references', function (done) { + + var a = {}; + a.b = a; + + var parsed; + + expect(function () { + + parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }).to.not.throw(); + + expect(parsed).to.contain('foo'); + expect(parsed.foo).to.contain('bar', 'baz'); + expect(parsed.foo.bar).to.equal('baz'); + expect(parsed.foo.baz).to.deep.equal(a); + done(); + }); + + it('parses plain objects correctly', function (done) { + + var a = Object.create(null); + a.b = 'c'; + + expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); + var result = Qs.parse({ a: a }); + expect(result).to.contain('a'); + expect(result.a).to.deep.equal(a); + done(); + }); + + it('parses dates correctly', function (done) { + + var now = new Date(); + expect(Qs.parse({ a: now })).to.deep.equal({ a: now }); + done(); + }); + + it('parses regular expressions correctly', function (done) { + + var re = /^test$/; + expect(Qs.parse({ a: re })).to.deep.equal({ a: re }); + done(); + }); }); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js index 7bf1df4b59e1cf..75e397a749ae18 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js @@ -1,5 +1,7 @@ +/* eslint no-extend-native:0 */ // Load modules +var Code = require('code'); var Lab = require('lab'); var Qs = require('../'); @@ -11,14 +13,13 @@ var internals = {}; // Test shortcuts -var expect = Lab.expect; -var before = Lab.before; -var after = Lab.after; -var describe = Lab.experiment; -var it = Lab.test; +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; -describe('#stringify', function () { +describe('stringify()', function () { it('stringifies a querystring object', function (done) { @@ -41,6 +42,12 @@ describe('#stringify', function () { done(); }); + it('omits array indices when asked', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); + done(); + }); + it('stringifies a nested array value', function (done) { expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); @@ -54,6 +61,12 @@ describe('#stringify', function () { done(); }); + it('does not omit object keys when indices = false', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); + done(); + }); + it('stringifies a complicated object', function (done) { expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); @@ -69,6 +82,34 @@ describe('#stringify', function () { done(); }); + it('stringifies an empty object', function (done) { + + var obj = Object.create(null); + obj.a = 'b'; + expect(Qs.stringify(obj)).to.equal('a=b'); + done(); + }); + + it('returns an empty string for invalid input', function (done) { + + expect(Qs.stringify(undefined)).to.equal(''); + expect(Qs.stringify(false)).to.equal(''); + expect(Qs.stringify(null)).to.equal(''); + expect(Qs.stringify('')).to.equal(''); + done(); + }); + + it('stringifies an object with an empty object as a child', function (done) { + + var obj = { + a: Object.create(null) + }; + + obj.a.b = 'c'; + expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); + done(); + }); + it('drops keys with a value of undefined', function (done) { expect(Qs.stringify({ a: undefined })).to.equal(''); @@ -123,7 +164,16 @@ describe('#stringify', function () { it('stringifies an object using an alternative delimiter', function (done) { - expect(Qs.stringify({ a: 'b', c: 'd' }, ';')).to.equal('a=b;c=d'); + expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d'); + done(); + }); + + it('doesn\'t blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d'); + global.Buffer = tempBuffer; done(); }); }); diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json old mode 100755 new mode 100644 index d68d512fd1d002..51cd6947b9e141 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -7,17 +7,17 @@ "util", "utility" ], - "version": "2.46.0", + "version": "2.51.0", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, "repository": { "type": "git", - "url": "https://github.com/mikeal/request.git" + "url": "https://github.com/request/request.git" }, "bugs": { - "url": "http://github.com/mikeal/request/issues" + "url": "http://github.com/request/request/issues" }, "license": "Apache-2.0", "engines": { @@ -26,36 +26,46 @@ "main": "index.js", "dependencies": { "bl": "~0.9.0", - "caseless": "~0.6.0", + "caseless": "~0.8.0", "forever-agent": "~0.5.0", - "form-data": "~0.1.0", + "form-data": "~0.2.0", "json-stringify-safe": "~5.0.0", "mime-types": "~1.0.1", "node-uuid": "~1.4.0", - "qs": "~1.2.0", + "qs": "~2.3.1", "tunnel-agent": "~0.4.0", "tough-cookie": ">=0.12.0", "http-signature": "~0.10.0", - "oauth-sign": "~0.4.0", + "oauth-sign": "~0.5.0", "hawk": "1.1.1", "aws-sign2": "~0.5.0", - "stringstream": "~0.0.4" + "stringstream": "~0.0.4", + "combined-stream": "~0.0.5" }, "scripts": { - "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js", + "test": "npm run lint && node node_modules/.bin/taper tests/test-*.js && npm run test-browser", + "test-browser": "browserify tests/browser/test.js -o tests/browser/test-browser.js && karma start tests/browser/karma.conf.js", "lint": "node node_modules/.bin/eslint lib/ *.js tests/ && echo Lint passed." }, "devDependencies": { + "browserify": "~5.9.1", + "coveralls": "~2.11.2", "eslint": "0.5.1", + "function-bind": "~1.0.0", + "istanbul": "~0.3.2", + "karma": "~0.12.21", + "karma-cli": "0.0.4", + "karma-phantomjs-launcher": "~0.1.4", + "karma-tap": "~1.0.1", "rimraf": "~2.2.8", "tape": "~3.0.0", "taper": "~0.3.0" }, - "gitHead": "7cdd75ec184868bba3be88a780bfb6e10fe33be4", - "homepage": "https://github.com/mikeal/request", - "_id": "request@2.46.0", - "_shasum": "359195d52eaf720bc69742579d04ad6d265a8274", - "_from": "request@>=2.46.0 <2.47.0", + "gitHead": "1c8aca6a9205df58660c676005fb8ec4603d5265", + "homepage": "https://github.com/request/request", + "_id": "request@2.51.0", + "_shasum": "35d00bbecc012e55f907b1bd9e0dbd577bfef26e", + "_from": "request@>=2.51.0 <2.52.0", "_npmVersion": "1.4.14", "_npmUser": { "name": "nylen", @@ -69,13 +79,17 @@ { "name": "nylen", "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" } ], "dist": { - "shasum": "359195d52eaf720bc69742579d04ad6d265a8274", - "tarball": "http://registry.npmjs.org/request/-/request-2.46.0.tgz" + "shasum": "35d00bbecc012e55f907b1bd9e0dbd577bfef26e", + "tarball": "http://registry.npmjs.org/request/-/request-2.51.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/request/-/request-2.46.0.tgz", + "_resolved": "https://registry.npmjs.org/request/-/request-2.51.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/release.sh b/deps/npm/node_modules/request/release.sh index 05e7767fc1025c..7678bf8d8b691b 100755 --- a/deps/npm/node_modules/request/release.sh +++ b/deps/npm/node_modules/request/release.sh @@ -1,3 +1,45 @@ #!/bin/sh -npm version minor && npm publish && npm version patch && git push --tags && git push origin master +if [ -z "`which github-changes`" ]; then + # specify version because github-changes "is under heavy development. Things + # may break between releases" until 0.1.0 + echo "First, do: [sudo] npm install -g github-changes@0.0.14" + exit 1 +fi + +if [ -d .git/refs/remotes/upstream ]; then + remote=upstream +else + remote=origin +fi + +# Increment v2.x.y -> v2.x+1.0 +npm version minor || exit 1 + +# Generate changelog from pull requests +github-changes -o request -r request \ + --auth --verbose \ + --file CHANGELOG.md \ + --only-pulls --use-commit-body \ + --date-format '(YYYY/MM/DD)' \ + || exit 1 + +# Since the tag for the new version hasn't been pushed yet, any changes in it +# will be marked as "upcoming" +version="$(grep '"version"' package.json | cut -d'"' -f4)" +sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md + +# This may fail if no changelog updates +# TODO: would this ever actually happen? handle it better? +git add CHANGELOG.md; git commit -m 'Update changelog' + +# Publish the new version to npm +npm publish || exit 1 + +# Increment v2.x.0 -> v2.x.1 +# For rationale, see: +# https://github.com/request/oauth-sign/issues/10#issuecomment-58917018 +npm version patch || exit 1 + +# Push back to the main repo +git push $remote master --tags || exit 1 diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index 466d9165588ef0..90220d2ba4037a 100644 --- a/deps/npm/node_modules/request/request.js +++ b/deps/npm/node_modules/request/request.js @@ -25,6 +25,7 @@ var http = require('http') , copy = require('./lib/copy') , debug = require('./lib/debug') , net = require('net') + , CombinedStream = require('combined-stream') var safeStringify = helpers.safeStringify , md5 = helpers.md5 @@ -56,7 +57,6 @@ var defaultProxyHeaderWhiteList = [ 'expect', 'max-forwards', 'pragma', - 'proxy-authorization', 'referer', 'te', 'transfer-encoding', @@ -64,6 +64,10 @@ var defaultProxyHeaderWhiteList = [ 'via' ] +var defaultProxyHeaderExclusiveList = [ + 'proxy-authorization' +] + function filterForNonReserved(reserved, options) { // Filter out properties that are not reserved. // Reserved values are passed in at call site. @@ -111,9 +115,15 @@ function constructProxyHost(uriObject) { } function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { + var whiteList = proxyHeaderWhiteList + .reduce(function (set, header) { + set[header.toLowerCase()] = true + return set + }, {}) + return Object.keys(headers) .filter(function (header) { - return proxyHeaderWhiteList.indexOf(header.toLowerCase()) !== -1 + return whiteList[header.toLowerCase()] }) .reduce(function (set, header) { set[header] = headers[header] @@ -123,23 +133,13 @@ function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { function construcTunnelOptions(request) { var proxy = request.proxy - var proxyHeaders = request.proxyHeaders - var proxyAuth - - if (proxy.auth) { - proxyAuth = proxy.auth - } - - if (!proxy.auth && request.proxyAuthorization) { - proxyHeaders['Proxy-Authorization'] = request.proxyAuthorization - } var tunnelOptions = { proxy: { host: proxy.hostname, port: +proxy.port, - proxyAuth: proxyAuth, - headers: proxyHeaders + proxyAuth: proxy.auth, + headers: request.proxyHeaders }, rejectUnauthorized: request.rejectUnauthorized, headers: request.headers, @@ -199,7 +199,8 @@ function getProxyFromURI(uri) { } } else { noProxyItem = noProxyItem.replace(/^\.*/, '.') - if (hostname.indexOf(noProxyItem) === hostname.length - noProxyItem.length) { + var isMatchedAt = hostname.indexOf(noProxyItem) + if (isMatchedAt > -1 && isMatchedAt === hostname.length - noProxyItem.length) { return null } } @@ -303,14 +304,28 @@ Request.prototype.setupTunnel = function () { return false } + // Always include `defaultProxyHeaderExclusiveList` + + if (!self.proxyHeaderExclusiveList) { + self.proxyHeaderExclusiveList = [] + } + + var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) + + // Treat `proxyHeaderExclusiveList` as part of `proxyHeaderWhiteList` + if (!self.proxyHeaderWhiteList) { self.proxyHeaderWhiteList = defaultProxyHeaderWhiteList } + var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) + var proxyHost = constructProxyHost(self.uri) - self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, self.proxyHeaderWhiteList) + self.proxyHeaders = constructProxyHeaderWhiteList(self.headers, proxyHeaderWhiteList) self.proxyHeaders.host = proxyHost + proxyHeaderExclusiveList.forEach(self.removeHeader, self) + var tunnelFn = getTunnelFn(self) var tunnelOptions = construcTunnelOptions(self) @@ -331,12 +346,6 @@ Request.prototype.init = function (options) { caseless.httpify(self, self.headers) - // Never send proxy-auth to the endpoint! - if (self.hasHeader('proxy-authorization')) { - self.proxyAuthorization = self.getHeader('proxy-authorization') - self.removeHeader('proxy-authorization') - } - if (!self.method) { self.method = options.method || 'GET' } @@ -447,11 +456,12 @@ Request.prototype.init = function (options) { self.setHost = false if (!self.hasHeader('host')) { - self.setHeader('host', self.uri.hostname) + var hostHeaderName = self.originalHostHeaderName || 'host' + self.setHeader(hostHeaderName, self.uri.hostname) if (self.uri.port) { if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && !(self.uri.port === 443 && self.uri.protocol === 'https:') ) { - self.setHeader('host', self.getHeader('host') + (':' + self.uri.port) ) + self.setHeader(hostHeaderName, self.getHeader('host') + (':' + self.uri.port) ) } } self.setHost = true @@ -556,17 +566,12 @@ Request.prototype.init = function (options) { self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) } - if (self.proxy && !self.tunnel) { - if (self.proxy.auth && !self.proxyAuthorization) { - var proxyAuthPieces = self.proxy.auth.split(':').map(function(item){ - return querystring.unescape(item) - }) - var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) - self.proxyAuthorization = authHeader - } - if (self.proxyAuthorization) { - self.setHeader('proxy-authorization', self.proxyAuthorization) - } + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function(item){ + return querystring.unescape(item) + }) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) } if (self.proxy && !self.tunnel) { @@ -575,7 +580,8 @@ Request.prototype.init = function (options) { if (options.json) { self.json(options.json) - } else if (options.multipart) { + } + if (options.multipart) { self.boundary = uuid() self.multipart(options.multipart) } @@ -634,15 +640,7 @@ Request.prototype.init = function (options) { if (self.pool === false) { self.agent = false } else { - self.agent = self.agent || self.getAgent() - if (self.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.maxSockets - } - if (self.pool.maxSockets) { - // Don't use our pooling if node has the refactored client - self.agent.maxSockets = self.pool.maxSockets - } + self.agent = self.agent || self.getNewAgent() } self.on('pipe', function (src) { @@ -684,6 +682,9 @@ Request.prototype.init = function (options) { if (self._form) { self._form.pipe(self) } + if (self._multipart) { + self._multipart.pipe(self) + } if (self.body) { if (Array.isArray(self.body)) { self.body.forEach(function (part) { @@ -753,7 +754,7 @@ Request.prototype._updateProtocol = function () { // if there's an agent, we need to get a new one. if (self.agent) { - self.agent = self.getAgent() + self.agent = self.getNewAgent() } } else { @@ -774,12 +775,12 @@ Request.prototype._updateProtocol = function () { // if there's an agent, then get a new one. if (self.agent) { self.agent = null - self.agent = self.getAgent() + self.agent = self.getNewAgent() } } } -Request.prototype.getAgent = function () { +Request.prototype.getNewAgent = function () { var self = this var Agent = self.agentClass var options = {} @@ -816,16 +817,6 @@ Request.prototype.getAgent = function () { poolKey += Agent.name } - if (!self.httpModule.globalAgent) { - // node 0.4.x - options.host = self.host - options.port = self.port - if (poolKey) { - poolKey += ':' - } - poolKey += self.host + ':' + self.port - } - // ca option is only relevant if proxy or destination are https var proxy = self.proxy if (typeof proxy === 'string') { @@ -885,6 +876,10 @@ Request.prototype.getAgent = function () { // generate a new agent for this setting if none yet exists if (!self.pool[poolKey]) { self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } } return self.pool[poolKey] @@ -1015,8 +1010,13 @@ Request.prototype.onRequestResponse = function (response) { } // Save the original host before any redirect (if it changes, we need to - // remove any authorization headers) - self.originalHost = self.headers.host + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } if (self.setHost) { self.removeHeader('host') } @@ -1308,7 +1308,7 @@ Request.prototype.onRequestResponse = function (response) { if (self._json) { try { - response.body = JSON.parse(response.body) + response.body = JSON.parse(response.body, self._jsonReviver) } catch (e) {} } debug('emitting complete', self.uri.href) @@ -1421,12 +1421,23 @@ Request.prototype.form = function (form) { } Request.prototype.multipart = function (multipart) { var self = this - self.body = [] - if (!self.hasHeader('content-type')) { + var chunked = (multipart instanceof Array) || (multipart.chunked === undefined) || multipart.chunked + multipart = multipart.data || multipart + + var items = chunked ? new CombinedStream() : [] + function add (part) { + return chunked ? items.append(part) : items.push(new Buffer(part)) + } + + if (chunked) { + self.setHeader('transfer-encoding', 'chunked') + } + + var headerName = self.hasHeader('content-type') + if (!headerName || self.headers[headerName].indexOf('multipart') === -1) { self.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) } else { - var headerName = self.hasHeader('content-type') self.setHeader(headerName, self.headers[headerName].split(';')[0] + '; boundary=' + self.boundary) } @@ -1435,7 +1446,7 @@ Request.prototype.multipart = function (multipart) { } if (self.preambleCRLF) { - self.body.push(new Buffer('\r\n')) + add('\r\n') } multipart.forEach(function (part) { @@ -1443,22 +1454,23 @@ Request.prototype.multipart = function (multipart) { if(typeof body === 'undefined') { throw new Error('Body attribute missing in multipart.') } - delete part.body var preamble = '--' + self.boundary + '\r\n' Object.keys(part).forEach(function (key) { + if (key === 'body') { return } preamble += key + ': ' + part[key] + '\r\n' }) preamble += '\r\n' - self.body.push(new Buffer(preamble)) - self.body.push(new Buffer(body)) - self.body.push(new Buffer('\r\n')) + add(preamble) + add(body) + add('\r\n') }) - self.body.push(new Buffer('--' + self.boundary + '--')) + add('--' + self.boundary + '--') if (self.postambleCRLF) { - self.body.push(new Buffer('\r\n')) + add('\r\n') } + self[chunked ? '_multipart' : 'body'] = items return self } Request.prototype.json = function (val) { @@ -1470,7 +1482,7 @@ Request.prototype.json = function (val) { self._json = true if (typeof val === 'boolean') { - if (typeof self.body === 'object') { + if (self.body !== undefined && self.getHeader('content-type') !== 'application/x-www-form-urlencoded') { self.body = safeStringify(self.body) if (!self.hasHeader('content-type')) { self.setHeader('content-type', 'application/json') @@ -1483,6 +1495,10 @@ Request.prototype.json = function (val) { } } + if (typeof self.jsonReviver === 'function') { + self._jsonReviver = self.jsonReviver + } + return self } Request.prototype.getHeader = function (name, headers) { @@ -1617,17 +1633,26 @@ Request.prototype.oauth = function (_oauth) { if (!oa.oauth_nonce) { oa.oauth_nonce = uuid().replace(/-/g, '') } + if (!oa.oauth_signature_method) { + oa.oauth_signature_method = 'HMAC-SHA1' + } - oa.oauth_signature_method = 'HMAC-SHA1' - - var consumer_secret = oa.oauth_consumer_secret + var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key delete oa.oauth_consumer_secret + delete oa.oauth_private_key var token_secret = oa.oauth_token_secret delete oa.oauth_token_secret var baseurl = self.uri.protocol + '//' + self.uri.host + self.uri.pathname var params = self.qsLib.parse([].concat(query, form, self.qsLib.stringify(oa)).join('&')) - var signature = oauth.hmacsign(self.method, baseurl, params, consumer_secret, token_secret) + + var signature = oauth.sign( + oa.oauth_signature_method, + self.method, + baseurl, + params, + consumer_secret_or_private_key, + token_secret) var realm = _oauth.realm ? 'realm="' + _oauth.realm + '",' : '' var authHeader = 'OAuth ' + realm + @@ -1736,6 +1761,9 @@ Request.prototype.destroy = function () { Request.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList.slice() +Request.defaultProxyHeaderExclusiveList = + defaultProxyHeaderExclusiveList.slice() + // Exports Request.prototype.toJSON = requestToJSON diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 7e1961d45781a3..1ec80895463b61 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -16,12 +16,12 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | -d ] + Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] Test if version(s) satisfy the supplied range(s), and sort them. Multiple versions or ranges may be supplied, unless increment - or decrement options are specified. In that case, only a single - version may be used, and it is incremented by the specified level + option is specified. In that case, only a single version may + be used, and it is incremented by the specified level Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. @@ -101,6 +101,30 @@ the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the *next* set of prerelease versions. +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +````javascript +> semver.inc('1.2.3', 'pre', 'beta') +'1.2.4-beta.0' +``` + +command-line example: + +```shell +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```shell +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + ### Advanced Range Syntax Advanced range syntax desugars to primitive comparators in @@ -161,8 +185,6 @@ comparator. Allows minor-level changes if not. `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. -Note: this is the same as the `~>` operator in rubygems. - #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` Allows changes that do not modify the left-most non-zero digit in the @@ -245,6 +267,9 @@ strings that they parse. `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. ### Ranges diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index a22dc9737fd804..51326d7a307d04 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "4.1.0", + "version": "4.2.0", "description": "The semantic version parser used by npm.", "main": "semver.js", "browser": "semver.browser.js", @@ -21,16 +21,16 @@ "bin": { "semver": "./bin/semver" }, - "gitHead": "f8db569b9fd00788d14064aaf81854ed81e1337a", + "gitHead": "f353d3337dd9bef990b6873e281342260b4e63ae", "bugs": { "url": "https://github.com/isaacs/node-semver/issues" }, "homepage": "https://github.com/isaacs/node-semver", - "_id": "semver@4.1.0", - "_shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", - "_from": "semver@>=4.1.0 <5.0.0", - "_npmVersion": "2.1.3", - "_nodeVersion": "0.10.31", + "_id": "semver@4.2.0", + "_shasum": "a571fd4adbe974fe32bd9cb4c5e249606f498423", + "_from": "semver@>=4.2.0 <4.3.0", + "_npmVersion": "2.1.14", + "_nodeVersion": "0.10.33", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -46,10 +46,10 @@ } ], "dist": { - "shasum": "bc80a9ff68532814362cc3cfda3c7b75ed9c321c", - "tarball": "http://registry.npmjs.org/semver/-/semver-4.1.0.tgz" + "shasum": "a571fd4adbe974fe32bd9cb4c5e249606f498423", + "tarball": "http://registry.npmjs.org/semver/-/semver-4.2.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/semver/-/semver-4.1.0.tgz", + "_resolved": "https://registry.npmjs.org/semver/-/semver-4.2.0.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/semver/semver.browser.js b/deps/npm/node_modules/semver/semver.browser.js index 712de835cb72b7..49d785650e04b9 100644 --- a/deps/npm/node_modules/semver/semver.browser.js +++ b/deps/npm/node_modules/semver/semver.browser.js @@ -454,6 +454,33 @@ function inc(version, release, loose, identifier) { } } +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; diff --git a/deps/npm/node_modules/semver/semver.browser.js.gz b/deps/npm/node_modules/semver/semver.browser.js.gz index e3066055506fd6..c6b27c9ad311eb 100644 Binary files a/deps/npm/node_modules/semver/semver.browser.js.gz and b/deps/npm/node_modules/semver/semver.browser.js.gz differ diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index 22673fdd1937d4..026173eabcde45 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -464,6 +464,33 @@ function inc(version, release, loose, identifier) { } } +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; diff --git a/deps/npm/node_modules/semver/semver.min.js b/deps/npm/node_modules/semver/semver.min.js index 56c9249e1ca3af..2f07e16ed3dd52 100644 --- a/deps/npm/node_modules/semver/semver.min.js +++ b/deps/npm/node_modules/semver/semver.min.js @@ -1 +1 @@ -(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var l=n++;t[l]="(?:"+t[s]+"|"+t[a]+")";var p=n++;t[p]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var c=n++;t[c]="(?:-?("+t[l]+"(?:\\."+t[l]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[p]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[c]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var N=n++;t[N]="^"+t[A]+t[k]+"$";var P=n++;t[P]="^"+t[y]+"\\s*("+w+")$|^$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+g+")$|^$";var q=n++;t[q]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[$]+")";r[q]=new RegExp(t[q],"g");var L="$1$2$3";var X=n++;t[X]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var _=n++;t[_]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new H(e,t).inc(r,n).version}catch(i){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=lr;function lr(e,r){if(e instanceof lr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof lr))return new lr(e,r);this.loose=r;this.parse(e);if(this.semver===pr)this.value="";else this.value=this.operator+this.semver.version}var pr={};lr.prototype.parse=function(e){var t=this.loose?r[P]:r[Z];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=pr;else this.semver=new H(n[2],this.loose)};lr.prototype.inspect=function(){return''};lr.prototype.toString=function(){return this.value};lr.prototype.test=function(e){if(this.semver===pr)return true;if(typeof e==="string")e=new H(e,this.loose);return ur(e,this.operator,this.semver,this.loose)};e.Range=cr;function cr(e,r){if(e instanceof cr&&e.loose===r)return e;if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}cr.prototype.inspect=function(){return''};cr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};cr.prototype.toString=function(){return this.range};cr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[_]:r[X];e=e.replace(n,kr);e=e.replace(r[q],L);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[P]:r[Z];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new lr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new cr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=$r(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[N]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(a){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(o)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(o){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function $r(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,l,p,c){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0";else if(mr(i))r=">="+t+"."+n+".0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0";else if(mr(l))o="<"+f+"."+(+u+1)+".0";else if(p)o="<="+f+"."+u+"."+l+"-"+p;else o="<="+o;return(r+" "+o).trim()}cr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new cr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new cr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new cr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u)?=?)";var j=n++;t[j]=t[s]+"|x|X|\\*";var b=n++;t[b]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var N=n++;t[N]="^"+t[A]+t[k]+"$";var P=n++;t[P]="^"+t[y]+"\\s*("+w+")$|^$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+g+")$|^$";var q=n++;t[q]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[$]+")";r[q]=new RegExp(t[q],"g");var L="$1$2$3";var X=n++;t[X]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var _=n++;t[_]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return U(this.major,e.major)||U(this.minor,e.minor)||U(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return U(t,n)}while(++r)};H.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new H(e,t).inc(r,n).version}catch(i){return null}}e.diff=K;function K(e,r){if(ar(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=U;var Q=/^[0-9]+$/;function U(e,r){var t=Q.test(e);var n=Q.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=W;function W(e,r){return U(r,e)}e.compare=Y;function Y(e,r,t){return new H(e,t).compare(r)}e.compareLoose=er;function er(e,r){return Y(e,r,true)}e.rcompare=rr;function rr(e,r,t){return Y(r,e,t)}e.sort=tr;function tr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=nr;function nr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ir;function ir(e,r,t){return Y(e,r,t)>0}e.lt=sr;function sr(e,r,t){return Y(e,r,t)<0}e.eq=ar;function ar(e,r,t){return Y(e,r,t)===0}e.neq=or;function or(e,r,t){return Y(e,r,t)!==0}e.gte=fr;function fr(e,r,t){return Y(e,r,t)>=0}e.lte=ur;function ur(e,r,t){return Y(e,r,t)<=0}e.cmp=lr;function lr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=ar(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=ir(e,t,n);break;case">=":i=fr(e,t,n);break;case"<":i=sr(e,t,n);break;case"<=":i=ur(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=pr;function pr(e,r){if(e instanceof pr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.parse(e);if(this.semver===cr)this.value="";else this.value=this.operator+this.semver.version}var cr={};pr.prototype.parse=function(e){var t=this.loose?r[P]:r[Z];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=cr;else this.semver=new H(n[2],this.loose)};pr.prototype.inspect=function(){return''};pr.prototype.toString=function(){return this.value};pr.prototype.test=function(e){if(this.semver===cr)return true;if(typeof e==="string")e=new H(e,this.loose);return lr(e,this.operator,this.semver,this.loose)};e.Range=hr;function hr(e,r){if(e instanceof hr&&e.loose===r)return e;if(!(this instanceof hr))return new hr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}hr.prototype.inspect=function(){return''};hr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};hr.prototype.toString=function(){return this.range};hr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[_]:r[X];e=e.replace(n,Er);e=e.replace(r[q],L);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[P]:r[Z];var s=e.split(" ").map(function(e){return mr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new pr(e,t)});return s};e.toComparators=vr;function vr(e,r){return new hr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function mr(e,r){e=yr(e,r);e=wr(e,r);e=br(e,r);e=kr(e,r);return e}function gr(e){return!e||e.toLowerCase()==="x"||e==="*"}function wr(e,r){return e.trim().split(/\s+/).map(function(e){return dr(e,r)}).join(" ")}function dr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(gr(r))s="";else if(gr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(gr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function yr(e,r){return e.trim().split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){var n=t?r[N]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(gr(r))s="";else if(gr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(gr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=gr(t);var o=a||gr(n);var f=o||gr(i);var u=f;if(r==="="&&u)r="";if(a){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(o)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(o){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function kr(e,t){return e.trim().replace(r[O],"")}function Er(e,r,t,n,i,s,a,o,f,u,l,p,c){if(gr(t))r="";else if(gr(n))r=">="+t+".0.0";else if(gr(i))r=">="+t+"."+n+".0";else r=">="+r;if(gr(f))o="";else if(gr(u))o="<"+(+f+1)+".0.0";else if(gr(l))o="<"+f+"."+(+u+1)+".0";else if(p)o="<="+f+"."+u+"."+l+"-"+p;else o="<="+o;return(r+" "+o).trim()}hr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Rr;function Rr(e,r,t){try{r=new hr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Sr;function Sr(e,r,t){return e.filter(function(e){return Rr(e,r,t)}).sort(function(e,r){return rr(e,r,t)})[0]||null}e.validRange=Vr;function Vr(e,r){try{return new hr(e,r).range||"*"}catch(t){return null}}e.ltr=Ir;function Ir(e,r,t){return Ar(e,r,"<",t)}e.gtr=Tr;function Tr(e,r,t){return Ar(e,r,">",t)}e.outside=Ar;function Ar(e,r,t,n){e=new H(e,n);r=new hr(r,n);var i,s,a,o,f;switch(t){case">":i=ir;s=ur;a=sr;o=">";f=">=";break;case"<":i=sr;s=fr;a=ir;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Rr(e,r,n)){return false}for(var u=0;u result + [['1.2.3', '0.2.3', 'major'], + ['1.4.5', '0.2.3', 'major'], + ['1.2.3', '2.0.0-pre', 'premajor'], + ['1.2.3', '1.3.3', 'minor'], + ['1.0.1', '1.1.0-pre', 'preminor'], + ['1.2.3', '1.2.4', 'patch'], + ['1.2.3', '1.2.4-pre', 'prepatch'], + ['0.0.1', '0.0.1-pre', 'prerelease'], + ['0.0.1', '0.0.1-pre-2', 'prerelease'], + ['1.1.0', '1.1.0-pre', 'prerelease'], + ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], + ['1.0.0', '1.0.0', null] + + ].forEach(function(v) { + var version1 = v[0]; + var version2 = v[1]; + var wanted = v[2]; + var found = diff(version1, version2); + var cmd = 'diff(' + version1 + ', ' + version2 + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + }); + + t.end(); +}); + test('\nvalid range test', function(t) { // [range, result] // validRange(range) -> result diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch b/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch index b984607a41cc1f..c5d8242da5be4b 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch @@ -3,16 +3,16 @@ index c5a741c..a2e0d8e 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -26,8 +26,8 @@ - + module.exports = Duplex; var util = require('util'); -var Readable = require('_stream_readable'); -var Writable = require('_stream_writable'); +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); - + util.inherits(Duplex, Readable); - + diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js index a5e9864..330c247 100644 --- a/lib/_stream_passthrough.js diff --git a/deps/npm/node_modules/tar/.travis.yml b/deps/npm/node_modules/tar/.travis.yml index 2d26206d58cbb7..fca8ef019405d5 100644 --- a/deps/npm/node_modules/tar/.travis.yml +++ b/deps/npm/node_modules/tar/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: - - 0.6 + - 0.10 + - 0.11 diff --git a/deps/npm/node_modules/tar/examples/extracter.js b/deps/npm/node_modules/tar/examples/extracter.js index e150abf25d5444..f6253a72c5cd3e 100644 --- a/deps/npm/node_modules/tar/examples/extracter.js +++ b/deps/npm/node_modules/tar/examples/extracter.js @@ -1,11 +1,19 @@ var tar = require("../tar.js") , fs = require("fs") + +function onError(err) { + console.error('An error occurred:', err) +} + +function onEnd() { + console.log('Extracted!') +} + +var extractor = tar.Extract({path: __dirname + "/extract"}) + .on('error', onError) + .on('end', onEnd); + fs.createReadStream(__dirname + "/../test/fixtures/c.tar") - .pipe(tar.Extract({ path: __dirname + "/extract" })) - .on("error", function (er) { - console.error("error here") - }) - .on("end", function () { - console.error("done") - }) + .on('error', onError) + .pipe(extractor); diff --git a/deps/npm/node_modules/tar/examples/packer.js b/deps/npm/node_modules/tar/examples/packer.js index ebe38926e1a941..039969ce300d12 100644 --- a/deps/npm/node_modules/tar/examples/packer.js +++ b/deps/npm/node_modules/tar/examples/packer.js @@ -2,9 +2,23 @@ var tar = require("../tar.js") , fstream = require("fstream") , fs = require("fs") -var dir_destination = fs.createWriteStream('dir.tar') +var dirDest = fs.createWriteStream('dir.tar') + + +function onError(err) { + console.error('An error occurred:', err) +} + +function onEnd() { + console.log('Packed!') +} + +var packer = tar.Pack({ noProprietary: true }) + .on('error', onError) + .on('end', onEnd); // This must be a "directory" fstream.Reader({ path: __dirname, type: "Directory" }) - .pipe(tar.Pack({ noProprietary: true })) - .pipe(dir_destination) \ No newline at end of file + .on('error', onError) + .pipe(packer) + .pipe(dirDest) diff --git a/deps/npm/node_modules/tar/lib/extract.js b/deps/npm/node_modules/tar/lib/extract.js index c34a81e21f8512..9fb1e6fb1b502c 100644 --- a/deps/npm/node_modules/tar/lib/extract.js +++ b/deps/npm/node_modules/tar/lib/extract.js @@ -57,6 +57,14 @@ function Extract (opts) { me.resume() }) + this._fst.on('error', function(err) { + me.emit('error', err) + }) + + this._fst.on('drain', function() { + me.emit('drain') + }) + // this._fst.on("end", function () { // console.error("\nEEEE Extract End", me._fst.path) // }) diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js index 009a85f4135dc2..8517c481bc6ef4 100644 --- a/deps/npm/node_modules/tar/lib/parse.js +++ b/deps/npm/node_modules/tar/lib/parse.js @@ -146,7 +146,7 @@ Parse.prototype._startEntry = function (c) { e.header = header e.tar_file_offset = this.position e.tar_block = this.position / 512 - this.emit("error", e) + return this.emit("error", e) } switch (tar.types[header.type]) { diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 207eaa1fdd2fb0..b4a1209921174b 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -6,7 +6,7 @@ }, "name": "tar", "description": "tar for node", - "version": "1.0.1", + "version": "1.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -23,33 +23,18 @@ "devDependencies": { "graceful-fs": "^3.0.2", "rimraf": "1.x", - "tap": "0.x" + "tap": "0.x", + "mkdirp": "^0.5.0" }, "license": "BSD", - "gitHead": "476bf6f5882b9c33d1cbf66f175d0f25e3981044", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", + "readmeFilename": "README.md", + "gitHead": "f4151128c585da236c6b1e278b762ecaedc20c15", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" }, "homepage": "https://github.com/isaacs/node-tar", - "_id": "tar@1.0.1", - "_shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", - "_from": "tar@1.0.1", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", - "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_id": "tar@1.0.3", + "_shasum": "15bcdab244fa4add44e4244a0176edb8aa9a2b44", + "_from": "tar@>=1.0.3 <1.1.0" } diff --git a/deps/npm/node_modules/tar/test/extract.js b/deps/npm/node_modules/tar/test/extract.js index a68144be982308..eca4e7cc962db6 100644 --- a/deps/npm/node_modules/tar/test/extract.js +++ b/deps/npm/node_modules/tar/test/extract.js @@ -118,7 +118,7 @@ var tap = require("tap") linkpath: undefined, nlink: 2 }, { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: '120755', + mode: '120777', type: 'SymbolicLink', depth: 1, size: 200, diff --git a/deps/npm/node_modules/uid-number/package.json b/deps/npm/node_modules/uid-number/package.json index 643c36b4660af4..8d416235f86da8 100644 --- a/deps/npm/node_modules/uid-number/package.json +++ b/deps/npm/node_modules/uid-number/package.json @@ -6,7 +6,7 @@ }, "name": "uid-number", "description": "Convert a username/group name to a uid/gid number", - "version": "0.0.5", + "version": "0.0.6", "repository": { "type": "git", "url": "git://github.com/isaacs/uid-number.git" @@ -19,17 +19,17 @@ "node": "*" }, "license": "ISC", + "gitHead": "aab48f5d6bda85794946b26d945d2ee452e0e9ab", "bugs": { "url": "https://github.com/isaacs/uid-number/issues" }, "homepage": "https://github.com/isaacs/uid-number", - "_id": "uid-number@0.0.5", - "dist": { - "shasum": "5a3db23ef5dbd55b81fce0ec9a2ac6fccdebb81e", - "tarball": "http://registry.npmjs.org/uid-number/-/uid-number-0.0.5.tgz" - }, - "_from": "uid-number@latest", - "_npmVersion": "1.4.3", + "_id": "uid-number@0.0.6", + "scripts": {}, + "_shasum": "0ea10e8035e8eb5b8e4449f06da1c730663baa81", + "_from": "uid-number@>=0.0.6 <0.1.0", + "_npmVersion": "2.1.3", + "_nodeVersion": "0.10.31", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -40,8 +40,10 @@ "email": "i@izs.me" } ], + "dist": { + "shasum": "0ea10e8035e8eb5b8e4449f06da1c730663baa81", + "tarball": "http://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" + }, "directories": {}, - "_shasum": "5a3db23ef5dbd55b81fce0ec9a2ac6fccdebb81e", - "_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.5.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" } diff --git a/deps/npm/node_modules/uid-number/uid-number.js b/deps/npm/node_modules/uid-number/uid-number.js index 2ae421edee0f2a..bd62184fda7a94 100644 --- a/deps/npm/node_modules/uid-number/uid-number.js +++ b/deps/npm/node_modules/uid-number/uid-number.js @@ -32,8 +32,13 @@ function uidNumber (uid, gid, cb) { child_process.execFile( process.execPath , [getter, uid, gid] - , function (code, out, err) { - if (er) return cb(new Error("could not get uid/gid\n" + err)) + , function (code, out, stderr) { + if (code) { + var er = new Error("could not get uid/gid\n" + stderr) + er.code = code + return cb(er) + } + try { out = JSON.parse(out+"") } catch (ex) { diff --git a/deps/npm/node_modules/which/LICENSE b/deps/npm/node_modules/which/LICENSE index 05a4010949cac3..19129e315fe593 100644 --- a/deps/npm/node_modules/which/LICENSE +++ b/deps/npm/node_modules/which/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC 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: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. +THE 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/which/package.json b/deps/npm/node_modules/which/package.json index c45dafee92832e..079989abc0c67a 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.0.5", + "version": "1.0.8", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -15,20 +15,32 @@ "bin": { "which": "./bin/which" }, - "engines": { - "node": "*" + "license": "ISC", + "gitHead": "681a9ebbc447cb428232ddf6c0983006d89e7755", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" }, - "dependencies": {}, - "devDependencies": {}, + "homepage": "https://github.com/isaacs/node-which", + "_id": "which@1.0.8", + "scripts": {}, + "_shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "_from": "which@>=1.0.8 <1.1.0", + "_npmVersion": "2.1.11", + "_nodeVersion": "0.10.16", "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_id": "which@1.0.5", - "optionalDependencies": {}, - "_engineSupported": true, - "_npmVersion": "1.1.2", - "_nodeVersion": "v0.7.6-pre", - "_defaultsLoaded": true, - "_from": "which@1" + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "c2ff319534ac4a1fa45df2221b56c36279903ded", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.8.tgz" } diff --git a/deps/npm/node_modules/which/which.js b/deps/npm/node_modules/which/which.js index db7e8f74dc73d6..f19dd335bc5fcf 100644 --- a/deps/npm/node_modules/which/which.js +++ b/deps/npm/node_modules/which/which.js @@ -5,12 +5,7 @@ var path = require("path") , fs , COLON = process.platform === "win32" ? ";" : ":" , isExe - -try { - fs = require("graceful-fs") -} catch (ex) { - fs = require("fs") -} + , fs = require("fs") if (process.platform == "win32") { // On windows, there is no good way to check that a file is executable diff --git a/deps/npm/package.json b/deps/npm/package.json index 761c8c814e0216..191268f7e902a5 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "2.1.6", + "version": "2.2.0", "name": "npm", "description": "A package manager for node", "keywords": [ @@ -12,7 +12,7 @@ "config": { "publishtest": false }, - "homepage": "https://npmjs.org/doc/", + "homepage": "https://docs.npmjs.com/", "author": "Isaac Z. Schlueter (http://blog.izs.me)", "repository": { "type": "git", @@ -43,33 +43,34 @@ "chmodr": "~0.1.0", "chownr": "0", "cmd-shim": "~2.0.1", - "columnify": "~1.2.1", + "columnify": "~1.3.2", "config-chain": "~1.1.8", "dezalgo": "~1.0.1", "editor": "~0.1.0", - "fs-vacuum": "~1.2.1", + "fs-vacuum": "~1.2.5", "fs-write-stream-atomic": "~1.0.2", - "fstream": "~1.0.2", + "fstream": "~1.0.3", "fstream-npm": "~1.0.1", "github-url-from-git": "~1.4.0", "github-url-from-username-repo": "~1.0.2", - "glob": "~4.0.6", - "graceful-fs": "~3.0.4", + "glob": "~4.3.2", + "graceful-fs": "~3.0.5", "inflight": "~1.0.4", "inherits": "~2.0.1", - "ini": "~1.3.0", - "init-package-json": "~1.1.1", + "ini": "~1.3.2", + "init-package-json": "~1.1.3", "lockfile": "~1.0.0", "lru-cache": "~2.5.0", - "minimatch": "~1.0.0", + "minimatch": "~2.0.1", "mkdirp": "~0.5.0", - "node-gyp": "~1.0.1", + "node-gyp": "~1.0.2", "nopt": "~3.0.1", + "normalize-git-url": "~1.0.0", "normalize-package-data": "~1.0.3", "npm-cache-filename": "~1.0.1", - "npm-install-checks": "~1.0.2", + "npm-install-checks": "~1.0.5", "npm-package-arg": "~2.1.3", - "npm-registry-client": "~3.2.4", + "npm-registry-client": "~4.0.5", "npm-user-validate": "~0.1.1", "npmlog": "~0.1.1", "once": "~1.3.1", @@ -77,21 +78,21 @@ "osenv": "~0.1.0", "path-is-inside": "~1.0.0", "read": "~1.0.4", - "read-installed": "~3.1.2", + "read-installed": "~3.1.5", "read-package-json": "~1.2.7", - "readable-stream": "~1.0.32", - "realize-package-specifier": "~1.2.0", - "request": "~2.46.0", + "readable-stream": "~1.0.33", + "realize-package-specifier": "~1.3.0", + "request": "~2.51.0", "retry": "~0.6.1", "rimraf": "~2.2.8", - "semver": "~4.1.0", + "semver": "~4.2.0", "sha": "~1.3.0", "slide": "~1.1.6", "sorted-object": "~1.0.0", - "tar": "~1.0.1", + "tar": "~1.0.3", "text-table": "~0.2.0", - "uid-number": "0.0.5", - "which": "1", + "uid-number": "0.0.6", + "which": "~1.0.8", "wrappy": "~1.0.1", "write-file-atomic": "~1.1.0" }, @@ -130,6 +131,7 @@ "mkdirp", "node-gyp", "nopt", + "normalize-git-url", "normalize-package-data", "npm-cache-filename", "npm-install-checks", @@ -163,7 +165,7 @@ "devDependencies": { "marked": "~0.3.2", "marked-man": "~0.1.4", - "nock": "~0.48.1", + "nock": "~0.52.4", "npm-registry-couchapp": "~2.6.2", "npm-registry-mock": "~0.6.3", "require-inject": "~1.1.0", diff --git a/deps/npm/scripts/install.sh b/deps/npm/scripts/install.sh index 74840459e84f2a..e6624f06160d3b 100755 --- a/deps/npm/scripts/install.sh +++ b/deps/npm/scripts/install.sh @@ -56,7 +56,7 @@ ret=$? if [ $ret -eq 0 ] && [ -x "$node" ]; then (exit 0) else - echo "npm cannot be installed without nodejs." >&2 + echo "npm cannot be installed without node.js." >&2 echo "Install node first, and then try again." >&2 echo "" >&2 echo "Maybe node is installed, but not in the PATH?" >&2 @@ -118,11 +118,11 @@ MAKE=NOMAKE if [ "x$MAKE" = "x" ]; then make=`which gmake 2>&1` - if [ $? -eq 0 ] && [ -x $make ]; then + if [ $? -eq 0 ] && [ -x "$make" ]; then (exit 0) else make=`which make 2>&1` - if [ $? -eq 0 ] && [ -x $make ]; then + if [ $? -eq 0 ] && [ -x "$make" ]; then (exit 0) else make=NOMAKE @@ -161,15 +161,11 @@ if [ -z "$t" ]; then # switch based on node version. # note that we can only use strict sh-compatible patterns here. case $node_version in - 0.[012345].* | v0.[012345].*) + 0.[01234567].* | v0.[01234567].*) echo "You are using an outdated and unsupported version of" >&2 echo "node ($node_version). Please update node and try again." >&2 exit 99 ;; - v0.[678].* | 0.[678].*) - echo "install npm@1.1" - t=1.1 - ;; *) echo "install npm@latest" t="latest" @@ -177,32 +173,9 @@ if [ -z "$t" ]; then esac fi -# the npmca cert -cacert=' ------BEGIN CERTIFICATE----- -MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC -VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x -IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w -bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y -MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV -BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj -YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA -aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE -OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz -Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl -y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC -l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv -yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl -ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op ------END CERTIFICATE----- -' - -echo "$cacert" > "$TMP/cafile.crt" -cacert="$TMP/cafile.crt" - # need to echo "" after, because Posix sed doesn't treat EOF # as an implied end of line. -url=`(curl -SsL --cacert "$cacert" https://registry.npmjs.org/npm/$t; echo "") \ +url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ | sed -e 's/^.*tarball":"//' \ | sed -e 's/".*$//'` @@ -210,7 +183,7 @@ ret=$? if [ "x$url" = "x" ]; then ret=125 # try without the -e arg to sed. - url=`(curl -SsL --cacert "$cacert" https://registry.npmjs.org/npm/$t; echo "") \ + url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ | sed 's/^.*tarball":"//' \ | sed 's/".*$//'` ret=$? @@ -227,28 +200,12 @@ fi echo "fetching: $url" >&2 cd "$TMP" \ - && curl -SsL --cacert "$cacert" "$url" \ + && curl -SsL "$url" \ | $tar -xzf - \ - && rm "$cacert" \ && cd "$TMP"/* \ - && (req=`"$node" bin/read-package-json.js package.json engines.node` - if [ -d node_modules ]; then - "$node" node_modules/semver/bin/semver -v "$node_version" -r "$req" - ret=$? - else - "$node" bin/semver.js -v "$node_version" -r "$req" - ret=$? - fi - if [ $ret -ne 0 ]; then - echo "You need node $req to run this program." >&2 - echo "node --version reports: $node_version" >&2 - echo "Please upgrade node before continuing." >&2 - exit $ret - fi) \ && (ver=`"$node" bin/read-package-json.js package.json version` isnpm10=0 if [ $ret -eq 0 ]; then - req=`"$node" bin/read-package-json.js package.json engines.node` if [ -d node_modules ]; then if "$node" node_modules/semver/bin/semver -v "$ver" -r "1" then @@ -288,7 +245,7 @@ cd "$TMP" \ && (if [ "x$configures" = "x" ]; then (exit 0) else - echo "./configure "$configures + echo "./configure $configures" echo "$configures" > npmrc fi) \ && (if [ "$make" = "NOMAKE" ]; then diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 2efca30c48107e..1c51ed71895ecf 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -1,13 +1,12 @@ var spawn = require("child_process").spawn var path = require("path") -var fs = require("fs") var port = exports.port = 1337 exports.registry = "http://localhost:" + port process.env.npm_config_loglevel = "error" var npm_config_cache = path.resolve(__dirname, "npm_cache") -exports.npm_config_cache = npm_config_cache +process.env.npm_config_cache = exports.npm_config_cache = npm_config_cache var bin = exports.bin = require.resolve("../bin/npm-cli.js") var once = require("once") @@ -42,26 +41,3 @@ exports.npm = function (cmd, opts, cb) { }) return child } - -// based on http://bit.ly/1tkI6DJ -function deleteNpmCacheRecursivelySync(cache) { - cache = cache ? cache : npm_config_cache - var files = [] - var res - if( fs.existsSync(cache) ) { - files = fs.readdirSync(cache) - files.forEach(function(file,index) { - var curPath = path.resolve(cache, file) - if(fs.lstatSync(curPath).isDirectory()) { // recurse - deleteNpmCacheRecursivelySync(curPath) - } else { // delete file - if (res = fs.unlinkSync(curPath)) - throw Error("Failed to delete file " + curPath + ", error " + res) - } - }) - if (res = fs.rmdirSync(cache)) - throw Error("Failed to delete directory " + cache + ", error " + res) - } - return 0 -} -exports.deleteNpmCacheRecursivelySync = deleteNpmCacheRecursivelySync \ No newline at end of file diff --git a/deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz b/deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz new file mode 100644 index 00000000000000..d98a345996b5b4 Binary files /dev/null and b/deps/npm/test/fixtures/scoped-underscore-1.3.1.tgz differ diff --git a/deps/npm/test/run.js b/deps/npm/test/run.js index 904df5b8e464ad..6feba3596a3a6b 100644 --- a/deps/npm/test/run.js +++ b/deps/npm/test/run.js @@ -19,6 +19,7 @@ var temp = process.env.TMPDIR temp = path.resolve(temp, "npm-test-" + process.pid) var root = path.resolve(temp, "root") + , cache = path.resolve(temp, "npm_cache") var failures = 0 , mkdir = require("mkdirp") @@ -47,6 +48,7 @@ env.npm_config_global = "true" env.npm_config_npat = "false" env.PATH = pathEnv.join(pathEnvSplit) env.NODE_PATH = path.join(root, "node_modules") +env.npm_config_cache = cache diff --git a/deps/npm/test/tap/00-config-setup.js b/deps/npm/test/tap/00-config-setup.js index aaad5462715393..33581eb138ff6f 100644 --- a/deps/npm/test/tap/00-config-setup.js +++ b/deps/npm/test/tap/00-config-setup.js @@ -63,6 +63,6 @@ if (module === require.main) { var gcini = "globalconfig = " + exports.globalconfig + "\n" fs.writeFileSync(exports.userconfig, gcini + uc) - console.log("0..1") + console.log("1..1") console.log("ok 1 setup done") } diff --git a/deps/npm/test/tap/add-remote-git-fake-windows.js b/deps/npm/test/tap/add-remote-git-fake-windows.js new file mode 100644 index 00000000000000..75ebf1da20aed5 --- /dev/null +++ b/deps/npm/test/tap/add-remote-git-fake-windows.js @@ -0,0 +1,126 @@ +var fs = require("fs") +var resolve = require("path").resolve + +var chain = require("slide").chain +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test + +var npm = require("../../lib/npm.js") +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "add-remote-git") +var repo = resolve(__dirname, "add-remote-git-repo") + +var daemon +var git + +test("setup", function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, "git started up successfully") + + if (!er) daemon = r[r.length - 1] + + t.end() + }) +}) + +test("install from repo on 'Windows'", function (t) { + // before we confuse everything by switching the platform + require("../../lib/install.js") + require("../../lib/unbuild.js") + process.platform = "win32" + process.chdir(pkg) + npm.commands.install(".", [], function (er) { + t.ifError(er, "npm installed via git") + + t.end() + }) +}) + +test("clean", function (t) { + daemon.on("close", function () { + cleanup() + t.end() + }) + daemon.kill("SIGINT") +}) + +var pjParent = JSON.stringify({ + name : "parent", + version : "1.2.3", + dependencies : { + "child" : "git://localhost:1234/child.git" + } +}, null, 2) + "\n" + +var pjChild = JSON.stringify({ + name : "child", + version : "1.0.3" +}, null, 2) + "\n" + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, "package.json"), pjParent) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, "package.json"), pjChild) + npm.load({ registry : common.registry, loglevel : "silent" }, function () { + // some really cheesy monkeypatching + require("module")._cache[require.resolve("which")] = { + exports : function (_, cb) { cb() } + } + git = require("../../lib/utils/git.js") + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + "daemon", + "--listen=localhost", + "--export-all", + "--base-path=.", + "--port=1234" + ], + { + cwd : pkg, + env : process.env, + stdio : ["pipe", "pipe", "pipe"] + } + ) + + cb(null, d) + } + + var opts = { + cwd : repo, + env : process.env + } + + chain( + [ + git.chainableExec(["init"], opts), + git.chainableExec(["config", "user.name", "PhantomFaker"], opts), + git.chainableExec(["config", "user.email", "nope@not.real"], opts), + git.chainableExec(["add", "package.json"], opts), + git.chainableExec(["commit", "-m", "stub package"], opts), + git.chainableExec( + ["clone", "--bare", repo, "child.git"], + { cwd : pkg, env : process.env } + ), + startDaemon + ], + cb + ) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/add-remote-git.js b/deps/npm/test/tap/add-remote-git.js new file mode 100644 index 00000000000000..13fbc8c34dd1c1 --- /dev/null +++ b/deps/npm/test/tap/add-remote-git.js @@ -0,0 +1,119 @@ +var fs = require("fs") +var resolve = require("path").resolve + +var chain = require("slide").chain +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test + +var npm = require("../../lib/npm.js") +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "add-remote-git") +var repo = resolve(__dirname, "add-remote-git-repo") + +var daemon +var git + +test("setup", function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, "git started up successfully") + + if (!er) daemon = r[r.length - 1] + + t.end() + }) +}) + +test("install from repo on 'OS X'", function (t) { + process.platform = "darwin" + process.chdir(pkg) + npm.commands.install(".", [], function (er) { + t.ifError(er, "npm installed via git") + + t.end() + }) +}) + +test("clean", function (t) { + daemon.on("close", function () { + cleanup() + t.end() + }) + daemon.kill("SIGINT") +}) + +var pjParent = JSON.stringify({ + name : "parent", + version : "1.2.3", + dependencies : { + "child" : "git://localhost:1234/child.git" + } +}, null, 2) + "\n" + +var pjChild = JSON.stringify({ + name : "child", + version : "1.0.3" +}, null, 2) + "\n" + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, "package.json"), pjParent) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, "package.json"), pjChild) + npm.load({ registry : common.registry, loglevel : "silent" }, function () { + git = require("../../lib/utils/git.js") + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + "daemon", + "--listen=localhost", + "--export-all", + "--base-path=.", + "--port=1234" + ], + { + cwd : pkg, + env : process.env, + stdio : ["pipe", "pipe", "pipe"] + } + ) + + cb(null, d) + } + + var opts = { + cwd : repo, + env : process.env + } + + chain( + [ + git.chainableExec(["init"], opts), + git.chainableExec(["config", "user.name", "PhantomFaker"], opts), + git.chainableExec(["config", "user.email", "nope@not.real"], opts), + git.chainableExec(["add", "package.json"], opts), + git.chainableExec(["commit", "-m", "stub package"], opts), + git.chainableExec( + ["clone", "--bare", repo, "child.git"], + { cwd : pkg, env : process.env } + ), + startDaemon + ], + cb + ) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/login-always-auth.js b/deps/npm/test/tap/adduser-always-auth.js similarity index 100% rename from deps/npm/test/tap/login-always-auth.js rename to deps/npm/test/tap/adduser-always-auth.js diff --git a/deps/npm/test/tap/adduser-legacy-auth.js b/deps/npm/test/tap/adduser-legacy-auth.js new file mode 100644 index 00000000000000..56303903fffb31 --- /dev/null +++ b/deps/npm/test/tap/adduser-legacy-auth.js @@ -0,0 +1,89 @@ +var fs = require("fs") +var path = require("path") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var common = require("../common-tap.js") + +var opts = {cwd : __dirname} +var pkg = path.resolve(__dirname, "adduser-legacy-auth") +var outfile = path.resolve(pkg, "_npmrc") + +var contents = "_auth=" + new Buffer("u:x").toString("base64") + "\n" + + "email=u@p.me\n" + +var responses = { + "Username" : "u\n", + "Password" : "p\n", + "Email" : "u@p.me\n" +} + +function mocks (server) { + server.filteringRequestBody(function (r) { + if (r.match(/\"_id\":\"org\.couchdb\.user:u\"/)) { + return "auth" + } + }) + server.put("/-/user/org.couchdb.user:u", "auth") + .reply(409, {"error": "user exists"}) + server.get("/-/user/org.couchdb.user:u?write=true") + .reply(200, {_rev : "3-deadcafebabebeef"}) + server.put("/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef", "auth", {"authorization" : "Basic dTpw"}) + .reply(201, {username : "u", password : "p", email : "u@p.me"}) +} + +test("setup", function (t) { + mkdirp(pkg, function (er) { + t.ifError(er, pkg + " made successfully") + + fs.writeFile(outfile, contents, function (er) { + t.ifError(er, "wrote legacy config") + + t.end() + }) + }) +}) + +test("npm login", function (t) { + mr({port : common.port, mocks : mocks}, function (s) { + var runner = common.npm( + [ + "login", + "--registry", common.registry, + "--loglevel", "silly", + "--userconfig", outfile + ], + opts, + function (err, code) { + t.notOk(code, "exited OK") + t.notOk(err, "no error output") + var config = fs.readFileSync(outfile, "utf8") + t.like(config, /:always-auth=false/, "always-auth is scoped and false (by default)") + s.close() + rimraf(outfile, function (err) { + t.ifError(err, "removed config file OK") + t.end() + }) + }) + + var o = "", e = "", remaining = Object.keys(responses).length + runner.stdout.on("data", function (chunk) { + remaining-- + o += chunk + + var label = chunk.toString("utf8").split(":")[0] + runner.stdin.write(responses[label]) + + if (remaining === 0) runner.stdin.end() + }) + runner.stderr.on("data", function (chunk) { e += chunk }) + }) +}) + +test("cleanup", function (t) { + rimraf.sync(outfile) + t.pass("cleaned up") + t.end() +}) diff --git a/deps/npm/test/tap/bugs.js b/deps/npm/test/tap/bugs.js new file mode 100644 index 00000000000000..845a42123e510d --- /dev/null +++ b/deps/npm/test/tap/bugs.js @@ -0,0 +1,151 @@ +if (process.platform === "win32") { + console.error("skipping test, because windows and shebangs") + return +} + +var common = require("../common-tap.js") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var rimraf = require("rimraf") +var fs = require("fs") +var path = require("path") +var join = path.join +var outFile = path.join(__dirname, "/_output") + +var opts = { cwd: __dirname } + +test("setup", function (t) { + var s = "#!/usr/bin/env bash\n" + + "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n" + fs.writeFileSync(join(__dirname, "/_script.sh"), s, "ascii") + fs.chmodSync(join(__dirname, "/_script.sh"), "0755") + t.pass("made script") + t.end() +}) + +test("npm bugs underscore", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "underscore", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://github.com/jashkenas/underscore/issues\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs optimist - github (https://)", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "optimist", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://github.com/substack/node-optimist/issues\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs npm-test-peer-deps - no repo", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "npm-test-peer-deps", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/npm-test-peer-deps\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-http - non-github (http://)", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "test-repo-url-http", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-http\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-https - non-github (https://)", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "test-repo-url-https", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-https\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-ssh - non-github (ssh://)", function (t) { + mr(common.port, function (s) { + common.npm([ + "bugs", "test-repo-url-ssh", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-ssh\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("cleanup", function (t) { + fs.unlinkSync(join(__dirname, "/_script.sh")) + t.pass("cleaned up") + t.end() +}) diff --git a/deps/npm/test/tap/build-already-built.js b/deps/npm/test/tap/build-already-built.js new file mode 100644 index 00000000000000..1de5929f43473a --- /dev/null +++ b/deps/npm/test/tap/build-already-built.js @@ -0,0 +1,81 @@ +// if "npm rebuild" is run with bundled dependencies, +// message "already built" should not be error +var test = require("tap").test +var path = require("path") +var osenv = require("osenv") +var rimraf = require("rimraf") +var npmlog = require("npmlog") +var mkdirp = require("mkdirp") +var requireInject = require("require-inject") + +var npm = require("../../lib/npm.js") + +var PKG_DIR = path.resolve(__dirname, "build-alread-built") +var fakePkg = "foo" + +test("setup", function (t) { + cleanup() + + t.end() +}) + +test("issue #6735 build 'already built' message", function (t) { + npm.load({loglevel : "warn"}, function () { + // capture log messages with level + var log = "" + npmlog.on("log", function (chunk) { + log += chunk.level + " " + chunk.message + "\n" + }) + + mkdirp.sync(fakePkg) + var folder = path.resolve(fakePkg) + + var global = npm.config.get("global") + + var build = requireInject("../../lib/build", { + }) + + t.test("pin previous behavior", function (t) { + + build([fakePkg], global, false, false, function (err) { + t.ok(err, "build failed as expected") + t.similar(err.message, /package.json/, "missing package.json as expected") + t.notSimilar(log, /already built/, "no already built message written") + + t.end() + }) + }) + + t.test("simulate rebuild of bundledDependency", function (t) { + + log = "" + + build._didBuild[folder] = true + + build([fakePkg], global, false, false, function (err) { + t.ok(err, "build failed as expected") + t.similar(err.message, /package.json/, "missing package.json as expected") + + t.similar(log, /already built/, "already built message written") + t.notSimilar(log, /ERR! already built/, "already built message written is not error") + t.similar(log, /info already built/, "already built message written is info") + + t.end() + }) + }) + + t.end() + }) +}) + + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} diff --git a/deps/npm/test/tap/config-private.js b/deps/npm/test/tap/config-private.js new file mode 100644 index 00000000000000..37e283eec321e4 --- /dev/null +++ b/deps/npm/test/tap/config-private.js @@ -0,0 +1,81 @@ +var fs = require("fs") +var path = require("path") +var test = require("tap").test +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "config-private") +var opts = { cwd: pkg } + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + t.end() +}) + +test("config get private var (old auth)", function (t) { + common.npm([ + "config", + "get", + "_auth" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.similar(stderr, /sekretz/, "password blocked on stderr") + t.equal(stdout, "", "no output") + t.end() + } + ) +}) + +test("config get private var (new auth)", function (t) { + common.npm([ + "config", + "get", + "//registry.npmjs.org/:_password" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.similar(stderr, /sekretz/, "password blocked on stderr") + t.equal(stdout, "", "no output") + t.end() + } + ) +}) + +test("config get public var (new username)", function (t) { + var FIXTURE_PATH = path.resolve(pkg, "fixture_npmrc") + var s = "//registry.lvh.me/:username = wombat\n" + + "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + + "//registry.lvh.me/:email = lindsay@wdu.org.au\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + common.npm( + [ + "config", + "get", + "//registry.lvh.me/:username", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://registry.lvh.me/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "stderr is empty") + t.equal(stdout, "wombat\n", "got usename is output") + t.end() + } + ) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/gently-rm-overeager.js b/deps/npm/test/tap/gently-rm-overeager.js new file mode 100644 index 00000000000000..7284d3e3685fe0 --- /dev/null +++ b/deps/npm/test/tap/gently-rm-overeager.js @@ -0,0 +1,62 @@ +var resolve = require("path").resolve +var fs = require("graceful-fs") +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "gently-rm-overeager") +var dep = resolve(__dirname, "test-whoops") + +var EXEC_OPTS = { + cwd : pkg +} + +test("setup", function (t) { + cleanup() + setup() + + t.end() +}) + +test("cache add", function (t) { + common.npm(["install", "../test-whoops"], EXEC_OPTS, function (er, c) { + t.ifError(er, "test-whoops install didn't explode") + t.ok(c, "test-whoops install also failed") + fs.readdir(pkg, function (er, files) { + t.ifError(er, "package directory is still there") + t.deepEqual(files, ["npm-debug.log"], "only debug log remains") + + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + + +var fixture = { + name: "@test/whoops", + version: "1.0.0", + scripts: { + postinstall: "echo \"nope\" && exit 1" + } +} + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) +} + +function setup () { + mkdirp.sync(pkg) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, "node_modules")) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) +} diff --git a/deps/npm/test/tap/gently-rm-symlink.js b/deps/npm/test/tap/gently-rm-symlink.js new file mode 100644 index 00000000000000..ff1524b04ac3d5 --- /dev/null +++ b/deps/npm/test/tap/gently-rm-symlink.js @@ -0,0 +1,113 @@ +var resolve = require("path").resolve +var fs = require("graceful-fs") +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "gently-rm-linked") +var dep = resolve(__dirname, "test-linked") +var glb = resolve(__dirname, "test-global") +var lnk = resolve(__dirname, "test-global-link") + +var EXEC_OPTS = { + cwd : pkg +} + +test("setup", function (t) { + cleanup() + setup() + + t.end() +}) + +test("install and link", function (t) { + common.npm( + [ + "--global", + "--prefix", lnk, + "--loglevel", "silent", + "install", "../test-linked" + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, "test-linked install also failed") + t.notOk(stderr, "no log output") + + verify(t, stdout) + + // again, to make sure unlinking works properlyt + common.npm( + [ + "--global", + "--prefix", lnk, + "--loglevel", "silent", + "install", "../test-linked" + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, "test-linked install also failed") + t.notOk(stderr, "no log output") + + verify(t, stdout) + + fs.readdir(pkg, function (er, files) { + t.ifError(er, "package directory is still there") + t.deepEqual(files, ["node_modules"], "only stub modules dir remains") + + t.end() + }) + } + ) + } + ) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + + +var index = "module.exports = function () { console.log('whoop whoop') }" + +var fixture = { + name: "@test/linked", + version: "1.0.0", + bin: { + linked: "./index.js" + } +} + +function verify (t, stdout) { + var binPath = resolve(lnk, "bin", "linked") + var pkgPath = resolve(lnk, "lib", "node_modules", "@test", "linked") + var trgPath = resolve(pkgPath, "index.js") + t.equal( + stdout, + binPath+" -> "+trgPath+"\n@test/linked@1.0.0 "+pkgPath+"\n", + "got expected install output" + ) +} + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) + rimraf.sync(lnk) + rimraf.sync(glb) +} + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(glb) + fs.symlinkSync(glb, lnk) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, "node_modules")) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) + fs.writeFileSync(resolve(dep, "index.js"), index) +} diff --git a/deps/npm/test/tap/get.js b/deps/npm/test/tap/get.js new file mode 100644 index 00000000000000..fbc88161e64b78 --- /dev/null +++ b/deps/npm/test/tap/get.js @@ -0,0 +1,125 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var cacheFile = require("npm-cache-filename") +var npm = require("../../") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var path = require("path") +var mr = require("npm-registry-mock") +var fs = require("graceful-fs") + +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var TIMEOUT = 3600 +var FOLLOW = false +var STALE_OK = true +var TOKEN = "lolbutts" +var AUTH = { + token : TOKEN +} +var PARAMS = { + timeout : TIMEOUT, + follow : FOLLOW, + staleOk : STALE_OK, + auth : AUTH +} +var PKG_DIR = path.resolve(__dirname, "get-basic") +var CACHE_DIR = path.resolve(PKG_DIR, "cache") +var BIGCO_SAMPLE = { + name : "@bigco/sample", + version : "1.2.3" +} + +// mock server reference +var server + +var mocks = { + "get": { + "/@bigco%2fsample/1.2.3" : [200, JSON.stringify(BIGCO_SAMPLE)] + } +} + +var mapper = cacheFile(CACHE_DIR) + +function getCachePath (uri) { + return path.join(mapper(uri), ".cache.json") +} + +test("setup", function (t) { + mkdirp.sync(CACHE_DIR) + + mr({port: common.port, mocks: mocks}, function (s) { + npm.load({cache: CACHE_DIR, registry: common.registry}, function (err) { + t.ifError(err) + server = s + t.end() + }) + }) +}) + +test("get call contract", function (t) { + t.throws(function () { + npm.registry.get(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + npm.registry.get([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + npm.registry.get(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + npm.registry.get(URI, "", nop) + }, "params must be object") + + t.throws(function () { + npm.registry.get(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + npm.registry.get(URI, PARAMS, "callback") + }, "callback must be function") + + t.end() +}) + +test("basic request", function (t) { + t.plan(9) + + var versioned = common.registry + "/underscore/1.3.3" + npm.registry.get(versioned, PARAMS, function (er, data) { + t.ifError(er, "loaded specified version underscore data") + t.equal(data.version, "1.3.3") + fs.stat(getCachePath(versioned), function (er) { + t.ifError(er, "underscore 1.3.3 cache data written") + }) + }) + + var rollup = common.registry + "/underscore" + npm.registry.get(rollup, PARAMS, function (er, data) { + t.ifError(er, "loaded all metadata") + t.deepEqual(data.name, "underscore") + fs.stat(getCachePath(rollup), function (er) { + t.ifError(er, "underscore rollup cache data written") + }) + }) + + var scoped = common.registry + "/@bigco%2fsample/1.2.3" + npm.registry.get(scoped, PARAMS, function (er, data) { + t.ifError(er, "loaded all metadata") + t.deepEqual(data.name, "@bigco/sample") + fs.stat(getCachePath(scoped), function (er) { + t.ifError(er, "scoped cache data written") + }) + }) +}) + +test("cleanup", function (t) { + server.close() + rimraf.sync(PKG_DIR) + + t.end() +}) diff --git a/deps/npm/test/tap/git-npmignore.js b/deps/npm/test/tap/git-npmignore.js new file mode 100644 index 00000000000000..6a703f0cf6f8f1 --- /dev/null +++ b/deps/npm/test/tap/git-npmignore.js @@ -0,0 +1,172 @@ +var cat = require("graceful-fs").writeFileSync +var exec = require("child_process").exec +var readdir = require("graceful-fs").readdirSync +var resolve = require("path").resolve + +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test +var tmpdir = require("osenv").tmpdir +var which = require("which") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "git-npmignore") +var dep = resolve(pkg, "deps", "gitch") +var packname = "gitch-1.0.0.tgz" +var packed = resolve(pkg, packname) +var modules = resolve(pkg, "node_modules") +var installed = resolve(modules, "gitch") +var expected = [ + "a.js", + "package.json", + ".npmignore" +].sort() + +var EXEC_OPTS = { + cwd : pkg +} + +test("setup", function (t) { + setup(function (er) { + t.ifError(er, "setup ran OK") + + t.end() + }) +}) + +test("npm pack directly from directory", function (t) { + packInstallTest(dep, t) +}) + +test("npm pack via git", function (t) { + packInstallTest("git+file://"+dep, t) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function packInstallTest (spec, t) { + common.npm( + [ + "--loglevel", "silent", + "pack", spec + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm pack ran without error") + t.notOk(code, "npm pack exited cleanly") + t.notOk(stderr, "npm pack ran silently") + t.equal(stdout.trim(), packname, "got expected package name") + + common.npm( + [ + "--loglevel", "silent", + "install", packed + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm install ran without error") + t.notOk(code, "npm install exited cleanly") + t.notOk(stderr, "npm install ran silently") + + var actual = readdir(installed).sort() + t.same(actual, expected, "no unexpected files in packed directory") + + rimraf(packed, function () { + t.end() + }) + } + ) + } + ) +} + +var gitignore = "node_modules/\n" +var npmignore = "t.js\n" + +var a = "console.log('hi');" +var t = "require('tap').test(function (t) { t.pass('I am a test!'); t.end(); });" +var fixture = { + "name" : "gitch", + "version" : "1.0.0", + "private" : true, + "main" : "a.js" +} + +function cleanup () { + process.chdir(tmpdir()) + rimraf.sync(pkg) +} + +function setup (cb) { + cleanup() + + mkdirp.sync(modules) + mkdirp.sync(dep) + + process.chdir(dep) + + cat(resolve(dep, ".npmignore"), npmignore) + cat(resolve(dep, ".gitignore"), gitignore) + cat(resolve(dep, "a.js"), a) + cat(resolve(dep, "t.js"), t) + cat(resolve(dep, "package.json"), JSON.stringify(fixture)) + + common.npm( + [ + "--loglevel", "silent", + "cache", "clean" + ], + EXEC_OPTS, + function (er, code, _, stderr) { + if (er) return cb(er) + if (code) return cb(new Error("npm cache nonzero exit: "+code)) + if (stderr) return cb(new Error("npm cache clean error: "+stderr)) + + which("git", function found (er, git) { + if (er) return cb(er) + + exec(git+" init", init) + + function init (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git init error: "+stderr)) + + exec(git+" config user.name 'Phantom Faker'", user) + } + + function user (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git config error: "+stderr)) + + exec(git+" config user.email nope@not.real", email) + } + + function email (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git config error: "+stderr)) + + exec(git+" add .", addAll) + } + + function addAll (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git add . error: "+stderr)) + + exec(git+" commit -m boot", commit) + } + + function commit (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git commit error: "+stderr)) + + cb() + } + }) + } + ) +} diff --git a/deps/npm/test/tap/ignore-scripts.js b/deps/npm/test/tap/ignore-scripts.js index 9526443e92c163..8b5291f7872411 100644 --- a/deps/npm/test/tap/ignore-scripts.js +++ b/deps/npm/test/tap/ignore-scripts.js @@ -27,7 +27,6 @@ var scripts = [ "prepublish", "publish", "postpublish", "preinstall", "install", "postinstall", "preuninstall", "uninstall", "postuninstall", - "preupdate", "update", "postupdate", "pretest", "test", "posttest", "prestop", "stop", "poststop", "prestart", "start", "poststart", diff --git a/deps/npm/test/tap/ignore-scripts/package.json b/deps/npm/test/tap/ignore-scripts/package.json index 45336caedf0cd3..261aa902d73572 100644 --- a/deps/npm/test/tap/ignore-scripts/package.json +++ b/deps/npm/test/tap/ignore-scripts/package.json @@ -9,11 +9,9 @@ "preinstall": "exit 123", "postinstall": "exit 123", "preuninstall": "exit 123", + "install": "exit 123", "uninstall": "exit 123", "postuninstall": "exit 123", - "preupdate": "exit 123", - "update": "exit 123", - "postupdate": "exit 123", "pretest": "exit 123", "test": "exit 123", "posttest": "exit 123", diff --git a/deps/npm/test/tap/init-interrupt.js b/deps/npm/test/tap/init-interrupt.js new file mode 100644 index 00000000000000..962ab72444747b --- /dev/null +++ b/deps/npm/test/tap/init-interrupt.js @@ -0,0 +1,58 @@ +// if "npm init" is interrupted with ^C, don't report +// "init written successfully" +var test = require("tap").test +var path = require("path") +var osenv = require("osenv") +var rimraf = require("rimraf") +var npmlog = require("npmlog") +var requireInject = require("require-inject") + +var npm = require("../../lib/npm.js") + +var PKG_DIR = path.resolve(__dirname, "init-interrupt") + +test("setup", function (t) { + cleanup() + + t.end() +}) + +test("issue #6684 remove confusing message", function (t) { + + var initJsonMock = function (dir, input, config, cb) { + process.nextTick(function () { + cb({message : "canceled"}) + }) + } + initJsonMock.yes = function () { return true } + + npm.load({loglevel : "silent"}, function () { + var log = "" + var init = requireInject("../../lib/init", { + "init-package-json": initJsonMock + }) + + // capture log messages + npmlog.on("log", function (chunk) { log += chunk.message + "\n" } ) + + init([], function (err, code) { + t.ifError(err, "init ran successfully") + t.notOk(code, "exited without issue") + t.notSimilar(log, /written successfully/, "no success message written") + t.similar(log, /canceled/, "alerted that init was canceled") + + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} diff --git a/deps/npm/test/tap/install-bad-man.js b/deps/npm/test/tap/install-bad-man.js new file mode 100644 index 00000000000000..531509e9974dc5 --- /dev/null +++ b/deps/npm/test/tap/install-bad-man.js @@ -0,0 +1,79 @@ +var fs = require("fs") +var resolve = require("path").resolve + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "install-bad-man") +var target = resolve(__dirname, "install-bad-man-target") + +var EXEC_OPTS = { + cwd: target +} + +test("setup", function (t) { + setup() + t.pass("setup ran") + t.end() +}) + +test("install from repo on 'OS X'", function (t) { + common.npm( + [ + "install", + "--prefix", target, + "--global", + pkg + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm command ran from test") + t.equals(code, 1, "install exited with failure (1)") + t.notOk(stdout, "no output indicating success") + t.notOk( + stderr.match(/Cannot read property '1' of null/), + "no longer has cryptic error output" + ) + t.ok( + stderr.match(/install-bad-man\.1\.lol is not a valid name/), + "got expected error output" + ) + + t.end() + } + ) +}) + +test("clean", function (t) { + cleanup() + t.pass("cleaned up") + t.end() +}) + +var json = { + name : "install-bad-man", + version : "1.2.3", + man : [ "./install-bad-man.1.lol" ] +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + // make sure it installs locally + mkdirp.sync(resolve(target, "node_modules")) + fs.writeFileSync( + resolve(pkg, "package.json"), + JSON.stringify(json, null, 2)+"\n" + ) + fs.writeFileSync(resolve(pkg, "install-bad-man.1.lol"), "lol\n") +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(target) +} diff --git a/deps/npm/test/tap/ls-l-depth-0.js b/deps/npm/test/tap/ls-l-depth-0.js new file mode 100644 index 00000000000000..c11f4826e4dc84 --- /dev/null +++ b/deps/npm/test/tap/ls-l-depth-0.js @@ -0,0 +1,114 @@ +var cat = require("graceful-fs").writeFileSync +var resolve = require("path").resolve + +var mkdirp = require("mkdirp") +var mr = require("npm-registry-mock") +var rimraf = require("rimraf") +var test = require("tap").test +var tmpdir = require("osenv").tmpdir + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "ls-l-depth-0") +var dep = resolve(pkg, "deps", "glock") +var modules = resolve(pkg, "node_modules") + +var expected = + "\n" + + "│ " + pkg + "\n" + + "│ \n" + + "└── glock@1.8.7\n" + + " an inexplicably hostile sample package\n" + + " https://github.com/npm/glo.ck\n" + + " https://glo.ck\n" + + "\n" + +var server + +var EXEC_OPTS = { + cwd : pkg +} + +test("setup", function (t) { + setup() + mr(common.port, function (s) { + server = s + + t.end() + }) +}) + +test("#6311: npm ll --depth=0 duplicates listing", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "install", dep + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm install ran without error") + t.notOk(code, "npm install exited cleanly") + t.notOk(stderr, "npm install ran silently") + t.equal( + stdout.trim(), + "glock@1.8.7 node_modules/glock\n└── underscore@1.5.1", + "got expected install output" + ) + + common.npm( + [ + "--loglevel", "silent", + "ls", "--long", + "--depth", "0" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm ll ran without error") + t.notOk(code, "npm ll exited cleanly") + t.notOk(stderr, "npm ll ran silently") + t.equal( + stdout, + expected, + "got expected package name" + ) + + t.end() + } + ) + } + ) +}) + +test("cleanup", function (t) { + cleanup() + server.close() + + t.end() +}) + +var fixture = { + "name" : "glock", + "version" : "1.8.7", + "private" : true, + "description" : "an inexplicably hostile sample package", + "homepage" : "https://glo.ck", + "repository" : "https://github.com/npm/glo.ck", + "dependencies" : { + "underscore" : "1.5.1" + } +} + +function cleanup () { + process.chdir(tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + + mkdirp.sync(modules) + mkdirp.sync(dep) + + cat(resolve(dep, "package.json"), JSON.stringify(fixture)) +} diff --git a/deps/npm/test/tap/map-to-registry.js b/deps/npm/test/tap/map-to-registry.js new file mode 100644 index 00000000000000..72cdbe51669f54 --- /dev/null +++ b/deps/npm/test/tap/map-to-registry.js @@ -0,0 +1,89 @@ +var test = require("tap").test +var npm = require("../../") + +var mapRegistry = require("../../lib/utils/map-to-registry.js") + +var creds = { + "//registry.npmjs.org/:username" : "u", + "//registry.npmjs.org/:_password" : new Buffer("p").toString("base64"), + "//registry.npmjs.org/:email" : "e" +} +test("setup", function (t) { + npm.load(creds, function (err) { + t.ifError(err) + t.end() + }) +}) + +test("mapRegistryToURI", function (t) { + t.plan(16) + + mapRegistry("basic", npm.config, function (er, uri, auth, registry) { + t.ifError(er, "mapRegistryToURI worked") + t.equal(uri, "https://registry.npmjs.org/basic") + t.deepEqual(auth, { + scope : "//registry.npmjs.org/", + token : undefined, + username : "u", + password : "p", + email : "e", + auth : "dTpw", + alwaysAuth : false + }) + t.equal(registry, "https://registry.npmjs.org/") + }) + + npm.config.set("scope", "test") + npm.config.set("@test:registry", "http://reg.npm/design/-/rewrite/") + npm.config.set("//reg.npm/design/-/rewrite/:_authToken", "a-token") + mapRegistry("simple", npm.config, function (er, uri, auth, registry) { + t.ifError(er, "mapRegistryToURI worked") + t.equal(uri, "http://reg.npm/design/-/rewrite/simple") + t.deepEqual(auth, { + scope : "//reg.npm/design/-/rewrite/", + token : "a-token", + username : undefined, + password : undefined, + email : undefined, + auth : undefined, + alwaysAuth : undefined + }) + t.equal(registry, "http://reg.npm/design/-/rewrite/") + }) + + npm.config.set("scope", "") + npm.config.set("@test2:registry", "http://reg.npm/-/rewrite/") + npm.config.set("//reg.npm/-/rewrite/:_authToken", "b-token") + mapRegistry("@test2/easy", npm.config, function (er, uri, auth, registry) { + t.ifError(er, "mapRegistryToURI worked") + t.equal(uri, "http://reg.npm/-/rewrite/@test2%2feasy") + t.deepEqual(auth, { + scope : "//reg.npm/-/rewrite/", + token : "b-token", + username : undefined, + password : undefined, + email : undefined, + auth : undefined, + alwaysAuth : undefined + }) + t.equal(registry, "http://reg.npm/-/rewrite/") + }) + + npm.config.set("scope", "test") + npm.config.set("@test3:registry", "http://reg.npm/design/-/rewrite/relative") + npm.config.set("//reg.npm/design/-/rewrite/:_authToken", "c-token") + mapRegistry("@test3/basic", npm.config, function (er, uri, auth, registry) { + t.ifError(er, "mapRegistryToURI worked") + t.equal(uri, "http://reg.npm/design/-/rewrite/relative/@test3%2fbasic") + t.deepEqual(auth, { + scope : "//reg.npm/design/-/rewrite/", + token : "c-token", + username : undefined, + password : undefined, + email : undefined, + auth : undefined, + alwaysAuth : undefined + }) + t.equal(registry, "http://reg.npm/design/-/rewrite/relative/") + }) +}) diff --git a/deps/npm/test/tap/nerf-dart.js b/deps/npm/test/tap/nerf-dart.js new file mode 100644 index 00000000000000..157f6c7dfe4b5d --- /dev/null +++ b/deps/npm/test/tap/nerf-dart.js @@ -0,0 +1,32 @@ +// taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js +// originally written by Charlie Robbins, https://github.com/indexzero +var test = require("tap").test +var toNerfDart = require("../../lib/config/nerf-dart.js") + +function validNerfDart (uri, valid) { + if (!valid) valid = "//registry.npmjs.org/" + test(uri, function (t) { + t.equal(toNerfDart(uri), valid) + t.end() + }) +} + +validNerfDart("http://registry.npmjs.org") +validNerfDart("http://registry.npmjs.org/some-package") +validNerfDart("http://registry.npmjs.org/some-package?write=true") +validNerfDart("http://user:pass@registry.npmjs.org/some-package?write=true") +validNerfDart("http://registry.npmjs.org/#random-hash") +validNerfDart("http://registry.npmjs.org/some-package#random-hash") + +validNerfDart( + "http://relative.couchapp.npm/design/-/rewrite/", + "//relative.couchapp.npm/design/-/rewrite/" +) +validNerfDart( + "http://relative.couchapp.npm:8080/design/-/rewrite/", + "//relative.couchapp.npm:8080/design/-/rewrite/" +) +validNerfDart( + "http://relative.couchapp.npm:8080/design/-/rewrite/some-package", + "//relative.couchapp.npm:8080/design/-/rewrite/" +) diff --git a/deps/npm/test/tap/outdated-private.js b/deps/npm/test/tap/outdated-private.js new file mode 100644 index 00000000000000..b0f84647f29a60 --- /dev/null +++ b/deps/npm/test/tap/outdated-private.js @@ -0,0 +1,101 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var rimraf = require("rimraf") +var path = require("path") +var mr = require("npm-registry-mock") +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("graceful-fs") + +var pkg = path.resolve(__dirname, "outdated-private") +var pkgLocalPrivate = path.resolve(pkg, "local-private") +var pkgScopedLocalPrivate = path.resolve(pkg, "another-local-private") +var pkgLocalUnderscore = path.resolve(pkg, "underscore") + +test("setup", function (t) { + bootstrap() + t.end() +}) + +test("outdated ignores private modules", function (t) { + t.plan(3) + process.chdir(pkg) + mr({ port : common.port }, function (s) { + npm.load( + { + loglevel : "silent", + parseable : true, + registry : common.registry + }, + function () { + npm.install(".", function (err) { + t.ifError(err, "install success") + npm.outdated(function (er, d) { + t.ifError(er, "outdated success") + t.deepEqual(d, [[ + path.resolve(__dirname, "outdated-private"), + "underscore", + "1.3.1", + "1.3.1", + "1.5.1", + "file:underscore" + ]]) + s.close() + }) + }) + } + ) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) + +var pjParent = JSON.stringify({ + name : "outdated-private", + version : "1.0.0", + dependencies : { + "local-private" : "file:local-private", + "@scoped/another-local-private" : "file:another-local-private", + "underscore" : "file:underscore" + } +}, null, 2) + "\n" + +var pjLocalPrivate = JSON.stringify({ + name : "local-private", + version : "1.0.0", + private : true +}, null, 2) + "\n" + +var pjScopedLocalPrivate = JSON.stringify({ + name : "@scoped/another-local-private", + version : "1.0.0", + private : true +}, null, 2) + "\n" + +var pjLocalUnderscore = JSON.stringify({ + name : "underscore", + version : "1.3.1" +}, null, 2) + "\n" + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(path.resolve(pkg, "package.json"), pjParent) + + mkdirp.sync(pkgLocalPrivate) + fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivate) + + mkdirp.sync(pkgScopedLocalPrivate) + fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, "package.json"), pjScopedLocalPrivate) + + mkdirp.sync(pkgLocalUnderscore) + fs.writeFileSync(path.resolve(pkgLocalUnderscore, "package.json"), pjLocalUnderscore) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/owner.js b/deps/npm/test/tap/owner.js new file mode 100644 index 00000000000000..47dc255d87577b --- /dev/null +++ b/deps/npm/test/tap/owner.js @@ -0,0 +1,161 @@ +var mr = require("npm-registry-mock") +var test = require("tap").test + +var common = require("../common-tap.js") + +var server + +var EXEC_OPTS = {} + +var jashkenas = { + name : "jashkenas", + email : "jashkenas@gmail.com" +} + +var othiym23 = { + name : "othiym23", + email : "forrest@npmjs.com" +} + +var bcoe = { + name : "bcoe", + email : "ben@npmjs.com" +} + +function shrt (user) { + return user.name+" <"+user.email+">\n" +} + +function mocks (server) { + server.get("/-/user/org.couchdb.user:othiym23") + .many().reply(200, othiym23) + + // test 1 + server.get("/underscore") + .reply(200, {_id:"underscore",_rev:1,maintainers:[jashkenas]}) + server.put( + "/underscore/-rev/1", + {_id:"underscore",_rev:1,maintainers:[jashkenas,othiym23]}, + {} + ).reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + + // test 2 + server.get("/@xxx%2fscoped") + .reply(200, {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe]}) + server.put( + "/@xxx%2fscoped/-rev/1", + {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe,othiym23]}, + {} + ).reply(200, {_id:"@xxx/scoped",_rev:2,maintainers:[bcoe,othiym23]}) + + // test 3 + server.get("/underscore") + .reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + + // test 4 + server.put( + "/underscore/-rev/2", + {_id:"underscore",_rev:2,maintainers:[jashkenas]}, + {} + ).reply(200, {_id:"underscore",_rev:3,maintainers:[jashkenas]}) +} + +test("setup", function (t) { + common.npm( + [ + "--loglevel", "silent", + "cache", "clean" + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, "npm cache clean ran without error") + t.notOk(code, "npm cache clean exited cleanly") + + mr({ port : common.port, mocks : mocks }, function (s) { + server = s + t.end() + }) + } + ) +}) + +test("npm owner add", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "add", "othiym23", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner add ran without error") + t.notOk(code, "npm owner add exited cleanly") + t.notOk(stderr, "npm owner add ran silently") + t.equal(stdout, "+ othiym23 (underscore)\n", "got expected add output") + + t.end() + } + ) +}) + +test("npm owner add (scoped)", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "add", "othiym23", "@xxx/scoped" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner add (scoped) ran without error") + t.notOk(code, "npm owner add (scoped) exited cleanly") + t.notOk(stderr, "npm owner add (scoped) ran silently") + t.equal(stdout, "+ othiym23 (@xxx/scoped)\n", "got expected scoped add output") + + t.end() + } + ) +}) + +test("npm owner ls", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "ls", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner ls ran without error") + t.notOk(code, "npm owner ls exited cleanly") + t.notOk(stderr, "npm owner ls ran silently") + t.equal(stdout, shrt(jashkenas)+shrt(othiym23), "got expected ls output") + + t.end() + } + ) +}) + +test("npm owner rm", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "rm", "othiym23", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner rm ran without error") + t.notOk(code, "npm owner rm exited cleanly") + t.notOk(stderr, "npm owner rm ran silently") + t.equal(stdout, "- othiym23 (underscore)\n", "got expected rm output") + + t.end() + } + ) +}) + +test("cleanup", function (t) { + server.close() + t.end() +}) diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js index 6ce361968db96b..6b5ce26aa48879 100644 --- a/deps/npm/test/tap/run-script.js +++ b/deps/npm/test/tap/run-script.js @@ -19,8 +19,8 @@ function testOutput (t, command, er, code, stdout, stderr) { lines = stdout.trim().split("\n") stdout = lines.filter(function(line) { - return line.trim() !== "" && line[0] !== '>' - }).join(';') + return line.trim() !== "" && line[0] !== ">" + }).join(";") t.equal(stdout, command) t.end() @@ -78,6 +78,31 @@ test("npm run-script explicitly call pre script with arg", function (t) { common.npm(["run-script", "prewith-pre", "--", "an arg"], opts, testOutput.bind(null, t, "an arg")) }) +test("npm run-script test", function (t) { + common.npm(["run-script", "test"], opts, function (er, code, stdout, stderr) { + t.ifError(er, "npm run-script test ran without issue") + t.notOk(stderr, "should not generate errors") + t.end() + }) +}) + +test("npm run-script env", function (t) { + common.npm(["run-script", "env"], opts, function (er, code, stdout, stderr) { + t.ifError(er, "using default env script") + t.notOk(stderr, "should not generate errors") + t.ok( stdout.indexOf("npm_config_init_version") > 0, "expected values in var list" ) + t.end() + }) +}) + +test("npm run-script nonexistent-script", function (t) { + common.npm(["run-script", "nonexistent-script"], opts, function (er, code, stdout, stderr) { + t.ifError(er, "npm run-script nonexistent-script did not cause npm to explode") + t.ok(stderr, "should generate errors") + t.end() + }) +}) + test("cleanup", function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/run-script/package.json b/deps/npm/test/tap/run-script/package.json index afa0e3f0c8de2b..ebaffefe0297ba 100644 --- a/deps/npm/test/tap/run-script/package.json +++ b/deps/npm/test/tap/run-script/package.json @@ -1,13 +1,13 @@ {"name":"runscript" ,"version":"1.2.3" ,"scripts":{ - "start":"node -e 'console.log(process.argv[1] || \"start\")'", - "prewith-pre":"node -e 'console.log(process.argv[1] || \"pre\")'", - "with-pre":"node -e 'console.log(process.argv[1] || \"main\")'", - "with-post":"node -e 'console.log(process.argv[1] || \"main\")'", - "postwith-post":"node -e 'console.log(process.argv[1] || \"post\")'", - "prewith-both":"node -e 'console.log(process.argv[1] || \"pre\")'", - "with-both":"node -e 'console.log(process.argv[1] || \"main\")'", - "postwith-both":"node -e 'console.log(process.argv[1] || \"post\")'" + "start":"node -e \"console.log(process.argv[1] || 'start')\"", + "prewith-pre":"node -e \"console.log(process.argv[1] || 'pre')\"", + "with-pre":"node -e \"console.log(process.argv[1] || 'main')\"", + "with-post":"node -e \"console.log(process.argv[1] || 'main')\"", + "postwith-post":"node -e \"console.log(process.argv[1] || 'post')\"", + "prewith-both":"node -e \"console.log(process.argv[1] || 'pre')\"", + "with-both":"node -e \"console.log(process.argv[1] || 'main')\"", + "postwith-both":"node -e \"console.log(process.argv[1] || 'post')\"" } } diff --git a/deps/npm/test/tap/shrinkwrap-local-dependency.js b/deps/npm/test/tap/shrinkwrap-local-dependency.js new file mode 100644 index 00000000000000..d9514e42d3237e --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-local-dependency.js @@ -0,0 +1,121 @@ +var test = require("tap").test +var path = require("path") +var fs = require("fs") +var osenv = require("osenv") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var PKG_DIR = path.resolve(__dirname, "shrinkwrap-local-dependency") +var CACHE_DIR = path.resolve(PKG_DIR, "cache") +var DEP_DIR = path.resolve(PKG_DIR, "dep") + +test("shrinkwrap uses resolved with file: on local deps", function(t) { + setup() + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + {}, + function (err, code) { + t.ifError(err, "npm install worked") + t.equal(code, 0, "npm exited normally") + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "shrinkwrap"], + {}, + function (err, code) { + t.ifError(err, "npm shrinkwrap worked") + t.equal(code, 0, "npm exited normally") + + fs.readFile("npm-shrinkwrap.json", { encoding : "utf8" }, function (err, data) { + t.ifError(err, "read file correctly") + t.deepEqual(JSON.parse(data), desired, "shrinkwrap looks correct") + + t.end() + }) + } + ) + } + ) +}) + +test('"npm install" should install local packages from shrinkwrap', function (t) { + cleanNodeModules() + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + {}, + function (err, code) { + t.ifError(err, "install ran correctly") + t.notOk(code, "npm install exited with code 0") + var dependencyPackageJson = path.resolve( + PKG_DIR, + "node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json" + ) + t.ok( + JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")), + "package with local dependency installed from shrinkwrap" + ) + + t.end() + } + ) +}) + +test("cleanup", function(t) { + cleanup() + t.end() +}) + +var desired = { + "name": "npm-test-shrinkwrap-local-dependency", + "version": "0.0.0", + "dependencies": { + "npm-test-shrinkwrap-local-dependency-dep": { + "version": "0.0.0", + "from": "dep", + "resolved": "file:dep" + } + } +} + +var root = { + "author": "Thomas Torp", + "name": "npm-test-shrinkwrap-local-dependency", + "version": "0.0.0", + "dependencies": { + "npm-test-shrinkwrap-local-dependency-dep": "file:./dep" + } +} + +var dependency = { + "author": "Thomas Torp", + "name": "npm-test-shrinkwrap-local-dependency-dep", + "version": "0.0.0" +} + +function setup() { + cleanup() + mkdirp.sync(PKG_DIR) + mkdirp.sync(CACHE_DIR) + mkdirp.sync(DEP_DIR) + fs.writeFileSync( + path.resolve(PKG_DIR, "package.json"), + JSON.stringify(root, null, 2) + ) + fs.writeFileSync( + path.resolve(DEP_DIR, "package.json"), + JSON.stringify(dependency, null, 2) + ) + process.chdir(PKG_DIR) +} + +function cleanNodeModules() { + rimraf.sync(path.resolve(PKG_DIR, "node_modules")) +} + +function cleanup() { + process.chdir(osenv.tmpdir()) + cleanNodeModules() + rimraf.sync(PKG_DIR) +} diff --git a/deps/npm/test/tap/shrinkwrap-scoped-auth.js b/deps/npm/test/tap/shrinkwrap-scoped-auth.js new file mode 100644 index 00000000000000..d6bb6b8d6a0649 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-scoped-auth.js @@ -0,0 +1,108 @@ +var resolve = require("path").resolve +var writeFileSync = require("graceful-fs").writeFileSync + +var mkdirp = require("mkdirp") +var mr = require("npm-registry-mock") +var osenv = require("osenv") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") +var toNerfDart = require("../../lib/config/nerf-dart.js") + +var pkg = resolve(__dirname, "shrinkwrap-scoped-auth") +var outfile = resolve(pkg, "_npmrc") +var modules = resolve(pkg, "node_modules") +var tarballPath = "/scoped-underscore/-/scoped-underscore-1.3.1.tgz" +var tarballURL = common.registry + tarballPath +var tarball = resolve(__dirname, "../fixtures/scoped-underscore-1.3.1.tgz") + +var server + +var EXEC_OPTS = { + cwd : pkg +} + +function mocks (server) { + var auth = "Bearer 0xabad1dea" + server.get(tarballPath, { authorization : auth }).replyWithFile(200, tarball) + server.get(tarballPath).reply(401, { + error : "unauthorized", + reason : "You are not authorized to access this db." + }) +} + +test("setup", function (t) { + mr({ port : common.port, mocks : mocks }, function (s) { + server = s + t.ok(s, "set up mock registry") + setup() + t.end() + }) +}) + +test("authed npm install with shrinkwrapped scoped package", function (t) { + common.npm( + [ + "install", + "--loglevel", "silent", + "--fetch-retries", 0, + "--userconfig", outfile + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "test runner executed without error") + t.equal(code, 0, "npm install exited OK") + t.notOk(stderr, "no output on stderr") + t.equal( + stdout, + "@scoped/underscore@1.3.1 node_modules/@scoped/underscore\n", + "module installed where expected" + ) + + t.end() + } + ) +}) + +test("cleanup", function (t) { + server.close() + cleanup() + t.end() +}) + +var contents = "@scoped:registry="+common.registry+"\n" + + toNerfDart(common.registry)+":_authToken=0xabad1dea\n" + +var json = { + name : "test-package-install", + version : "1.0.0" +} + +var shrinkwrap = { + name : "test-package-install", + version : "1.0.0", + dependencies : { + "@scoped/underscore" : { + resolved : tarballURL, + from : ">=1.3.1 <2", + version : "1.3.1" + } + } +} + +function setup () { + cleanup() + mkdirp.sync(modules) + writeFileSync(resolve(pkg, "package.json"), JSON.stringify(json, null, 2)+"\n") + writeFileSync(outfile, contents) + writeFileSync( + resolve(pkg, "npm-shrinkwrap.json"), + JSON.stringify(shrinkwrap, null, 2)+"\n" + ) +} + +function cleanup() { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/spawn-enoent-help.js b/deps/npm/test/tap/spawn-enoent-help.js new file mode 100644 index 00000000000000..70fb078faf77e8 --- /dev/null +++ b/deps/npm/test/tap/spawn-enoent-help.js @@ -0,0 +1,34 @@ +var path = require("path") +var test = require("tap").test +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "spawn-enoent-help") + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + t.end() +}) + +test("enoent help", function (t) { + common.npm(["help", "config"], { + cwd: pkg, + env: { + PATH: "", + Path: "", + "npm_config_loglevel": "warn", + "npm_config_viewer": "woman" + } + }, function (er, code, sout, serr) { + t.similar(serr, /Check if the file 'emacsclient' is present./) + t.equal(global.cooked, undefined, "Don't leak into global scope") + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/spawn-enoent.js b/deps/npm/test/tap/spawn-enoent.js index 20fed21bcf4e06..29b70f6f8ac19e 100644 --- a/deps/npm/test/tap/spawn-enoent.js +++ b/deps/npm/test/tap/spawn-enoent.js @@ -29,7 +29,7 @@ test("enoent script", function (t) { "npm_config_loglevel": "warn" } }, function (er, code, sout, serr) { - t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script\./) + t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script 'wharble-garble-blorst'\./) t.end() }) }) diff --git a/deps/npm/test/tap/unpack-foreign-tarball.js b/deps/npm/test/tap/unpack-foreign-tarball.js index d2e2e73c918129..b998175b66e9e9 100644 --- a/deps/npm/test/tap/unpack-foreign-tarball.js +++ b/deps/npm/test/tap/unpack-foreign-tarball.js @@ -51,12 +51,18 @@ test("gitignore and npmignore", function (t) { common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"])) }) -test("gitignore and npmignore, not gzipped", function (t) { +test("gitignore and npmignore, not gzipped 1/2", function (t) { setup() var file = path.resolve(dir, "gitignore-and-npmignore.tar") common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"])) }) +test("gitignore and npmignore, not gzipped 2/2", function (t) { + setup() + var file = path.resolve(dir, "gitignore-and-npmignore-2.tar") + common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"])) +}) + test("clean", function (t) { clean() t.end() diff --git a/deps/npm/test/tap/unpack-foreign-tarball/gitignore-and-npmignore-2.tar b/deps/npm/test/tap/unpack-foreign-tarball/gitignore-and-npmignore-2.tar new file mode 100644 index 00000000000000..289dd568bd6f8c Binary files /dev/null and b/deps/npm/test/tap/unpack-foreign-tarball/gitignore-and-npmignore-2.tar differ diff --git a/deps/npm/test/tap/update-index.js b/deps/npm/test/tap/update-index.js new file mode 100644 index 00000000000000..f592ecb070bfc8 --- /dev/null +++ b/deps/npm/test/tap/update-index.js @@ -0,0 +1,188 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var path = require("path") +var mr = require("npm-registry-mock") + +var updateIndex = require("../../lib/cache/update-index.js") + +var PKG_DIR = path.resolve(__dirname, "get-basic") +var CACHE_DIR = path.resolve(PKG_DIR, "cache") + +var server + +function setup (t, mock) { + mkdirp.sync(CACHE_DIR) + mr({ port: common.port, mocks: mock }, function (s) { + npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { + t.ifError(err, "no error") + server = s + t.end() + }) + }) +} + +function cleanup (t) { + server.close() + rimraf.sync(PKG_DIR) + + t.end() +} + +test("setup basic", function (t) { + setup(t, mocks.basic) +}) + +test("request basic", function (t) { + updateIndex("http://localhost:1337/-/all", {}, function (er) { + t.ifError(er, "no error") + t.end() + }) +}) + +test("cleanup basic", cleanup) + +test("setup auth", function (t) { + setup(t, mocks.auth) +}) + +test("request auth failure", function (t) { + updateIndex("http://localhost:1337/-/all", {}, function (er) { + t.ok(er.code, "E401") + t.ok(/^unauthorized/.test(er.message), "unauthorized message") + t.end() + }) +}) + +test("request auth success", function (t) { + // mimic as if alwaysAuth had been set + var params = { + auth: { + username: "bobby", + password: "tables", + alwaysAuth: true + } + } + + updateIndex("http://localhost:1337/-/all", params, function (er) { + t.ifError(er, "no error") + t.end() + }) +}) + +test("cleanup auth", cleanup) + +var mocks = { + basic: function (server) { + server.get("/-/all").reply(200, allMock) + }, + auth: function (server) { + var littleBobbyTablesAuth = new Buffer("bobby:tables").toString("base64") + var auth = "Basic " + littleBobbyTablesAuth + server.get("/-/all", { authorization: auth }).reply(200, allMock) + server.get("/-/all").reply(401, { + error: "unauthorized", + reason: "You are not authorized to access this db." + }) + } +} + +var allMock = { + "_updated": 1411727900+25, + "generator-frontcow": { + "name": "generator-frontcow", + "description": "f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache", + "dist-tags": { + "latest": "0.1.19" + }, + "maintainers": [ + { + "name": "bcabanes", + "email": "contact@benjamincabanes.com" + } + ], + "homepage": "https://github.com/bcabanes/generator-frontcow", + "keywords": [ + "sass", + "frontend", + "yeoman-generator", + "atomic", + "design", + "sass", + "foundation", + "foundation5", + "atomic design", + "bourbon", + "polyfill", + "font awesome" + ], + "repository": { + "type": "git", + "url": "https://github.com/bcabanes/generator-frontcow" + }, + "author": { + "name": "ben", + "email": "contact@benjamincabanes.com", + "url": "https://github.com/bcabanes" + }, + "bugs": { + "url": "https://github.com/bcabanes/generator-frontcow/issues" + }, + "license": "MIT", + "readmeFilename": "README.md", + "time": { + "modified": "2014-10-03T02:26:18.406Z" + }, + "versions": { + "0.1.19": "latest" + } + }, + "marko": { + "name": "marko", + "description": "Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.", + "dist-tags": { + "latest": "1.2.16" + }, + "maintainers": [ + { + "name": "pnidem", + "email": "pnidem@gmail.com" + }, + { + "name": "philidem", + "email": "phillip.idem@gmail.com" + } + ], + "homepage": "https://github.com/raptorjs/marko", + "keywords": [ + "templating", + "template", + "async", + "streaming" + ], + "repository": { + "type": "git", + "url": "https://github.com/raptorjs/marko.git" + }, + "author": { + "name": "Patrick Steele-Idem", + "email": "pnidem@gmail.com" + }, + "bugs": { + "url": "https://github.com/raptorjs/marko/issues" + }, + "license": "Apache License v2.0", + "readmeFilename": "README.md", + "users": { + "pnidem": true + }, + "time": { + "modified": "2014-10-03T02:27:31.775Z" + }, + "versions": { + "1.2.16": "latest" + } + } +} diff --git a/deps/npm/test/tap/version-git-not-clean.js b/deps/npm/test/tap/version-git-not-clean.js new file mode 100644 index 00000000000000..efca3624077c0b --- /dev/null +++ b/deps/npm/test/tap/version-git-not-clean.js @@ -0,0 +1,81 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var which = require("which") +var spawn = require("child_process").spawn + +var pkg = path.resolve(__dirname, "version-git-not-clean") +var cache = path.resolve(pkg, "cache") + +test("npm version with working directory not clean", function (t) { + setup() + npm.load({ cache: cache, registry: common.registry, prefix: pkg }, function () { + which("git", function (err, git) { + t.ifError(err, "git found") + + function gitInit(_cb) { + var child = spawn(git, ["init"]) + var out = "" + child.stdout.on("data", function (d) { + out += d.toString() + }) + child.on("exit", function () { + return _cb(out) + }) + } + + function addPackageJSON(_cb) { + var data = JSON.stringify({ name: "blah", version: "0.1.2" }) + fs.writeFile("package.json", data, function() { + var child = spawn(git, ["add", "package.json"]) + child.on("exit", function () { + var child2 = spawn(git, ["commit", "package.json", "-m", "init"]) + var out = "" + child2.stdout.on("data", function (d) { + out += d.toString() + }) + child2.on("exit", function () { + return _cb(out) + }) + }) + }) + } + + gitInit(function() { + addPackageJSON(function() { + var data = JSON.stringify({ name: "blah", version: "0.1.3" }) + fs.writeFile("package.json", data, function() { + npm.commands.version(["patch"], function (err) { + if (!err) { + t.fail("should fail on non-clean working directory") + } + else { + t.equal(err.message, "Git working directory not clean.\nM package.json") + } + t.end() + }) + }) + }) + }) + }) + }) +}) + +test("cleanup", function (t) { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + mkdirp.sync(cache) + process.chdir(pkg) +} diff --git a/deps/npm/test/tap/version-no-package.js b/deps/npm/test/tap/version-no-package.js new file mode 100644 index 00000000000000..539f53feb72ca9 --- /dev/null +++ b/deps/npm/test/tap/version-no-package.js @@ -0,0 +1,45 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var osenv = require("osenv") +var path = require("path") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var pkg = path.resolve(__dirname, "version-no-package") + +test("setup", function (t) { + setup() + t.end() +}) + +test("npm version in a prefix with no package.json", function(t) { + setup() + common.npm( + ["version", "--json", "--prefix", pkg], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm version doesn't care that there's no package.json") + t.notOk(code, "npm version ran without barfing") + t.ok(stdout, "got version output") + t.notOk(stderr, "no error output") + t.doesNotThrow(function () { + var metadata = JSON.parse(stdout) + t.equal(metadata.node, process.versions.node, "node versions match") + + t.end() + }, "able to reconstitute version object from stdout") + } + ) +}) + +test("cleanup", function(t) { + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + process.chdir(pkg) +} diff --git a/deps/npm/test/tap/version-update-shrinkwrap.js b/deps/npm/test/tap/version-update-shrinkwrap.js new file mode 100644 index 00000000000000..204c7323b3ca91 --- /dev/null +++ b/deps/npm/test/tap/version-update-shrinkwrap.js @@ -0,0 +1,249 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var which = require("which") +var spawn = require("child_process").spawn + +var pkg = path.resolve(__dirname, "version-shrinkwrap") +var cache = path.resolve(pkg, "cache") + +test("npm version updates shrinkwrap - no git", function (t) { + setup() + npm.load({ cache: pkg + "/cache", registry: common.registry }, function () { + npm.commands.version(["patch"], function(err) { + if (err) return t.fail("Error perform version patch") + var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json")) + t.equal(shrinkwrap.version, "0.0.1", "got expected version") + t.end() + }) + }) +}) + +test("npm version updates git works with no shrinkwrap", function (t) { + setup() + + rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json")) + + var opts = { + cache : cache, + registry : common.registry + } + npm.load(opts, function () { + npm.config.set("sign-git-tag", false) + which("git", function (err, git) { + if (err) t.fail("Git not installed, or which git command error") + + initRepo() + + function initRepo () { + var init = spawn(git, ["init"]) + init.stdout.pipe(process.stdout) + init.on("exit", function (code) { + t.notOk(code, "git init exited without issue") + + configName() + }) + } + + function configName () { + var namer = spawn(git, ["config", "user.name", "Phantom Faker"]) + namer.stdout.pipe(process.stdout) + namer.on("exit", function (code) { + t.notOk(code, "git config user.name exited without issue") + + configEmail() + }) + } + + function configEmail () { + var emailer = spawn(git, ["config", "user.email", "nope@not.real"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git config user.email exited without issue") + + addAll() + }) + } + + function addAll () { + var emailer = spawn(git, ["add", "package.json"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git add package.json exited without issue") + + commit() + }) + + } + + function commit () { + var emailer = spawn(git, ["commit", "-m", "test setup"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git commit -m 'test setup' exited without issue") + + version() + }) + + } + + function version () { + npm.commands.version(["patch"], checkCommit) + } + + function checkCommit (er) { + t.ifError(er, "version command ran without error") + + var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json")) + t.equal(shrinkwrap.version, "0.0.1", "got expected version") + + var shower = spawn(git, ["show", "HEAD", "--name-only"]) + var out = "", eout = "" + shower.stdout.on("data", function (d) { + out += d.toString() + }) + shower.stderr.on("data", function (d) { + eout += d.toString() + }) + shower.on("exit", function (code) { + t.notOk(code, "git show HEAD exited without issue") + t.notOk(err, "git show produced no error output") + + var lines = out.split("\n") + t.notEqual(lines.indexOf("package.json"), -1, "package.json commited") + t.equal(lines.indexOf("npm-shrinkwrap.json"), -1, "npm-shrinkwrap.json not present") + + t.end() + }) + } + }) + }) +}) + +test("npm version updates shrinkwrap and updates git", function (t) { + setup() + + var opts = { + cache : cache, + registry : common.registry + } + npm.load(opts, function () { + npm.config.set("sign-git-tag", false) + which("git", function (err, git) { + t.ifError(err, "git found") + + initRepo() + + function initRepo () { + var init = spawn(git, ["init"]) + init.stdout.pipe(process.stdout) + init.on("exit", function (code) { + t.notOk(code, "git init exited without issue") + + configName() + }) + } + + function configName () { + var namer = spawn(git, ["config", "user.name", "Phantom Faker"]) + namer.stdout.pipe(process.stdout) + namer.on("exit", function (code) { + t.notOk(code, "git config user.name exited without issue") + + configEmail() + }) + } + + function configEmail () { + var emailer = spawn(git, ["config", "user.email", "nope@not.real"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git config user.email exited without issue") + + addAll() + }) + } + + function addAll () { + var emailer = spawn(git, ["add", "package.json", "npm-shrinkwrap.json"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git add package.json npm-shrinkwrap.json exited without issue") + + commit() + }) + + } + + function commit () { + var emailer = spawn(git, ["commit", "-m", "test setup"]) + emailer.stdout.pipe(process.stdout) + emailer.on("exit", function (code) { + t.notOk(code, "git commit -m 'test setup' exited without issue") + + version() + }) + + } + + function version () { + npm.commands.version(["patch"], checkCommit) + } + + function checkCommit (er) { + t.ifError(er, "version command ran without error") + + var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json")) + t.equal(shrinkwrap.version, "0.0.1", "got expected version") + + var shower = spawn(git, ["show", "HEAD", "--name-only"]) + var out = "", eout = "" + shower.stdout.on("data", function (d) { + out += d.toString() + }) + shower.stderr.on("data", function (d) { + eout += d.toString() + }) + shower.on("exit", function (code) { + t.notOk(code, "git show HEAD exited without issue") + t.notOk(err, "git show produced no error output") + + var lines = out.split("\n") + t.notEqual(lines.indexOf("package.json"), -1, "package.json commited") + t.notEqual(lines.indexOf("npm-shrinkwrap.json"), -1, "npm-shrinkwrap.json commited") + + t.end() + }) + } + }) + }) +}) + +test("cleanup", function(t) { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(cache) + var contents = { + author: "Nathan Bowser && Faiq Raza", + name: "version-with-shrinkwrap-test", + version: "0.0.0", + description: "Test for version with shrinkwrap update" + } + + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(contents), "utf8") + fs.writeFileSync(path.resolve(pkg, "npm-shrinkwrap.json"), JSON.stringify(contents), "utf8") + process.chdir(pkg) +} diff --git a/deps/npm/test/tap/zz-cleanup.js b/deps/npm/test/tap/zz-cleanup.js index 7167537e0601b2..c491cbf0711f1c 100644 --- a/deps/npm/test/tap/zz-cleanup.js +++ b/deps/npm/test/tap/zz-cleanup.js @@ -1,15 +1,8 @@ var common = require("../common-tap") var test = require("tap").test -var fs = require("fs") +var rimraf = require("rimraf") test("cleanup", function (t) { - var res = common.deleteNpmCacheRecursivelySync() - t.equal(res, 0, "Deleted test npm cache successfully") - - // ensure cache is clean - fs.readdir(common.npm_config_cache, function (err) { - t.ok(err, "error expected") - t.equal(err.code, "ENOENT", "npm cache directory no longer exists") - t.end() - }) + rimraf.sync(common.npm_config_cache) + t.end() }) diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index 5d7880a558f4ee..6b644ab253906b 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -925,9 +925,8 @@ 'asm/x64-win32-masm/whrlpool/wp-x86_64.asm', 'asm/x64-win32-masm/modes/ghash-x86_64.asm', 'asm/x64-win32-masm/x86_64cpuid.asm', - # Non-generated asm - 'openssl/crypto/bn/asm/x86_64-win32-masm.asm', # No asm available + 'openssl/crypto/bn/bn_asm.c', 'openssl/crypto/bf/bf_enc.c', 'openssl/crypto/cast/c_enc.c', 'openssl/crypto/camellia/cmll_misc.c', @@ -1095,6 +1094,13 @@ 'PURIFY', '_REENTRANT', + # SSLv2 is known broken and has been superseded by SSLv3 for almost + # twenty years now. + 'OPENSSL_NO_SSL2', + + # SSLv3 is susceptible to downgrade attacks (POODLE.) + 'OPENSSL_NO_SSL3', + # Heartbeat is a TLS extension, that couldn't be turned off or # asked to be not advertised. Unfortunately this is unacceptable for # Microsoft's IIS, which seems to be ignoring whole ClientHello after @@ -1108,6 +1114,11 @@ 'WIN32_LEAN_AND_MEAN', 'OPENSSL_SYSNAME_WIN32', ], + 'msvs_disabled_warnings': [ + 4244, # conversion from 'signed type', possible loss of data + 4267, # conversion from 'unsigned type', possible loss of data + 4996, # 'GetVersionExA': was declared deprecated + ], }, { 'defines': [ # ENGINESDIR must be defined if OPENSSLDIR is. diff --git a/deps/openssl/openssl/CHANGES b/deps/openssl/openssl/CHANGES index 277b46f17c0dcd..117ba6d79a59af 100644 --- a/deps/openssl/openssl/CHANGES +++ b/deps/openssl/openssl/CHANGES @@ -2,6 +2,136 @@ OpenSSL CHANGES _______________ + Changes between 1.0.1j and 1.0.1k [8 Jan 2015] + + *) Fix DTLS segmentation fault in dtls1_get_record. A carefully crafted DTLS + message can cause a segmentation fault in OpenSSL due to a NULL pointer + dereference. This could lead to a Denial Of Service attack. Thanks to + Markus Stenberg of Cisco Systems, Inc. for reporting this issue. + (CVE-2014-3571) + [Steve Henson] + + *) Fix DTLS memory leak in dtls1_buffer_record. A memory leak can occur in the + dtls1_buffer_record function under certain conditions. In particular this + could occur if an attacker sent repeated DTLS records with the same + sequence number but for the next epoch. The memory leak could be exploited + by an attacker in a Denial of Service attack through memory exhaustion. + Thanks to Chris Mueller for reporting this issue. + (CVE-2015-0206) + [Matt Caswell] + + *) Fix issue where no-ssl3 configuration sets method to NULL. When openssl is + built with the no-ssl3 option and a SSL v3 ClientHello is received the ssl + method would be set to NULL which could later result in a NULL pointer + dereference. Thanks to Frank Schmirler for reporting this issue. + (CVE-2014-3569) + [Kurt Roeckx] + + *) Abort handshake if server key exchange message is omitted for ephemeral + ECDH ciphersuites. + + Thanks to Karthikeyan Bhargavan of the PROSECCO team at INRIA for + reporting this issue. + (CVE-2014-3572) + [Steve Henson] + + *) Remove non-export ephemeral RSA code on client and server. This code + violated the TLS standard by allowing the use of temporary RSA keys in + non-export ciphersuites and could be used by a server to effectively + downgrade the RSA key length used to a value smaller than the server + certificate. Thanks for Karthikeyan Bhargavan of the PROSECCO team at + INRIA or reporting this issue. + (CVE-2015-0204) + [Steve Henson] + + *) Fixed issue where DH client certificates are accepted without verification. + An OpenSSL server will accept a DH certificate for client authentication + without the certificate verify message. This effectively allows a client to + authenticate without the use of a private key. This only affects servers + which trust a client certificate authority which issues certificates + containing DH keys: these are extremely rare and hardly ever encountered. + Thanks for Karthikeyan Bhargavan of the PROSECCO team at INRIA or reporting + this issue. + (CVE-2015-0205) + [Steve Henson] + + *) Ensure that the session ID context of an SSL is updated when its + SSL_CTX is updated via SSL_set_SSL_CTX. + + The session ID context is typically set from the parent SSL_CTX, + and can vary with the CTX. + [Adam Langley] + + *) Fix various certificate fingerprint issues. + + By using non-DER or invalid encodings outside the signed portion of a + certificate the fingerprint can be changed without breaking the signature. + Although no details of the signed portion of the certificate can be changed + this can cause problems with some applications: e.g. those using the + certificate fingerprint for blacklists. + + 1. Reject signatures with non zero unused bits. + + If the BIT STRING containing the signature has non zero unused bits reject + the signature. All current signature algorithms require zero unused bits. + + 2. Check certificate algorithm consistency. + + Check the AlgorithmIdentifier inside TBS matches the one in the + certificate signature. NB: this will result in signature failure + errors for some broken certificates. + + Thanks to Konrad Kraszewski from Google for reporting this issue. + + 3. Check DSA/ECDSA signatures use DER. + + Reencode DSA/ECDSA signatures and compare with the original received + signature. Return an error if there is a mismatch. + + This will reject various cases including garbage after signature + (thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS + program for discovering this case) and use of BER or invalid ASN.1 INTEGERs + (negative or with leading zeroes). + + Further analysis was conducted and fixes were developed by Stephen Henson + of the OpenSSL core team. + + (CVE-2014-8275) + [Steve Henson] + + *) Correct Bignum squaring. Bignum squaring (BN_sqr) may produce incorrect + results on some platforms, including x86_64. This bug occurs at random + with a very low probability, and is not known to be exploitable in any + way, though its exact impact is difficult to determine. Thanks to Pieter + Wuille (Blockstream) who reported this issue and also suggested an initial + fix. Further analysis was conducted by the OpenSSL development team and + Adam Langley of Google. The final fix was developed by Andy Polyakov of + the OpenSSL core team. + (CVE-2014-3570) + [Andy Polyakov] + + *) Do not resume sessions on the server if the negotiated protocol + version does not match the session's version. Resuming with a different + version, while not strictly forbidden by the RFC, is of questionable + sanity and breaks all known clients. + [David Benjamin, Emilia Ksper] + + *) Tighten handling of the ChangeCipherSpec (CCS) message: reject + early CCS messages during renegotiation. (Note that because + renegotiation is encrypted, this early CCS was not exploitable.) + [Emilia Ksper] + + *) Tighten client-side session ticket handling during renegotiation: + ensure that the client only accepts a session ticket if the server sends + the extension anew in the ServerHello. Previously, a TLS client would + reuse the old extension state and thus accept a session ticket if one was + announced in the initial ServerHello. + + Similarly, ensure that the client requires a session ticket if one + was advertised in the ServerHello. Previously, a TLS client would + ignore a missing NewSessionTicket message. + [Emilia Ksper] + Changes between 1.0.1i and 1.0.1j [15 Oct 2014] *) SRTP Memory Leak. diff --git a/deps/openssl/openssl/Configure b/deps/openssl/openssl/Configure index 6f0da761b66644..541be9ec57d865 100755 --- a/deps/openssl/openssl/Configure +++ b/deps/openssl/openssl/Configure @@ -804,6 +804,11 @@ PROCESS_ARGS: { $disabled{"tls1"} = "option(tls)" } + elsif ($1 eq "ssl3-method") + { + $disabled{"ssl3-method"} = "option(ssl)"; + $disabled{"ssl3"} = "option(ssl)"; + } else { $disabled{$1} = "option"; diff --git a/deps/openssl/openssl/Makefile b/deps/openssl/openssl/Makefile index d475c12d46944c..6282bdebab6285 100644 --- a/deps/openssl/openssl/Makefile +++ b/deps/openssl/openssl/Makefile @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1j +VERSION=1.0.1k MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 diff --git a/deps/openssl/openssl/Makefile.bak b/deps/openssl/openssl/Makefile.bak index a90fb0854b2256..34fd58f46871ba 100644 --- a/deps/openssl/openssl/Makefile.bak +++ b/deps/openssl/openssl/Makefile.bak @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.1j-dev +VERSION=1.0.1k-dev MAJOR=1 MINOR=0.1 SHLIB_VERSION_NUMBER=1.0.0 diff --git a/deps/openssl/openssl/NEWS b/deps/openssl/openssl/NEWS index 512a667ff42416..85969135ff17d6 100644 --- a/deps/openssl/openssl/NEWS +++ b/deps/openssl/openssl/NEWS @@ -5,6 +5,17 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.1j and OpenSSL 1.0.1k [8 Jan 2015] + + o Fix for CVE-2014-3571 + o Fix for CVE-2015-0206 + o Fix for CVE-2014-3569 + o Fix for CVE-2014-3572 + o Fix for CVE-2015-0204 + o Fix for CVE-2015-0205 + o Fix for CVE-2014-8275 + o Fix for CVE-2014-3570 + Major changes between OpenSSL 1.0.1i and OpenSSL 1.0.1j [15 Oct 2014] o Fix for CVE-2014-3513 diff --git a/deps/openssl/openssl/README b/deps/openssl/openssl/README index cb90c9f4028dc4..df2734d3b5a4ba 100644 --- a/deps/openssl/openssl/README +++ b/deps/openssl/openssl/README @@ -1,5 +1,5 @@ - OpenSSL 1.0.1j 15 Oct 2014 + OpenSSL 1.0.1k 8 Jan 2015 Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson diff --git a/deps/openssl/openssl/apps/ca.c b/deps/openssl/openssl/apps/ca.c index 9c25026ac0b20a..613f5bee5cc399 100644 --- a/deps/openssl/openssl/apps/ca.c +++ b/deps/openssl/openssl/apps/ca.c @@ -703,7 +703,7 @@ EF_ALIGNMENT=0; ERR_clear_error(); #ifdef RL_DEBUG if (!p) - BIO_printf(bio_err, "DEBUG: unique_subject undefined\n", p); + BIO_printf(bio_err, "DEBUG: unique_subject undefined\n"); #endif #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: configured unique_subject is %d\n", diff --git a/deps/openssl/openssl/apps/dgst.c b/deps/openssl/openssl/apps/dgst.c index f4aec779c1dbe5..e31a6b182eb820 100644 --- a/deps/openssl/openssl/apps/dgst.c +++ b/deps/openssl/openssl/apps/dgst.c @@ -273,6 +273,8 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err,"-d to output debug info\n"); BIO_printf(bio_err,"-hex output as hex dump\n"); BIO_printf(bio_err,"-binary output in binary form\n"); + BIO_printf(bio_err,"-hmac arg set the HMAC key to arg\n"); + BIO_printf(bio_err,"-non-fips-allow allow use of non FIPS digest\n"); BIO_printf(bio_err,"-sign file sign digest using private key in file\n"); BIO_printf(bio_err,"-verify file verify a signature using public key in file\n"); BIO_printf(bio_err,"-prverify file verify a signature using private key in file\n"); diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c index 04263ffd927f88..8883afc9565b01 100644 --- a/deps/openssl/openssl/apps/ocsp.c +++ b/deps/openssl/openssl/apps/ocsp.c @@ -583,51 +583,52 @@ int MAIN(int argc, char **argv) BIO_printf (bio_err, "OCSP utility\n"); BIO_printf (bio_err, "Usage ocsp [options]\n"); BIO_printf (bio_err, "where options are\n"); - BIO_printf (bio_err, "-out file output filename\n"); - BIO_printf (bio_err, "-issuer file issuer certificate\n"); - BIO_printf (bio_err, "-cert file certificate to check\n"); - BIO_printf (bio_err, "-serial n serial number to check\n"); - BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n"); - BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n"); - BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n"); - BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n"); - BIO_printf (bio_err, "-req_text print text form of request\n"); - BIO_printf (bio_err, "-resp_text print text form of response\n"); - BIO_printf (bio_err, "-text print text form of request and response\n"); - BIO_printf (bio_err, "-reqout file write DER encoded OCSP request to \"file\"\n"); - BIO_printf (bio_err, "-respout file write DER encoded OCSP reponse to \"file\"\n"); - BIO_printf (bio_err, "-reqin file read DER encoded OCSP request from \"file\"\n"); - BIO_printf (bio_err, "-respin file read DER encoded OCSP reponse from \"file\"\n"); - BIO_printf (bio_err, "-nonce add OCSP nonce to request\n"); - BIO_printf (bio_err, "-no_nonce don't add OCSP nonce to request\n"); - BIO_printf (bio_err, "-url URL OCSP responder URL\n"); - BIO_printf (bio_err, "-host host:n send OCSP request to host on port n\n"); - BIO_printf (bio_err, "-path path to use in OCSP request\n"); - BIO_printf (bio_err, "-CApath dir trusted certificates directory\n"); - BIO_printf (bio_err, "-CAfile file trusted certificates file\n"); - BIO_printf (bio_err, "-VAfile file validator certificates file\n"); - BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n"); - BIO_printf (bio_err, "-status_age n maximum status age in seconds\n"); - BIO_printf (bio_err, "-noverify don't verify response at all\n"); - BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n"); - BIO_printf (bio_err, "-trust_other don't verify additional certificates\n"); - BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n"); + BIO_printf (bio_err, "-out file output filename\n"); + BIO_printf (bio_err, "-issuer file issuer certificate\n"); + BIO_printf (bio_err, "-cert file certificate to check\n"); + BIO_printf (bio_err, "-serial n serial number to check\n"); + BIO_printf (bio_err, "-signer file certificate to sign OCSP request with\n"); + BIO_printf (bio_err, "-signkey file private key to sign OCSP request with\n"); + BIO_printf (bio_err, "-sign_other file additional certificates to include in signed request\n"); + BIO_printf (bio_err, "-no_certs don't include any certificates in signed request\n"); + BIO_printf (bio_err, "-req_text print text form of request\n"); + BIO_printf (bio_err, "-resp_text print text form of response\n"); + BIO_printf (bio_err, "-text print text form of request and response\n"); + BIO_printf (bio_err, "-reqout file write DER encoded OCSP request to \"file\"\n"); + BIO_printf (bio_err, "-respout file write DER encoded OCSP reponse to \"file\"\n"); + BIO_printf (bio_err, "-reqin file read DER encoded OCSP request from \"file\"\n"); + BIO_printf (bio_err, "-respin file read DER encoded OCSP reponse from \"file\"\n"); + BIO_printf (bio_err, "-nonce add OCSP nonce to request\n"); + BIO_printf (bio_err, "-no_nonce don't add OCSP nonce to request\n"); + BIO_printf (bio_err, "-url URL OCSP responder URL\n"); + BIO_printf (bio_err, "-host host:n send OCSP request to host on port n\n"); + BIO_printf (bio_err, "-path path to use in OCSP request\n"); + BIO_printf (bio_err, "-CApath dir trusted certificates directory\n"); + BIO_printf (bio_err, "-CAfile file trusted certificates file\n"); + BIO_printf (bio_err, "-VAfile file validator certificates file\n"); + BIO_printf (bio_err, "-validity_period n maximum validity discrepancy in seconds\n"); + BIO_printf (bio_err, "-status_age n maximum status age in seconds\n"); + BIO_printf (bio_err, "-noverify don't verify response at all\n"); + BIO_printf (bio_err, "-verify_other file additional certificates to search for signer\n"); + BIO_printf (bio_err, "-trust_other don't verify additional certificates\n"); + BIO_printf (bio_err, "-no_intern don't search certificates contained in response for signer\n"); BIO_printf (bio_err, "-no_signature_verify don't check signature on response\n"); - BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n"); - BIO_printf (bio_err, "-no_chain don't chain verify response\n"); - BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n"); - BIO_printf (bio_err, "-port num port to run responder on\n"); - BIO_printf (bio_err, "-index file certificate status index file\n"); - BIO_printf (bio_err, "-CA file CA certificate\n"); - BIO_printf (bio_err, "-rsigner file responder certificate to sign responses with\n"); - BIO_printf (bio_err, "-rkey file responder key to sign responses with\n"); - BIO_printf (bio_err, "-rother file other certificates to include in response\n"); - BIO_printf (bio_err, "-resp_no_certs don't include any certificates in response\n"); - BIO_printf (bio_err, "-nmin n number of minutes before next update\n"); - BIO_printf (bio_err, "-ndays n number of days before next update\n"); - BIO_printf (bio_err, "-resp_key_id identify reponse by signing certificate key ID\n"); - BIO_printf (bio_err, "-nrequest n number of requests to accept (default unlimited)\n"); - BIO_printf (bio_err, "- use specified digest in the request\n"); + BIO_printf (bio_err, "-no_cert_verify don't check signing certificate\n"); + BIO_printf (bio_err, "-no_chain don't chain verify response\n"); + BIO_printf (bio_err, "-no_cert_checks don't do additional checks on signing certificate\n"); + BIO_printf (bio_err, "-port num port to run responder on\n"); + BIO_printf (bio_err, "-index file certificate status index file\n"); + BIO_printf (bio_err, "-CA file CA certificate\n"); + BIO_printf (bio_err, "-rsigner file responder certificate to sign responses with\n"); + BIO_printf (bio_err, "-rkey file responder key to sign responses with\n"); + BIO_printf (bio_err, "-rother file other certificates to include in response\n"); + BIO_printf (bio_err, "-resp_no_certs don't include any certificates in response\n"); + BIO_printf (bio_err, "-nmin n number of minutes before next update\n"); + BIO_printf (bio_err, "-ndays n number of days before next update\n"); + BIO_printf (bio_err, "-resp_key_id identify reponse by signing certificate key ID\n"); + BIO_printf (bio_err, "-nrequest n number of requests to accept (default unlimited)\n"); + BIO_printf (bio_err, "- use specified digest in the request\n"); + BIO_printf (bio_err, "-timeout n timeout connection to OCSP responder after n seconds\n"); goto end; } @@ -1398,16 +1399,7 @@ OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, if (use_ssl == 1) { BIO *sbio; -#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) ctx = SSL_CTX_new(SSLv23_client_method()); -#elif !defined(OPENSSL_NO_SSL3) - ctx = SSL_CTX_new(SSLv3_client_method()); -#elif !defined(OPENSSL_NO_SSL2) - ctx = SSL_CTX_new(SSLv2_client_method()); -#else - BIO_printf(err, "SSL is disabled\n"); - goto end; -#endif if (ctx == NULL) { BIO_printf(err, "Error creating SSL context.\n"); diff --git a/deps/openssl/openssl/apps/openssl.c b/deps/openssl/openssl/apps/openssl.c index 71e1e48ece4057..5372459456a37e 100644 --- a/deps/openssl/openssl/apps/openssl.c +++ b/deps/openssl/openssl/apps/openssl.c @@ -435,9 +435,7 @@ int main(int Argc, char *ARGV[]) if (prog != NULL) lh_FUNCTION_free(prog); if (arg.data != NULL) OPENSSL_free(arg.data); - apps_shutdown(); - CRYPTO_mem_leaks(bio_err); if (bio_err != NULL) { BIO_free(bio_err); @@ -450,6 +448,9 @@ int main(int Argc, char *ARGV[]) OPENSSL_free(Argv); } #endif + apps_shutdown(); + CRYPTO_mem_leaks(bio_err); + OPENSSL_EXIT(ret); } diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index 61ba7205718217..84f81d1fc5b5bb 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -336,10 +336,12 @@ static void sc_usage(void) BIO_printf(bio_err," -srppass arg - password for 'user'\n"); BIO_printf(bio_err," -srp_lateuser - SRP username into second ClientHello message\n"); BIO_printf(bio_err," -srp_moregroups - Tolerate other than the known g N values.\n"); - BIO_printf(bio_err," -srp_strength int - minimal mength in bits for N (default %d).\n",SRP_MINIMAL_N); + BIO_printf(bio_err," -srp_strength int - minimal length in bits for N (default %d).\n",SRP_MINIMAL_N); #endif BIO_printf(bio_err," -ssl2 - just use SSLv2\n"); +#ifndef OPENSSL_NO_SSL3_METHOD BIO_printf(bio_err," -ssl3 - just use SSLv3\n"); +#endif BIO_printf(bio_err," -tls1_2 - just use TLSv1.2\n"); BIO_printf(bio_err," -tls1_1 - just use TLSv1.1\n"); BIO_printf(bio_err," -tls1 - just use TLSv1\n"); @@ -814,7 +816,7 @@ int MAIN(int argc, char **argv) else if (strcmp(*argv,"-ssl2") == 0) meth=SSLv2_client_method(); #endif -#ifndef OPENSSL_NO_SSL3 +#ifndef OPENSSL_NO_SSL3_METHOD else if (strcmp(*argv,"-ssl3") == 0) meth=SSLv3_client_method(); #endif @@ -1326,10 +1328,22 @@ int MAIN(int argc, char **argv) BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout); } - if (socket_mtu > 28) + if (socket_mtu) { + if(socket_mtu < DTLS_get_link_min_mtu(con)) + { + BIO_printf(bio_err,"MTU too small. Must be at least %ld\n", + DTLS_get_link_min_mtu(con)); + BIO_free(sbio); + goto shut; + } SSL_set_options(con, SSL_OP_NO_QUERY_MTU); - SSL_set_mtu(con, socket_mtu - 28); + if(!DTLS_set_link_mtu(con, socket_mtu)) + { + BIO_printf(bio_err, "Failed to set MTU\n"); + BIO_free(sbio); + goto shut; + } } else /* want to do MTU discovery */ diff --git a/deps/openssl/openssl/apps/s_server.c b/deps/openssl/openssl/apps/s_server.c index fe7ad8823207c9..f47328ab352aec 100644 --- a/deps/openssl/openssl/apps/s_server.c +++ b/deps/openssl/openssl/apps/s_server.c @@ -515,7 +515,9 @@ static void sv_usage(void) BIO_printf(bio_err," -srpuserseed string - A seed string for a default user salt.\n"); #endif BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n"); +#ifndef OPENSSL_NO_SSL3_METHOD BIO_printf(bio_err," -ssl3 - Just talk SSLv3\n"); +#endif BIO_printf(bio_err," -tls1_2 - Just talk TLSv1.2\n"); BIO_printf(bio_err," -tls1_1 - Just talk TLSv1.1\n"); BIO_printf(bio_err," -tls1 - Just talk TLSv1\n"); @@ -1251,7 +1253,7 @@ int MAIN(int argc, char *argv[]) else if (strcmp(*argv,"-ssl2") == 0) { meth=SSLv2_server_method(); } #endif -#ifndef OPENSSL_NO_SSL3 +#ifndef OPENSSL_NO_SSL3_METHOD else if (strcmp(*argv,"-ssl3") == 0) { meth=SSLv3_server_method(); } #endif @@ -2049,10 +2051,24 @@ static int sv_body(char *hostname, int s, unsigned char *context) BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout); } - if (socket_mtu > 28) + if (socket_mtu) { + if(socket_mtu < DTLS_get_link_min_mtu(con)) + { + BIO_printf(bio_err,"MTU too small. Must be at least %ld\n", + DTLS_get_link_min_mtu(con)); + ret = -1; + BIO_free(sbio); + goto err; + } SSL_set_options(con, SSL_OP_NO_QUERY_MTU); - SSL_set_mtu(con, socket_mtu - 28); + if(!DTLS_set_link_mtu(con, socket_mtu)) + { + BIO_printf(bio_err, "Failed to set MTU\n"); + ret = -1; + BIO_free(sbio); + goto err; + } } else /* want to do MTU discovery */ diff --git a/deps/openssl/openssl/apps/s_time.c b/deps/openssl/openssl/apps/s_time.c index b823c33c58a026..81dad53243a4e0 100644 --- a/deps/openssl/openssl/apps/s_time.c +++ b/deps/openssl/openssl/apps/s_time.c @@ -349,13 +349,7 @@ int MAIN(int argc, char **argv) if (bio_err == NULL) bio_err=BIO_new_fp(stderr,BIO_NOCLOSE); -#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) s_time_meth=SSLv23_client_method(); -#elif !defined(OPENSSL_NO_SSL3) - s_time_meth=SSLv3_client_method(); -#elif !defined(OPENSSL_NO_SSL2) - s_time_meth=SSLv2_client_method(); -#endif /* parse the command line arguments */ if( parseArgs( argc, argv ) < 0 ) diff --git a/deps/openssl/openssl/apps/speed.c b/deps/openssl/openssl/apps/speed.c index 9886ca3766913d..24d41227ba66ea 100644 --- a/deps/openssl/openssl/apps/speed.c +++ b/deps/openssl/openssl/apps/speed.c @@ -225,7 +225,7 @@ #undef BUFSIZE #define BUFSIZE ((long)1024*8+1) -int run=0; +static volatile int run=0; static int mr=0; static int usertime=1; @@ -2727,27 +2727,6 @@ static int do_multi(int multi) k=atoi(sstrsep(&p,sep)); sstrsep(&p,sep); - d=atof(sstrsep(&p,sep)); - if(n) - rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d); - else - rsa_results[k][0]=d; - - d=atof(sstrsep(&p,sep)); - if(n) - rsa_results[k][1]=1/(1/rsa_results[k][1]+1/d); - else - rsa_results[k][1]=d; - } - else if(!strncmp(buf,"+F2:",4)) - { - int k; - double d; - - p=buf+4; - k=atoi(sstrsep(&p,sep)); - sstrsep(&p,sep); - d=atof(sstrsep(&p,sep)); if(n) rsa_results[k][0]=1/(1/rsa_results[k][0]+1/d); diff --git a/deps/openssl/openssl/crypto/LPdir_win.c b/deps/openssl/openssl/crypto/LPdir_win.c index d5b5e2c900db9e..7eea373cde9b83 100644 --- a/deps/openssl/openssl/crypto/LPdir_win.c +++ b/deps/openssl/openssl/crypto/LPdir_win.c @@ -36,7 +36,7 @@ #if defined(LP_SYS_WINCE) && !defined(FindFirstFile) # define FindFirstFile FindFirstFileW #endif -#if defined(LP_SYS_WINCE) && !defined(FindFirstFile) +#if defined(LP_SYS_WINCE) && !defined(FindNextFile) # define FindNextFile FindNextFileW #endif diff --git a/deps/openssl/openssl/crypto/Makefile b/deps/openssl/openssl/crypto/Makefile index ee5bfbda82bcec..2b6397a24b4dc8 100644 --- a/deps/openssl/openssl/crypto/Makefile +++ b/deps/openssl/openssl/crypto/Makefile @@ -55,12 +55,7 @@ top: all: shared buildinf.h: ../Makefile - ( echo "#ifndef MK1MF_BUILD"; \ - echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \ - echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \ - echo ' #define PLATFORM "$(PLATFORM)"'; \ - echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \ - echo '#endif' ) >buildinf.h + $(PERL) $(TOP)/util/mkbuildinf.pl "$(CFLAGS)" "$(PLATFORM)" >buildinf.h x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl b/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl index e52395421b3c5f..537c8d3172b684 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-mips.pl @@ -70,7 +70,7 @@ # ###################################################################### -$big_endian=(`echo MIPSEL | $ENV{CC} -E -P -`=~/MIPSEL/)?1:0; +$big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC}); for (@ARGV) { $output=$_ if (/^\w[\w\-]*\.\w+$/); } open STDOUT,">$output"; diff --git a/deps/openssl/openssl/crypto/asn1/a_bitstr.c b/deps/openssl/openssl/crypto/asn1/a_bitstr.c index 34179960b87aed..4117a67dc36fe7 100644 --- a/deps/openssl/openssl/crypto/asn1/a_bitstr.c +++ b/deps/openssl/openssl/crypto/asn1/a_bitstr.c @@ -136,11 +136,16 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, p= *pp; i= *(p++); + if (i > 7) + { + i=ASN1_R_INVALID_BIT_STRING_BITS_LEFT; + goto err; + } /* We do this to preserve the settings. If we modify * the settings, via the _set_bit function, we will recalculate * on output */ ret->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear */ - ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|(i&0x07)); /* set */ + ret->flags|=(ASN1_STRING_FLAG_BITS_LEFT|i); /* set */ if (len-- > 1) /* using one because of the bits left byte */ { diff --git a/deps/openssl/openssl/crypto/asn1/a_type.c b/deps/openssl/openssl/crypto/asn1/a_type.c index a45d2f9d12ddbc..5e1bc762d08bf6 100644 --- a/deps/openssl/openssl/crypto/asn1/a_type.c +++ b/deps/openssl/openssl/crypto/asn1/a_type.c @@ -113,7 +113,7 @@ IMPLEMENT_STACK_OF(ASN1_TYPE) IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) /* Returns 0 if they are equal, != 0 otherwise. */ -int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) { int result = -1; diff --git a/deps/openssl/openssl/crypto/asn1/a_verify.c b/deps/openssl/openssl/crypto/asn1/a_verify.c index fc84cd3d191bce..78dde1d0537133 100644 --- a/deps/openssl/openssl/crypto/asn1/a_verify.c +++ b/deps/openssl/openssl/crypto/asn1/a_verify.c @@ -90,6 +90,12 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); goto err; } + + if (signature->type == V_ASN1_BIT_STRING && signature->flags & 0x7) + { + ASN1err(ASN1_F_ASN1_VERIFY, ASN1_R_INVALID_BIT_STRING_BITS_LEFT); + goto err; + } inl=i2d(data,NULL); buf_in=OPENSSL_malloc((unsigned int)inl); @@ -146,6 +152,12 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, return -1; } + if (signature->type == V_ASN1_BIT_STRING && signature->flags & 0x7) + { + ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ASN1_R_INVALID_BIT_STRING_BITS_LEFT); + return -1; + } + EVP_MD_CTX_init(&ctx); /* Convert signature OID into digest and public key OIDs */ diff --git a/deps/openssl/openssl/crypto/asn1/asn1.h b/deps/openssl/openssl/crypto/asn1/asn1.h index 220a0c8c637e12..3c45d5d03f09bb 100644 --- a/deps/openssl/openssl/crypto/asn1/asn1.h +++ b/deps/openssl/openssl/crypto/asn1/asn1.h @@ -776,7 +776,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) int ASN1_TYPE_get(ASN1_TYPE *a); void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); -int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); ASN1_OBJECT * ASN1_OBJECT_new(void ); void ASN1_OBJECT_free(ASN1_OBJECT *a); @@ -1329,6 +1329,7 @@ void ERR_load_ASN1_strings(void); #define ASN1_R_ILLEGAL_TIME_VALUE 184 #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 +#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220 #define ASN1_R_INVALID_BMPSTRING_LENGTH 129 #define ASN1_R_INVALID_DIGIT 130 #define ASN1_R_INVALID_MIME_TYPE 205 @@ -1378,6 +1379,7 @@ void ERR_load_ASN1_strings(void); #define ASN1_R_TIME_NOT_ASCII_FORMAT 193 #define ASN1_R_TOO_LONG 155 #define ASN1_R_TYPE_NOT_CONSTRUCTED 156 +#define ASN1_R_TYPE_NOT_PRIMITIVE 218 #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 #define ASN1_R_UNEXPECTED_EOC 159 diff --git a/deps/openssl/openssl/crypto/asn1/asn1_err.c b/deps/openssl/openssl/crypto/asn1/asn1_err.c index aa60203ba8085d..568a8416b8116d 100644 --- a/deps/openssl/openssl/crypto/asn1/asn1_err.c +++ b/deps/openssl/openssl/crypto/asn1/asn1_err.c @@ -1,6 +1,6 @@ /* crypto/asn1/asn1_err.c */ /* ==================================================================== - * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -246,6 +246,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]= {ERR_REASON(ASN1_R_ILLEGAL_TIME_VALUE) ,"illegal time value"}, {ERR_REASON(ASN1_R_INTEGER_NOT_ASCII_FORMAT),"integer not ascii format"}, {ERR_REASON(ASN1_R_INTEGER_TOO_LARGE_FOR_LONG),"integer too large for long"}, +{ERR_REASON(ASN1_R_INVALID_BIT_STRING_BITS_LEFT),"invalid bit string bits left"}, {ERR_REASON(ASN1_R_INVALID_BMPSTRING_LENGTH),"invalid bmpstring length"}, {ERR_REASON(ASN1_R_INVALID_DIGIT) ,"invalid digit"}, {ERR_REASON(ASN1_R_INVALID_MIME_TYPE) ,"invalid mime type"}, @@ -295,6 +296,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]= {ERR_REASON(ASN1_R_TIME_NOT_ASCII_FORMAT),"time not ascii format"}, {ERR_REASON(ASN1_R_TOO_LONG) ,"too long"}, {ERR_REASON(ASN1_R_TYPE_NOT_CONSTRUCTED) ,"type not constructed"}, +{ERR_REASON(ASN1_R_TYPE_NOT_PRIMITIVE) ,"type not primitive"}, {ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_KEY),"unable to decode rsa key"}, {ERR_REASON(ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY),"unable to decode rsa private key"}, {ERR_REASON(ASN1_R_UNEXPECTED_EOC) ,"unexpected eoc"}, diff --git a/deps/openssl/openssl/crypto/asn1/tasn_dec.c b/deps/openssl/openssl/crypto/asn1/tasn_dec.c index 87d7dfdf5c374d..2cbfa814759601 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_dec.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_dec.c @@ -870,6 +870,14 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, } else if (cst) { + if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN + || utype == V_ASN1_OBJECT || utype == V_ASN1_INTEGER + || utype == V_ASN1_ENUMERATED) + { + ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, + ASN1_R_TYPE_NOT_PRIMITIVE); + return 0; + } buf.length = 0; buf.max = 0; buf.data = NULL; diff --git a/deps/openssl/openssl/crypto/asn1/x_algor.c b/deps/openssl/openssl/crypto/asn1/x_algor.c index 274e456c738296..57cc956c20b271 100644 --- a/deps/openssl/openssl/crypto/asn1/x_algor.c +++ b/deps/openssl/openssl/crypto/asn1/x_algor.c @@ -142,3 +142,14 @@ void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); } + +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) + { + int rv; + rv = OBJ_cmp(a->algorithm, b->algorithm); + if (rv) + return rv; + if (!a->parameter && !b->parameter) + return 0; + return ASN1_TYPE_cmp(a->parameter, b->parameter); + } diff --git a/deps/openssl/openssl/crypto/asn1/x_name.c b/deps/openssl/openssl/crypto/asn1/x_name.c index d7c2318693f5aa..22da57040e89a7 100644 --- a/deps/openssl/openssl/crypto/asn1/x_name.c +++ b/deps/openssl/openssl/crypto/asn1/x_name.c @@ -350,6 +350,8 @@ static int x509_name_canon(X509_NAME *a) set = entry->set; } tmpentry = X509_NAME_ENTRY_new(); + if (!tmpentry) + goto err; tmpentry->object = OBJ_dup(entry->object); if (!asn1_string_canon(tmpentry->value, entry->value)) goto err; diff --git a/deps/openssl/openssl/crypto/bio/bio.h b/deps/openssl/openssl/crypto/bio/bio.h index 05699ab21210ed..32eba71480566b 100644 --- a/deps/openssl/openssl/crypto/bio/bio.h +++ b/deps/openssl/openssl/crypto/bio/bio.h @@ -175,6 +175,8 @@ extern "C" { #define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to * adjust socket timeouts */ +#define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 + #ifndef OPENSSL_NO_SCTP /* SCTP stuff */ #define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 @@ -607,6 +609,8 @@ int BIO_ctrl_reset_read_request(BIO *b); (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer) #define BIO_dgram_set_peer(b,peer) \ (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) +#define BIO_dgram_get_mtu_overhead(b) \ + (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL) /* These two aren't currently implemented */ /* int BIO_get_ex_num(BIO *bio); */ diff --git a/deps/openssl/openssl/crypto/bio/bss_dgram.c b/deps/openssl/openssl/crypto/bio/bss_dgram.c index d9967e7272674e..0decf9449b3d98 100644 --- a/deps/openssl/openssl/crypto/bio/bss_dgram.c +++ b/deps/openssl/openssl/crypto/bio/bss_dgram.c @@ -454,6 +454,36 @@ static int dgram_write(BIO *b, const char *in, int inl) return(ret); } +static long dgram_get_mtu_overhead(bio_dgram_data *data) + { + long ret; + + switch (data->peer.sa.sa_family) + { + case AF_INET: + /* Assume this is UDP - 20 bytes for IP, 8 bytes for UDP */ + ret = 28; + break; +#if OPENSSL_USE_IPV6 + case AF_INET6: +#ifdef IN6_IS_ADDR_V4MAPPED + if (IN6_IS_ADDR_V4MAPPED(&data->peer.sa_in6.sin6_addr)) + /* Assume this is UDP - 20 bytes for IP, 8 bytes for UDP */ + ret = 28; + else +#endif + /* Assume this is UDP - 40 bytes for IP, 8 bytes for UDP */ + ret = 48; + break; +#endif + default: + /* We don't know. Go with the historical default */ + ret = 28; + break; + } + return ret; + } + static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) { long ret=1; @@ -630,23 +660,24 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) #endif break; case BIO_CTRL_DGRAM_GET_FALLBACK_MTU: + ret = -dgram_get_mtu_overhead(data); switch (data->peer.sa.sa_family) { case AF_INET: - ret = 576 - 20 - 8; + ret += 576; break; #if OPENSSL_USE_IPV6 case AF_INET6: #ifdef IN6_IS_ADDR_V4MAPPED if (IN6_IS_ADDR_V4MAPPED(&data->peer.sa_in6.sin6_addr)) - ret = 576 - 20 - 8; + ret += 576; else #endif - ret = 1280 - 40 - 8; + ret += 1280; break; #endif default: - ret = 576 - 20 - 8; + ret += 576; break; } break; @@ -847,6 +878,9 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ret = 0; break; #endif + case BIO_CTRL_DGRAM_GET_MTU_OVERHEAD: + ret = dgram_get_mtu_overhead(data); + break; default: ret=0; break; @@ -893,10 +927,18 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag) /* Activate SCTP-AUTH for DATA and FORWARD-TSN chunks */ auth.sauth_chunk = OPENSSL_SCTP_DATA_CHUNK_TYPE; ret = setsockopt(fd, IPPROTO_SCTP, SCTP_AUTH_CHUNK, &auth, sizeof(struct sctp_authchunk)); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } auth.sauth_chunk = OPENSSL_SCTP_FORWARD_CUM_TSN_CHUNK_TYPE; ret = setsockopt(fd, IPPROTO_SCTP, SCTP_AUTH_CHUNK, &auth, sizeof(struct sctp_authchunk)); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } /* Test if activation was successful. When using accept(), * SCTP-AUTH has to be activated for the listening socket @@ -905,7 +947,13 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag) authchunks = OPENSSL_malloc(sockopt_len); memset(authchunks, 0, sizeof(sockopt_len)); ret = getsockopt(fd, IPPROTO_SCTP, SCTP_LOCAL_AUTH_CHUNKS, authchunks, &sockopt_len); - OPENSSL_assert(ret >= 0); + + if (ret < 0) + { + OPENSSL_free(authchunks); + BIO_vfree(bio); + return(NULL); + } for (p = (unsigned char*) authchunks->gauth_chunks; p < (unsigned char*) authchunks + sockopt_len; @@ -927,16 +975,28 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag) event.se_type = SCTP_AUTHENTICATION_EVENT; event.se_on = 1; ret = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENT, &event, sizeof(struct sctp_event)); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } #else sockopt_len = (socklen_t) sizeof(struct sctp_event_subscribe); ret = getsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, &sockopt_len); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } event.sctp_authentication_event = 1; ret = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, sizeof(struct sctp_event_subscribe)); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } #endif #endif @@ -944,7 +1004,11 @@ BIO *BIO_new_dgram_sctp(int fd, int close_flag) * larger than the max record size of 2^14 + 2048 + 13 */ ret = setsockopt(fd, IPPROTO_SCTP, SCTP_PARTIAL_DELIVERY_POINT, &optval, sizeof(optval)); - OPENSSL_assert(ret >= 0); + if (ret < 0) + { + BIO_vfree(bio); + return(NULL); + } return(bio); } @@ -982,7 +1046,12 @@ static int dgram_sctp_free(BIO *a) return 0; data = (bio_dgram_sctp_data *)a->ptr; - if(data != NULL) OPENSSL_free(data); + if(data != NULL) + { + if(data->saved_message.data != NULL) + OPENSSL_free(data->saved_message.data); + OPENSSL_free(data); + } return(1); } @@ -1034,6 +1103,13 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) msg.msg_flags = 0; n = recvmsg(b->num, &msg, 0); + if (n <= 0) + { + if (n < 0) + ret = n; + break; + } + if (msg.msg_controllen > 0) { for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) @@ -1073,13 +1149,6 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) } } - if (n <= 0) - { - if (n < 0) - ret = n; - break; - } - if (msg.msg_flags & MSG_NOTIFICATION) { snp = (union sctp_notification*) out; @@ -1099,6 +1168,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) dgram_sctp_write(data->saved_message.bio, data->saved_message.data, data->saved_message.length); OPENSSL_free(data->saved_message.data); + data->saved_message.data = NULL; data->saved_message.length = 0; } @@ -1109,16 +1179,28 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) event.se_type = SCTP_SENDER_DRY_EVENT; event.se_on = 0; i = setsockopt(b->num, IPPROTO_SCTP, SCTP_EVENT, &event, sizeof(struct sctp_event)); - OPENSSL_assert(i >= 0); + if (i < 0) + { + ret = i; + break; + } #else eventsize = sizeof(struct sctp_event_subscribe); i = getsockopt(b->num, IPPROTO_SCTP, SCTP_EVENTS, &event, &eventsize); - OPENSSL_assert(i >= 0); + if (i < 0) + { + ret = i; + break; + } event.sctp_sender_dry_event = 0; i = setsockopt(b->num, IPPROTO_SCTP, SCTP_EVENTS, &event, sizeof(struct sctp_event_subscribe)); - OPENSSL_assert(i >= 0); + if (i < 0) + { + ret = i; + break; + } #endif } @@ -1151,8 +1233,8 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) */ optlen = (socklen_t) sizeof(int); ret = getsockopt(b->num, SOL_SOCKET, SO_RCVBUF, &optval, &optlen); - OPENSSL_assert(ret >= 0); - OPENSSL_assert(optval >= 18445); + if (ret >= 0) + OPENSSL_assert(optval >= 18445); /* Test if SCTP doesn't partially deliver below * max record size (2^14 + 2048 + 13) @@ -1160,8 +1242,8 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) optlen = (socklen_t) sizeof(int); ret = getsockopt(b->num, IPPROTO_SCTP, SCTP_PARTIAL_DELIVERY_POINT, &optval, &optlen); - OPENSSL_assert(ret >= 0); - OPENSSL_assert(optval >= 18445); + if (ret >= 0) + OPENSSL_assert(optval >= 18445); /* Partially delivered notification??? Probably a bug.... */ OPENSSL_assert(!(msg.msg_flags & MSG_NOTIFICATION)); @@ -1195,15 +1277,15 @@ static int dgram_sctp_read(BIO *b, char *out, int outl) authchunks = OPENSSL_malloc(optlen); memset(authchunks, 0, sizeof(optlen)); ii = getsockopt(b->num, IPPROTO_SCTP, SCTP_PEER_AUTH_CHUNKS, authchunks, &optlen); - OPENSSL_assert(ii >= 0); - for (p = (unsigned char*) authchunks->gauth_chunks; - p < (unsigned char*) authchunks + optlen; - p += sizeof(uint8_t)) - { - if (*p == OPENSSL_SCTP_DATA_CHUNK_TYPE) auth_data = 1; - if (*p == OPENSSL_SCTP_FORWARD_CUM_TSN_CHUNK_TYPE) auth_forward = 1; - } + if (ii >= 0) + for (p = (unsigned char*) authchunks->gauth_chunks; + p < (unsigned char*) authchunks + optlen; + p += sizeof(uint8_t)) + { + if (*p == OPENSSL_SCTP_DATA_CHUNK_TYPE) auth_data = 1; + if (*p == OPENSSL_SCTP_FORWARD_CUM_TSN_CHUNK_TYPE) auth_forward = 1; + } OPENSSL_free(authchunks); @@ -1258,9 +1340,11 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl) if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b)) { data->saved_message.bio = b; - data->saved_message.length = inl; + if (data->saved_message.data) + OPENSSL_free(data->saved_message.data); data->saved_message.data = OPENSSL_malloc(inl); memcpy(data->saved_message.data, in, inl); + data->saved_message.length = inl; return inl; } @@ -1367,6 +1451,10 @@ static long dgram_sctp_ctrl(BIO *b, int cmd, long num, void *ptr) * Returns always 1. */ break; + case BIO_CTRL_DGRAM_GET_MTU_OVERHEAD: + /* We allow transport protocol fragmentation so this is irrelevant */ + ret = 0; + break; case BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE: if (num > 0) data->in_handshake = 1; diff --git a/deps/openssl/openssl/crypto/bn/asm/mips.pl b/deps/openssl/openssl/crypto/bn/asm/mips.pl index d2f3ef7bbf2cac..215c9a7483257b 100644 --- a/deps/openssl/openssl/crypto/bn/asm/mips.pl +++ b/deps/openssl/openssl/crypto/bn/asm/mips.pl @@ -1872,6 +1872,41 @@ ($a_4,$a_5,$a_6,$a_7)=($b_0,$b_1,$b_2,$b_3); +sub add_c2 () { +my ($hi,$lo,$c0,$c1,$c2, + $warm, # !$warm denotes first call with specific sequence of + # $c_[XYZ] when there is no Z-carry to accumulate yet; + $an,$bn # these two are arguments for multiplication which + # result is used in *next* step [which is why it's + # commented as "forward multiplication" below]; + )=@_; +$code.=<<___; + mflo $lo + mfhi $hi + $ADDU $c0,$lo + sltu $at,$c0,$lo + $MULTU $an,$bn # forward multiplication + $ADDU $c0,$lo + $ADDU $at,$hi + sltu $lo,$c0,$lo + $ADDU $c1,$at + $ADDU $hi,$lo +___ +$code.=<<___ if (!$warm); + sltu $c2,$c1,$at + $ADDU $c1,$hi + sltu $hi,$c1,$hi + $ADDU $c2,$hi +___ +$code.=<<___ if ($warm); + sltu $at,$c1,$at + $ADDU $c1,$hi + $ADDU $c2,$at + sltu $hi,$c1,$hi + $ADDU $c2,$hi +___ +} + $code.=<<___; .align 5 @@ -1920,21 +1955,10 @@ sltu $at,$c_2,$t_1 $ADDU $c_3,$t_2,$at $ST $c_2,$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_1 # mul_add_c(a[1],b[1],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_1,$a_1); # mul_add_c(a[1],b[1],c3,c1,c2); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_3,$t_1 @@ -1945,67 +1969,19 @@ sltu $at,$c_1,$t_2 $ADDU $c_2,$at $ST $c_3,2*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_3,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_2 # mul_add_c2(a[1],b[2],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_4,$a_0 # mul_add_c2(a[4],b[0],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at +___ + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,0, + $a_1,$a_2); # mul_add_c2(a[1],b[2],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_4,$a_0); # mul_add_c2(a[4],b[0],c2,c3,c1); +$code.=<<___; $ST $c_1,3*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_1,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_3,$a_1 # mul_add_c2(a[3],b[1],c2,c3,c1); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_1,$at - $MULTU $a_2,$a_2 # mul_add_c(a[2],b[2],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at +___ + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,0, + $a_3,$a_1); # mul_add_c2(a[3],b[1],c2,c3,c1); + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,1, + $a_2,$a_2); # mul_add_c(a[2],b[2],c2,c3,c1); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_2,$t_1 @@ -2016,97 +1992,23 @@ sltu $at,$c_3,$t_2 $ADDU $c_1,$at $ST $c_2,4*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_4 # mul_add_c2(a[1],b[4],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_2,$at - $MULTU $a_2,$a_3 # mul_add_c2(a[2],b[3],c3,c1,c2); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $MULTU $a_6,$a_0 # mul_add_c2(a[6],b[0],c1,c2,c3); - $ADDU $c_2,$at - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_1,$a_4); # mul_add_c2(a[1],b[4],c3,c1,c2); + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,1, + $a_2,$a_3); # mul_add_c2(a[2],b[3],c3,c1,c2); + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,1, + $a_6,$a_0); # mul_add_c2(a[6],b[0],c1,c2,c3); +$code.=<<___; $ST $c_3,5*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_3,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_5,$a_1 # mul_add_c2(a[5],b[1],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_4,$a_2 # mul_add_c2(a[4],b[2],c1,c2,c3); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_3,$a_3 # mul_add_c(a[3],b[3],c1,c2,c3); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at +___ + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,0, + $a_5,$a_1); # mul_add_c2(a[5],b[1],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_4,$a_2); # mul_add_c2(a[4],b[2],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_3,$a_3); # mul_add_c(a[3],b[3],c1,c2,c3); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_1,$t_1 @@ -2117,112 +2019,25 @@ sltu $at,$c_2,$t_2 $ADDU $c_3,$at $ST $c_1,6*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_1,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_6 # mul_add_c2(a[1],b[6],c2,c3,c1); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_1,$at - $MULTU $a_2,$a_5 # mul_add_c2(a[2],b[5],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_1,$at - $MULTU $a_3,$a_4 # mul_add_c2(a[3],b[4],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_1,$at - $MULTU $a_7,$a_1 # mul_add_c2(a[7],b[1],c3,c1,c2); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at +___ + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,0, + $a_1,$a_6); # mul_add_c2(a[1],b[6],c2,c3,c1); + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,1, + $a_2,$a_5); # mul_add_c2(a[2],b[5],c2,c3,c1); + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,1, + $a_3,$a_4); # mul_add_c2(a[3],b[4],c2,c3,c1); + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,1, + $a_7,$a_1); # mul_add_c2(a[7],b[1],c3,c1,c2); +$code.=<<___; $ST $c_2,7*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_6,$a_2 # mul_add_c2(a[6],b[2],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_2,$at - $MULTU $a_5,$a_3 # mul_add_c2(a[5],b[3],c3,c1,c2); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_2,$at - $MULTU $a_4,$a_4 # mul_add_c(a[4],b[4],c3,c1,c2); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_6,$a_2); # mul_add_c2(a[6],b[2],c3,c1,c2); + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,1, + $a_5,$a_3); # mul_add_c2(a[5],b[3],c3,c1,c2); + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,1, + $a_4,$a_4); # mul_add_c(a[4],b[4],c3,c1,c2); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_3,$t_1 @@ -2233,82 +2048,21 @@ sltu $at,$c_1,$t_2 $ADDU $c_2,$at $ST $c_3,8*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_3,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_3,$a_6 # mul_add_c2(a[3],b[6],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_4,$a_5 # mul_add_c2(a[4],b[5],c1,c2,c3); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_7,$a_3 # mul_add_c2(a[7],b[3],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at +___ + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,0, + $a_3,$a_6); # mul_add_c2(a[3],b[6],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_4,$a_5); # mul_add_c2(a[4],b[5],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_7,$a_3); # mul_add_c2(a[7],b[3],c2,c3,c1); +$code.=<<___; $ST $c_1,9*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_1,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_6,$a_4 # mul_add_c2(a[6],b[4],c2,c3,c1); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_1,$at - $MULTU $a_5,$a_5 # mul_add_c(a[5],b[5],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at +___ + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,0, + $a_6,$a_4); # mul_add_c2(a[6],b[4],c2,c3,c1); + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,1, + $a_5,$a_5); # mul_add_c(a[5],b[5],c2,c3,c1); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_2,$t_1 @@ -2319,52 +2073,17 @@ sltu $at,$c_3,$t_2 $ADDU $c_1,$at $ST $c_2,10*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_5,$a_6 # mul_add_c2(a[5],b[6],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_2,$at - $MULTU $a_7,$a_5 # mul_add_c2(a[7],b[5],c1,c2,c3); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_5,$a_6); # mul_add_c2(a[5],b[6],c3,c1,c2); + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,1, + $a_7,$a_5); # mul_add_c2(a[7],b[5],c1,c2,c3); +$code.=<<___; $ST $c_3,11*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_3,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_6,$a_6 # mul_add_c(a[6],b[6],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at +___ + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,0, + $a_6,$a_6); # mul_add_c(a[6],b[6],c1,c2,c3); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_1,$t_1 @@ -2375,21 +2094,10 @@ sltu $at,$c_2,$t_2 $ADDU $c_3,$at $ST $c_1,12*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_1,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_7,$a_7 # mul_add_c(a[7],b[7],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at +___ + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,0, + $a_7,$a_7); # mul_add_c(a[7],b[7],c3,c1,c2); +$code.=<<___; $ST $c_2,13*$BNSZ($a0) mflo $t_1 @@ -2457,21 +2165,10 @@ sltu $at,$c_2,$t_1 $ADDU $c_3,$t_2,$at $ST $c_2,$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_1 # mul_add_c(a[1],b[1],c3,c1,c2); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_1,$a_1); # mul_add_c(a[1],b[1],c3,c1,c2); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_3,$t_1 @@ -2482,52 +2179,17 @@ sltu $at,$c_1,$t_2 $ADDU $c_2,$at $ST $c_3,2*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_3,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_1,$a_2 # mul_add_c(a2[1],b[2],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at - mflo $t_1 - mfhi $t_2 - slt $at,$t_2,$zero - $ADDU $c_3,$at - $MULTU $a_3,$a_1 # mul_add_c2(a[3],b[1],c2,c3,c1); - $SLL $t_2,1 - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_1,$t_1 - sltu $at,$c_1,$t_1 - $ADDU $t_2,$at - $ADDU $c_2,$t_2 - sltu $at,$c_2,$t_2 - $ADDU $c_3,$at +___ + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,0, + $a_1,$a_2); # mul_add_c2(a2[1],b[2],c1,c2,c3); + &add_c2($t_2,$t_1,$c_1,$c_2,$c_3,1, + $a_3,$a_1); # mul_add_c2(a[3],b[1],c2,c3,c1); +$code.=<<___; $ST $c_1,3*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_1,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_2,$a_2 # mul_add_c(a[2],b[2],c2,c3,c1); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_2,$t_1 - sltu $at,$c_2,$t_1 - $ADDU $t_2,$at - $ADDU $c_3,$t_2 - sltu $at,$c_3,$t_2 - $ADDU $c_1,$at +___ + &add_c2($t_2,$t_1,$c_2,$c_3,$c_1,0, + $a_2,$a_2); # mul_add_c(a[2],b[2],c2,c3,c1); +$code.=<<___; mflo $t_1 mfhi $t_2 $ADDU $c_2,$t_1 @@ -2538,21 +2200,10 @@ sltu $at,$c_3,$t_2 $ADDU $c_1,$at $ST $c_2,4*$BNSZ($a0) - - mflo $t_1 - mfhi $t_2 - slt $c_2,$t_2,$zero - $SLL $t_2,1 - $MULTU $a_3,$a_3 # mul_add_c(a[3],b[3],c1,c2,c3); - slt $a2,$t_1,$zero - $ADDU $t_2,$a2 - $SLL $t_1,1 - $ADDU $c_3,$t_1 - sltu $at,$c_3,$t_1 - $ADDU $t_2,$at - $ADDU $c_1,$t_2 - sltu $at,$c_1,$t_2 - $ADDU $c_2,$at +___ + &add_c2($t_2,$t_1,$c_3,$c_1,$c_2,0, + $a_3,$a_3); # mul_add_c(a[3],b[3],c1,c2,c3); +$code.=<<___; $ST $c_3,5*$BNSZ($a0) mflo $t_1 diff --git a/deps/openssl/openssl/crypto/bn/asm/mips3.s b/deps/openssl/openssl/crypto/bn/asm/mips3.s deleted file mode 100644 index dca4105c7db1b4..00000000000000 --- a/deps/openssl/openssl/crypto/bn/asm/mips3.s +++ /dev/null @@ -1,2201 +0,0 @@ -.rdata -.asciiz "mips3.s, Version 1.1" -.asciiz "MIPS III/IV ISA artwork by Andy Polyakov " - -/* - * ==================================================================== - * Written by Andy Polyakov for the OpenSSL - * project. - * - * Rights for redistribution and usage in source and binary forms are - * granted according to the OpenSSL license. Warranty of any kind is - * disclaimed. - * ==================================================================== - */ - -/* - * This is my modest contributon to the OpenSSL project (see - * http://www.openssl.org/ for more information about it) and is - * a drop-in MIPS III/IV ISA replacement for crypto/bn/bn_asm.c - * module. For updates see http://fy.chalmers.se/~appro/hpe/. - * - * The module is designed to work with either of the "new" MIPS ABI(5), - * namely N32 or N64, offered by IRIX 6.x. It's not ment to work under - * IRIX 5.x not only because it doesn't support new ABIs but also - * because 5.x kernels put R4x00 CPU into 32-bit mode and all those - * 64-bit instructions (daddu, dmultu, etc.) found below gonna only - * cause illegal instruction exception:-( - * - * In addition the code depends on preprocessor flags set up by MIPSpro - * compiler driver (either as or cc) and therefore (probably?) can't be - * compiled by the GNU assembler. GNU C driver manages fine though... - * I mean as long as -mmips-as is specified or is the default option, - * because then it simply invokes /usr/bin/as which in turn takes - * perfect care of the preprocessor definitions. Another neat feature - * offered by the MIPSpro assembler is an optimization pass. This gave - * me the opportunity to have the code looking more regular as all those - * architecture dependent instruction rescheduling details were left to - * the assembler. Cool, huh? - * - * Performance improvement is astonishing! 'apps/openssl speed rsa dsa' - * goes way over 3 times faster! - * - * - */ -#include -#include - -#if _MIPS_ISA>=4 -#define MOVNZ(cond,dst,src) \ - movn dst,src,cond -#else -#define MOVNZ(cond,dst,src) \ - .set noreorder; \ - bnezl cond,.+8; \ - move dst,src; \ - .set reorder -#endif - -.text - -.set noat -.set reorder - -#define MINUS4 v1 - -.align 5 -LEAF(bn_mul_add_words) - .set noreorder - bgtzl a2,.L_bn_mul_add_words_proceed - ld t0,0(a1) - jr ra - move v0,zero - .set reorder - -.L_bn_mul_add_words_proceed: - li MINUS4,-4 - and ta0,a2,MINUS4 - move v0,zero - beqz ta0,.L_bn_mul_add_words_tail - -.L_bn_mul_add_words_loop: - dmultu t0,a3 - ld t1,0(a0) - ld t2,8(a1) - ld t3,8(a0) - ld ta0,16(a1) - ld ta1,16(a0) - daddu t1,v0 - sltu v0,t1,v0 /* All manuals say it "compares 32-bit - * values", but it seems to work fine - * even on 64-bit registers. */ - mflo AT - mfhi t0 - daddu t1,AT - daddu v0,t0 - sltu AT,t1,AT - sd t1,0(a0) - daddu v0,AT - - dmultu t2,a3 - ld ta2,24(a1) - ld ta3,24(a0) - daddu t3,v0 - sltu v0,t3,v0 - mflo AT - mfhi t2 - daddu t3,AT - daddu v0,t2 - sltu AT,t3,AT - sd t3,8(a0) - daddu v0,AT - - dmultu ta0,a3 - subu a2,4 - PTR_ADD a0,32 - PTR_ADD a1,32 - daddu ta1,v0 - sltu v0,ta1,v0 - mflo AT - mfhi ta0 - daddu ta1,AT - daddu v0,ta0 - sltu AT,ta1,AT - sd ta1,-16(a0) - daddu v0,AT - - - dmultu ta2,a3 - and ta0,a2,MINUS4 - daddu ta3,v0 - sltu v0,ta3,v0 - mflo AT - mfhi ta2 - daddu ta3,AT - daddu v0,ta2 - sltu AT,ta3,AT - sd ta3,-8(a0) - daddu v0,AT - .set noreorder - bgtzl ta0,.L_bn_mul_add_words_loop - ld t0,0(a1) - - bnezl a2,.L_bn_mul_add_words_tail - ld t0,0(a1) - .set reorder - -.L_bn_mul_add_words_return: - jr ra - -.L_bn_mul_add_words_tail: - dmultu t0,a3 - ld t1,0(a0) - subu a2,1 - daddu t1,v0 - sltu v0,t1,v0 - mflo AT - mfhi t0 - daddu t1,AT - daddu v0,t0 - sltu AT,t1,AT - sd t1,0(a0) - daddu v0,AT - beqz a2,.L_bn_mul_add_words_return - - ld t0,8(a1) - dmultu t0,a3 - ld t1,8(a0) - subu a2,1 - daddu t1,v0 - sltu v0,t1,v0 - mflo AT - mfhi t0 - daddu t1,AT - daddu v0,t0 - sltu AT,t1,AT - sd t1,8(a0) - daddu v0,AT - beqz a2,.L_bn_mul_add_words_return - - ld t0,16(a1) - dmultu t0,a3 - ld t1,16(a0) - daddu t1,v0 - sltu v0,t1,v0 - mflo AT - mfhi t0 - daddu t1,AT - daddu v0,t0 - sltu AT,t1,AT - sd t1,16(a0) - daddu v0,AT - jr ra -END(bn_mul_add_words) - -.align 5 -LEAF(bn_mul_words) - .set noreorder - bgtzl a2,.L_bn_mul_words_proceed - ld t0,0(a1) - jr ra - move v0,zero - .set reorder - -.L_bn_mul_words_proceed: - li MINUS4,-4 - and ta0,a2,MINUS4 - move v0,zero - beqz ta0,.L_bn_mul_words_tail - -.L_bn_mul_words_loop: - dmultu t0,a3 - ld t2,8(a1) - ld ta0,16(a1) - ld ta2,24(a1) - mflo AT - mfhi t0 - daddu v0,AT - sltu t1,v0,AT - sd v0,0(a0) - daddu v0,t1,t0 - - dmultu t2,a3 - subu a2,4 - PTR_ADD a0,32 - PTR_ADD a1,32 - mflo AT - mfhi t2 - daddu v0,AT - sltu t3,v0,AT - sd v0,-24(a0) - daddu v0,t3,t2 - - dmultu ta0,a3 - mflo AT - mfhi ta0 - daddu v0,AT - sltu ta1,v0,AT - sd v0,-16(a0) - daddu v0,ta1,ta0 - - - dmultu ta2,a3 - and ta0,a2,MINUS4 - mflo AT - mfhi ta2 - daddu v0,AT - sltu ta3,v0,AT - sd v0,-8(a0) - daddu v0,ta3,ta2 - .set noreorder - bgtzl ta0,.L_bn_mul_words_loop - ld t0,0(a1) - - bnezl a2,.L_bn_mul_words_tail - ld t0,0(a1) - .set reorder - -.L_bn_mul_words_return: - jr ra - -.L_bn_mul_words_tail: - dmultu t0,a3 - subu a2,1 - mflo AT - mfhi t0 - daddu v0,AT - sltu t1,v0,AT - sd v0,0(a0) - daddu v0,t1,t0 - beqz a2,.L_bn_mul_words_return - - ld t0,8(a1) - dmultu t0,a3 - subu a2,1 - mflo AT - mfhi t0 - daddu v0,AT - sltu t1,v0,AT - sd v0,8(a0) - daddu v0,t1,t0 - beqz a2,.L_bn_mul_words_return - - ld t0,16(a1) - dmultu t0,a3 - mflo AT - mfhi t0 - daddu v0,AT - sltu t1,v0,AT - sd v0,16(a0) - daddu v0,t1,t0 - jr ra -END(bn_mul_words) - -.align 5 -LEAF(bn_sqr_words) - .set noreorder - bgtzl a2,.L_bn_sqr_words_proceed - ld t0,0(a1) - jr ra - move v0,zero - .set reorder - -.L_bn_sqr_words_proceed: - li MINUS4,-4 - and ta0,a2,MINUS4 - move v0,zero - beqz ta0,.L_bn_sqr_words_tail - -.L_bn_sqr_words_loop: - dmultu t0,t0 - ld t2,8(a1) - ld ta0,16(a1) - ld ta2,24(a1) - mflo t1 - mfhi t0 - sd t1,0(a0) - sd t0,8(a0) - - dmultu t2,t2 - subu a2,4 - PTR_ADD a0,64 - PTR_ADD a1,32 - mflo t3 - mfhi t2 - sd t3,-48(a0) - sd t2,-40(a0) - - dmultu ta0,ta0 - mflo ta1 - mfhi ta0 - sd ta1,-32(a0) - sd ta0,-24(a0) - - - dmultu ta2,ta2 - and ta0,a2,MINUS4 - mflo ta3 - mfhi ta2 - sd ta3,-16(a0) - sd ta2,-8(a0) - - .set noreorder - bgtzl ta0,.L_bn_sqr_words_loop - ld t0,0(a1) - - bnezl a2,.L_bn_sqr_words_tail - ld t0,0(a1) - .set reorder - -.L_bn_sqr_words_return: - move v0,zero - jr ra - -.L_bn_sqr_words_tail: - dmultu t0,t0 - subu a2,1 - mflo t1 - mfhi t0 - sd t1,0(a0) - sd t0,8(a0) - beqz a2,.L_bn_sqr_words_return - - ld t0,8(a1) - dmultu t0,t0 - subu a2,1 - mflo t1 - mfhi t0 - sd t1,16(a0) - sd t0,24(a0) - beqz a2,.L_bn_sqr_words_return - - ld t0,16(a1) - dmultu t0,t0 - mflo t1 - mfhi t0 - sd t1,32(a0) - sd t0,40(a0) - jr ra -END(bn_sqr_words) - -.align 5 -LEAF(bn_add_words) - .set noreorder - bgtzl a3,.L_bn_add_words_proceed - ld t0,0(a1) - jr ra - move v0,zero - .set reorder - -.L_bn_add_words_proceed: - li MINUS4,-4 - and AT,a3,MINUS4 - move v0,zero - beqz AT,.L_bn_add_words_tail - -.L_bn_add_words_loop: - ld ta0,0(a2) - subu a3,4 - ld t1,8(a1) - and AT,a3,MINUS4 - ld t2,16(a1) - PTR_ADD a2,32 - ld t3,24(a1) - PTR_ADD a0,32 - ld ta1,-24(a2) - PTR_ADD a1,32 - ld ta2,-16(a2) - ld ta3,-8(a2) - daddu ta0,t0 - sltu t8,ta0,t0 - daddu t0,ta0,v0 - sltu v0,t0,ta0 - sd t0,-32(a0) - daddu v0,t8 - - daddu ta1,t1 - sltu t9,ta1,t1 - daddu t1,ta1,v0 - sltu v0,t1,ta1 - sd t1,-24(a0) - daddu v0,t9 - - daddu ta2,t2 - sltu t8,ta2,t2 - daddu t2,ta2,v0 - sltu v0,t2,ta2 - sd t2,-16(a0) - daddu v0,t8 - - daddu ta3,t3 - sltu t9,ta3,t3 - daddu t3,ta3,v0 - sltu v0,t3,ta3 - sd t3,-8(a0) - daddu v0,t9 - - .set noreorder - bgtzl AT,.L_bn_add_words_loop - ld t0,0(a1) - - bnezl a3,.L_bn_add_words_tail - ld t0,0(a1) - .set reorder - -.L_bn_add_words_return: - jr ra - -.L_bn_add_words_tail: - ld ta0,0(a2) - daddu ta0,t0 - subu a3,1 - sltu t8,ta0,t0 - daddu t0,ta0,v0 - sltu v0,t0,ta0 - sd t0,0(a0) - daddu v0,t8 - beqz a3,.L_bn_add_words_return - - ld t1,8(a1) - ld ta1,8(a2) - daddu ta1,t1 - subu a3,1 - sltu t9,ta1,t1 - daddu t1,ta1,v0 - sltu v0,t1,ta1 - sd t1,8(a0) - daddu v0,t9 - beqz a3,.L_bn_add_words_return - - ld t2,16(a1) - ld ta2,16(a2) - daddu ta2,t2 - sltu t8,ta2,t2 - daddu t2,ta2,v0 - sltu v0,t2,ta2 - sd t2,16(a0) - daddu v0,t8 - jr ra -END(bn_add_words) - -.align 5 -LEAF(bn_sub_words) - .set noreorder - bgtzl a3,.L_bn_sub_words_proceed - ld t0,0(a1) - jr ra - move v0,zero - .set reorder - -.L_bn_sub_words_proceed: - li MINUS4,-4 - and AT,a3,MINUS4 - move v0,zero - beqz AT,.L_bn_sub_words_tail - -.L_bn_sub_words_loop: - ld ta0,0(a2) - subu a3,4 - ld t1,8(a1) - and AT,a3,MINUS4 - ld t2,16(a1) - PTR_ADD a2,32 - ld t3,24(a1) - PTR_ADD a0,32 - ld ta1,-24(a2) - PTR_ADD a1,32 - ld ta2,-16(a2) - ld ta3,-8(a2) - sltu t8,t0,ta0 - dsubu t0,ta0 - dsubu ta0,t0,v0 - sd ta0,-32(a0) - MOVNZ (t0,v0,t8) - - sltu t9,t1,ta1 - dsubu t1,ta1 - dsubu ta1,t1,v0 - sd ta1,-24(a0) - MOVNZ (t1,v0,t9) - - - sltu t8,t2,ta2 - dsubu t2,ta2 - dsubu ta2,t2,v0 - sd ta2,-16(a0) - MOVNZ (t2,v0,t8) - - sltu t9,t3,ta3 - dsubu t3,ta3 - dsubu ta3,t3,v0 - sd ta3,-8(a0) - MOVNZ (t3,v0,t9) - - .set noreorder - bgtzl AT,.L_bn_sub_words_loop - ld t0,0(a1) - - bnezl a3,.L_bn_sub_words_tail - ld t0,0(a1) - .set reorder - -.L_bn_sub_words_return: - jr ra - -.L_bn_sub_words_tail: - ld ta0,0(a2) - subu a3,1 - sltu t8,t0,ta0 - dsubu t0,ta0 - dsubu ta0,t0,v0 - MOVNZ (t0,v0,t8) - sd ta0,0(a0) - beqz a3,.L_bn_sub_words_return - - ld t1,8(a1) - subu a3,1 - ld ta1,8(a2) - sltu t9,t1,ta1 - dsubu t1,ta1 - dsubu ta1,t1,v0 - MOVNZ (t1,v0,t9) - sd ta1,8(a0) - beqz a3,.L_bn_sub_words_return - - ld t2,16(a1) - ld ta2,16(a2) - sltu t8,t2,ta2 - dsubu t2,ta2 - dsubu ta2,t2,v0 - MOVNZ (t2,v0,t8) - sd ta2,16(a0) - jr ra -END(bn_sub_words) - -#undef MINUS4 - -.align 5 -LEAF(bn_div_3_words) - .set reorder - move a3,a0 /* we know that bn_div_words doesn't - * touch a3, ta2, ta3 and preserves a2 - * so that we can save two arguments - * and return address in registers - * instead of stack:-) - */ - ld a0,(a3) - move ta2,a1 - ld a1,-8(a3) - bne a0,a2,.L_bn_div_3_words_proceed - li v0,-1 - jr ra -.L_bn_div_3_words_proceed: - move ta3,ra - bal bn_div_words - move ra,ta3 - dmultu ta2,v0 - ld t2,-16(a3) - move ta0,zero - mfhi t1 - mflo t0 - sltu t8,t1,v1 -.L_bn_div_3_words_inner_loop: - bnez t8,.L_bn_div_3_words_inner_loop_done - sgeu AT,t2,t0 - seq t9,t1,v1 - and AT,t9 - sltu t3,t0,ta2 - daddu v1,a2 - dsubu t1,t3 - dsubu t0,ta2 - sltu t8,t1,v1 - sltu ta0,v1,a2 - or t8,ta0 - .set noreorder - beqzl AT,.L_bn_div_3_words_inner_loop - dsubu v0,1 - .set reorder -.L_bn_div_3_words_inner_loop_done: - jr ra -END(bn_div_3_words) - -.align 5 -LEAF(bn_div_words) - .set noreorder - bnezl a2,.L_bn_div_words_proceed - move v1,zero - jr ra - li v0,-1 /* I'd rather signal div-by-zero - * which can be done with 'break 7' */ - -.L_bn_div_words_proceed: - bltz a2,.L_bn_div_words_body - move t9,v1 - dsll a2,1 - bgtz a2,.-4 - addu t9,1 - - .set reorder - negu t1,t9 - li t2,-1 - dsll t2,t1 - and t2,a0 - dsrl AT,a1,t1 - .set noreorder - bnezl t2,.+8 - break 6 /* signal overflow */ - .set reorder - dsll a0,t9 - dsll a1,t9 - or a0,AT - -#define QT ta0 -#define HH ta1 -#define DH v1 -.L_bn_div_words_body: - dsrl DH,a2,32 - sgeu AT,a0,a2 - .set noreorder - bnezl AT,.+8 - dsubu a0,a2 - .set reorder - - li QT,-1 - dsrl HH,a0,32 - dsrl QT,32 /* q=0xffffffff */ - beq DH,HH,.L_bn_div_words_skip_div1 - ddivu zero,a0,DH - mflo QT -.L_bn_div_words_skip_div1: - dmultu a2,QT - dsll t3,a0,32 - dsrl AT,a1,32 - or t3,AT - mflo t0 - mfhi t1 -.L_bn_div_words_inner_loop1: - sltu t2,t3,t0 - seq t8,HH,t1 - sltu AT,HH,t1 - and t2,t8 - sltu v0,t0,a2 - or AT,t2 - .set noreorder - beqz AT,.L_bn_div_words_inner_loop1_done - dsubu t1,v0 - dsubu t0,a2 - b .L_bn_div_words_inner_loop1 - dsubu QT,1 - .set reorder -.L_bn_div_words_inner_loop1_done: - - dsll a1,32 - dsubu a0,t3,t0 - dsll v0,QT,32 - - li QT,-1 - dsrl HH,a0,32 - dsrl QT,32 /* q=0xffffffff */ - beq DH,HH,.L_bn_div_words_skip_div2 - ddivu zero,a0,DH - mflo QT -.L_bn_div_words_skip_div2: -#undef DH - dmultu a2,QT - dsll t3,a0,32 - dsrl AT,a1,32 - or t3,AT - mflo t0 - mfhi t1 -.L_bn_div_words_inner_loop2: - sltu t2,t3,t0 - seq t8,HH,t1 - sltu AT,HH,t1 - and t2,t8 - sltu v1,t0,a2 - or AT,t2 - .set noreorder - beqz AT,.L_bn_div_words_inner_loop2_done - dsubu t1,v1 - dsubu t0,a2 - b .L_bn_div_words_inner_loop2 - dsubu QT,1 - .set reorder -.L_bn_div_words_inner_loop2_done: -#undef HH - - dsubu a0,t3,t0 - or v0,QT - dsrl v1,a0,t9 /* v1 contains remainder if anybody wants it */ - dsrl a2,t9 /* restore a2 */ - jr ra -#undef QT -END(bn_div_words) - -#define a_0 t0 -#define a_1 t1 -#define a_2 t2 -#define a_3 t3 -#define b_0 ta0 -#define b_1 ta1 -#define b_2 ta2 -#define b_3 ta3 - -#define a_4 s0 -#define a_5 s2 -#define a_6 s4 -#define a_7 a1 /* once we load a[7] we don't need a anymore */ -#define b_4 s1 -#define b_5 s3 -#define b_6 s5 -#define b_7 a2 /* once we load b[7] we don't need b anymore */ - -#define t_1 t8 -#define t_2 t9 - -#define c_1 v0 -#define c_2 v1 -#define c_3 a3 - -#define FRAME_SIZE 48 - -.align 5 -LEAF(bn_mul_comba8) - .set noreorder - PTR_SUB sp,FRAME_SIZE - .frame sp,64,ra - .set reorder - ld a_0,0(a1) /* If compiled with -mips3 option on - * R5000 box assembler barks on this - * line with "shouldn't have mult/div - * as last instruction in bb (R10K - * bug)" warning. If anybody out there - * has a clue about how to circumvent - * this do send me a note. - * - */ - ld b_0,0(a2) - ld a_1,8(a1) - ld a_2,16(a1) - ld a_3,24(a1) - ld b_1,8(a2) - ld b_2,16(a2) - ld b_3,24(a2) - dmultu a_0,b_0 /* mul_add_c(a[0],b[0],c1,c2,c3); */ - sd s0,0(sp) - sd s1,8(sp) - sd s2,16(sp) - sd s3,24(sp) - sd s4,32(sp) - sd s5,40(sp) - mflo c_1 - mfhi c_2 - - dmultu a_0,b_1 /* mul_add_c(a[0],b[1],c2,c3,c1); */ - ld a_4,32(a1) - ld a_5,40(a1) - ld a_6,48(a1) - ld a_7,56(a1) - ld b_4,32(a2) - ld b_5,40(a2) - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu c_3,t_2,AT - dmultu a_1,b_0 /* mul_add_c(a[1],b[0],c2,c3,c1); */ - ld b_6,48(a2) - ld b_7,56(a2) - sd c_1,0(a0) /* r[0]=c1; */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - sd c_2,8(a0) /* r[1]=c2; */ - - dmultu a_2,b_0 /* mul_add_c(a[2],b[0],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - dmultu a_1,b_1 /* mul_add_c(a[1],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_0,b_2 /* mul_add_c(a[0],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,16(a0) /* r[2]=c3; */ - - dmultu a_0,b_3 /* mul_add_c(a[0],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu c_3,c_2,t_2 - dmultu a_1,b_2 /* mul_add_c(a[1],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_2,b_1 /* mul_add_c(a[2],b[1],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_3,b_0 /* mul_add_c(a[3],b[0],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,24(a0) /* r[3]=c1; */ - - dmultu a_4,b_0 /* mul_add_c(a[4],b[0],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - dmultu a_3,b_1 /* mul_add_c(a[3],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_2,b_2 /* mul_add_c(a[2],b[2],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_1,b_3 /* mul_add_c(a[1],b[3],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_0,b_4 /* mul_add_c(a[0],b[4],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,32(a0) /* r[4]=c2; */ - - dmultu a_0,b_5 /* mul_add_c(a[0],b[5],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_1,b_4 /* mul_add_c(a[1],b[4],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_2,b_3 /* mul_add_c(a[2],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_3,b_2 /* mul_add_c(a[3],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_4,b_1 /* mul_add_c(a[4],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_5,b_0 /* mul_add_c(a[5],b[0],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,40(a0) /* r[5]=c3; */ - - dmultu a_6,b_0 /* mul_add_c(a[6],b[0],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu c_3,c_2,t_2 - dmultu a_5,b_1 /* mul_add_c(a[5],b[1],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_4,b_2 /* mul_add_c(a[4],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_3,b_3 /* mul_add_c(a[3],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_2,b_4 /* mul_add_c(a[2],b[4],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_1,b_5 /* mul_add_c(a[1],b[5],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_0,b_6 /* mul_add_c(a[0],b[6],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,48(a0) /* r[6]=c1; */ - - dmultu a_0,b_7 /* mul_add_c(a[0],b[7],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - dmultu a_1,b_6 /* mul_add_c(a[1],b[6],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_2,b_5 /* mul_add_c(a[2],b[5],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_3,b_4 /* mul_add_c(a[3],b[4],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_4,b_3 /* mul_add_c(a[4],b[3],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_5,b_2 /* mul_add_c(a[5],b[2],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_6,b_1 /* mul_add_c(a[6],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_7,b_0 /* mul_add_c(a[7],b[0],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,56(a0) /* r[7]=c2; */ - - dmultu a_7,b_1 /* mul_add_c(a[7],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_6,b_2 /* mul_add_c(a[6],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_5,b_3 /* mul_add_c(a[5],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_4,b_4 /* mul_add_c(a[4],b[4],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_3,b_5 /* mul_add_c(a[3],b[5],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_2,b_6 /* mul_add_c(a[2],b[6],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_1,b_7 /* mul_add_c(a[1],b[7],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,64(a0) /* r[8]=c3; */ - - dmultu a_2,b_7 /* mul_add_c(a[2],b[7],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu c_3,c_2,t_2 - dmultu a_3,b_6 /* mul_add_c(a[3],b[6],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_4,b_5 /* mul_add_c(a[4],b[5],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_5,b_4 /* mul_add_c(a[5],b[4],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_6,b_3 /* mul_add_c(a[6],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_7,b_2 /* mul_add_c(a[7],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,72(a0) /* r[9]=c1; */ - - dmultu a_7,b_3 /* mul_add_c(a[7],b[3],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - dmultu a_6,b_4 /* mul_add_c(a[6],b[4],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_5,b_5 /* mul_add_c(a[5],b[5],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_4,b_6 /* mul_add_c(a[4],b[6],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_3,b_7 /* mul_add_c(a[3],b[7],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,80(a0) /* r[10]=c2; */ - - dmultu a_4,b_7 /* mul_add_c(a[4],b[7],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_5,b_6 /* mul_add_c(a[5],b[6],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_6,b_5 /* mul_add_c(a[6],b[5],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_7,b_4 /* mul_add_c(a[7],b[4],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,88(a0) /* r[11]=c3; */ - - dmultu a_7,b_5 /* mul_add_c(a[7],b[5],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu c_3,c_2,t_2 - dmultu a_6,b_6 /* mul_add_c(a[6],b[6],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_5,b_7 /* mul_add_c(a[5],b[7],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,96(a0) /* r[12]=c1; */ - - dmultu a_6,b_7 /* mul_add_c(a[6],b[7],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - dmultu a_7,b_6 /* mul_add_c(a[7],b[6],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,104(a0) /* r[13]=c2; */ - - dmultu a_7,b_7 /* mul_add_c(a[7],b[7],c3,c1,c2); */ - ld s0,0(sp) - ld s1,8(sp) - ld s2,16(sp) - ld s3,24(sp) - ld s4,32(sp) - ld s5,40(sp) - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sd c_3,112(a0) /* r[14]=c3; */ - sd c_1,120(a0) /* r[15]=c1; */ - - PTR_ADD sp,FRAME_SIZE - - jr ra -END(bn_mul_comba8) - -.align 5 -LEAF(bn_mul_comba4) - .set reorder - ld a_0,0(a1) - ld b_0,0(a2) - ld a_1,8(a1) - ld a_2,16(a1) - dmultu a_0,b_0 /* mul_add_c(a[0],b[0],c1,c2,c3); */ - ld a_3,24(a1) - ld b_1,8(a2) - ld b_2,16(a2) - ld b_3,24(a2) - mflo c_1 - mfhi c_2 - sd c_1,0(a0) - - dmultu a_0,b_1 /* mul_add_c(a[0],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu c_3,t_2,AT - dmultu a_1,b_0 /* mul_add_c(a[1],b[0],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - sd c_2,8(a0) - - dmultu a_2,b_0 /* mul_add_c(a[2],b[0],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - dmultu a_1,b_1 /* mul_add_c(a[1],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_0,b_2 /* mul_add_c(a[0],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,16(a0) - - dmultu a_0,b_3 /* mul_add_c(a[0],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu c_3,c_2,t_2 - dmultu a_1,b_2 /* mul_add_c(a[1],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_2,b_1 /* mul_add_c(a[2],b[1],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_3,b_0 /* mul_add_c(a[3],b[0],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,24(a0) - - dmultu a_3,b_1 /* mul_add_c(a[3],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu c_1,c_3,t_2 - dmultu a_2,b_2 /* mul_add_c(a[2],b[2],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_1,b_3 /* mul_add_c(a[1],b[3],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,32(a0) - - dmultu a_2,b_3 /* mul_add_c(a[2],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu c_2,c_1,t_2 - dmultu a_3,b_2 /* mul_add_c(a[3],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,40(a0) - - dmultu a_3,b_3 /* mul_add_c(a[3],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sd c_1,48(a0) - sd c_2,56(a0) - - jr ra -END(bn_mul_comba4) - -#undef a_4 -#undef a_5 -#undef a_6 -#undef a_7 -#define a_4 b_0 -#define a_5 b_1 -#define a_6 b_2 -#define a_7 b_3 - -.align 5 -LEAF(bn_sqr_comba8) - .set reorder - ld a_0,0(a1) - ld a_1,8(a1) - ld a_2,16(a1) - ld a_3,24(a1) - - dmultu a_0,a_0 /* mul_add_c(a[0],b[0],c1,c2,c3); */ - ld a_4,32(a1) - ld a_5,40(a1) - ld a_6,48(a1) - ld a_7,56(a1) - mflo c_1 - mfhi c_2 - sd c_1,0(a0) - - dmultu a_0,a_1 /* mul_add_c2(a[0],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu c_3,t_2,AT - sd c_2,8(a0) - - dmultu a_2,a_0 /* mul_add_c2(a[2],b[0],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_1,a_1 /* mul_add_c(a[1],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,16(a0) - - dmultu a_0,a_3 /* mul_add_c2(a[0],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt c_3,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_1,a_2 /* mul_add_c2(a[1],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,24(a0) - - dmultu a_4,a_0 /* mul_add_c2(a[4],b[0],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_3,a_1 /* mul_add_c2(a[3],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_1,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_2,a_2 /* mul_add_c(a[2],b[2],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,32(a0) - - dmultu a_0,a_5 /* mul_add_c2(a[0],b[5],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_1,a_4 /* mul_add_c2(a[1],b[4],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_2,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_2,a_3 /* mul_add_c2(a[2],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_2,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,40(a0) - - dmultu a_6,a_0 /* mul_add_c2(a[6],b[0],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt c_3,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_5,a_1 /* mul_add_c2(a[5],b[1],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_4,a_2 /* mul_add_c2(a[4],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_3,a_3 /* mul_add_c(a[3],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,48(a0) - - dmultu a_0,a_7 /* mul_add_c2(a[0],b[7],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_1,a_6 /* mul_add_c2(a[1],b[6],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_1,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_2,a_5 /* mul_add_c2(a[2],b[5],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_1,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_3,a_4 /* mul_add_c2(a[3],b[4],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_1,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,56(a0) - - dmultu a_7,a_1 /* mul_add_c2(a[7],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_6,a_2 /* mul_add_c2(a[6],b[2],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_2,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_5,a_3 /* mul_add_c2(a[5],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_2,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_4,a_4 /* mul_add_c(a[4],b[4],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,64(a0) - - dmultu a_2,a_7 /* mul_add_c2(a[2],b[7],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt c_3,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_3,a_6 /* mul_add_c2(a[3],b[6],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_4,a_5 /* mul_add_c2(a[4],b[5],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,72(a0) - - dmultu a_7,a_3 /* mul_add_c2(a[7],b[3],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_6,a_4 /* mul_add_c2(a[6],b[4],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_1,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_5,a_5 /* mul_add_c(a[5],b[5],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,80(a0) - - dmultu a_4,a_7 /* mul_add_c2(a[4],b[7],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_5,a_6 /* mul_add_c2(a[5],b[6],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_2,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,88(a0) - - dmultu a_7,a_5 /* mul_add_c2(a[7],b[5],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt c_3,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_6,a_6 /* mul_add_c(a[6],b[6],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,96(a0) - - dmultu a_6,a_7 /* mul_add_c2(a[6],b[7],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,104(a0) - - dmultu a_7,a_7 /* mul_add_c(a[7],b[7],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sd c_3,112(a0) - sd c_1,120(a0) - - jr ra -END(bn_sqr_comba8) - -.align 5 -LEAF(bn_sqr_comba4) - .set reorder - ld a_0,0(a1) - ld a_1,8(a1) - ld a_2,16(a1) - ld a_3,24(a1) - dmultu a_0,a_0 /* mul_add_c(a[0],b[0],c1,c2,c3); */ - mflo c_1 - mfhi c_2 - sd c_1,0(a0) - - dmultu a_0,a_1 /* mul_add_c2(a[0],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu c_3,t_2,AT - sd c_2,8(a0) - - dmultu a_2,a_0 /* mul_add_c2(a[2],b[0],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - dmultu a_1,a_1 /* mul_add_c(a[1],b[1],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,16(a0) - - dmultu a_0,a_3 /* mul_add_c2(a[0],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt c_3,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - dmultu a_1,a_2 /* mul_add_c(a2[1],b[2],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - slt AT,t_2,zero - daddu c_3,AT - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sltu AT,c_2,t_2 - daddu c_3,AT - sd c_1,24(a0) - - dmultu a_3,a_1 /* mul_add_c2(a[3],b[1],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - slt c_1,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - dmultu a_2,a_2 /* mul_add_c(a[2],b[2],c2,c3,c1); */ - mflo t_1 - mfhi t_2 - daddu c_2,t_1 - sltu AT,c_2,t_1 - daddu t_2,AT - daddu c_3,t_2 - sltu AT,c_3,t_2 - daddu c_1,AT - sd c_2,32(a0) - - dmultu a_2,a_3 /* mul_add_c2(a[2],b[3],c3,c1,c2); */ - mflo t_1 - mfhi t_2 - slt c_2,t_2,zero - dsll t_2,1 - slt a2,t_1,zero - daddu t_2,a2 - dsll t_1,1 - daddu c_3,t_1 - sltu AT,c_3,t_1 - daddu t_2,AT - daddu c_1,t_2 - sltu AT,c_1,t_2 - daddu c_2,AT - sd c_3,40(a0) - - dmultu a_3,a_3 /* mul_add_c(a[3],b[3],c1,c2,c3); */ - mflo t_1 - mfhi t_2 - daddu c_1,t_1 - sltu AT,c_1,t_1 - daddu t_2,AT - daddu c_2,t_2 - sd c_1,48(a0) - sd c_2,56(a0) - - jr ra -END(bn_sqr_comba4) diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c index 31476abebfb79b..2d39407f499ed7 100644 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c @@ -273,6 +273,10 @@ BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) /* sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) */ /* sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) */ +/* + * Keep in mind that carrying into high part of multiplication result + * can not overflow, because it cannot be all-ones. + */ #if 0 /* original macros are kept for reference purposes */ #define mul_add_c(a,b,c0,c1,c2) { \ @@ -287,10 +291,10 @@ BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) BN_ULONG ta=(a),tb=(b),t0; \ t1 = BN_UMULT_HIGH(ta,tb); \ t0 = ta * tb; \ - t2 = t1+t1; c2 += (t2dmax && words >= (_bnum2)->top); \ + assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \ + /* avoid unused variable warning with NDEBUG */ \ + (void)(_bnum2); \ } while(0) #else /* !BN_DEBUG */ diff --git a/deps/openssl/openssl/crypto/bn/bn_asm.c b/deps/openssl/openssl/crypto/bn/bn_asm.c index c43c91cc09f485..a33b63411b7ffe 100644 --- a/deps/openssl/openssl/crypto/bn/bn_asm.c +++ b/deps/openssl/openssl/crypto/bn/bn_asm.c @@ -438,6 +438,10 @@ BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n) /* sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) */ /* sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number c=(c2,c1,c0) */ +/* + * Keep in mind that carrying into high part of multiplication result + * can not overflow, because it cannot be all-ones. + */ #ifdef BN_LLONG #define mul_add_c(a,b,c0,c1,c2) \ t=(BN_ULLONG)a*b; \ @@ -478,10 +482,10 @@ BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n) #define mul_add_c2(a,b,c0,c1,c2) { \ BN_ULONG ta=(a),tb=(b),t0; \ BN_UMULT_LOHI(t0,t1,ta,tb); \ - t2 = t1+t1; c2 += (t2pool.head; BN_STACK *stack = &ctx->stack; - fprintf(stderr,"(%08x): ", (unsigned int)ctx); + fprintf(stderr,"(%16p): ", ctx); while(bnidx < ctx->used) { fprintf(stderr,"%03x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax); diff --git a/deps/openssl/openssl/crypto/bn/bn_div.c b/deps/openssl/openssl/crypto/bn/bn_div.c index 7b2403185e6279..0ec90e805c471e 100644 --- a/deps/openssl/openssl/crypto/bn/bn_div.c +++ b/deps/openssl/openssl/crypto/bn/bn_div.c @@ -189,15 +189,17 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, int no_branch=0; /* Invalid zero-padding would have particularly bad consequences - * in the case of 'num', so don't just rely on bn_check_top() for this one + * so don't just rely on bn_check_top() here * (bn_check_top() works only for BN_DEBUG builds) */ - if (num->top > 0 && num->d[num->top - 1] == 0) + if ((num->top > 0 && num->d[num->top - 1] == 0) || + (divisor->top > 0 && divisor->d[divisor->top - 1] == 0)) { BNerr(BN_F_BN_DIV,BN_R_NOT_INITIALIZED); return 0; } bn_check_top(num); + bn_check_top(divisor); if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) { @@ -207,7 +209,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, bn_check_top(dv); bn_check_top(rm); /* bn_check_top(num); */ /* 'num' has been checked already */ - bn_check_top(divisor); + /* bn_check_top(divisor); */ /* 'divisor' has been checked already */ if (BN_is_zero(divisor)) { diff --git a/deps/openssl/openssl/crypto/bn/bntest.c b/deps/openssl/openssl/crypto/bn/bntest.c index 06f5954acc3908..48bc63384c9246 100644 --- a/deps/openssl/openssl/crypto/bn/bntest.c +++ b/deps/openssl/openssl/crypto/bn/bntest.c @@ -107,6 +107,7 @@ int test_mod(BIO *bp,BN_CTX *ctx); int test_mod_mul(BIO *bp,BN_CTX *ctx); int test_mod_exp(BIO *bp,BN_CTX *ctx); int test_mod_exp_mont_consttime(BIO *bp,BN_CTX *ctx); +int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx); int test_exp(BIO *bp,BN_CTX *ctx); int test_gf2m_add(BIO *bp); int test_gf2m_mod(BIO *bp); @@ -249,6 +250,7 @@ int main(int argc, char *argv[]) message(out,"BN_mod_exp_mont_consttime"); if (!test_mod_exp_mont_consttime(out,ctx)) goto err; + if (!test_mod_exp_mont5(out,ctx)) goto err; (void)BIO_flush(out); message(out,"BN_exp"); @@ -676,44 +678,98 @@ int test_mul(BIO *bp) int test_sqr(BIO *bp, BN_CTX *ctx) { - BIGNUM a,c,d,e; - int i; + BIGNUM *a,*c,*d,*e; + int i, ret = 0; - BN_init(&a); - BN_init(&c); - BN_init(&d); - BN_init(&e); + a = BN_new(); + c = BN_new(); + d = BN_new(); + e = BN_new(); + if (a == NULL || c == NULL || d == NULL || e == NULL) + { + goto err; + } for (i=0; ineg=rand_neg(); + BN_sqr(c,a,ctx); if (bp != NULL) { if (!results) { - BN_print(bp,&a); + BN_print(bp,a); BIO_puts(bp," * "); - BN_print(bp,&a); + BN_print(bp,a); BIO_puts(bp," - "); } - BN_print(bp,&c); + BN_print(bp,c); BIO_puts(bp,"\n"); } - BN_div(&d,&e,&c,&a,ctx); - BN_sub(&d,&d,&a); - if(!BN_is_zero(&d) || !BN_is_zero(&e)) - { - fprintf(stderr,"Square test failed!\n"); - return 0; - } + BN_div(d,e,c,a,ctx); + BN_sub(d,d,a); + if(!BN_is_zero(d) || !BN_is_zero(e)) + { + fprintf(stderr,"Square test failed!\n"); + goto err; + } } - BN_free(&a); - BN_free(&c); - BN_free(&d); - BN_free(&e); - return(1); + + /* Regression test for a BN_sqr overflow bug. */ + BN_hex2bn(&a, + "80000000000000008000000000000001FFFFFFFFFFFFFFFE0000000000000000"); + BN_sqr(c, a, ctx); + if (bp != NULL) + { + if (!results) + { + BN_print(bp,a); + BIO_puts(bp," * "); + BN_print(bp,a); + BIO_puts(bp," - "); + } + BN_print(bp,c); + BIO_puts(bp,"\n"); + } + BN_mul(d, a, a, ctx); + if (BN_cmp(c, d)) + { + fprintf(stderr, "Square test failed: BN_sqr and BN_mul produce " + "different results!\n"); + goto err; + } + + /* Regression test for a BN_sqr overflow bug. */ + BN_hex2bn(&a, + "80000000000000000000000080000001FFFFFFFE000000000000000000000000"); + BN_sqr(c, a, ctx); + if (bp != NULL) + { + if (!results) + { + BN_print(bp,a); + BIO_puts(bp," * "); + BN_print(bp,a); + BIO_puts(bp," - "); + } + BN_print(bp,c); + BIO_puts(bp,"\n"); + } + BN_mul(d, a, a, ctx); + if (BN_cmp(c, d)) + { + fprintf(stderr, "Square test failed: BN_sqr and BN_mul produce " + "different results!\n"); + goto err; + } + ret = 1; +err: + if (a != NULL) BN_free(a); + if (c != NULL) BN_free(c); + if (d != NULL) BN_free(d); + if (e != NULL) BN_free(e); + return ret; } int test_mont(BIO *bp, BN_CTX *ctx) @@ -1012,6 +1068,80 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) return(1); } +/* Test constant-time modular exponentiation with 1024-bit inputs, + * which on x86_64 cause a different code branch to be taken. + */ +int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx) + { + BIGNUM *a,*p,*m,*d,*e; + + BN_MONT_CTX *mont; + + a=BN_new(); + p=BN_new(); + m=BN_new(); + d=BN_new(); + e=BN_new(); + + mont = BN_MONT_CTX_new(); + + BN_bntest_rand(m,1024,0,1); /* must be odd for montgomery */ + /* Zero exponent */ + BN_bntest_rand(a,1024,0,0); + BN_zero(p); + if(!BN_mod_exp_mont_consttime(d,a,p,m,ctx,NULL)) + return 0; + if(!BN_is_one(d)) + { + fprintf(stderr, "Modular exponentiation test failed!\n"); + return 0; + } + /* Zero input */ + BN_bntest_rand(p,1024,0,0); + BN_zero(a); + if(!BN_mod_exp_mont_consttime(d,a,p,m,ctx,NULL)) + return 0; + if(!BN_is_zero(d)) + { + fprintf(stderr, "Modular exponentiation test failed!\n"); + return 0; + } + /* Craft an input whose Montgomery representation is 1, + * i.e., shorter than the modulus m, in order to test + * the const time precomputation scattering/gathering. + */ + BN_one(a); + BN_MONT_CTX_set(mont,m,ctx); + if(!BN_from_montgomery(e,a,mont,ctx)) + return 0; + if(!BN_mod_exp_mont_consttime(d,e,p,m,ctx,NULL)) + return 0; + if(!BN_mod_exp_simple(a,e,p,m,ctx)) + return 0; + if(BN_cmp(a,d) != 0) + { + fprintf(stderr,"Modular exponentiation test failed!\n"); + return 0; + } + /* Finally, some regular test vectors. */ + BN_bntest_rand(e,1024,0,0); + if(!BN_mod_exp_mont_consttime(d,e,p,m,ctx,NULL)) + return 0; + if(!BN_mod_exp_simple(a,e,p,m,ctx)) + return 0; + if(BN_cmp(a,d) != 0) + { + fprintf(stderr,"Modular exponentiation test failed!\n"); + return 0; + } + BN_free(a); + BN_free(p); + BN_free(m); + BN_free(d); + BN_free(e); + return(1); + } + int test_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*d,*e,*one; diff --git a/deps/openssl/openssl/crypto/constant_time_locl.h b/deps/openssl/openssl/crypto/constant_time_locl.h index c0483939fe3dbb..8af98c168329e9 100644 --- a/deps/openssl/openssl/crypto/constant_time_locl.h +++ b/deps/openssl/openssl/crypto/constant_time_locl.h @@ -129,17 +129,12 @@ static inline int constant_time_select_int(unsigned int mask, int a, int b); static inline unsigned int constant_time_msb(unsigned int a) { - return (unsigned int)((int)(a) >> (sizeof(int) * 8 - 1)); + return 0-(a >> (sizeof(a) * 8 - 1)); } static inline unsigned int constant_time_lt(unsigned int a, unsigned int b) { - unsigned int lt; - /* Case 1: msb(a) == msb(b). a < b iff the MSB of a - b is set.*/ - lt = ~(a ^ b) & (a - b); - /* Case 2: msb(a) != msb(b). a < b iff the MSB of b is set. */ - lt |= ~a & b; - return constant_time_msb(lt); + return constant_time_msb(a^((a^b)|((a-b)^b))); } static inline unsigned char constant_time_lt_8(unsigned int a, unsigned int b) @@ -149,12 +144,7 @@ static inline unsigned char constant_time_lt_8(unsigned int a, unsigned int b) static inline unsigned int constant_time_ge(unsigned int a, unsigned int b) { - unsigned int ge; - /* Case 1: msb(a) == msb(b). a >= b iff the MSB of a - b is not set.*/ - ge = ~((a ^ b) | (a - b)); - /* Case 2: msb(a) != msb(b). a >= b iff the MSB of a is set. */ - ge |= a & ~b; - return constant_time_msb(ge); + return ~constant_time_lt(a, b); } static inline unsigned char constant_time_ge_8(unsigned int a, unsigned int b) @@ -204,7 +194,7 @@ static inline unsigned char constant_time_select_8(unsigned char mask, return (unsigned char)(constant_time_select(mask, a, b)); } -inline int constant_time_select_int(unsigned int mask, int a, int b) +static inline int constant_time_select_int(unsigned int mask, int a, int b) { return (int)(constant_time_select(mask, (unsigned)(a), (unsigned)(b))); } diff --git a/deps/openssl/openssl/crypto/cversion.c b/deps/openssl/openssl/crypto/cversion.c index ea9f25fd16663d..881957e8923e15 100644 --- a/deps/openssl/openssl/crypto/cversion.c +++ b/deps/openssl/openssl/crypto/cversion.c @@ -69,10 +69,7 @@ const char *SSLeay_version(int t) if (t == SSLEAY_BUILT_ON) { #ifdef DATE - static char buf[sizeof(DATE)+11]; - - BIO_snprintf(buf,sizeof buf,"built on: %s",DATE); - return(buf); + return(DATE); #else return("built on: date not available"); #endif @@ -80,10 +77,7 @@ const char *SSLeay_version(int t) if (t == SSLEAY_CFLAGS) { #ifdef CFLAGS - static char buf[sizeof(CFLAGS)+11]; - - BIO_snprintf(buf,sizeof buf,"compiler: %s",CFLAGS); - return(buf); + return(CFLAGS); #else return("compiler: information not available"); #endif @@ -91,10 +85,7 @@ const char *SSLeay_version(int t) if (t == SSLEAY_PLATFORM) { #ifdef PLATFORM - static char buf[sizeof(PLATFORM)+11]; - - BIO_snprintf(buf,sizeof buf,"platform: %s", PLATFORM); - return(buf); + return(PLATFORM); #else return("platform: information not available"); #endif diff --git a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c index 60585343746d97..473af873e02bef 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_asn1.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_asn1.c @@ -176,13 +176,25 @@ int DSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int siglen, DSA *dsa) { DSA_SIG *s; + const unsigned char *p = sigbuf; + unsigned char *der = NULL; + int derlen = -1; int ret=-1; s = DSA_SIG_new(); if (s == NULL) return(ret); - if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL) goto err; + if (d2i_DSA_SIG(&s,&p,siglen) == NULL) goto err; + /* Ensure signature uses DER and doesn't have trailing garbage */ + derlen = i2d_DSA_SIG(s, &der); + if (derlen != siglen || memcmp(sigbuf, der, derlen)) + goto err; ret=DSA_do_verify(dgst,dgst_len,s,dsa); err: + if (derlen > 0) + { + OPENSSL_cleanse(der, derlen); + OPENSSL_free(der); + } DSA_SIG_free(s); return(ret); } diff --git a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c index 4a56aace0e367d..faa9d76b42701b 100644 --- a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c +++ b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c @@ -60,10 +60,8 @@ that handle _GNU_SOURCE and other similar macros. Defining it later is simply too late, because those headers are protected from re- inclusion. */ -#ifdef __linux -# ifndef _GNU_SOURCE -# define _GNU_SOURCE /* make sure dladdr is declared */ -# endif +#ifndef _GNU_SOURCE +# define _GNU_SOURCE /* make sure dladdr is declared */ #endif #include diff --git a/deps/openssl/openssl/crypto/ec/ec_lib.c b/deps/openssl/openssl/crypto/ec/ec_lib.c index e2c4741b5b77ca..0992c393b0f49e 100644 --- a/deps/openssl/openssl/crypto/ec/ec_lib.c +++ b/deps/openssl/openssl/crypto/ec/ec_lib.c @@ -68,7 +68,7 @@ #include "ec_lcl.h" -static const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT; +const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT; /* functions for EC_GROUP objects */ diff --git a/deps/openssl/openssl/crypto/ec/ec_mult.c b/deps/openssl/openssl/crypto/ec/ec_mult.c index 19f21675fbd804..e81200b255357e 100644 --- a/deps/openssl/openssl/crypto/ec/ec_mult.c +++ b/deps/openssl/openssl/crypto/ec/ec_mult.c @@ -445,15 +445,16 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, wNAF_len = OPENSSL_malloc(totalnum * sizeof wNAF_len[0]); wNAF = OPENSSL_malloc((totalnum + 1) * sizeof wNAF[0]); /* includes space for pivot */ val_sub = OPENSSL_malloc(totalnum * sizeof val_sub[0]); - + + /* Ensure wNAF is initialised in case we end up going to err */ + if (wNAF) wNAF[0] = NULL; /* preliminary pivot */ + if (!wsize || !wNAF_len || !wNAF || !val_sub) { ECerr(EC_F_EC_WNAF_MUL, ERR_R_MALLOC_FAILURE); goto err; } - wNAF[0] = NULL; /* preliminary pivot */ - /* num_val will be the total number of temporarily precomputed points */ num_val = 0; diff --git a/deps/openssl/openssl/crypto/ec/ec_pmeth.c b/deps/openssl/openssl/crypto/ec/ec_pmeth.c index 66ee397d86c413..b62b532cf86997 100644 --- a/deps/openssl/openssl/crypto/ec/ec_pmeth.c +++ b/deps/openssl/openssl/crypto/ec/ec_pmeth.c @@ -167,6 +167,7 @@ static int pkey_ec_verify(EVP_PKEY_CTX *ctx, return ret; } +#ifndef OPENSSL_NO_ECDH static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { int ret; @@ -200,6 +201,7 @@ static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) *keylen = ret; return 1; } +#endif static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { @@ -333,7 +335,11 @@ const EVP_PKEY_METHOD ec_pkey_meth = 0,0, 0, +#ifndef OPENSSL_NO_ECDH pkey_ec_derive, +#else + 0, +#endif pkey_ec_ctrl, pkey_ec_ctrl_str diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c index 4bc0f5dce02212..b884f73d31c02c 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c @@ -113,7 +113,6 @@ typedef u64 smallfelem[NLIMBS]; /* This is the value of the prime as four 64-bit words, little-endian. */ static const u64 kPrime[4] = { 0xfffffffffffffffful, 0xffffffff, 0, 0xffffffff00000001ul }; -static const limb bottom32bits = 0xffffffff; static const u64 bottom63bits = 0x7ffffffffffffffful; /* bin32_to_felem takes a little-endian byte array and converts it into felem diff --git a/deps/openssl/openssl/crypto/ec/ectest.c b/deps/openssl/openssl/crypto/ec/ectest.c index d1bf980599c8ac..8e4154d86549cf 100644 --- a/deps/openssl/openssl/crypto/ec/ectest.c +++ b/deps/openssl/openssl/crypto/ec/ectest.c @@ -1366,7 +1366,7 @@ static const struct nistp_test_params nistp_tests_params[] = }, }; -void nistp_single_test(const struct nistp_test_params *test) +static void nistp_single_test(const struct nistp_test_params *test) { BN_CTX *ctx; BIGNUM *p, *a, *b, *x, *y, *n, *m, *order; @@ -1469,7 +1469,7 @@ void nistp_single_test(const struct nistp_test_params *test) BN_CTX_free(ctx); } -void nistp_tests() +static void nistp_tests() { unsigned i; diff --git a/deps/openssl/openssl/crypto/ecdsa/Makefile b/deps/openssl/openssl/crypto/ecdsa/Makefile index e89e0c010c6b93..60c876df1abf69 100644 --- a/deps/openssl/openssl/crypto/ecdsa/Makefile +++ b/deps/openssl/openssl/crypto/ecdsa/Makefile @@ -126,15 +126,16 @@ ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h ecs_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h ecs_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h ecs_sign.o: ecs_locl.h ecs_sign.c -ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -ecs_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -ecs_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -ecs_vrf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/evp.h +ecs_vrf.o: ../../e_os.h ../../include/openssl/asn1.h +ecs_vrf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h +ecs_vrf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +ecs_vrf.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h +ecs_vrf.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h +ecs_vrf.o: ../../include/openssl/err.h ../../include/openssl/evp.h ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h ecs_vrf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h ecs_vrf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -ecs_vrf.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_vrf.c +ecs_vrf.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ecs_locl.h ecs_vrf.c diff --git a/deps/openssl/openssl/crypto/ecdsa/ecs_vrf.c b/deps/openssl/openssl/crypto/ecdsa/ecs_vrf.c index ef9acf7b610284..2836efe5eff228 100644 --- a/deps/openssl/openssl/crypto/ecdsa/ecs_vrf.c +++ b/deps/openssl/openssl/crypto/ecdsa/ecs_vrf.c @@ -57,6 +57,7 @@ */ #include "ecs_locl.h" +#include "cryptlib.h" #ifndef OPENSSL_NO_ENGINE #include #endif @@ -84,13 +85,25 @@ int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) { ECDSA_SIG *s; + const unsigned char *p = sigbuf; + unsigned char *der = NULL; + int derlen = -1; int ret=-1; s = ECDSA_SIG_new(); if (s == NULL) return(ret); - if (d2i_ECDSA_SIG(&s, &sigbuf, sig_len) == NULL) goto err; + if (d2i_ECDSA_SIG(&s, &p, sig_len) == NULL) goto err; + /* Ensure signature uses DER and doesn't have trailing garbage */ + derlen = i2d_ECDSA_SIG(s, &der); + if (derlen != sig_len || memcmp(sigbuf, der, derlen)) + goto err; ret=ECDSA_do_verify(dgst, dgst_len, s, eckey); err: + if (derlen > 0) + { + OPENSSL_cleanse(der, derlen); + OPENSSL_free(der); + } ECDSA_SIG_free(s); return(ret); } diff --git a/deps/openssl/openssl/crypto/engine/eng_dyn.c b/deps/openssl/openssl/crypto/engine/eng_dyn.c index 807da7a5eb841c..01db4556aaa0af 100644 --- a/deps/openssl/openssl/crypto/engine/eng_dyn.c +++ b/deps/openssl/openssl/crypto/engine/eng_dyn.c @@ -114,9 +114,6 @@ static const ENGINE_CMD_DEFN dynamic_cmd_defns[] = { ENGINE_CMD_FLAG_NO_INPUT}, {0, NULL, NULL, 0} }; -static const ENGINE_CMD_DEFN dynamic_cmd_defns_empty[] = { - {0, NULL, NULL, 0} - }; /* Loading code stores state inside the ENGINE structure via the "ex_data" * element. We load all our state into a single structure and use that as a diff --git a/deps/openssl/openssl/crypto/evp/Makefile b/deps/openssl/openssl/crypto/evp/Makefile index fa25bff6b5cab3..5d0c6b7db4c9a1 100644 --- a/deps/openssl/openssl/crypto/evp/Makefile +++ b/deps/openssl/openssl/crypto/evp/Makefile @@ -383,7 +383,7 @@ evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -evp_enc.o: ../constant_time_locl.h ../cryptlib.h evp_enc.c evp_locl.h +evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h diff --git a/deps/openssl/openssl/crypto/evp/e_des3.c b/deps/openssl/openssl/crypto/evp/e_des3.c index 8d7b7de292bcf4..7e1e8b309caa8f 100644 --- a/deps/openssl/openssl/crypto/evp/e_des3.c +++ b/deps/openssl/openssl/crypto/evp/e_des3.c @@ -124,12 +124,11 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, #ifdef KSSL_DEBUG { int i; - char *cp; - printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len); - printf("\t iv= "); + fprintf(stderr,"des_ede_cbc_cipher(ctx=%p, buflen=%d)\n", ctx, ctx->buf_len); + fprintf(stderr,"\t iv= "); for(i=0;i<8;i++) - printf("%02X",ctx->iv[i]); - printf("\n"); + fprintf(stderr,"%02X",ctx->iv[i]); + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ while (inl>=EVP_MAXCHUNK) @@ -260,11 +259,14 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, #ifdef KSSL_DEBUG { int i; - printf("des_ede3_init_key(ctx=%lx)\n", ctx); - printf("\tKEY= "); - for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n"); - printf("\t IV= "); - for(i=0;i<8;i++) printf("%02X",iv[i]); printf("\n"); + fprintf(stderr,"des_ede3_init_key(ctx=%p)\n", ctx); + fprintf(stderr,"\tKEY= "); + for(i=0;i<24;i++) fprintf(stderr,"%02X",key[i]); fprintf(stderr,"\n"); + if (iv) + { + fprintf(stderr,"\t IV= "); + for(i=0;i<8;i++) fprintf(stderr,"%02X",iv[i]); fprintf(stderr,"\n"); + } } #endif /* KSSL_DEBUG */ diff --git a/deps/openssl/openssl/crypto/evp/evp_enc.c b/deps/openssl/openssl/crypto/evp/evp_enc.c index 7b1842a52a6dac..2e863ac54204ec 100644 --- a/deps/openssl/openssl/crypto/evp/evp_enc.c +++ b/deps/openssl/openssl/crypto/evp/evp_enc.c @@ -67,7 +67,6 @@ #ifdef OPENSSL_FIPS #include #endif -#include "constant_time_locl.h" #include "evp_locl.h" #ifdef OPENSSL_FIPS @@ -501,21 +500,21 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { - unsigned int i, b; - unsigned char pad, padding_good; + int i,n; + unsigned int b; *outl=0; if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { - int ret = M_do_cipher(ctx, out, NULL, 0); - if (ret < 0) + i = M_do_cipher(ctx, out, NULL, 0); + if (i < 0) return 0; else - *outl = ret; + *outl = i; return 1; } - b=(unsigned int)(ctx->cipher->block_size); + b=ctx->cipher->block_size; if (ctx->flags & EVP_CIPH_NO_PADDING) { if(ctx->buf_len) @@ -534,34 +533,33 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) return(0); } OPENSSL_assert(b <= sizeof ctx->final); - pad=ctx->final[b-1]; - - padding_good = (unsigned char)(~constant_time_is_zero_8(pad)); - padding_good &= constant_time_ge_8(b, pad); - - for (i = 1; i < b; ++i) - { - unsigned char is_pad_index = constant_time_lt_8(i, pad); - unsigned char pad_byte_good = constant_time_eq_8(ctx->final[b-i-1], pad); - padding_good &= constant_time_select_8(is_pad_index, pad_byte_good, 0xff); - } /* - * At least 1 byte is always padding, so we always write b - 1 - * bytes to avoid a timing leak. The caller is required to have |b| - * bytes space in |out| by the API contract. + * The following assumes that the ciphertext has been authenticated. + * Otherwise it provides a padding oracle. */ - for (i = 0; i < b - 1; ++i) - out[i] = ctx->final[i] & padding_good; - /* Safe cast: for a good padding, EVP_MAX_IV_LENGTH >= b >= pad */ - *outl = padding_good & ((unsigned char)(b - pad)); - return padding_good & 1; + n=ctx->final[b-1]; + if (n == 0 || n > (int)b) + { + EVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_BAD_DECRYPT); + return(0); + } + for (i=0; ifinal[--b] != n) + { + EVPerr(EVP_F_EVP_DECRYPTFINAL_EX,EVP_R_BAD_DECRYPT); + return(0); + } + } + n=ctx->cipher->block_size-n; + for (i=0; ifinal[i]; + *outl=n; } else - { - *outl = 0; - return 1; - } + *outl=0; + return(1); } void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) diff --git a/deps/openssl/openssl/crypto/md32_common.h b/deps/openssl/openssl/crypto/md32_common.h index bb7381952a2263..a75f136ca54038 100644 --- a/deps/openssl/openssl/crypto/md32_common.h +++ b/deps/openssl/openssl/crypto/md32_common.h @@ -225,8 +225,7 @@ #define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24), \ l|=(((unsigned long)(*((c)++)))<<16), \ l|=(((unsigned long)(*((c)++)))<< 8), \ - l|=(((unsigned long)(*((c)++))) ), \ - l) + l|=(((unsigned long)(*((c)++))) ) ) #endif #ifndef HOST_l2c #define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff), \ @@ -262,8 +261,7 @@ #define HOST_c2l(c,l) (l =(((unsigned long)(*((c)++))) ), \ l|=(((unsigned long)(*((c)++)))<< 8), \ l|=(((unsigned long)(*((c)++)))<<16), \ - l|=(((unsigned long)(*((c)++)))<<24), \ - l) + l|=(((unsigned long)(*((c)++)))<<24) ) #endif #ifndef HOST_l2c #define HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \ diff --git a/deps/openssl/openssl/crypto/mem.c b/deps/openssl/openssl/crypto/mem.c index 1cc62eafd12213..01052cfa38e9a5 100644 --- a/deps/openssl/openssl/crypto/mem.c +++ b/deps/openssl/openssl/crypto/mem.c @@ -255,10 +255,12 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line) if (num <= 0) return NULL; - allow_customize = 0; + if(allow_customize) + allow_customize = 0; if (malloc_debug_func != NULL) { - allow_customize_debug = 0; + if(allow_customize_debug) + allow_customize_debug = 0; malloc_debug_func(NULL, num, file, line, 0); } ret = malloc_locked_ex_func(num,file,line); @@ -299,10 +301,12 @@ void *CRYPTO_malloc(int num, const char *file, int line) if (num <= 0) return NULL; - allow_customize = 0; + if(allow_customize) + allow_customize = 0; if (malloc_debug_func != NULL) { - allow_customize_debug = 0; + if(allow_customize_debug) + allow_customize_debug = 0; malloc_debug_func(NULL, num, file, line, 0); } ret = malloc_ex_func(num,file,line); diff --git a/deps/openssl/openssl/crypto/objects/obj_xref.h b/deps/openssl/openssl/crypto/objects/obj_xref.h index e23938c2960492..33cb24b0708b89 100644 --- a/deps/openssl/openssl/crypto/objects/obj_xref.h +++ b/deps/openssl/openssl/crypto/objects/obj_xref.h @@ -43,9 +43,6 @@ static const nid_triple sigoid_srt[] = static const nid_triple * const sigoid_srt_xref[] = { - &sigoid_srt[29], - &sigoid_srt[17], - &sigoid_srt[18], &sigoid_srt[0], &sigoid_srt[1], &sigoid_srt[7], diff --git a/deps/openssl/openssl/crypto/objects/objxref.pl b/deps/openssl/openssl/crypto/objects/objxref.pl index 731d3ae22c2745..6c4c832ab205a0 100644 --- a/deps/openssl/openssl/crypto/objects/objxref.pl +++ b/deps/openssl/openssl/crypto/objects/objxref.pl @@ -90,7 +90,10 @@ foreach (@srt2) { - my $x = $xref_tbl{$_}[2]; + my ($p1, $p2, $x) = @{$xref_tbl{$_}}; + # If digest or signature algorithm is "undef" then the algorithm + # needs special handling and is excluded from the cross reference table. + next if $p1 eq "undef" || $p2 eq "undef"; print "\t\&sigoid_srt\[$x\],\n"; } diff --git a/deps/openssl/openssl/crypto/opensslv.h b/deps/openssl/openssl/crypto/opensslv.h index f375967ef9132a..0aebfd44662650 100644 --- a/deps/openssl/openssl/crypto/opensslv.h +++ b/deps/openssl/openssl/crypto/opensslv.h @@ -29,11 +29,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -#define OPENSSL_VERSION_NUMBER 0x100010afL +#define OPENSSL_VERSION_NUMBER 0x100010bfL #ifdef OPENSSL_FIPS -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j-fips 15 Oct 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k-fips 8 Jan 2015" #else -#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1j 15 Oct 2014" +#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1k 8 Jan 2015" #endif #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl index f1a702f38f5307..197bc6b50e95f5 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-mips.pl @@ -64,7 +64,7 @@ # ###################################################################### -$big_endian=(`echo MIPSEL | $ENV{CC} -E -P -`=~/MIPSEL/)?1:0; +$big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC}); for (@ARGV) { $output=$_ if (/^\w[\w\-]*\.\w+$/); } open STDOUT,">$output"; diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl index ffa053bb7d367a..6807a2c7220b44 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha512-mips.pl @@ -68,7 +68,7 @@ # ###################################################################### -$big_endian=(`echo MIPSEL | $ENV{CC} -E -P -`=~/MIPSEL/)?1:0; +$big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC}); for (@ARGV) { $output=$_ if (/^\w[\w\-]*\.\w+$/); } open STDOUT,">$output"; diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c index b0f023c9d2f87c..2c0e94edda1616 100644 --- a/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c +++ b/deps/openssl/openssl/crypto/ts/ts_rsp_sign.c @@ -977,7 +977,7 @@ TS_RESP_set_genTime_with_precision(ASN1_GENERALIZEDTIME *asn1_time, if (precision > 0) { /* Add fraction of seconds (leave space for dot and null). */ - BIO_snprintf(p, 2 + precision, ".%ld", usec); + BIO_snprintf(p, 2 + precision, ".%06ld", usec); /* We cannot use the snprintf return value, because it might have been truncated. */ p += strlen(p); diff --git a/deps/openssl/openssl/crypto/x509/x509.h b/deps/openssl/openssl/crypto/x509/x509.h index 092dd7450d3b0a..ed767f84dd2364 100644 --- a/deps/openssl/openssl/crypto/x509/x509.h +++ b/deps/openssl/openssl/crypto/x509/x509.h @@ -768,6 +768,7 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, X509_ALGOR *algor); void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); X509_NAME *X509_NAME_dup(X509_NAME *xn); X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); diff --git a/deps/openssl/openssl/crypto/x509/x509_vpm.c b/deps/openssl/openssl/crypto/x509/x509_vpm.c index dfd89d89faf0e8..ba546bd1fabf04 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vpm.c +++ b/deps/openssl/openssl/crypto/x509/x509_vpm.c @@ -89,6 +89,8 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) { X509_VERIFY_PARAM *param; param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM)); + if (!param) + return NULL; memset(param, 0, sizeof(X509_VERIFY_PARAM)); x509_verify_param_zero(param); return param; diff --git a/deps/openssl/openssl/crypto/x509/x_all.c b/deps/openssl/openssl/crypto/x509/x_all.c index e06602d65abcc0..fef55f89d9a076 100644 --- a/deps/openssl/openssl/crypto/x509/x_all.c +++ b/deps/openssl/openssl/crypto/x509/x_all.c @@ -72,6 +72,8 @@ int X509_verify(X509 *a, EVP_PKEY *r) { + if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature)) + return 0; return(ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF),a->sig_alg, a->signature,a->cert_info,r)); } diff --git a/deps/openssl/openssl/doc/HOWTO/certificates.txt b/deps/openssl/openssl/doc/HOWTO/certificates.txt index a8a34c7abc5184..65f8fc8296cdf6 100644 --- a/deps/openssl/openssl/doc/HOWTO/certificates.txt +++ b/deps/openssl/openssl/doc/HOWTO/certificates.txt @@ -3,22 +3,22 @@ 1. Introduction -How you handle certificates depend a great deal on what your role is. +How you handle certificates depends a great deal on what your role is. Your role can be one or several of: - - User of some client software - - User of some server software + - User of some client application + - User of some server application - Certificate authority This file is for users who wish to get a certificate of their own. -Certificate authorities should read ca.txt. +Certificate authorities should read https://www.openssl.org/docs/apps/ca.html. In all the cases shown below, the standard configuration file, as compiled into openssl, will be used. You may find it in /etc/, -/usr/local/ssl/ or somewhere else. The name is openssl.cnf, and -is better described in another HOWTO . If you want to -use a different configuration file, use the argument '-config {file}' -with the command shown below. +/usr/local/ssl/ or somewhere else. By default the file is named +openssl.cnf and is described at https://www.openssl.org/docs/apps/config.html. +You can specify a different configuration file using the +'-config {file}' argument with the commands shown below. 2. Relationship with keys @@ -29,24 +29,26 @@ somewhere. With OpenSSL, public keys are easily derived from private keys, so before you create a certificate or a certificate request, you need to create a private key. -Private keys are generated with 'openssl genrsa' if you want a RSA -private key, or 'openssl gendsa' if you want a DSA private key. -Further information on how to create private keys can be found in -another HOWTO . The rest of this text assumes you have -a private key in the file privkey.pem. +Private keys are generated with 'openssl genrsa -out privkey.pem' if +you want a RSA private key, or if you want a DSA private key: +'openssl dsaparam -out dsaparam.pem 2048; openssl gendsa -out privkey.pem dsaparam.pem'. + +The private keys created by these commands are not passphrase protected; +it might or might not be the desirable thing. Further information on how to +create private keys can be found at https://www.openssl.org/docs/HOWTO/keys.txt. +The rest of this text assumes you have a private key in the file privkey.pem. 3. Creating a certificate request -To create a certificate, you need to start with a certificate -request (or, as some certificate authorities like to put -it, "certificate signing request", since that's exactly what they do, -they sign it and give you the result back, thus making it authentic -according to their policies). A certificate request can then be sent -to a certificate authority to get it signed into a certificate, or if -you have your own certificate authority, you may sign it yourself, or -if you need a self-signed certificate (because you just want a test -certificate or because you are setting up your own CA). +To create a certificate, you need to start with a certificate request +(or, as some certificate authorities like to put it, "certificate +signing request", since that's exactly what they do, they sign it and +give you the result back, thus making it authentic according to their +policies). A certificate request is sent to a certificate authority +to get it signed into a certificate. You can also sign the certificate +yourself if you have your own certificate authority or create a +self-signed certificate (typically for testing purpose). The certificate request is created like this: @@ -55,12 +57,14 @@ The certificate request is created like this: Now, cert.csr can be sent to the certificate authority, if they can handle files in PEM format. If not, use the extra argument '-outform' followed by the keyword for the format to use (see another HOWTO -). In some cases, that isn't sufficient and you will -have to be more creative. +). In some cases, -outform does not let you output the +certificate request in the right format and you will have to use one +of the various other commands that are exposed by openssl (or get +creative and use a combination of tools). -When the certificate authority has then done the checks the need to -do (and probably gotten payment from you), they will hand over your -new certificate to you. +The certificate authority performs various checks (according to their +policies) and usually waits for payment from you. Once that is +complete, they send you your new certificate. Section 5 will tell you more on how to handle the certificate you received. @@ -68,11 +72,12 @@ received. 4. Creating a self-signed test certificate -If you don't want to deal with another certificate authority, or just -want to create a test certificate for yourself. This is similar to -creating a certificate request, but creates a certificate instead of -a certificate request. This is NOT the recommended way to create a -CA certificate, see ca.txt. +You can create a self-signed certificate if you don't want to deal +with a certificate authority, or if you just want to create a test +certificate for yourself. This is similar to creating a certificate +request, but creates a certificate instead of a certificate request. +This is NOT the recommended way to create a CA certificate, see +https://www.openssl.org/docs/apps/ca.html. openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 @@ -93,13 +98,13 @@ certificate and your key to various formats, most often also putting them together into one file. The ways to do this is described in another HOWTO , I will just mention the simplest case. In the case of a raw DER thing in PEM format, and assuming that's all -right for yor applications, simply concatenating the certificate and +right for your applications, simply concatenating the certificate and the key into a new file and using that one should be enough. With some applications, you don't even have to do that. -By now, you have your cetificate and your private key and can start -using the software that depend on it. +By now, you have your certificate and your private key and can start +using applications that depend on it. -- Richard Levitte diff --git a/deps/openssl/openssl/doc/HOWTO/proxy_certificates.txt b/deps/openssl/openssl/doc/HOWTO/proxy_certificates.txt index f98ec36076786f..d78be2f142bfb4 100644 --- a/deps/openssl/openssl/doc/HOWTO/proxy_certificates.txt +++ b/deps/openssl/openssl/doc/HOWTO/proxy_certificates.txt @@ -1,74 +1,69 @@ - HOWTO proxy certificates 0. WARNING -NONE OF THE CODE PRESENTED HERE HAVE BEEN CHECKED! They are just an -example to show you how things can be done. There may be typos or -type conflicts, and you will have to resolve them. +NONE OF THE CODE PRESENTED HERE HAS BEEN CHECKED! The code is just examples to +show you how things could be done. There might be typos or type conflicts, and +you will have to resolve them. 1. Introduction -Proxy certificates are defined in RFC 3820. They are really usual -certificates with the mandatory extension proxyCertInfo. +Proxy certificates are defined in RFC 3820. They are really usual certificates +with the mandatory extension proxyCertInfo. -Proxy certificates are issued by an End Entity (typically a user), -either directly with the EE certificate as issuing certificate, or by -extension through an already issued proxy certificate.. They are used -to extend rights to some other entity (a computer process, typically, -or sometimes to the user itself), so it can perform operations in the -name of the owner of the EE certificate. +Proxy certificates are issued by an End Entity (typically a user), either +directly with the EE certificate as issuing certificate, or by extension through +an already issued proxy certificate. Proxy certificates are used to extend +rights to some other entity (a computer process, typically, or sometimes to the +user itself). This allows the entity to perform operations on behalf of the +owner of the EE certificate. See http://www.ietf.org/rfc/rfc3820.txt for more information. 2. A warning about proxy certificates -Noone seems to have tested proxy certificates with security in mind. -Basically, to this date, it seems that proxy certificates have only -been used in a world that's highly aware of them. What would happen -if an unsuspecting application is to validate a chain of certificates -that contains proxy certificates? It would usually consider the leaf -to be the certificate to check for authorisation data, and since proxy -certificates are controlled by the EE certificate owner alone, it's -would be normal to consider what the EE certificate owner could do -with them. +No one seems to have tested proxy certificates with security in mind. To this +date, it seems that proxy certificates have only been used in a context highly +aware of them. -subjectAltName and issuerAltName are forbidden in proxy certificates, -and this is enforced in OpenSSL. The subject must be the same as the -issuer, with one commonName added on. +Existing applications might misbehave when trying to validate a chain of +certificates which use a proxy certificate. They might incorrectly consider the +leaf to be the certificate to check for authorisation data, which is controlled +by the EE certificate owner. -Possible threats are, as far as has been imagined so far: +subjectAltName and issuerAltName are forbidden in proxy certificates, and this +is enforced in OpenSSL. The subject must be the same as the issuer, with one +commonName added on. + +Possible threats we can think of at this time include: - impersonation through commonName (think server certificates). - - use of additional extensions, possibly non-standard ones used in - certain environments, that would grant extra or different - authorisation rights. + - use of additional extensions, possibly non-standard ones used in certain + environments, that would grant extra or different authorisation rights. + +For these reasons, OpenSSL requires that the use of proxy certificates be +explicitly allowed. Currently, this can be done using the following methods: -For this reason, OpenSSL requires that the use of proxy certificates -be explicitely allowed. Currently, this can be done using the -following methods: + - if the application directly calls X509_verify_cert(), it can first call: - - if the application calls X509_verify_cert() itself, it can do the - following prior to that call (ctx is the pointer passed in the call - to X509_verify_cert()): + X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS); - X509_STORE_CTX_set_flags(ctx, X509_V_FLAG_ALLOW_PROXY_CERTS); + Where ctx is the pointer which then gets passed to X509_verify_cert(). - - in all other cases, proxy certificate validation can be enabled - before starting the application by setting the envirnoment variable - OPENSSL_ALLOW_PROXY_CERTS with some non-empty value. + - proxy certificate validation can be enabled before starting the application + by setting the environment variable OPENSSL_ALLOW_PROXY_CERTS. -There are thoughts to allow proxy certificates with a line in the -default openssl.cnf, but that's still in the future. +In the future, it might be possible to enable proxy certificates by editing +openssl.cnf. -3. How to create proxy cerificates +3. How to create proxy certificates -It's quite easy to create proxy certificates, by taking advantage of -the lack of checks of the 'openssl x509' application (*ahem*). But -first, you need to create a configuration section that contains a -definition of the proxyCertInfo extension, a little like this: +Creating proxy certificates is quite easy, by taking advantage of a lack of +checks in the 'openssl x509' application (*ahem*). You must first create a +configuration section that contains a definition of the proxyCertInfo extension, +for example: [ v3_proxy ] # A proxy certificate MUST NEVER be a CA certificate. @@ -77,10 +72,10 @@ definition of the proxyCertInfo extension, a little like this: # Usual authority key ID authorityKeyIdentifier=keyid,issuer:always - # Now, for the extension that marks this certificate as a proxy one + # The extension which marks this certificate as a proxy proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:1,policy:text:AB -It's also possible to give the proxy extension in a separate section: +It's also possible to specify the proxy extension in a separate section: proxyCertInfo=critical,@proxy_ext @@ -89,96 +84,85 @@ It's also possible to give the proxy extension in a separate section: pathlen=0 policy=text:BC -The policy value has a specific syntax, {syntag}:{string}, where the -syntag determines what will be done with the string. The recognised -syntags are as follows: - - text indicates that the string is simply the bytes, not - encoded in any kind of way: +The policy value has a specific syntax, {syntag}:{string}, where the syntag +determines what will be done with the string. The following syntags are +recognised: - policy=text:rksmrgs + text indicates that the string is simply bytes, without any encoding: - Previous versions of this design had a specific tag - for UTF-8 text. However, since the bytes are copied - as-is anyway, there's no need for it. Instead, use - the text: tag, like this: + policy=text:räksmörgås - policy=text:räksmörgås + Previous versions of this design had a specific tag for UTF-8 text. + However, since the bytes are copied as-is anyway, there is no need for + such a specific tag. - hex indicates the string is encoded in hex, with colons - between each byte (every second hex digit): + hex indicates the string is encoded in hex, with colons between each byte + (every second hex digit): - policy=hex:72:E4:6B:73:6D:F6:72:67:E5:73 + policy=hex:72:E4:6B:73:6D:F6:72:67:E5:73 - Previous versions of this design had a tag to insert a - complete DER blob. However, the only legal use for - this would be to surround the bytes that would go with - the hex: tag with what's needed to construct a correct - OCTET STRING. Since hex: does that, the DER tag felt - superfluous, and was therefore removed. + Previous versions of this design had a tag to insert a complete DER + blob. However, the only legal use for this would be to surround the + bytes that would go with the hex: tag with whatever is needed to + construct a correct OCTET STRING. The DER tag therefore felt + superfluous, and was removed. - file indicates that the text of the policy should really be - taken from a file. The string is then really a file - name. This is useful for policies that are large - (more than a few of lines) XML documents, for example. + file indicates that the text of the policy should really be taken from a + file. The string is then really a file name. This is useful for + policies that are large (more than a few lines, e.g. XML documents). The 'policy' setting can be split up in multiple lines like this: 0.policy=This is - 1.polisy= a multi- + 1.policy= a multi- 2.policy=line policy. -NOTE: the proxy policy value is the part that determines the rights -granted to the process using the proxy certificate. The value is -completely dependent on the application reading and interpretting it! +NOTE: the proxy policy value is the part which determines the rights granted to +the process using the proxy certificate. The value is completely dependent on +the application reading and interpreting it! -Now that you have created an extension section for your proxy -certificate, you can now easily create a proxy certificate like this: +Now that you have created an extension section for your proxy certificate, you +can easily create a proxy certificate by doing: - openssl req -new -config openssl.cnf \ - -out proxy.req -keyout proxy.key - openssl x509 -req -CAcreateserial -in proxy.req -days 7 \ - -out proxy.crt -CA user.crt -CAkey user.key \ - -extfile openssl.cnf -extensions v3_proxy + openssl req -new -config openssl.cnf -out proxy.req -keyout proxy.key + openssl x509 -req -CAcreateserial -in proxy.req -days 7 -out proxy.crt \ + -CA user.crt -CAkey user.key -extfile openssl.cnf -extensions v3_proxy -It's just as easy to create a proxy certificate using another proxy -certificate as issuer (note that I'm using a different configuration -section for it): +You can also create a proxy certificate using another proxy certificate as +issuer (note: I'm using a different configuration section for it): - openssl req -new -config openssl.cnf \ - -out proxy2.req -keyout proxy2.key - openssl x509 -req -CAcreateserial -in proxy2.req -days 7 \ - -out proxy2.crt -CA proxy.crt -CAkey proxy.key \ - -extfile openssl.cnf -extensions v3_proxy2 + openssl req -new -config openssl.cnf -out proxy2.req -keyout proxy2.key + openssl x509 -req -CAcreateserial -in proxy2.req -days 7 -out proxy2.crt \ + -CA proxy.crt -CAkey proxy.key -extfile openssl.cnf -extensions v3_proxy2 4. How to have your application interpret the policy? -The basic way to interpret proxy policies is to prepare some default -rights, then do a check of the proxy certificate against the a chain -of proxy certificates, user certificate and CA certificates, and see -what rights came out by the end. Sounds easy, huh? It almost is. +The basic way to interpret proxy policies is to start with some default rights, +then compute the resulting rights by checking the proxy certificate against +the chain of proxy certificates, user certificate and CA certificates. You then +use the final computed rights. Sounds easy, huh? It almost is. -The slightly complicated part is how to pass data between your +The slightly complicated part is figuring out how to pass data between your application and the certificate validation procedure. You need the following ingredients: - - a callback routing that will be called for every certificate that's - validated. It will be called several times for each certificates, - so you must be attentive to when it's a good time to do the proxy - policy interpretation and check, as well as to fill in the defaults - when the EE certificate is checked. + - a callback function that will be called for every certificate being + validated. The callback be called several times for each certificate, + so you must be careful to do the proxy policy interpretation at the right + time. You also need to fill in the defaults when the EE certificate is + checked. - - a structure of data that's shared between your application code and - the callback. + - a data structure that is shared between your application code and the + callback. - a wrapper function that sets it all up. - - an ex_data index function that creates an index into the generic - ex_data store that's attached to an X509 validation context. + - an ex_data index function that creates an index into the generic ex_data + store that is attached to an X509 validation context. -This is some cookbook code for you to fill in: +Here is some skeleton code you can fill in: /* In this example, I will use a view of granted rights as a bit array, one bit for each possible right. */ @@ -210,7 +194,7 @@ This is some cookbook code for you to fill in: static int verify_callback(int ok, X509_STORE_CTX *ctx) { if (ok == 1) /* It's REALLY important you keep the proxy policy - check within this secion. It's important to know + check within this section. It's important to know that when ok is 1, the certificates are checked from top to bottom. You get the CA root first, followed by the possible chain of intermediate @@ -221,7 +205,7 @@ This is some cookbook code for you to fill in: if (xs->ex_flags & EXFLAG_PROXY) { - YOUR_RIGHTS *rights = + YOUR_RIGHTS *rights = (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx, get_proxy_auth_ex_data_idx()); PROXY_CERT_INFO_EXTENSION *pci = @@ -250,12 +234,12 @@ This is some cookbook code for you to fill in: bit array and fill it with the rights granted by the current proxy certificate, then use it as a mask on the accumulated rights bit array, and - voil, you now have a new accumulated rights bit + voilà, you now have a new accumulated rights bit array. */ { int i; YOUR_RIGHTS tmp_rights; - memset(tmp_rights.rights, 0, sizeof(tmp_rights.rights)); + memset(tmp_rights.rights, 0, sizeof(tmp_rights.rights)); /* process_rights() is supposed to be a procedure that takes a string and it's length, interprets @@ -276,7 +260,7 @@ This is some cookbook code for you to fill in: { /* We have a EE certificate, let's use it to set default! */ - YOUR_RIGHTS *rights = + YOUR_RIGHTS *rights = (YOUR_RIGHTS *)X509_STORE_CTX_get_ex_data(ctx, get_proxy_auth_ex_data_idx()); diff --git a/deps/openssl/openssl/doc/apps/dgst.pod b/deps/openssl/openssl/doc/apps/dgst.pod index 2414c533777847..9e15798d8279d1 100644 --- a/deps/openssl/openssl/doc/apps/dgst.pod +++ b/deps/openssl/openssl/doc/apps/dgst.pod @@ -13,6 +13,8 @@ B B [B<-hex>] [B<-binary>] [B<-r>] +[B<-hmac arg>] +[B<-non-fips-allow>] [B<-out filename>] [B<-sign filename>] [B<-keyform arg>] @@ -62,6 +64,15 @@ output the digest or signature in binary form. output the digest in the "coreutils" format used by programs like B. +=item B<-hmac arg> + +set the HMAC key to "arg". + +=item B<-non-fips-allow> + +Allow use of non FIPS digest when in FIPS mode. This has no effect when not in +FIPS mode. + =item B<-out filename> filename to output to, or standard output by default. diff --git a/deps/openssl/openssl/doc/apps/ocsp.pod b/deps/openssl/openssl/doc/apps/ocsp.pod index af2e12e418bf43..38f026afc1b679 100644 --- a/deps/openssl/openssl/doc/apps/ocsp.pod +++ b/deps/openssl/openssl/doc/apps/ocsp.pod @@ -133,6 +133,10 @@ if the B option is present then the OCSP request is sent to the host B on port B. B specifies the HTTP path name to use or "/" by default. +=item B<-timeout seconds> + +connection timeout to the OCSP responder in seconds + =item B<-CAfile file>, B<-CApath pathname> file or pathname containing trusted CA certificates. These are used to verify diff --git a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod index 4e22edcd679bfb..ed027b387aea3c 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod @@ -115,7 +115,7 @@ writes the encrypted version to B. This function can be called multiple times to encrypt successive blocks of data. The amount of data written depends on the block alignment of the encrypted data: as a result the amount of data written may be anything from zero bytes -to (inl + cipher_block_size - 1) so B should contain sufficient +to (inl + cipher_block_size - 1) so B should contain sufficient room. The actual number of bytes written is placed in B. If padding is enabled (the default) then EVP_EncryptFinal_ex() encrypts diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_encrypt.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_encrypt.pod index e495a81242b989..6799ce1010bd6e 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_encrypt.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_encrypt.pod @@ -43,19 +43,23 @@ indicates the operation is not supported by the public key algorithm. =head1 EXAMPLE -Encrypt data using OAEP (for RSA keys): +Encrypt data using OAEP (for RSA keys). See also L or +L for means to load a public key. You may also simply +set 'eng = NULL;' to start with the default OpenSSL RSA implementation: #include #include + #include EVP_PKEY_CTX *ctx; + ENGINE *eng; unsigned char *out, *in; size_t outlen, inlen; EVP_PKEY *key; - /* NB: assumes key in, inlen are already set up + /* NB: assumes eng, key, in, inlen are already set up, * and that key is an RSA public key */ - ctx = EVP_PKEY_CTX_new(key); + ctx = EVP_PKEY_CTX_new(key,eng); if (!ctx) /* Error occurred */ if (EVP_PKEY_encrypt_init(ctx) <= 0) @@ -79,6 +83,8 @@ Encrypt data using OAEP (for RSA keys): =head1 SEE ALSO +L, +L, L, L, L, diff --git a/deps/openssl/openssl/doc/crypto/X509_NAME_add_entry_by_txt.pod b/deps/openssl/openssl/doc/crypto/X509_NAME_add_entry_by_txt.pod index 1afd008cb372bb..043766cc461bee 100644 --- a/deps/openssl/openssl/doc/crypto/X509_NAME_add_entry_by_txt.pod +++ b/deps/openssl/openssl/doc/crypto/X509_NAME_add_entry_by_txt.pod @@ -81,14 +81,14 @@ Create an B structure: nm = X509_NAME_new(); if (nm == NULL) /* Some error */ - if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, - "C", "UK", -1, -1, 0)) + if (!X509_NAME_add_entry_by_txt(nm, "C", MBSTRING_ASC, + "UK", -1, -1, 0)) /* Error */ - if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, - "O", "Disorganized Organization", -1, -1, 0)) + if (!X509_NAME_add_entry_by_txt(nm, "O", MBSTRING_ASC, + "Disorganized Organization", -1, -1, 0)) /* Error */ - if (!X509_NAME_add_entry_by_txt(nm, MBSTRING_ASC, - "CN", "Joe Bloggs", -1, -1, 0)) + if (!X509_NAME_add_entry_by_txt(nm, "CN", MBSTRING_ASC, + "Joe Bloggs", -1, -1, 0)) /* Error */ =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod b/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod index 3b1f9ff43b65a0..c8a81287956149 100644 --- a/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod +++ b/deps/openssl/openssl/doc/crypto/X509_NAME_get_index_by_NID.pod @@ -59,6 +59,10 @@ X509_NAME_get_index_by_OBJ() should be used followed by X509_NAME_get_entry() on any matching indices and then the various B utility functions on the result. +The list of all relevant B and B can be found in +the source code header files Eopenssl/obj_mac.hE and/or +Eopenssl/objects.hE. + =head1 EXAMPLES Process all entries: diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_mode.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_mode.pod index 8cb669daeb78c1..2a5aaa555e13ab 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_mode.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_mode.pod @@ -71,6 +71,16 @@ SSL_CTX->freelist_max_len, which defaults to 32. Using this flag can save around 34k per idle SSL connection. This flag has no effect on SSL v2 connections, or on DTLS connections. +=item SSL_MODE_SEND_FALLBACK_SCSV + +Send TLS_FALLBACK_SCSV in the ClientHello. +To be set only by applications that reconnect with a downgraded protocol +version; see draft-ietf-tls-downgrade-scsv-00 for details. + +DO NOT ENABLE THIS if your application attempts a normal handshake. +Only use this in explicit fallback retries, following the guidance +in draft-ietf-tls-downgrade-scsv-00. + =back =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod index 6e6b5e6d808218..e80a72cd4d06b1 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod @@ -158,15 +158,7 @@ temporary/ephemeral DH parameters are used. =item SSL_OP_EPHEMERAL_RSA -Always use ephemeral (temporary) RSA key when doing RSA operations -(see L). -According to the specifications this is only done, when a RSA key -can only be used for signature operations (namely under export ciphers -with restricted RSA keylength). By setting this option, ephemeral -RSA keys are always used. This option breaks compatibility with the -SSL/TLS specifications and may lead to interoperability problems with -clients and should therefore never be used. Ciphers with EDH (ephemeral -Diffie-Hellman) key exchange should be used instead. +This option is no longer implemented and is treated as no op. =item SSL_OP_CIPHER_SERVER_PREFERENCE diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_rsa_callback.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_rsa_callback.pod index 534643cd9de4a2..8794eb7ac360bc 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_rsa_callback.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_rsa_callback.pod @@ -74,21 +74,14 @@ exchange and use EDH (Ephemeral Diffie-Hellman) key exchange instead in order to achieve forward secrecy (see L). -On OpenSSL servers ephemeral RSA key exchange is therefore disabled by default -and must be explicitly enabled using the SSL_OP_EPHEMERAL_RSA option of -L, violating the TLS/SSL -standard. When ephemeral RSA key exchange is required for export ciphers, -it will automatically be used without this option! - -An application may either directly specify the key or can supply the key via -a callback function. The callback approach has the advantage, that the -callback may generate the key only in case it is actually needed. As the -generation of a RSA key is however costly, it will lead to a significant -delay in the handshake procedure. Another advantage of the callback function -is that it can supply keys of different size (e.g. for SSL_OP_EPHEMERAL_RSA -usage) while the explicit setting of the key is only useful for key size of -512 bits to satisfy the export restricted ciphers and does give away key length -if a longer key would be allowed. +An application may either directly specify the key or can supply the key via a +callback function. The callback approach has the advantage, that the callback +may generate the key only in case it is actually needed. As the generation of a +RSA key is however costly, it will lead to a significant delay in the handshake +procedure. Another advantage of the callback function is that it can supply +keys of different size while the explicit setting of the key is only useful for +key size of 512 bits to satisfy the export restricted ciphers and does give +away key length if a longer key would be allowed. The B is called with the B needed and the B information. The B flag is set, when the diff --git a/deps/openssl/openssl/e_os.h b/deps/openssl/openssl/e_os.h index 733155e48df816..832272e9866e90 100644 --- a/deps/openssl/openssl/e_os.h +++ b/deps/openssl/openssl/e_os.h @@ -290,7 +290,7 @@ extern "C" { # ifdef _WIN64 # define strlen(s) _strlen31(s) /* cut strings to 2GB */ -static unsigned int _strlen31(const char *str) +static __inline unsigned int _strlen31(const char *str) { unsigned int len=0; while (*str && len<0x80000000U) str++, len++; @@ -375,15 +375,6 @@ static unsigned int _strlen31(const char *str) # define check_winnt() (GetVersion() < 0x80000000) #endif -/* - * Visual Studio: inline is available in C++ only, however - * __inline is available for C, see - * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx - */ -#if defined(_MSC_VER) && !defined(__cplusplus) && !defined(inline) -# define inline __inline -#endif - #else /* The non-microsoft world */ # ifdef OPENSSL_SYS_VMS @@ -741,6 +732,22 @@ struct servent *getservbyname(const char *name, const char *proto); #include #endif +#if !defined(inline) && !defined(__cplusplus) +# if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L + /* do nothing, inline works */ +# elif defined(__GNUC__) && __GNUC__>=2 +# define inline __inline__ +# elif defined(_MSC_VER) + /* + * Visual Studio: inline is available in C++ only, however + * __inline is available for C, see + * http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx + */ +# define inline __inline +# else +# define inline +# endif +#endif #ifdef __cplusplus } diff --git a/deps/openssl/openssl/engines/e_padlock.c b/deps/openssl/openssl/engines/e_padlock.c index 9f7a85a8da57a0..5d252f62a9ca8f 100644 --- a/deps/openssl/openssl/engines/e_padlock.c +++ b/deps/openssl/openssl/engines/e_padlock.c @@ -384,6 +384,7 @@ padlock_available(void) } #ifndef OPENSSL_NO_AES +#ifndef AES_ASM /* Our own htonl()/ntohl() */ static inline void padlock_bswapl(AES_KEY *ks) @@ -397,6 +398,7 @@ padlock_bswapl(AES_KEY *ks) } } #endif +#endif /* Force key reload from memory to the CPU microcode. Loading EFLAGS from the stack clears EFLAGS[30] diff --git a/deps/openssl/openssl/makevms.com b/deps/openssl/openssl/makevms.com index 11db2f16e4ef1e..e4f5a86b61580a 100755 --- a/deps/openssl/openssl/makevms.com +++ b/deps/openssl/openssl/makevms.com @@ -646,9 +646,10 @@ $ if (CFLAGS .nes. "") then CFLAGS = CFLAGS+ " " $ CFLAGS = CFLAGS+ "/DEFINE=ZLIB" $ endif $! -$ WRITE H_FILE "#define CFLAGS ""''CFLAGS'""" -$ WRITE H_FILE "#define PLATFORM ""VMS ''ARCHD' ''VMS_VERSION'""" -$ WRITE H_FILE "#define DATE ""''TIME'"" " +$ WRITE H_FILE "#define CFLAGS" +$ WRITE H_FILE "static const char cflags[] = ""compiler: ''CFLAGS'"";" +$ WRITE H_FILE "#define PLATFORM ""platform: VMS ''ARCHD' ''VMS_VERSION'""" +$ WRITE H_FILE "#define DATE ""built on: ''TIME'"" " $! $! Close The [.CRYPTO._xxx]BUILDINF.H File. $! diff --git a/deps/openssl/openssl/openssl.spec b/deps/openssl/openssl/openssl.spec index 706fb5d239901f..707dd2c5782068 100644 --- a/deps/openssl/openssl/openssl.spec +++ b/deps/openssl/openssl/openssl.spec @@ -7,7 +7,7 @@ Release: 1 Summary: Secure Sockets Layer and cryptography libraries and tools Name: openssl #Version: %{libmaj}.%{libmin}.%{librel} -Version: 1.0.1j +Version: 1.0.1k Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz License: OpenSSL Group: System Environment/Libraries diff --git a/deps/openssl/openssl/ssl/d1_both.c b/deps/openssl/openssl/ssl/d1_both.c index 2e4250fcfecfd4..1b9d64bf60272a 100644 --- a/deps/openssl/openssl/ssl/d1_both.c +++ b/deps/openssl/openssl/ssl/d1_both.c @@ -156,9 +156,8 @@ static unsigned char bitmask_start_values[] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe static unsigned char bitmask_end_values[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; /* XDTLS: figure out the right values */ -static unsigned int g_probable_mtu[] = {1500 - 28, 512 - 28, 256 - 28}; +static const unsigned int g_probable_mtu[] = {1500, 512, 256}; -static unsigned int dtls1_guess_mtu(unsigned int curr_mtu); static void dtls1_fix_message_header(SSL *s, unsigned long frag_off, unsigned long frag_len); static unsigned char *dtls1_write_message_header(SSL *s, @@ -211,8 +210,7 @@ dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) return frag; } -static void -dtls1_hm_fragment_free(hm_fragment *frag) +void dtls1_hm_fragment_free(hm_fragment *frag) { if (frag->msg_header.is_ccs) @@ -225,53 +223,50 @@ dtls1_hm_fragment_free(hm_fragment *frag) OPENSSL_free(frag); } -/* send s->init_buf in records of type 'type' (SSL3_RT_HANDSHAKE or SSL3_RT_CHANGE_CIPHER_SPEC) */ -int dtls1_do_write(SSL *s, int type) - { - int ret; - int curr_mtu; - unsigned int len, frag_off, mac_size, blocksize; +static int dtls1_query_mtu(SSL *s) +{ + if(s->d1->link_mtu) + { + s->d1->mtu = s->d1->link_mtu-BIO_dgram_get_mtu_overhead(SSL_get_wbio(s)); + s->d1->link_mtu = 0; + } /* AHA! Figure out the MTU, and stick to the right size */ - if (s->d1->mtu < dtls1_min_mtu() && !(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) + if (s->d1->mtu < dtls1_min_mtu(s)) { - s->d1->mtu = - BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); - - /* I've seen the kernel return bogus numbers when it doesn't know - * (initial write), so just make sure we have a reasonable number */ - if (s->d1->mtu < dtls1_min_mtu()) + if(!(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) { - s->d1->mtu = 0; - s->d1->mtu = dtls1_guess_mtu(s->d1->mtu); - BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SET_MTU, - s->d1->mtu, NULL); + s->d1->mtu = + BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); + + /* I've seen the kernel return bogus numbers when it doesn't know + * (initial write), so just make sure we have a reasonable number */ + if (s->d1->mtu < dtls1_min_mtu(s)) + { + /* Set to min mtu */ + s->d1->mtu = dtls1_min_mtu(s); + BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SET_MTU, + s->d1->mtu, NULL); + } } + else + return 0; } -#if 0 - mtu = s->d1->mtu; - - fprintf(stderr, "using MTU = %d\n", mtu); - - mtu -= (DTLS1_HM_HEADER_LENGTH + DTLS1_RT_HEADER_LENGTH); - - curr_mtu = mtu - BIO_wpending(SSL_get_wbio(s)); + return 1; +} - if ( curr_mtu > 0) - mtu = curr_mtu; - else if ( ( ret = BIO_flush(SSL_get_wbio(s))) <= 0) - return ret; +/* send s->init_buf in records of type 'type' (SSL3_RT_HANDSHAKE or SSL3_RT_CHANGE_CIPHER_SPEC) */ +int dtls1_do_write(SSL *s, int type) + { + int ret; + unsigned int curr_mtu; + int retry = 1; + unsigned int len, frag_off, mac_size, blocksize, used_len; - if ( BIO_wpending(SSL_get_wbio(s)) + s->init_num >= mtu) - { - ret = BIO_flush(SSL_get_wbio(s)); - if ( ret <= 0) - return ret; - mtu = s->d1->mtu - (DTLS1_HM_HEADER_LENGTH + DTLS1_RT_HEADER_LENGTH); - } -#endif + if(!dtls1_query_mtu(s)) + return -1; - OPENSSL_assert(s->d1->mtu >= dtls1_min_mtu()); /* should have something reasonable now */ + OPENSSL_assert(s->d1->mtu >= dtls1_min_mtu(s)); /* should have something reasonable now */ if ( s->init_off == 0 && type == SSL3_RT_HANDSHAKE) OPENSSL_assert(s->init_num == @@ -289,10 +284,15 @@ int dtls1_do_write(SSL *s, int type) blocksize = 0; frag_off = 0; - while( s->init_num) + /* s->init_num shouldn't ever be < 0...but just in case */ + while(s->init_num > 0) { - curr_mtu = s->d1->mtu - BIO_wpending(SSL_get_wbio(s)) - - DTLS1_RT_HEADER_LENGTH - mac_size - blocksize; + used_len = BIO_wpending(SSL_get_wbio(s)) + DTLS1_RT_HEADER_LENGTH + + mac_size + blocksize; + if(s->d1->mtu > used_len) + curr_mtu = s->d1->mtu - used_len; + else + curr_mtu = 0; if ( curr_mtu <= DTLS1_HM_HEADER_LENGTH) { @@ -300,15 +300,27 @@ int dtls1_do_write(SSL *s, int type) ret = BIO_flush(SSL_get_wbio(s)); if ( ret <= 0) return ret; - curr_mtu = s->d1->mtu - DTLS1_RT_HEADER_LENGTH - - mac_size - blocksize; + used_len = DTLS1_RT_HEADER_LENGTH + mac_size + blocksize; + if(s->d1->mtu > used_len + DTLS1_HM_HEADER_LENGTH) + { + curr_mtu = s->d1->mtu - used_len; + } + else + { + /* Shouldn't happen */ + return -1; + } } - if ( s->init_num > curr_mtu) + /* We just checked that s->init_num > 0 so this cast should be safe */ + if (((unsigned int)s->init_num) > curr_mtu) len = curr_mtu; else len = s->init_num; + /* Shouldn't ever happen */ + if(len > INT_MAX) + len = INT_MAX; /* XDTLS: this function is too long. split out the CCS part */ if ( type == SSL3_RT_HANDSHAKE) @@ -319,18 +331,29 @@ int dtls1_do_write(SSL *s, int type) s->init_off -= DTLS1_HM_HEADER_LENGTH; s->init_num += DTLS1_HM_HEADER_LENGTH; - if ( s->init_num > curr_mtu) + /* We just checked that s->init_num > 0 so this cast should be safe */ + if (((unsigned int)s->init_num) > curr_mtu) len = curr_mtu; else len = s->init_num; } + /* Shouldn't ever happen */ + if(len > INT_MAX) + len = INT_MAX; + + if ( len < DTLS1_HM_HEADER_LENGTH ) + { + /* + * len is so small that we really can't do anything sensible + * so fail + */ + return -1; + } dtls1_fix_message_header(s, frag_off, len - DTLS1_HM_HEADER_LENGTH); dtls1_write_message_header(s, (unsigned char *)&s->init_buf->data[s->init_off]); - - OPENSSL_assert(len >= DTLS1_HM_HEADER_LENGTH); } ret=dtls1_write_bytes(s,type,&s->init_buf->data[s->init_off], @@ -343,12 +366,23 @@ int dtls1_do_write(SSL *s, int type) * is fine and wait for an alert to handle the * retransmit */ - if ( BIO_ctrl(SSL_get_wbio(s), + if ( retry && BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_MTU_EXCEEDED, 0, NULL) > 0 ) - s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), - BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); + { + if(!(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) + { + if(!dtls1_query_mtu(s)) + return -1; + /* Have one more go */ + retry = 0; + } + else + return -1; + } else + { return(-1); + } } else { @@ -1412,28 +1446,20 @@ dtls1_write_message_header(SSL *s, unsigned char *p) return p; } -unsigned int -dtls1_min_mtu(void) +unsigned int +dtls1_link_min_mtu(void) { return (g_probable_mtu[(sizeof(g_probable_mtu) / sizeof(g_probable_mtu[0])) - 1]); } -static unsigned int -dtls1_guess_mtu(unsigned int curr_mtu) +unsigned int +dtls1_min_mtu(SSL *s) { - unsigned int i; - - if ( curr_mtu == 0 ) - return g_probable_mtu[0] ; - - for ( i = 0; i < sizeof(g_probable_mtu)/sizeof(g_probable_mtu[0]); i++) - if ( curr_mtu > g_probable_mtu[i]) - return g_probable_mtu[i]; - - return curr_mtu; + return dtls1_link_min_mtu()-BIO_dgram_get_mtu_overhead(SSL_get_wbio(s)); } + void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr) { diff --git a/deps/openssl/openssl/ssl/d1_clnt.c b/deps/openssl/openssl/ssl/d1_clnt.c index fd6562c114dc05..9045fb9902f518 100644 --- a/deps/openssl/openssl/ssl/d1_clnt.c +++ b/deps/openssl/openssl/ssl/d1_clnt.c @@ -249,6 +249,9 @@ int dtls1_connect(SSL *s) memset(s->s3->client_random,0,sizeof(s->s3->client_random)); s->d1->send_cookie = 0; s->hit = 0; + s->d1->change_cipher_spec_ok = 0; + /* Should have been reset by ssl3_get_finished, too. */ + s->s3->change_cipher_spec = 0; break; #ifndef OPENSSL_NO_SCTP @@ -370,20 +373,6 @@ int dtls1_connect(SSL *s) case SSL3_ST_CR_CERT_A: case SSL3_ST_CR_CERT_B: -#ifndef OPENSSL_NO_TLSEXT - ret=ssl3_check_finished(s); - if (ret <= 0) goto end; - if (ret == 2) - { - s->hit = 1; - if (s->tlsext_ticket_expected) - s->state=SSL3_ST_CR_SESSION_TICKET_A; - else - s->state=SSL3_ST_CR_FINISHED_A; - s->init_num=0; - break; - } -#endif /* Check if it is anon DH or PSK */ if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) @@ -506,7 +495,6 @@ int dtls1_connect(SSL *s) else #endif s->state=SSL3_ST_CW_CHANGE_A; - s->s3->change_cipher_spec=0; } s->init_num=0; @@ -527,7 +515,6 @@ int dtls1_connect(SSL *s) #endif s->state=SSL3_ST_CW_CHANGE_A; s->init_num=0; - s->s3->change_cipher_spec=0; break; case SSL3_ST_CW_CHANGE_A: @@ -1730,6 +1717,12 @@ int dtls1_send_client_certificate(SSL *s) s->state=SSL3_ST_CW_CERT_D; l=dtls1_output_cert_chain(s, (s->s3->tmp.cert_req == 2)?NULL:s->cert->key->x509); + if (!l) + { + SSLerr(SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR); + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR); + return 0; + } s->init_num=(int)l; s->init_off=0; diff --git a/deps/openssl/openssl/ssl/d1_enc.c b/deps/openssl/openssl/ssl/d1_enc.c index 712c4647f24cb0..3da2b4c8c2a79c 100644 --- a/deps/openssl/openssl/ssl/d1_enc.c +++ b/deps/openssl/openssl/ssl/d1_enc.c @@ -241,7 +241,8 @@ int dtls1_enc(SSL *s, int send) return 0; } - EVP_Cipher(ds,rec->data,rec->input,l); + if(EVP_Cipher(ds,rec->data,rec->input,l) < 1) + return -1; #ifdef KSSL_DEBUG { diff --git a/deps/openssl/openssl/ssl/d1_lib.c b/deps/openssl/openssl/ssl/d1_lib.c index 82ca653920630e..14337b31a4e907 100644 --- a/deps/openssl/openssl/ssl/d1_lib.c +++ b/deps/openssl/openssl/ssl/d1_lib.c @@ -113,6 +113,9 @@ int dtls1_new(SSL *s) d1->cookie_len = sizeof(s->d1->cookie); } + d1->link_mtu = 0; + d1->mtu = 0; + if( ! d1->unprocessed_rcds.q || ! d1->processed_rcds.q || ! d1->buffered_messages || ! d1->sent_messages || ! d1->buffered_app_data.q) { @@ -161,16 +164,14 @@ static void dtls1_clear_queues(SSL *s) while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL) { frag = (hm_fragment *)item->data; - OPENSSL_free(frag->fragment); - OPENSSL_free(frag); + dtls1_hm_fragment_free(frag); pitem_free(item); } while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL) { frag = (hm_fragment *)item->data; - OPENSSL_free(frag->fragment); - OPENSSL_free(frag); + dtls1_hm_fragment_free(frag); pitem_free(item); } @@ -210,6 +211,7 @@ void dtls1_clear(SSL *s) pqueue sent_messages; pqueue buffered_app_data; unsigned int mtu; + unsigned int link_mtu; if (s->d1) { @@ -219,6 +221,7 @@ void dtls1_clear(SSL *s) sent_messages = s->d1->sent_messages; buffered_app_data = s->d1->buffered_app_data.q; mtu = s->d1->mtu; + link_mtu = s->d1->link_mtu; dtls1_clear_queues(s); @@ -232,6 +235,7 @@ void dtls1_clear(SSL *s) if (SSL_get_options(s) & SSL_OP_NO_QUERY_MTU) { s->d1->mtu = mtu; + s->d1->link_mtu = link_mtu; } s->d1->unprocessed_rcds.q = unprocessed_rcds; @@ -276,7 +280,22 @@ long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg) /* Just one protocol version is supported so far; * fail closed if the version is not as expected. */ return s->version == DTLS_MAX_VERSION; - + case DTLS_CTRL_SET_LINK_MTU: + if (larg < (long)dtls1_link_min_mtu()) + return 0; + s->d1->link_mtu = larg; + return 1; + case DTLS_CTRL_GET_LINK_MIN_MTU: + return (long)dtls1_link_min_mtu(); + case SSL_CTRL_SET_MTU: + /* + * We may not have a BIO set yet so can't call dtls1_min_mtu() + * We'll have to make do with dtls1_link_min_mtu() and max overhead + */ + if (larg < (long)dtls1_link_min_mtu() - DTLS1_MAX_MTU_OVERHEAD) + return 0; + s->d1->mtu = larg; + return larg; default: ret = ssl3_ctrl(s, cmd, larg, parg); break; @@ -415,12 +434,17 @@ void dtls1_stop_timer(SSL *s) int dtls1_check_timeout_num(SSL *s) { + unsigned int mtu; + s->d1->timeout.num_alerts++; /* Reduce MTU after 2 unsuccessful retransmissions */ - if (s->d1->timeout.num_alerts > 2) + if (s->d1->timeout.num_alerts > 2 + && !(SSL_get_options(s) & SSL_OP_NO_QUERY_MTU)) { - s->d1->mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + mtu = BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + if(mtu < s->d1->mtu) + s->d1->mtu = mtu; } if (s->d1->timeout.num_alerts > DTLS1_TMO_ALERT_COUNT) diff --git a/deps/openssl/openssl/ssl/d1_pkt.c b/deps/openssl/openssl/ssl/d1_pkt.c index 438c0913d24e72..0059fe2f152dda 100644 --- a/deps/openssl/openssl/ssl/d1_pkt.c +++ b/deps/openssl/openssl/ssl/d1_pkt.c @@ -212,7 +212,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) /* Limit the size of the queue to prevent DOS attacks */ if (pqueue_size(queue->q) >= 100) return 0; - + rdata = OPENSSL_malloc(sizeof(DTLS1_RECORD_DATA)); item = pitem_new(priority, rdata); if (rdata == NULL || item == NULL) @@ -247,18 +247,22 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority) if (!ssl3_setup_buffers(s)) { SSLerr(SSL_F_DTLS1_BUFFER_RECORD, ERR_R_INTERNAL_ERROR); + if (rdata->rbuf.buf != NULL) + OPENSSL_free(rdata->rbuf.buf); OPENSSL_free(rdata); pitem_free(item); - return(0); + return(-1); } /* insert should not fail, since duplicates are dropped */ if (pqueue_insert(queue->q, item) == NULL) { SSLerr(SSL_F_DTLS1_BUFFER_RECORD, ERR_R_INTERNAL_ERROR); + if (rdata->rbuf.buf != NULL) + OPENSSL_free(rdata->rbuf.buf); OPENSSL_free(rdata); pitem_free(item); - return(0); + return(-1); } return(1); @@ -314,8 +318,9 @@ dtls1_process_buffered_records(SSL *s) dtls1_get_unprocessed_record(s); if ( ! dtls1_process_record(s)) return(0); - dtls1_buffer_record(s, &(s->d1->processed_rcds), - s->s3->rrec.seq_num); + if(dtls1_buffer_record(s, &(s->d1->processed_rcds), + s->s3->rrec.seq_num)<0) + return -1; } } @@ -530,7 +535,6 @@ printf("\n"); /* we have pulled in a full packet so zero things */ s->packet_length=0; - dtls1_record_bitmap_update(s, &(s->d1->bitmap));/* Mark receipt of record. */ return(1); f_err: @@ -563,7 +567,8 @@ int dtls1_get_record(SSL *s) /* The epoch may have changed. If so, process all the * pending records. This is a non-blocking operation. */ - dtls1_process_buffered_records(s); + if(dtls1_process_buffered_records(s)<0) + return -1; /* if we're renegotiating, then there may be buffered records */ if (dtls1_get_processed_record(s)) @@ -642,8 +647,6 @@ int dtls1_get_record(SSL *s) /* now s->packet_length == DTLS1_RT_HEADER_LENGTH */ i=rr->length; n=ssl3_read_n(s,i,i,1); - if (n <= 0) return(n); /* error or non-blocking io */ - /* this packet contained a partial record, dump it */ if ( n != i) { @@ -678,7 +681,8 @@ int dtls1_get_record(SSL *s) * would be dropped unnecessarily. */ if (!(s->d1->listen && rr->type == SSL3_RT_HANDSHAKE && - *p == SSL3_MT_CLIENT_HELLO) && + s->packet_length > DTLS1_RT_HEADER_LENGTH && + s->packet[DTLS1_RT_HEADER_LENGTH] == SSL3_MT_CLIENT_HELLO) && !dtls1_record_replay_check(s, bitmap)) { rr->length = 0; @@ -701,7 +705,9 @@ int dtls1_get_record(SSL *s) { if ((SSL_in_init(s) || s->in_handshake) && !s->d1->listen) { - dtls1_buffer_record(s, &(s->d1->unprocessed_rcds), rr->seq_num); + if(dtls1_buffer_record(s, &(s->d1->unprocessed_rcds), rr->seq_num)<0) + return -1; + dtls1_record_bitmap_update(s, bitmap);/* Mark receipt of record. */ } rr->length = 0; s->packet_length = 0; @@ -714,6 +720,7 @@ int dtls1_get_record(SSL *s) s->packet_length = 0; /* dump this record */ goto again; /* get another record */ } + dtls1_record_bitmap_update(s, bitmap);/* Mark receipt of record. */ return(1); @@ -865,7 +872,11 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) * buffer the application data for later processing rather * than dropping the connection. */ - dtls1_buffer_record(s, &(s->d1->buffered_app_data), rr->seq_num); + if(dtls1_buffer_record(s, &(s->d1->buffered_app_data), rr->seq_num)<0) + { + SSLerr(SSL_F_DTLS1_READ_BYTES, ERR_R_INTERNAL_ERROR); + return -1; + } rr->length = 0; goto start; } @@ -1619,7 +1630,7 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len, wr->length += bs; } - s->method->ssl3_enc->enc(s,1); + if(s->method->ssl3_enc->enc(s,1) < 1) goto err; /* record length after mac and block padding */ /* if (type == SSL3_RT_APPLICATION_DATA || diff --git a/deps/openssl/openssl/ssl/d1_srvr.c b/deps/openssl/openssl/ssl/d1_srvr.c index 4b8ba3e452f36c..da4c21e06a1c72 100644 --- a/deps/openssl/openssl/ssl/d1_srvr.c +++ b/deps/openssl/openssl/ssl/d1_srvr.c @@ -233,6 +233,7 @@ int dtls1_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; } @@ -246,6 +247,9 @@ int dtls1_accept(SSL *s) } s->init_num=0; + s->d1->change_cipher_spec_ok = 0; + /* Should have been reset by ssl3_get_finished, too. */ + s->s3->change_cipher_spec = 0; if (s->state != SSL_ST_RENEGOTIATE) { @@ -450,24 +454,15 @@ int dtls1_accept(SSL *s) case SSL3_ST_SW_KEY_EXCH_B: alg_k = s->s3->tmp.new_cipher->algorithm_mkey; - /* clear this, it may get reset by - * send_server_key_exchange */ - if ((s->options & SSL_OP_EPHEMERAL_RSA) -#ifndef OPENSSL_NO_KRB5 - && !(alg_k & SSL_kKRB5) -#endif /* OPENSSL_NO_KRB5 */ - ) - /* option SSL_OP_EPHEMERAL_RSA sends temporary RSA key - * even when forbidden by protocol specs - * (handshake may fail as clients are not required to - * be able to handle this) */ - s->s3->tmp.use_rsa_tmp=1; - else - s->s3->tmp.use_rsa_tmp=0; + /* + * clear this, it may get reset by + * send_server_key_exchange + */ + s->s3->tmp.use_rsa_tmp=0; /* only send if a DH key exchange or * RSA but we have a sign only certificate */ - if (s->s3->tmp.use_rsa_tmp + if (0 /* PSK: send ServerKeyExchange if PSK identity * hint if provided */ #ifndef OPENSSL_NO_PSK @@ -658,8 +653,14 @@ int dtls1_accept(SSL *s) case SSL3_ST_SR_CERT_VRFY_A: case SSL3_ST_SR_CERT_VRFY_B: - - s->d1->change_cipher_spec_ok = 1; + /* + * This *should* be the first time we enable CCS, but be + * extra careful about surrounding code changes. We need + * to set this here because we don't know if we're + * expecting a CertificateVerify or not. + */ + if (!s->s3->change_cipher_spec) + s->d1->change_cipher_spec_ok = 1; /* we should decide if we expected this one */ ret=ssl3_get_cert_verify(s); if (ret <= 0) goto end; @@ -675,7 +676,18 @@ int dtls1_accept(SSL *s) case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: - s->d1->change_cipher_spec_ok = 1; + /* + * Enable CCS for resumed handshakes. + * In a full handshake, we end up here through + * SSL3_ST_SR_CERT_VRFY_B, so change_cipher_spec_ok was + * already set. Receiving a CCS clears the flag, so make + * sure not to re-enable it to ban duplicates. + * s->s3->change_cipher_spec is set when a CCS is + * processed in d1_pkt.c, and remains set until + * the client's Finished message is read. + */ + if (!s->s3->change_cipher_spec) + s->d1->change_cipher_spec_ok = 1; ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) goto end; @@ -1604,6 +1616,11 @@ int dtls1_send_server_certificate(SSL *s) } l=dtls1_output_cert_chain(s,x); + if (!l) + { + SSLerr(SSL_F_DTLS1_SEND_SERVER_CERTIFICATE,ERR_R_INTERNAL_ERROR); + return(0); + } s->state=SSL3_ST_SW_CERT_B; s->init_num=(int)l; s->init_off=0; diff --git a/deps/openssl/openssl/ssl/dtls1.h b/deps/openssl/openssl/ssl/dtls1.h index 192c5deff98a0f..338575268f9eee 100644 --- a/deps/openssl/openssl/ssl/dtls1.h +++ b/deps/openssl/openssl/ssl/dtls1.h @@ -117,6 +117,9 @@ extern "C" { #define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP" #endif +/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */ +#define DTLS1_MAX_MTU_OVERHEAD 48 + typedef struct dtls1_bitmap_st { unsigned long map; /* track 32 packets on 32-bit systems @@ -231,6 +234,7 @@ typedef struct dtls1_state_st /* Is set when listening for new connections with dtls1_listen() */ unsigned int listen; + unsigned int link_mtu; /* max on-the-wire DTLS packet size */ unsigned int mtu; /* max DTLS packet size */ struct hm_header_st w_msg_hdr; @@ -252,6 +256,10 @@ typedef struct dtls1_state_st unsigned int handshake_fragment_len; unsigned int retransmitting; + /* + * Set when the handshake is ready to process peer's ChangeCipherSpec message. + * Cleared after the message has been processed. + */ unsigned int change_cipher_spec_ok; #ifndef OPENSSL_NO_SCTP diff --git a/deps/openssl/openssl/ssl/kssl.c b/deps/openssl/openssl/ssl/kssl.c index fd7c67bb1fcb64..950a0c56f1a9c9 100644 --- a/deps/openssl/openssl/ssl/kssl.c +++ b/deps/openssl/openssl/ssl/kssl.c @@ -954,15 +954,15 @@ print_krb5_data(char *label, krb5_data *kdata) { int i; - printf("%s[%d] ", label, kdata->length); + fprintf(stderr,"%s[%d] ", label, kdata->length); for (i=0; i < (int)kdata->length; i++) { if (0 && isprint((int) kdata->data[i])) - printf( "%c ", kdata->data[i]); + fprintf(stderr, "%c ", kdata->data[i]); else - printf( "%02x ", (unsigned char) kdata->data[i]); + fprintf(stderr, "%02x ", (unsigned char) kdata->data[i]); } - printf("\n"); + fprintf(stderr,"\n"); } @@ -973,20 +973,20 @@ print_krb5_authdata(char *label, krb5_authdata **adata) { if (adata == NULL) { - printf("%s, authdata==0\n", label); + fprintf(stderr,"%s, authdata==0\n", label); return; } - printf("%s [%p]\n", label, (void *)adata); + fprintf(stderr,"%s [%p]\n", label, (void *)adata); #if 0 { int i; - printf("%s[at%d:%d] ", label, adata->ad_type, adata->length); + fprintf(stderr,"%s[at%d:%d] ", label, adata->ad_type, adata->length); for (i=0; i < adata->length; i++) { - printf((isprint(adata->contents[i]))? "%c ": "%02x", + fprintf(stderr,(isprint(adata->contents[i]))? "%c ": "%02x", adata->contents[i]); } - printf("\n"); + fprintf(stderr,"\n"); } #endif } @@ -1001,24 +1001,24 @@ print_krb5_keyblock(char *label, krb5_keyblock *keyblk) if (keyblk == NULL) { - printf("%s, keyblk==0\n", label); + fprintf(stderr,"%s, keyblk==0\n", label); return; } #ifdef KRB5_HEIMDAL - printf("%s\n\t[et%d:%d]: ", label, keyblk->keytype, + fprintf(stderr,"%s\n\t[et%d:%d]: ", label, keyblk->keytype, keyblk->keyvalue->length); for (i=0; i < (int)keyblk->keyvalue->length; i++) { - printf("%02x",(unsigned char *)(keyblk->keyvalue->contents)[i]); + fprintf(stderr,"%02x",(unsigned char *)(keyblk->keyvalue->contents)[i]); } - printf("\n"); + fprintf(stderr,"\n"); #else - printf("%s\n\t[et%d:%d]: ", label, keyblk->enctype, keyblk->length); + fprintf(stderr,"%s\n\t[et%d:%d]: ", label, keyblk->enctype, keyblk->length); for (i=0; i < (int)keyblk->length; i++) { - printf("%02x",keyblk->contents[i]); + fprintf(stderr,"%02x",keyblk->contents[i]); } - printf("\n"); + fprintf(stderr,"\n"); #endif } @@ -1031,17 +1031,17 @@ print_krb5_princ(char *label, krb5_principal_data *princ) { int i, ui, uj; - printf("%s principal Realm: ", label); + fprintf(stderr,"%s principal Realm: ", label); if (princ == NULL) return; for (ui=0; ui < (int)princ->realm.length; ui++) putchar(princ->realm.data[ui]); - printf(" (nametype %d) has %d strings:\n", princ->type,princ->length); + fprintf(stderr," (nametype %d) has %d strings:\n", princ->type,princ->length); for (i=0; i < (int)princ->length; i++) { - printf("\t%d [%d]: ", i, princ->data[i].length); + fprintf(stderr,"\t%d [%d]: ", i, princ->data[i].length); for (uj=0; uj < (int)princ->data[i].length; uj++) { putchar(princ->data[i].data[uj]); } - printf("\n"); + fprintf(stderr,"\n"); } return; } @@ -1332,7 +1332,7 @@ kssl_sget_tkt( /* UPDATE */ KSSL_CTX *kssl_ctx, } #ifdef KSSL_DEBUG - printf("in kssl_sget_tkt(%s)\n", kstring(kssl_ctx->service_name)); + fprintf(stderr,"in kssl_sget_tkt(%s)\n", kstring(kssl_ctx->service_name)); #endif /* KSSL_DEBUG */ if (!krb5context && (krb5rc = krb5_init_context(&krb5context))) @@ -1481,18 +1481,18 @@ kssl_sget_tkt( /* UPDATE */ KSSL_CTX *kssl_ctx, #ifdef KSSL_DEBUG { int i; krb5_address **paddr = krb5ticket->enc_part2->caddrs; - printf("Decrypted ticket fields:\n"); - printf("\tflags: %X, transit-type: %X", + fprintf(stderr,"Decrypted ticket fields:\n"); + fprintf(stderr,"\tflags: %X, transit-type: %X", krb5ticket->enc_part2->flags, krb5ticket->enc_part2->transited.tr_type); print_krb5_data("\ttransit-data: ", &(krb5ticket->enc_part2->transited.tr_contents)); - printf("\tcaddrs: %p, authdata: %p\n", + fprintf(stderr,"\tcaddrs: %p, authdata: %p\n", krb5ticket->enc_part2->caddrs, krb5ticket->enc_part2->authorization_data); if (paddr) { - printf("\tcaddrs:\n"); + fprintf(stderr,"\tcaddrs:\n"); for (i=0; paddr[i] != NULL; i++) { krb5_data d; @@ -1501,7 +1501,7 @@ kssl_sget_tkt( /* UPDATE */ KSSL_CTX *kssl_ctx, print_krb5_data("\t\tIP: ", &d); } } - printf("\tstart/auth/end times: %d / %d / %d\n", + fprintf(stderr,"\tstart/auth/end times: %d / %d / %d\n", krb5ticket->enc_part2->times.starttime, krb5ticket->enc_part2->times.authtime, krb5ticket->enc_part2->times.endtime); @@ -1976,7 +1976,7 @@ krb5_error_code kssl_validate_times( krb5_timestamp atime, if ((now - ttimes->endtime) > skew) return SSL_R_KRB5_S_TKT_EXPIRED; #ifdef KSSL_DEBUG - printf("kssl_validate_times: %d |<- | %d - %d | < %d ->| %d\n", + fprintf(stderr,"kssl_validate_times: %d |<- | %d - %d | < %d ->| %d\n", start, atime, now, skew, ttimes->endtime); #endif /* KSSL_DEBUG */ @@ -2027,10 +2027,10 @@ krb5_error_code kssl_check_authent( #ifdef KSSL_DEBUG { unsigned int ui; - printf("kssl_check_authent: authenticator[%d]:\n",authentp->length); + fprintf(stderr,"kssl_check_authent: authenticator[%d]:\n",authentp->length); p = authentp->data; - for (ui=0; ui < authentp->length; ui++) printf("%02x ",p[ui]); - printf("\n"); + for (ui=0; ui < authentp->length; ui++) fprintf(stderr,"%02x ",p[ui]); + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -2095,9 +2095,9 @@ krb5_error_code kssl_check_authent( #ifdef KSSL_DEBUG { int padl; - printf("kssl_check_authent: decrypted authenticator[%d] =\n", outl); - for (padl=0; padl < outl; padl++) printf("%02x ",unenc_authent[padl]); - printf("\n"); + fprintf(stderr,"kssl_check_authent: decrypted authenticator[%d] =\n", outl); + for (padl=0; padl < outl; padl++) fprintf(stderr,"%02x ",unenc_authent[padl]); + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -2132,10 +2132,10 @@ krb5_error_code kssl_check_authent( } #ifdef KSSL_DEBUG - printf("kssl_check_authent: returns %d for client time ", *atimep); + fprintf(stderr,"kssl_check_authent: returns %d for client time ", *atimep); if (auth && auth->ctime && auth->ctime->length && auth->ctime->data) - printf("%.*s\n", auth->ctime->length, auth->ctime->data); - else printf("NULL\n"); + fprintf(stderr,"%.*s\n", auth->ctime->length, auth->ctime->data); + else fprintf(stderr,"NULL\n"); #endif /* KSSL_DEBUG */ err: diff --git a/deps/openssl/openssl/ssl/s23_srvr.c b/deps/openssl/openssl/ssl/s23_srvr.c index 93ca7d53cda473..3178815ec99b7f 100644 --- a/deps/openssl/openssl/ssl/s23_srvr.c +++ b/deps/openssl/openssl/ssl/s23_srvr.c @@ -192,6 +192,7 @@ int ssl23_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; } @@ -602,12 +603,14 @@ int ssl23_get_client_hello(SSL *s) if ((type == 2) || (type == 3)) { /* we have SSLv3/TLSv1 (type 2: SSL2 style, type 3: SSL3/TLS style) */ - s->method = ssl23_get_server_method(s->version); - if (s->method == NULL) + const SSL_METHOD *new_method; + new_method = ssl23_get_server_method(s->version); + if (new_method == NULL) { SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); goto err; } + s->method = new_method; if (!ssl_init_wbio_buffer(s,1)) goto err; diff --git a/deps/openssl/openssl/ssl/s2_enc.c b/deps/openssl/openssl/ssl/s2_enc.c index ff3395f459e7ad..a35968f63a7f7d 100644 --- a/deps/openssl/openssl/ssl/s2_enc.c +++ b/deps/openssl/openssl/ssl/s2_enc.c @@ -117,8 +117,9 @@ int ssl2_enc_init(SSL *s, int client) /* read/writes from s->s2->mac_data using length for encrypt and * decrypt. It sets s->s2->padding and s->[rw]length - * if we are encrypting */ -void ssl2_enc(SSL *s, int send) + * if we are encrypting + * Returns 0 on error and 1 on success */ +int ssl2_enc(SSL *s, int send) { EVP_CIPHER_CTX *ds; unsigned long l; @@ -136,7 +137,7 @@ void ssl2_enc(SSL *s, int send) } /* check for NULL cipher */ - if (ds == NULL) return; + if (ds == NULL) return 1; bs=ds->cipher->block_size; @@ -145,7 +146,10 @@ void ssl2_enc(SSL *s, int send) if (bs == 8) l=(l+7)/8*8; - EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l); + if(EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l) < 1) + return 0; + + return 1; } void ssl2_mac(SSL *s, unsigned char *md, int send) diff --git a/deps/openssl/openssl/ssl/s2_pkt.c b/deps/openssl/openssl/ssl/s2_pkt.c index 8bb6ab8baa3350..acd61dc546afb3 100644 --- a/deps/openssl/openssl/ssl/s2_pkt.c +++ b/deps/openssl/openssl/ssl/s2_pkt.c @@ -265,7 +265,11 @@ static int ssl2_read_internal(SSL *s, void *buf, int len, int peek) if ((!s->s2->clear_text) && (s->s2->rlength >= (unsigned int)mac_size)) { - ssl2_enc(s,0); + if(!ssl2_enc(s,0)) + { + SSLerr(SSL_F_SSL2_READ_INTERNAL,SSL_R_DECRYPTION_FAILED); + return(-1); + } s->s2->ract_data_length-=mac_size; ssl2_mac(s,mac,0); s->s2->ract_data_length-=s->s2->padding; @@ -616,7 +620,8 @@ static int n_do_ssl_write(SSL *s, const unsigned char *buf, unsigned int len) s->s2->wact_data_length=len+p; ssl2_mac(s,s->s2->mac_data,1); s->s2->wlength+=p+mac_size; - ssl2_enc(s,1); + if(ssl2_enc(s,1) < 1) + return -1; } /* package up the header */ diff --git a/deps/openssl/openssl/ssl/s2_srvr.c b/deps/openssl/openssl/ssl/s2_srvr.c index 2cba426bb7efde..59ced3f3052f36 100644 --- a/deps/openssl/openssl/ssl/s2_srvr.c +++ b/deps/openssl/openssl/ssl/s2_srvr.c @@ -188,13 +188,21 @@ int ssl2_accept(SSL *s) s->version=SSL2_VERSION; s->type=SSL_ST_ACCEPT; - buf=s->init_buf; - if ((buf == NULL) && ((buf=BUF_MEM_new()) == NULL)) - { ret= -1; goto end; } - if (!BUF_MEM_grow(buf,(int) - SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER)) - { ret= -1; goto end; } - s->init_buf=buf; + if(s->init_buf == NULL) + { + if ((buf=BUF_MEM_new()) == NULL) + { + ret= -1; + goto end; + } + if (!BUF_MEM_grow(buf,(int) SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER)) + { + BUF_MEM_free(buf); + ret= -1; + goto end; + } + s->init_buf=buf; + } s->init_num=0; s->ctx->stats.sess_accept++; s->handshake_func=ssl2_accept; diff --git a/deps/openssl/openssl/ssl/s3_both.c b/deps/openssl/openssl/ssl/s3_both.c index 53b9390fdd3af3..3581fbf4ff426a 100644 --- a/deps/openssl/openssl/ssl/s3_both.c +++ b/deps/openssl/openssl/ssl/s3_both.c @@ -439,6 +439,7 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) goto f_err; } *ok=1; + s->state = stn; s->init_msg = s->init_buf->data + 4; s->init_num = (int)s->s3->tmp.message_size; return s->init_num; diff --git a/deps/openssl/openssl/ssl/s3_clnt.c b/deps/openssl/openssl/ssl/s3_clnt.c index 263e6348c97815..7692716988ac7f 100644 --- a/deps/openssl/openssl/ssl/s3_clnt.c +++ b/deps/openssl/openssl/ssl/s3_clnt.c @@ -167,9 +167,9 @@ #include #endif -static const SSL_METHOD *ssl3_get_client_method(int ver); static int ca_dn_cmp(const X509_NAME * const *a,const X509_NAME * const *b); +#ifndef OPENSSL_NO_SSL3_METHOD static const SSL_METHOD *ssl3_get_client_method(int ver) { if (ver == SSL3_VERSION) @@ -182,6 +182,7 @@ IMPLEMENT_ssl3_meth_func(SSLv3_client_method, ssl_undefined_function, ssl3_connect, ssl3_get_client_method) +#endif int ssl3_connect(SSL *s) { @@ -272,6 +273,9 @@ int ssl3_connect(SSL *s) s->state=SSL3_ST_CW_CLNT_HELLO_A; s->ctx->stats.sess_connect++; s->init_num=0; + s->s3->flags &= ~SSL3_FLAGS_CCS_OK; + /* Should have been reset by ssl3_get_finished, too. */ + s->s3->change_cipher_spec = 0; break; case SSL3_ST_CW_CLNT_HELLO_A: @@ -312,20 +316,6 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_CERT_A: case SSL3_ST_CR_CERT_B: -#ifndef OPENSSL_NO_TLSEXT - ret=ssl3_check_finished(s); - if (ret <= 0) goto end; - if (ret == 2) - { - s->hit = 1; - if (s->tlsext_ticket_expected) - s->state=SSL3_ST_CR_SESSION_TICKET_A; - else - s->state=SSL3_ST_CR_FINISHED_A; - s->init_num=0; - break; - } -#endif /* Check if it is anon DH/ECDH, SRP auth */ /* or PSK */ if (!(s->s3->tmp.new_cipher->algorithm_auth & (SSL_aNULL|SSL_aSRP)) && @@ -433,12 +423,10 @@ int ssl3_connect(SSL *s) else { s->state=SSL3_ST_CW_CHANGE_A; - s->s3->change_cipher_spec=0; } if (s->s3->flags & TLS1_FLAGS_SKIP_CERT_VERIFY) { s->state=SSL3_ST_CW_CHANGE_A; - s->s3->change_cipher_spec=0; } s->init_num=0; @@ -450,7 +438,6 @@ int ssl3_connect(SSL *s) if (ret <= 0) goto end; s->state=SSL3_ST_CW_CHANGE_A; s->init_num=0; - s->s3->change_cipher_spec=0; break; case SSL3_ST_CW_CHANGE_A: @@ -510,7 +497,6 @@ int ssl3_connect(SSL *s) s->method->ssl3_enc->client_finished_label, s->method->ssl3_enc->client_finished_label_len); if (ret <= 0) goto end; - s->s3->flags |= SSL3_FLAGS_CCS_OK; s->state=SSL3_ST_CW_FLUSH; /* clear flags */ @@ -559,7 +545,6 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: - s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); @@ -669,11 +654,7 @@ int ssl3_client_hello(SSL *s) SSL_SESSION *sess = s->session; if ((sess == NULL) || (sess->ssl_version != s->version) || -#ifdef OPENSSL_NO_TLSEXT !sess->session_id_length || -#else - (!sess->session_id_length && !sess->tlsext_tick) || -#endif (sess->not_resumable)) { if (!ssl_get_new_session(s,0)) @@ -879,6 +860,8 @@ int ssl3_get_server_hello(SSL *s) memcpy(s->s3->server_random,p,SSL3_RANDOM_SIZE); p+=SSL3_RANDOM_SIZE; + s->hit = 0; + /* get the session-id */ j= *(p++); @@ -902,12 +885,12 @@ int ssl3_get_server_hello(SSL *s) { s->session->cipher = pref_cipher ? pref_cipher : ssl_get_cipher_by_char(s, p+j); - s->s3->flags |= SSL3_FLAGS_CCS_OK; + s->hit = 1; } } #endif /* OPENSSL_NO_TLSEXT */ - if (j != 0 && j == s->session->session_id_length + if (!s->hit && j != 0 && j == s->session->session_id_length && memcmp(p,s->session->session_id,j) == 0) { if(s->sid_ctx_length != s->session->sid_ctx_length @@ -918,14 +901,13 @@ int ssl3_get_server_hello(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); goto f_err; } - s->s3->flags |= SSL3_FLAGS_CCS_OK; s->hit=1; } - else /* a miss or crap from the other end */ + /* a miss or crap from the other end */ + if (!s->hit) { /* If we were trying for session-id reuse, make a new * SSL_SESSION so we don't stuff up other people */ - s->hit=0; if (s->session->session_id_length > 0) { if (!ssl_get_new_session(s,0)) @@ -1203,9 +1185,9 @@ int ssl3_get_server_certificate(SSL *s) ? 0 : 1; #ifdef KSSL_DEBUG - printf("pkey,x = %p, %p\n", pkey,x); - printf("ssl_cert_type(x,pkey) = %d\n", ssl_cert_type(x,pkey)); - printf("cipher, alg, nc = %s, %lx, %lx, %d\n", s->s3->tmp.new_cipher->name, + fprintf(stderr,"pkey,x = %p, %p\n", pkey,x); + fprintf(stderr,"ssl_cert_type(x,pkey) = %d\n", ssl_cert_type(x,pkey)); + fprintf(stderr,"cipher, alg, nc = %s, %lx, %lx, %d\n", s->s3->tmp.new_cipher->name, s->s3->tmp.new_cipher->algorithm_mkey, s->s3->tmp.new_cipher->algorithm_auth, need_cert); #endif /* KSSL_DEBUG */ @@ -1295,6 +1277,8 @@ int ssl3_get_key_exchange(SSL *s) int encoded_pt_len = 0; #endif + EVP_MD_CTX_init(&md_ctx); + /* use same message size as in ssl3_get_certificate_request() * as ServerKeyExchange message may be skipped */ n=s->method->ssl_get_message(s, @@ -1305,14 +1289,26 @@ int ssl3_get_key_exchange(SSL *s) &ok); if (!ok) return((int)n); + alg_k=s->s3->tmp.new_cipher->algorithm_mkey; + if (s->s3->tmp.message_type != SSL3_MT_SERVER_KEY_EXCHANGE) { + /* + * Can't skip server key exchange if this is an ephemeral + * ciphersuite. + */ + if (alg_k & (SSL_kEDH|SSL_kEECDH)) + { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_UNEXPECTED_MESSAGE); + al = SSL_AD_UNEXPECTED_MESSAGE; + goto f_err; + } #ifndef OPENSSL_NO_PSK /* In plain PSK ciphersuite, ServerKeyExchange can be omitted if no identity hint is sent. Set session->sess_cert anyway to avoid problems later.*/ - if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) + if (alg_k & SSL_kPSK) { s->session->sess_cert=ssl_sess_cert_new(); if (s->ctx->psk_identity_hint) @@ -1357,9 +1353,7 @@ int ssl3_get_key_exchange(SSL *s) /* Total length of the parameters including the length prefix */ param_len=0; - alg_k=s->s3->tmp.new_cipher->algorithm_mkey; alg_a=s->s3->tmp.new_cipher->algorithm_auth; - EVP_MD_CTX_init(&md_ctx); al=SSL_AD_DECODE_ERROR; @@ -1543,6 +1537,13 @@ int ssl3_get_key_exchange(SSL *s) #ifndef OPENSSL_NO_RSA if (alg_k & SSL_kRSA) { + /* Temporary RSA keys only allowed in export ciphersuites */ + if (!SSL_C_IS_EXPORT(s->s3->tmp.new_cipher)) + { + al=SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE); + goto f_err; + } if ((rsa=RSA_new()) == NULL) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_MALLOC_FAILURE); @@ -2174,24 +2175,13 @@ int ssl3_get_new_session_ticket(SSL *s) n=s->method->ssl_get_message(s, SSL3_ST_CR_SESSION_TICKET_A, SSL3_ST_CR_SESSION_TICKET_B, - -1, + SSL3_MT_NEWSESSION_TICKET, 16384, &ok); if (!ok) return((int)n); - if (s->s3->tmp.message_type == SSL3_MT_FINISHED) - { - s->s3->tmp.reuse_message=1; - return(1); - } - if (s->s3->tmp.message_type != SSL3_MT_NEWSESSION_TICKET) - { - al=SSL_AD_UNEXPECTED_MESSAGE; - SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET,SSL_R_BAD_MESSAGE_TYPE); - goto f_err; - } if (n < 6) { /* need at least ticket_lifetime_hint + ticket length */ @@ -2223,7 +2213,7 @@ int ssl3_get_new_session_ticket(SSL *s) } memcpy(s->session->tlsext_tick, p, ticklen); s->session->tlsext_ticklen = ticklen; - /* There are two ways to detect a resumed ticket sesion. + /* There are two ways to detect a resumed ticket session. * One is to set an appropriate session ID and then the server * must return a match in ServerHello. This allows the normal * client session ID matching to work and we know much @@ -2462,7 +2452,7 @@ int ssl3_send_client_key_exchange(SSL *s) EVP_CIPHER_CTX_init(&ciph_ctx); #ifdef KSSL_DEBUG - printf("ssl3_send_client_key_exchange(%lx & %lx)\n", + fprintf(stderr,"ssl3_send_client_key_exchange(%lx & %lx)\n", alg_k, SSL_kKRB5); #endif /* KSSL_DEBUG */ @@ -2478,9 +2468,9 @@ int ssl3_send_client_key_exchange(SSL *s) goto err; #ifdef KSSL_DEBUG { - printf("kssl_cget_tkt rtn %d\n", krb5rc); + fprintf(stderr,"kssl_cget_tkt rtn %d\n", krb5rc); if (krb5rc && kssl_err.text) - printf("kssl_cget_tkt kssl_err=%s\n", kssl_err.text); + fprintf(stderr,"kssl_cget_tkt kssl_err=%s\n", kssl_err.text); } #endif /* KSSL_DEBUG */ @@ -3309,6 +3299,12 @@ int ssl3_send_client_certificate(SSL *s) s->state=SSL3_ST_CW_CERT_D; l=ssl3_output_cert_chain(s, (s->s3->tmp.cert_req == 2)?NULL:s->cert->key->x509); + if (!l) + { + SSLerr(SSL_F_SSL3_SEND_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR); + ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR); + return 0; + } s->init_num=(int)l; s->init_off=0; } @@ -3478,40 +3474,9 @@ int ssl3_send_next_proto(SSL *s) } return ssl3_do_write(s, SSL3_RT_HANDSHAKE); -} + } #endif /* !OPENSSL_NO_TLSEXT && !OPENSSL_NO_NEXTPROTONEG */ -/* Check to see if handshake is full or resumed. Usually this is just a - * case of checking to see if a cache hit has occurred. In the case of - * session tickets we have to check the next message to be sure. - */ - -#ifndef OPENSSL_NO_TLSEXT -int ssl3_check_finished(SSL *s) - { - int ok; - long n; - /* If we have no ticket it cannot be a resumed session. */ - if (!s->session->tlsext_tick) - return 1; - /* this function is called when we really expect a Certificate - * message, so permit appropriate message length */ - n=s->method->ssl_get_message(s, - SSL3_ST_CR_CERT_A, - SSL3_ST_CR_CERT_B, - -1, - s->max_cert_list, - &ok); - if (!ok) return((int)n); - s->s3->tmp.reuse_message = 1; - if ((s->s3->tmp.message_type == SSL3_MT_FINISHED) - || (s->s3->tmp.message_type == SSL3_MT_NEWSESSION_TICKET)) - return 2; - - return 1; - } -#endif - int ssl_do_client_cert_cb(SSL *s, X509 **px509, EVP_PKEY **ppkey) { int i = 0; diff --git a/deps/openssl/openssl/ssl/s3_enc.c b/deps/openssl/openssl/ssl/s3_enc.c index 9db45af7ea7f5a..89c133e681ed84 100644 --- a/deps/openssl/openssl/ssl/s3_enc.c +++ b/deps/openssl/openssl/ssl/s3_enc.c @@ -535,7 +535,8 @@ int ssl3_enc(SSL *s, int send) /* otherwise, rec->length >= bs */ } - EVP_Cipher(ds,rec->data,rec->input,l); + if(EVP_Cipher(ds,rec->data,rec->input,l) < 1) + return -1; if (EVP_MD_CTX_md(s->read_hash) != NULL) mac_size = EVP_MD_CTX_size(s->read_hash); diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c index 3f1745336b22ea..e7cbef4814a530 100644 --- a/deps/openssl/openssl/ssl/s3_lib.c +++ b/deps/openssl/openssl/ssl/s3_lib.c @@ -3810,17 +3810,17 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, #endif #ifdef CIPHER_DEBUG - printf("Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr); + fprintf(stderr, "Server has %d from %p:\n", sk_SSL_CIPHER_num(srvr), (void *)srvr); for(i=0 ; i < sk_SSL_CIPHER_num(srvr) ; ++i) { c=sk_SSL_CIPHER_value(srvr,i); - printf("%p:%s\n",(void *)c,c->name); + fprintf(stderr, "%p:%s\n",(void *)c,c->name); } - printf("Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt); + fprintf(stderr, "Client sent %d from %p:\n", sk_SSL_CIPHER_num(clnt), (void *)clnt); for(i=0 ; i < sk_SSL_CIPHER_num(clnt) ; ++i) { c=sk_SSL_CIPHER_value(clnt,i); - printf("%p:%s\n",(void *)c,c->name); + fprintf(stderr, "%p:%s\n",(void *)c,c->name); } #endif @@ -3860,7 +3860,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, #endif #ifdef KSSL_DEBUG -/* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/ +/* fprintf(stderr,"ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/ #endif /* KSSL_DEBUG */ alg_k=c->algorithm_mkey; @@ -3883,7 +3883,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, { ok = (alg_k & emask_k) && (alg_a & emask_a); #ifdef CIPHER_DEBUG - printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a, + fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a, (void *)c,c->name); #endif } @@ -3891,7 +3891,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, { ok = (alg_k & mask_k) && (alg_a & mask_a); #ifdef CIPHER_DEBUG - printf("%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c, + fprintf(stderr, "%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(void *)c, c->name); #endif } @@ -4000,6 +4000,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, } ok = ok && ec_ok; } +#ifndef OPENSSL_NO_ECDH if ( /* if we are considering an ECC cipher suite that uses an ephemeral EC key */ (alg_k & SSL_kEECDH) @@ -4047,6 +4048,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, } ok = ok && ec_ok; } +#endif /* OPENSSL_NO_ECDH */ #endif /* OPENSSL_NO_EC */ #endif /* OPENSSL_NO_TLSEXT */ diff --git a/deps/openssl/openssl/ssl/s3_meth.c b/deps/openssl/openssl/ssl/s3_meth.c index cdddb17b627d77..4dec7033d6c90a 100644 --- a/deps/openssl/openssl/ssl/s3_meth.c +++ b/deps/openssl/openssl/ssl/s3_meth.c @@ -60,7 +60,7 @@ #include #include "ssl_locl.h" -static const SSL_METHOD *ssl3_get_method(int ver); +#ifndef OPENSSL_NO_SSL3_METHOD static const SSL_METHOD *ssl3_get_method(int ver) { if (ver == SSL3_VERSION) @@ -73,5 +73,4 @@ IMPLEMENT_ssl3_meth_func(SSLv3_method, ssl3_accept, ssl3_connect, ssl3_get_method) - - +#endif diff --git a/deps/openssl/openssl/ssl/s3_pkt.c b/deps/openssl/openssl/ssl/s3_pkt.c index 4c9285f355b264..1ec9e6ea46daea 100644 --- a/deps/openssl/openssl/ssl/s3_pkt.c +++ b/deps/openssl/openssl/ssl/s3_pkt.c @@ -183,6 +183,8 @@ int ssl3_read_n(SSL *s, int n, int max, int extend) * at once (as long as it fits into the buffer). */ if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) { + if (left == 0 && extend) + return 0; if (left > 0 && n > left) n = left; } @@ -856,8 +858,7 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, wr->length += eivlen; } - /* ssl3_enc can only have an error on read */ - s->method->ssl3_enc->enc(s,1); + if(s->method->ssl3_enc->enc(s,1)<1) goto err; /* record length after mac and block padding */ s2n(wr->length,plen); diff --git a/deps/openssl/openssl/ssl/s3_srvr.c b/deps/openssl/openssl/ssl/s3_srvr.c index c23d9870802923..fadca74ec269f3 100644 --- a/deps/openssl/openssl/ssl/s3_srvr.c +++ b/deps/openssl/openssl/ssl/s3_srvr.c @@ -170,6 +170,7 @@ #endif #include +#ifndef OPENSSL_NO_SSL3_METHOD static const SSL_METHOD *ssl3_get_server_method(int ver); static const SSL_METHOD *ssl3_get_server_method(int ver) @@ -180,6 +181,12 @@ static const SSL_METHOD *ssl3_get_server_method(int ver) return(NULL); } +IMPLEMENT_ssl3_meth_func(SSLv3_server_method, + ssl3_accept, + ssl_undefined_function, + ssl3_get_server_method) +#endif + #ifndef OPENSSL_NO_SRP static int ssl_check_srp_ext_ClientHello(SSL *s, int *al) { @@ -206,11 +213,6 @@ static int ssl_check_srp_ext_ClientHello(SSL *s, int *al) } #endif -IMPLEMENT_ssl3_meth_func(SSLv3_server_method, - ssl3_accept, - ssl_undefined_function, - ssl3_get_server_method) - int ssl3_accept(SSL *s) { BUF_MEM *buf; @@ -284,6 +286,7 @@ int ssl3_accept(SSL *s) } if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH)) { + BUF_MEM_free(buf); ret= -1; goto end; } @@ -298,6 +301,9 @@ int ssl3_accept(SSL *s) s->init_num=0; s->s3->flags &= ~SSL3_FLAGS_SGC_RESTART_DONE; + s->s3->flags &= ~SSL3_FLAGS_CCS_OK; + /* Should have been reset by ssl3_get_finished, too. */ + s->s3->change_cipher_spec = 0; if (s->state != SSL_ST_RENEGOTIATE) { @@ -441,20 +447,11 @@ int ssl3_accept(SSL *s) case SSL3_ST_SW_KEY_EXCH_B: alg_k = s->s3->tmp.new_cipher->algorithm_mkey; - /* clear this, it may get reset by - * send_server_key_exchange */ - if ((s->options & SSL_OP_EPHEMERAL_RSA) -#ifndef OPENSSL_NO_KRB5 - && !(alg_k & SSL_kKRB5) -#endif /* OPENSSL_NO_KRB5 */ - ) - /* option SSL_OP_EPHEMERAL_RSA sends temporary RSA key - * even when forbidden by protocol specs - * (handshake may fail as clients are not required to - * be able to handle this) */ - s->s3->tmp.use_rsa_tmp=1; - else - s->s3->tmp.use_rsa_tmp=0; + /* + * clear this, it may get reset by + * send_server_key_exchange + */ + s->s3->tmp.use_rsa_tmp=0; /* only send if a DH key exchange, fortezza or @@ -468,7 +465,7 @@ int ssl3_accept(SSL *s) * server certificate contains the server's * public key for key exchange. */ - if (s->s3->tmp.use_rsa_tmp + if (0 /* PSK: send ServerKeyExchange if PSK identity * hint if provided */ #ifndef OPENSSL_NO_PSK @@ -674,8 +671,14 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_CERT_VRFY_A: case SSL3_ST_SR_CERT_VRFY_B: - - s->s3->flags |= SSL3_FLAGS_CCS_OK; + /* + * This *should* be the first time we enable CCS, but be + * extra careful about surrounding code changes. We need + * to set this here because we don't know if we're + * expecting a CertificateVerify or not. + */ + if (!s->s3->change_cipher_spec) + s->s3->flags |= SSL3_FLAGS_CCS_OK; /* we should decide if we expected this one */ ret=ssl3_get_cert_verify(s); if (ret <= 0) goto end; @@ -694,6 +697,19 @@ int ssl3_accept(SSL *s) #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) case SSL3_ST_SR_NEXT_PROTO_A: case SSL3_ST_SR_NEXT_PROTO_B: + /* + * Enable CCS for resumed handshakes with NPN. + * In a full handshake with NPN, we end up here through + * SSL3_ST_SR_CERT_VRFY_B, where SSL3_FLAGS_CCS_OK was + * already set. Receiving a CCS clears the flag, so make + * sure not to re-enable it to ban duplicates. + * s->s3->change_cipher_spec is set when a CCS is + * processed in s3_pkt.c, and remains set until + * the client's Finished message is read. + */ + if (!s->s3->change_cipher_spec) + s->s3->flags |= SSL3_FLAGS_CCS_OK; + ret=ssl3_get_next_proto(s); if (ret <= 0) goto end; s->init_num = 0; @@ -703,7 +719,18 @@ int ssl3_accept(SSL *s) case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: - s->s3->flags |= SSL3_FLAGS_CCS_OK; + /* + * Enable CCS for resumed handshakes without NPN. + * In a full handshake, we end up here through + * SSL3_ST_SR_CERT_VRFY_B, where SSL3_FLAGS_CCS_OK was + * already set. Receiving a CCS clears the flag, so make + * sure not to re-enable it to ban duplicates. + * s->s3->change_cipher_spec is set when a CCS is + * processed in s3_pkt.c, and remains set until + * the client's Finished message is read. + */ + if (!s->s3->change_cipher_spec) + s->s3->flags |= SSL3_FLAGS_CCS_OK; ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) goto end; @@ -775,7 +802,6 @@ int ssl3_accept(SSL *s) #else if (s->s3->next_proto_neg_seen) { - s->s3->flags |= SSL3_FLAGS_CCS_OK; s->s3->tmp.next_state=SSL3_ST_SR_NEXT_PROTO_A; } else @@ -1017,7 +1043,16 @@ int ssl3_get_client_hello(SSL *s) else { i=ssl_get_prev_session(s, p, j, d + n); - if (i == 1) + /* + * Only resume if the session's version matches the negotiated + * version. + * RFC 5246 does not provide much useful advice on resumption + * with a different protocol version. It doesn't forbid it but + * the sanity of such behaviour would be questionable. + * In practice, clients do not accept a version mismatch and + * will abort the handshake with an error. + */ + if (i == 1 && s->version == s->session->ssl_version) { /* previous session */ s->hit=1; } @@ -1112,14 +1147,15 @@ int ssl3_get_client_hello(SSL *s) id=s->session->cipher->id; #ifdef CIPHER_DEBUG - printf("client sent %d ciphers\n",sk_num(ciphers)); + fprintf(stderr,"client sent %d ciphers\n",sk_SSL_CIPHER_num(ciphers)); #endif for (i=0; iid == id) { @@ -2171,6 +2207,7 @@ int ssl3_get_client_key_exchange(SSL *s) unsigned char rand_premaster_secret[SSL_MAX_MASTER_KEY_LENGTH]; int decrypt_len; unsigned char decrypt_good, version_good; + size_t j; /* FIX THIS UP EAY EAY EAY EAY */ if (s->s3->tmp.use_rsa_tmp) @@ -2209,8 +2246,9 @@ int ssl3_get_client_key_exchange(SSL *s) { if (!(s->options & SSL_OP_TLS_D5_BUG)) { + al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG); - goto err; + goto f_err; } else p-=2; @@ -2219,6 +2257,20 @@ int ssl3_get_client_key_exchange(SSL *s) n=i; } + /* + * Reject overly short RSA ciphertext because we want to be sure + * that the buffer size makes it safe to iterate over the entire + * size of a premaster secret (SSL_MAX_MASTER_KEY_LENGTH). The + * actual expected size is larger due to RSA padding, but the + * bound is sufficient to be safe. + */ + if (n < SSL_MAX_MASTER_KEY_LENGTH) + { + al = SSL_AD_DECRYPT_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG); + goto f_err; + } + /* We must not leak whether a decryption failure occurs because * of Bleichenbacher's attack on PKCS #1 v1.5 RSA padding (see * RFC 2246, section 7.4.7.1). The code follows that advice of @@ -2266,19 +2318,23 @@ int ssl3_get_client_key_exchange(SSL *s) * to remain non-zero (0xff). */ decrypt_good &= version_good; - /* Now copy rand_premaster_secret over p using - * decrypt_good_mask. */ - for (i = 0; i < (int) sizeof(rand_premaster_secret); i++) + /* + * Now copy rand_premaster_secret over from p using + * decrypt_good_mask. If decryption failed, then p does not + * contain valid plaintext, however, a check above guarantees + * it is still sufficiently large to read from. + */ + for (j = 0; j < sizeof(rand_premaster_secret); j++) { - p[i] = constant_time_select_8(decrypt_good, p[i], - rand_premaster_secret[i]); + p[j] = constant_time_select_8(decrypt_good, p[j], + rand_premaster_secret[j]); } s->session->master_key_length= s->method->ssl3_enc->generate_master_secret(s, s->session->master_key, - p,i); - OPENSSL_cleanse(p,i); + p,sizeof(rand_premaster_secret)); + OPENSSL_cleanse(p,sizeof(rand_premaster_secret)); } else #endif @@ -2420,10 +2476,10 @@ int ssl3_get_client_key_exchange(SSL *s) &kssl_err)) != 0) { #ifdef KSSL_DEBUG - printf("kssl_sget_tkt rtn %d [%d]\n", + fprintf(stderr,"kssl_sget_tkt rtn %d [%d]\n", krb5rc, kssl_err.reason); if (kssl_err.text) - printf("kssl_err text= %s\n", kssl_err.text); + fprintf(stderr,"kssl_err text= %s\n", kssl_err.text); #endif /* KSSL_DEBUG */ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, kssl_err.reason); @@ -2437,10 +2493,10 @@ int ssl3_get_client_key_exchange(SSL *s) &authtime, &kssl_err)) != 0) { #ifdef KSSL_DEBUG - printf("kssl_check_authent rtn %d [%d]\n", + fprintf(stderr,"kssl_check_authent rtn %d [%d]\n", krb5rc, kssl_err.reason); if (kssl_err.text) - printf("kssl_err text= %s\n", kssl_err.text); + fprintf(stderr,"kssl_err text= %s\n", kssl_err.text); #endif /* KSSL_DEBUG */ SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, kssl_err.reason); @@ -2958,7 +3014,7 @@ int ssl3_get_cert_verify(SSL *s) if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) { s->s3->tmp.reuse_message=1; - if ((peer != NULL) && (type & EVP_PKT_SIGN)) + if (peer != NULL) { al=SSL_AD_UNEXPECTED_MESSAGE; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE); @@ -3362,6 +3418,11 @@ int ssl3_send_server_certificate(SSL *s) } l=ssl3_output_cert_chain(s,x); + if (!l) + { + SSLerr(SSL_F_SSL3_SEND_SERVER_CERTIFICATE,ERR_R_INTERNAL_ERROR); + return(0); + } s->state=SSL3_ST_SW_CERT_B; s->init_num=(int)l; s->init_off=0; diff --git a/deps/openssl/openssl/ssl/srtp.h b/deps/openssl/openssl/ssl/srtp.h index 24f23309d7c473..096b624d0d8cf1 100644 --- a/deps/openssl/openssl/ssl/srtp.h +++ b/deps/openssl/openssl/ssl/srtp.h @@ -1,4 +1,4 @@ -/* ssl/tls1.h */ +/* ssl/srtp.h */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -118,6 +118,8 @@ #ifndef HEADER_D1_SRTP_H #define HEADER_D1_SRTP_H +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/deps/openssl/openssl/ssl/ssl.h b/deps/openssl/openssl/ssl/ssl.h index b78a1cce4409f9..2ba5923204d298 100644 --- a/deps/openssl/openssl/ssl/ssl.h +++ b/deps/openssl/openssl/ssl/ssl.h @@ -596,9 +596,8 @@ struct ssl_session_st #define SSL_OP_SINGLE_ECDH_USE 0x00080000L /* If set, always create a new key when using tmp_dh parameters */ #define SSL_OP_SINGLE_DH_USE 0x00100000L -/* Set to always use the tmp_rsa key when doing RSA operations, - * even when this violates protocol specs */ -#define SSL_OP_EPHEMERAL_RSA 0x00200000L +/* Does nothing: retained for compatibiity */ +#define SSL_OP_EPHEMERAL_RSA 0x0 /* Set on servers to choose the cipher according to the server's * preferences */ #define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L @@ -654,8 +653,13 @@ struct ssl_session_st #define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L #define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L /* Send TLS_FALLBACK_SCSV in the ClientHello. - * To be set by applications that reconnect with a downgraded protocol - * version; see draft-ietf-tls-downgrade-scsv-00 for details. */ + * To be set only by applications that reconnect with a downgraded protocol + * version; see draft-ietf-tls-downgrade-scsv-00 for details. + * + * DO NOT ENABLE THIS if your application attempts a normal handshake. + * Only use this in explicit fallback retries, following the guidance + * in draft-ietf-tls-downgrade-scsv-00. + */ #define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L /* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, @@ -688,6 +692,10 @@ struct ssl_session_st SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) #define SSL_set_mtu(ssl, mtu) \ SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) +#define DTLS_set_link_mtu(ssl, mtu) \ + SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) +#define DTLS_get_link_min_mtu(ssl) \ + SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) #define SSL_get_secure_renegotiation_support(ssl) \ SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) @@ -1627,6 +1635,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) #define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 #define SSL_CTRL_CHECK_PROTO_VERSION 119 +#define DTLS_CTRL_SET_LINK_MTU 120 +#define DTLS_CTRL_GET_LINK_MIN_MTU 121 #define DTLSv1_get_timeout(ssl, arg) \ SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) @@ -1878,13 +1888,15 @@ const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ #endif +#ifndef OPENSSL_NO_SSL3_METHOD const SSL_METHOD *SSLv3_method(void); /* SSLv3 */ const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */ const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */ +#endif -const SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */ -const SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */ -const SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */ +const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS version */ +const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available SSL/TLS version */ +const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available SSL/TLS version */ const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ diff --git a/deps/openssl/openssl/ssl/ssl3.h b/deps/openssl/openssl/ssl/ssl3.h index 85f150409d21de..6fad054e03c5e2 100644 --- a/deps/openssl/openssl/ssl/ssl3.h +++ b/deps/openssl/openssl/ssl/ssl3.h @@ -393,8 +393,12 @@ typedef struct ssl3_buffer_st #define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 #define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 #define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020 +/* + * Set when the handshake is ready to process peer's ChangeCipherSpec message. + * Cleared after the message has been processed. + */ #define SSL3_FLAGS_CCS_OK 0x0080 - + /* SSL3_FLAGS_SGC_RESTART_DONE is set when we * restart a handshake because of MS SGC and so prevents us * from restarting the handshake in a loop. It's reset on a @@ -456,8 +460,11 @@ typedef struct ssl3_state_st * and freed and MD_CTX-es for all required digests are stored in * this array */ EVP_MD_CTX **handshake_dgst; - /* this is set whenerver we see a change_cipher_spec message - * come in when we are not looking for one */ + /* + * Set whenever an expected ChangeCipherSpec message is processed. + * Unset when the peer's Finished message is received. + * Unexpected ChangeCipherSpec messages trigger a fatal alert. + */ int change_cipher_spec; int warn_alert; diff --git a/deps/openssl/openssl/ssl/ssl_cert.c b/deps/openssl/openssl/ssl/ssl_cert.c index 5123a89182e590..cef3ff46e4a3f6 100644 --- a/deps/openssl/openssl/ssl/ssl_cert.c +++ b/deps/openssl/openssl/ssl/ssl_cert.c @@ -286,35 +286,6 @@ CERT *ssl_cert_dup(CERT *cert) ret->pkeys[i].privatekey = cert->pkeys[i].privatekey; CRYPTO_add(&ret->pkeys[i].privatekey->references, 1, CRYPTO_LOCK_EVP_PKEY); - - switch(i) - { - /* If there was anything special to do for - * certain types of keys, we'd do it here. - * (Nothing at the moment, I think.) */ - - case SSL_PKEY_RSA_ENC: - case SSL_PKEY_RSA_SIGN: - /* We have an RSA key. */ - break; - - case SSL_PKEY_DSA_SIGN: - /* We have a DSA key. */ - break; - - case SSL_PKEY_DH_RSA: - case SSL_PKEY_DH_DSA: - /* We have a DH key. */ - break; - - case SSL_PKEY_ECC: - /* We have an ECC key */ - break; - - default: - /* Can't happen. */ - SSLerr(SSL_F_SSL_CERT_DUP, SSL_R_LIBRARY_BUG); - } } } diff --git a/deps/openssl/openssl/ssl/ssl_ciph.c b/deps/openssl/openssl/ssl/ssl_ciph.c index 8188ff5d95c1a9..b767361e79b8d9 100644 --- a/deps/openssl/openssl/ssl/ssl_ciph.c +++ b/deps/openssl/openssl/ssl/ssl_ciph.c @@ -814,7 +814,7 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method, co_list[co_list_num].active = 0; co_list_num++; #ifdef KSSL_DEBUG - printf("\t%d: %s %lx %lx %lx\n",i,c->name,c->id,c->algorithm_mkey,c->algorithm_auth); + fprintf(stderr,"\t%d: %s %lx %lx %lx\n",i,c->name,c->id,c->algorithm_mkey,c->algorithm_auth); #endif /* KSSL_DEBUG */ /* if (!sk_push(ca_list,(char *)c)) goto err; @@ -931,7 +931,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id, int reverse = 0; #ifdef CIPHER_DEBUG - printf("Applying rule %d with %08lx/%08lx/%08lx/%08lx/%08lx %08lx (%d)\n", + fprintf(stderr, "Applying rule %d with %08lx/%08lx/%08lx/%08lx/%08lx %08lx (%d)\n", rule, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, algo_strength, strength_bits); #endif @@ -977,7 +977,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id, else { #ifdef CIPHER_DEBUG - printf("\nName: %s:\nAlgo = %08lx/%08lx/%08lx/%08lx/%08lx Algo_strength = %08lx\n", cp->name, cp->algorithm_mkey, cp->algorithm_auth, cp->algorithm_enc, cp->algorithm_mac, cp->algorithm_ssl, cp->algo_strength); + fprintf(stderr, "\nName: %s:\nAlgo = %08lx/%08lx/%08lx/%08lx/%08lx Algo_strength = %08lx\n", cp->name, cp->algorithm_mkey, cp->algorithm_auth, cp->algorithm_enc, cp->algorithm_mac, cp->algorithm_ssl, cp->algo_strength); #endif if (alg_mkey && !(alg_mkey & cp->algorithm_mkey)) @@ -997,7 +997,7 @@ static void ssl_cipher_apply_rule(unsigned long cipher_id, } #ifdef CIPHER_DEBUG - printf("Action = %d\n", rule); + fprintf(stderr, "Action = %d\n", rule); #endif /* add the cipher if it has not been added yet. */ @@ -1386,7 +1386,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, */ num_of_ciphers = ssl_method->num_ciphers(); #ifdef KSSL_DEBUG - printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); + fprintf(stderr,"ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); #endif /* KSSL_DEBUG */ co_list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * num_of_ciphers); if (co_list == NULL) @@ -1513,7 +1513,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, { sk_SSL_CIPHER_push(cipherstack, curr->cipher); #ifdef CIPHER_DEBUG - printf("<%s>\n",curr->cipher->name); + fprintf(stderr, "<%s>\n",curr->cipher->name); #endif } } diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c index 3f66fc061db5a3..4a62b4a790db88 100644 --- a/deps/openssl/openssl/ssl/ssl_lib.c +++ b/deps/openssl/openssl/ssl/ssl_lib.c @@ -383,13 +383,7 @@ SSL *SSL_new(SSL_CTX *ctx) return(s); err: if (s != NULL) - { - if (s->cert != NULL) - ssl_cert_free(s->cert); - if (s->ctx != NULL) - SSL_CTX_free(s->ctx); /* decrement reference count */ - OPENSSL_free(s); - } + SSL_free(s); SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE); return(NULL); } @@ -1080,19 +1074,6 @@ long SSL_ctrl(SSL *s,int cmd,long larg,void *parg) l=s->max_cert_list; s->max_cert_list=larg; return(l); - case SSL_CTRL_SET_MTU: -#ifndef OPENSSL_NO_DTLS1 - if (larg < (long)dtls1_min_mtu()) - return 0; -#endif - - if (SSL_version(s) == DTLS1_VERSION || - SSL_version(s) == DTLS1_BAD_VER) - { - s->d1->mtu = larg; - return larg; - } - return 0; case SSL_CTRL_SET_MAX_SEND_FRAGMENT: if (larg < 512 || larg > SSL3_RT_MAX_PLAIN_LENGTH) return 0; @@ -1507,6 +1488,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num, ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INAPPROPRIATE_FALLBACK); goto err; } + p += n; continue; } @@ -2112,7 +2094,7 @@ void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher) #ifdef CIPHER_DEBUG - printf("rt=%d rte=%d dht=%d ecdht=%d re=%d ree=%d rs=%d ds=%d dhr=%d dhd=%d\n", + fprintf(stderr,"rt=%d rte=%d dht=%d ecdht=%d re=%d ree=%d rs=%d ds=%d dhr=%d dhd=%d\n", rsa_tmp,rsa_tmp_export,dh_tmp,have_ecdh_tmp, rsa_enc,rsa_enc_export,rsa_sign,dsa_sign,dh_rsa,dh_dsa); #endif @@ -2996,10 +2978,32 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX* ctx) } ssl_cert_free(ocert); } + + /* + * Program invariant: |sid_ctx| has fixed size (SSL_MAX_SID_CTX_LENGTH), + * so setter APIs must prevent invalid lengths from entering the system. + */ + OPENSSL_assert(ssl->sid_ctx_length <= sizeof(ssl->sid_ctx)); + + /* + * If the session ID context matches that of the parent SSL_CTX, + * inherit it from the new SSL_CTX as well. If however the context does + * not match (i.e., it was set per-ssl with SSL_set_session_id_context), + * leave it unchanged. + */ + if ((ssl->ctx != NULL) && + (ssl->sid_ctx_length == ssl->ctx->sid_ctx_length) && + (memcmp(ssl->sid_ctx, ssl->ctx->sid_ctx, ssl->sid_ctx_length) == 0)) + { + ssl->sid_ctx_length = ctx->sid_ctx_length; + memcpy(&ssl->sid_ctx, &ctx->sid_ctx, sizeof(ssl->sid_ctx)); + } + CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX); if (ssl->ctx != NULL) SSL_CTX_free(ssl->ctx); /* decrement reference count */ ssl->ctx = ctx; + return(ssl->ctx); } diff --git a/deps/openssl/openssl/ssl/ssl_locl.h b/deps/openssl/openssl/ssl/ssl_locl.h index 98888d2df3738b..1b8fa8c4cbf61f 100644 --- a/deps/openssl/openssl/ssl/ssl_locl.h +++ b/deps/openssl/openssl/ssl/ssl_locl.h @@ -864,7 +864,7 @@ int ssl_fill_hello_random(SSL *s, int server, unsigned char *field, int len); int ssl2_enc_init(SSL *s, int client); int ssl2_generate_key_material(SSL *s); -void ssl2_enc(SSL *s,int send_data); +int ssl2_enc(SSL *s,int send_data); void ssl2_mac(SSL *s,unsigned char *mac,int send_data); const SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p); int ssl2_put_cipher_by_char(const SSL_CIPHER *c,unsigned char *p); @@ -997,7 +997,9 @@ void dtls1_stop_timer(SSL *s); int dtls1_is_timer_expired(SSL *s); void dtls1_double_timeout(SSL *s); int dtls1_send_newsession_ticket(SSL *s); -unsigned int dtls1_min_mtu(void); +unsigned int dtls1_min_mtu(SSL *s); +unsigned int dtls1_link_min_mtu(void); +void dtls1_hm_fragment_free(hm_fragment *frag); /* some client-only functions */ int ssl3_client_hello(SSL *s); @@ -1014,7 +1016,6 @@ int ssl3_get_key_exchange(SSL *s); int ssl3_get_server_certificate(SSL *s); int ssl3_check_cert_and_algorithm(SSL *s); #ifndef OPENSSL_NO_TLSEXT -int ssl3_check_finished(SSL *s); # ifndef OPENSSL_NO_NEXTPROTONEG int ssl3_send_next_proto(SSL *s); # endif diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c index ad40fadd02cc50..235f92d824cd1e 100644 --- a/deps/openssl/openssl/ssl/ssl_sess.c +++ b/deps/openssl/openssl/ssl/ssl_sess.c @@ -335,7 +335,21 @@ int ssl_get_new_session(SSL *s, int session) return(0); } #ifndef OPENSSL_NO_TLSEXT - /* If RFC4507 ticket use empty session ID */ + /* + * If RFC5077 ticket, use empty session ID (as server). + * Note that: + * (a) ssl_get_prev_session() does lookahead into the + * ClientHello extensions to find the session ticket. + * When ssl_get_prev_session() fails, s3_srvr.c calls + * ssl_get_new_session() in ssl3_get_client_hello(). + * At that point, it has not yet parsed the extensions, + * however, because of the lookahead, it already knows + * whether a ticket is expected or not. + * + * (b) s3_clnt.c calls ssl_get_new_session() before parsing + * ServerHello extensions, and before recording the session + * ID received from the server, so this block is a noop. + */ if (s->tlsext_ticket_expected) { ss->session_id_length = 0; diff --git a/deps/openssl/openssl/ssl/ssltest.c b/deps/openssl/openssl/ssl/ssltest.c index 4f80be8ee4d8e4..08889569f4effc 100644 --- a/deps/openssl/openssl/ssl/ssltest.c +++ b/deps/openssl/openssl/ssl/ssltest.c @@ -345,7 +345,7 @@ static void sv_usage(void) #ifndef OPENSSL_NO_SSL2 fprintf(stderr," -ssl2 - use SSLv2\n"); #endif -#ifndef OPENSSL_NO_SSL3 +#ifndef OPENSSL_NO_SSL3_METHOD fprintf(stderr," -ssl3 - use SSLv3\n"); #endif #ifndef OPENSSL_NO_TLS1 @@ -368,7 +368,9 @@ static void sv_usage(void) " Use \"openssl ecparam -list_curves\" for all names\n" \ " (default is sect163r2).\n"); #endif - fprintf(stderr," -test_cipherlist - verifies the order of the ssl cipher lists\n"); + fprintf(stderr," -test_cipherlist - Verifies the order of the ssl cipher lists.\n" + " When this option is requested, the cipherlist\n" + " tests are run instead of handshake tests.\n"); } static void print_details(SSL *c_ssl, const char *prefix) @@ -549,6 +551,7 @@ int main(int argc, char *argv[]) #ifdef OPENSSL_FIPS int fips_mode=0; #endif + int no_protocol = 0; verbose = 0; debug = 0; @@ -658,11 +661,26 @@ int main(int argc, char *argv[]) } #endif else if (strcmp(*argv,"-ssl2") == 0) - ssl2=1; + { +#ifdef OPENSSL_NO_SSL2 + no_protocol = 1; +#endif + ssl2 = 1; + } else if (strcmp(*argv,"-tls1") == 0) - tls1=1; + { +#ifdef OPENSSL_NO_TLS1 + no_protocol = 1; +#endif + tls1 = 1; + } else if (strcmp(*argv,"-ssl3") == 0) - ssl3=1; + { +#ifdef OPENSSL_NO_SSL3_METHOD + no_protocol = 1; +#endif + ssl3 = 1; + } else if (strncmp(*argv,"-num",4) == 0) { if (--argc < 1) goto bad; @@ -781,15 +799,41 @@ int main(int argc, char *argv[]) goto end; } + /* + * test_cipherlist prevails over protocol switch: we test the cipherlist + * for all enabled protocols. + */ if (test_cipherlist == 1) { /* ensure that the cipher list are correctly sorted and exit */ + fprintf(stdout, "Testing cipherlist order only. Ignoring all " + "other options.\n"); if (do_test_cipherlist() == 0) EXIT(1); ret = 0; goto end; } + if (ssl2 + ssl3 + tls1 > 1) + { + fprintf(stderr, "At most one of -ssl2, -ssl3, or -tls1 should " + "be requested.\n"); + EXIT(1); + } + + /* + * Testing was requested for a compiled-out protocol (e.g. SSLv2). + * Ideally, we would error out, but the generic test wrapper can't know + * when to expect failure. So we do nothing and return success. + */ + if (no_protocol) + { + fprintf(stderr, "Testing was requested for a disabled protocol. " + "Skipping tests.\n"); + ret = 0; + goto end; + } + if (!ssl2 && !ssl3 && !tls1 && number > 1 && !reuse && !force) { fprintf(stderr, "This case cannot work. Use -f to perform " @@ -868,30 +912,25 @@ int main(int argc, char *argv[]) } #endif -#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) +/* At this point, ssl2/ssl3/tls1 is only set if the protocol is available. + * (Otherwise we exit early.) + * However the compiler doesn't know this, so we ifdef. */ +#ifndef OPENSSL_NO_SSL2 if (ssl2) meth=SSLv2_method(); - else - if (tls1) - meth=TLSv1_method(); else +#endif +#ifndef OPENSSL_NO_SSL3 if (ssl3) meth=SSLv3_method(); else - meth=SSLv23_method(); -#else -#ifdef OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_TLS1 if (tls1) meth=TLSv1_method(); else - if (ssl3) - meth=SSLv3_method(); - else - meth=SSLv23_method(); -#else - meth=SSLv2_method(); -#endif #endif + meth=SSLv23_method(); c_ctx=SSL_CTX_new(meth); s_ctx=SSL_CTX_new(meth); diff --git a/deps/openssl/openssl/ssl/t1_enc.c b/deps/openssl/openssl/ssl/t1_enc.c index 1923cf3e9d123d..1308c0344feafb 100644 --- a/deps/openssl/openssl/ssl/t1_enc.c +++ b/deps/openssl/openssl/ssl/t1_enc.c @@ -303,15 +303,15 @@ static int tls1_generate_key_block(SSL *s, unsigned char *km, s->session->master_key,s->session->master_key_length, km,tmp,num); #ifdef KSSL_DEBUG - printf("tls1_generate_key_block() ==> %d byte master_key =\n\t", + fprintf(stderr,"tls1_generate_key_block() ==> %d byte master_key =\n\t", s->session->master_key_length); { int i; for (i=0; i < s->session->master_key_length; i++) { - printf("%02X", s->session->master_key[i]); + fprintf(stderr,"%02X", s->session->master_key[i]); } - printf("\n"); } + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ return ret; } @@ -349,19 +349,19 @@ int tls1_change_cipher_state(SSL *s, int which) #endif #ifdef KSSL_DEBUG - printf("tls1_change_cipher_state(which= %d) w/\n", which); - printf("\talg= %ld/%ld, comp= %p\n", + fprintf(stderr,"tls1_change_cipher_state(which= %d) w/\n", which); + fprintf(stderr,"\talg= %ld/%ld, comp= %p\n", s->s3->tmp.new_cipher->algorithm_mkey, s->s3->tmp.new_cipher->algorithm_auth, comp); - printf("\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", c); - printf("\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n", + fprintf(stderr,"\tevp_cipher == %p ==? &d_cbc_ede_cipher3\n", c); + fprintf(stderr,"\tevp_cipher: nid, blksz= %d, %d, keylen=%d, ivlen=%d\n", c->nid,c->block_size,c->key_len,c->iv_len); - printf("\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length); + fprintf(stderr,"\tkey_block: len= %d, data= ", s->s3->tmp.key_block_length); { int i; for (i=0; is3->tmp.key_block_length; i++) - printf("%02x", s->s3->tmp.key_block[i]); printf("\n"); + fprintf(stderr,"%02x", s->s3->tmp.key_block[i]); fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -540,11 +540,11 @@ printf("which = %04X\nmac key=",which); #ifdef KSSL_DEBUG { int i; - printf("EVP_CipherInit_ex(dd,c,key=,iv=,which)\n"); - printf("\tkey= "); for (i=0; ikey_len; i++) printf("%02x", key[i]); - printf("\n"); - printf("\t iv= "); for (i=0; iiv_len; i++) printf("%02x", iv[i]); - printf("\n"); + fprintf(stderr,"EVP_CipherInit_ex(dd,c,key=,iv=,which)\n"); + fprintf(stderr,"\tkey= "); for (i=0; ikey_len; i++) fprintf(stderr,"%02x", key[i]); + fprintf(stderr,"\n"); + fprintf(stderr,"\t iv= "); for (i=0; iiv_len; i++) fprintf(stderr,"%02x", iv[i]); + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -591,7 +591,7 @@ int tls1_setup_key_block(SSL *s) int ret=0; #ifdef KSSL_DEBUG - printf ("tls1_setup_key_block()\n"); + fprintf(stderr,"tls1_setup_key_block()\n"); #endif /* KSSL_DEBUG */ if (s->s3->tmp.key_block_length != 0) @@ -740,7 +740,7 @@ int tls1_enc(SSL *s, int send) } #ifdef KSSL_DEBUG - printf("tls1_enc(%d)\n", send); + fprintf(stderr,"tls1_enc(%d)\n", send); #endif /* KSSL_DEBUG */ if ((s->session == NULL) || (ds == NULL) || (enc == NULL)) @@ -812,18 +812,18 @@ int tls1_enc(SSL *s, int send) #ifdef KSSL_DEBUG { unsigned long ui; - printf("EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n", + fprintf(stderr,"EVP_Cipher(ds=%p,rec->data=%p,rec->input=%p,l=%ld) ==>\n", ds,rec->data,rec->input,l); - printf("\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%d %d], %d iv_len\n", + fprintf(stderr,"\tEVP_CIPHER_CTX: %d buf_len, %d key_len [%lu %lu], %d iv_len\n", ds->buf_len, ds->cipher->key_len, DES_KEY_SZ, DES_SCHEDULE_SZ, ds->cipher->iv_len); - printf("\t\tIV: "); - for (i=0; icipher->iv_len; i++) printf("%02X", ds->iv[i]); - printf("\n"); - printf("\trec->input="); - for (ui=0; uiinput[ui]); - printf("\n"); + fprintf(stderr,"\t\tIV: "); + for (i=0; icipher->iv_len; i++) fprintf(stderr,"%02X", ds->iv[i]); + fprintf(stderr,"\n"); + fprintf(stderr,"\trec->input="); + for (ui=0; uiinput[ui]); + fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -848,9 +848,9 @@ int tls1_enc(SSL *s, int send) #ifdef KSSL_DEBUG { unsigned long i; - printf("\trec->data="); + fprintf(stderr,"\trec->data="); for (i=0; idata[i]); printf("\n"); + fprintf(stderr," %02x", rec->data[i]); fprintf(stderr,"\n"); } #endif /* KSSL_DEBUG */ @@ -1048,10 +1048,10 @@ int tls1_mac(SSL *ssl, unsigned char *md, int send) if (!stream_mac) EVP_MD_CTX_cleanup(&hmac); #ifdef TLS_DEBUG -printf("seq="); -{int z; for (z=0; z<8; z++) printf("%02X ",seq[z]); printf("\n"); } -printf("rec="); -{unsigned int z; for (z=0; zlength; z++) printf("%02X ",rec->data[z]); printf("\n"); } +fprintf(stderr,"seq="); +{int z; for (z=0; z<8; z++) fprintf(stderr,"%02X ",seq[z]); fprintf(stderr,"\n"); } +fprintf(stderr,"rec="); +{unsigned int z; for (z=0; zlength; z++) fprintf(stderr,"%02X ",rec->data[z]); fprintf(stderr,"\n"); } #endif if (ssl->version != DTLS1_VERSION && ssl->version != DTLS1_BAD_VER) @@ -1064,7 +1064,7 @@ printf("rec="); } #ifdef TLS_DEBUG -{unsigned int z; for (z=0; z sizeof(nid_list)/sizeof(nid_list[0]))) return 0; @@ -242,7 +254,7 @@ int tls1_ec_curve_id2nid(int curve_id) int tls1_ec_nid2curve_id(int nid) { - /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */ + /* ECC curves from RFC 4492 */ switch (nid) { case NID_sect163k1: /* sect163k1 (1) */ @@ -488,11 +500,6 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned c s2n(TLSEXT_TYPE_elliptic_curves,ret); s2n(s->tlsext_ellipticcurvelist_length + 2, ret); - /* NB: draft-ietf-tls-ecc-12.txt uses a one-byte prefix for - * elliptic_curve_list, but the examples use two bytes. - * http://www1.ietf.org/mail-archive/web/tls/current/msg00538.html - * resolves this to two bytes. - */ s2n(s->tlsext_ellipticcurvelist_length, ret); memcpy(ret, s->tlsext_ellipticcurvelist, s->tlsext_ellipticcurvelist_length); ret+=s->tlsext_ellipticcurvelist_length; @@ -998,6 +1005,16 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in ssl_check_for_safari(s, data, d, n); #endif /* !OPENSSL_NO_EC */ +#ifndef OPENSSL_NO_SRP + if (s->srp_ctx.login != NULL) + { + OPENSSL_free(s->srp_ctx.login); + s->srp_ctx.login = NULL; + } +#endif + + s->srtp_profile = NULL; + if (data >= (d+n-2)) goto ri_check; n2s(data,len); @@ -1192,7 +1209,9 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in ellipticcurvelist_length += (*(sdata++)); if (ellipticcurvelist_length != size - 2 || - ellipticcurvelist_length < 1) + ellipticcurvelist_length < 1 || + /* Each NamedCurve is 2 bytes. */ + ellipticcurvelist_length & 1) { *al = TLS1_AD_DECODE_ERROR; return 0; @@ -1506,6 +1525,7 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in #ifndef OPENSSL_NO_NEXTPROTONEG s->s3->next_proto_neg_seen = 0; #endif + s->tlsext_ticket_expected = 0; #ifndef OPENSSL_NO_HEARTBEATS s->tlsext_heartbeat &= ~(SSL_TLSEXT_HB_ENABLED | @@ -1800,7 +1820,7 @@ int ssl_prepare_clienthello_tlsext(SSL *s) s->tlsext_ecpointformatlist[1] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime; s->tlsext_ecpointformatlist[2] = TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2; - /* we support all named elliptic curves in draft-ietf-tls-ecc-12 */ + /* we support all named elliptic curves in RFC 4492 */ if (s->tlsext_ellipticcurvelist != NULL) OPENSSL_free(s->tlsext_ellipticcurvelist); s->tlsext_ellipticcurvelist_length = sizeof(pref_list)/sizeof(pref_list[0]) * 2; if ((s->tlsext_ellipticcurvelist = OPENSSL_malloc(s->tlsext_ellipticcurvelist_length)) == NULL) diff --git a/deps/openssl/openssl/test/bntest.c b/deps/openssl/openssl/test/bntest.c index 06f5954acc3908..48bc63384c9246 100644 --- a/deps/openssl/openssl/test/bntest.c +++ b/deps/openssl/openssl/test/bntest.c @@ -107,6 +107,7 @@ int test_mod(BIO *bp,BN_CTX *ctx); int test_mod_mul(BIO *bp,BN_CTX *ctx); int test_mod_exp(BIO *bp,BN_CTX *ctx); int test_mod_exp_mont_consttime(BIO *bp,BN_CTX *ctx); +int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx); int test_exp(BIO *bp,BN_CTX *ctx); int test_gf2m_add(BIO *bp); int test_gf2m_mod(BIO *bp); @@ -249,6 +250,7 @@ int main(int argc, char *argv[]) message(out,"BN_mod_exp_mont_consttime"); if (!test_mod_exp_mont_consttime(out,ctx)) goto err; + if (!test_mod_exp_mont5(out,ctx)) goto err; (void)BIO_flush(out); message(out,"BN_exp"); @@ -676,44 +678,98 @@ int test_mul(BIO *bp) int test_sqr(BIO *bp, BN_CTX *ctx) { - BIGNUM a,c,d,e; - int i; + BIGNUM *a,*c,*d,*e; + int i, ret = 0; - BN_init(&a); - BN_init(&c); - BN_init(&d); - BN_init(&e); + a = BN_new(); + c = BN_new(); + d = BN_new(); + e = BN_new(); + if (a == NULL || c == NULL || d == NULL || e == NULL) + { + goto err; + } for (i=0; ineg=rand_neg(); + BN_sqr(c,a,ctx); if (bp != NULL) { if (!results) { - BN_print(bp,&a); + BN_print(bp,a); BIO_puts(bp," * "); - BN_print(bp,&a); + BN_print(bp,a); BIO_puts(bp," - "); } - BN_print(bp,&c); + BN_print(bp,c); BIO_puts(bp,"\n"); } - BN_div(&d,&e,&c,&a,ctx); - BN_sub(&d,&d,&a); - if(!BN_is_zero(&d) || !BN_is_zero(&e)) - { - fprintf(stderr,"Square test failed!\n"); - return 0; - } + BN_div(d,e,c,a,ctx); + BN_sub(d,d,a); + if(!BN_is_zero(d) || !BN_is_zero(e)) + { + fprintf(stderr,"Square test failed!\n"); + goto err; + } } - BN_free(&a); - BN_free(&c); - BN_free(&d); - BN_free(&e); - return(1); + + /* Regression test for a BN_sqr overflow bug. */ + BN_hex2bn(&a, + "80000000000000008000000000000001FFFFFFFFFFFFFFFE0000000000000000"); + BN_sqr(c, a, ctx); + if (bp != NULL) + { + if (!results) + { + BN_print(bp,a); + BIO_puts(bp," * "); + BN_print(bp,a); + BIO_puts(bp," - "); + } + BN_print(bp,c); + BIO_puts(bp,"\n"); + } + BN_mul(d, a, a, ctx); + if (BN_cmp(c, d)) + { + fprintf(stderr, "Square test failed: BN_sqr and BN_mul produce " + "different results!\n"); + goto err; + } + + /* Regression test for a BN_sqr overflow bug. */ + BN_hex2bn(&a, + "80000000000000000000000080000001FFFFFFFE000000000000000000000000"); + BN_sqr(c, a, ctx); + if (bp != NULL) + { + if (!results) + { + BN_print(bp,a); + BIO_puts(bp," * "); + BN_print(bp,a); + BIO_puts(bp," - "); + } + BN_print(bp,c); + BIO_puts(bp,"\n"); + } + BN_mul(d, a, a, ctx); + if (BN_cmp(c, d)) + { + fprintf(stderr, "Square test failed: BN_sqr and BN_mul produce " + "different results!\n"); + goto err; + } + ret = 1; +err: + if (a != NULL) BN_free(a); + if (c != NULL) BN_free(c); + if (d != NULL) BN_free(d); + if (e != NULL) BN_free(e); + return ret; } int test_mont(BIO *bp, BN_CTX *ctx) @@ -1012,6 +1068,80 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) return(1); } +/* Test constant-time modular exponentiation with 1024-bit inputs, + * which on x86_64 cause a different code branch to be taken. + */ +int test_mod_exp_mont5(BIO *bp, BN_CTX *ctx) + { + BIGNUM *a,*p,*m,*d,*e; + + BN_MONT_CTX *mont; + + a=BN_new(); + p=BN_new(); + m=BN_new(); + d=BN_new(); + e=BN_new(); + + mont = BN_MONT_CTX_new(); + + BN_bntest_rand(m,1024,0,1); /* must be odd for montgomery */ + /* Zero exponent */ + BN_bntest_rand(a,1024,0,0); + BN_zero(p); + if(!BN_mod_exp_mont_consttime(d,a,p,m,ctx,NULL)) + return 0; + if(!BN_is_one(d)) + { + fprintf(stderr, "Modular exponentiation test failed!\n"); + return 0; + } + /* Zero input */ + BN_bntest_rand(p,1024,0,0); + BN_zero(a); + if(!BN_mod_exp_mont_consttime(d,a,p,m,ctx,NULL)) + return 0; + if(!BN_is_zero(d)) + { + fprintf(stderr, "Modular exponentiation test failed!\n"); + return 0; + } + /* Craft an input whose Montgomery representation is 1, + * i.e., shorter than the modulus m, in order to test + * the const time precomputation scattering/gathering. + */ + BN_one(a); + BN_MONT_CTX_set(mont,m,ctx); + if(!BN_from_montgomery(e,a,mont,ctx)) + return 0; + if(!BN_mod_exp_mont_consttime(d,e,p,m,ctx,NULL)) + return 0; + if(!BN_mod_exp_simple(a,e,p,m,ctx)) + return 0; + if(BN_cmp(a,d) != 0) + { + fprintf(stderr,"Modular exponentiation test failed!\n"); + return 0; + } + /* Finally, some regular test vectors. */ + BN_bntest_rand(e,1024,0,0); + if(!BN_mod_exp_mont_consttime(d,e,p,m,ctx,NULL)) + return 0; + if(!BN_mod_exp_simple(a,e,p,m,ctx)) + return 0; + if(BN_cmp(a,d) != 0) + { + fprintf(stderr,"Modular exponentiation test failed!\n"); + return 0; + } + BN_free(a); + BN_free(p); + BN_free(m); + BN_free(d); + BN_free(e); + return(1); + } + int test_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*d,*e,*one; diff --git a/deps/openssl/openssl/test/ectest.c b/deps/openssl/openssl/test/ectest.c index d1bf980599c8ac..8e4154d86549cf 100644 --- a/deps/openssl/openssl/test/ectest.c +++ b/deps/openssl/openssl/test/ectest.c @@ -1366,7 +1366,7 @@ static const struct nistp_test_params nistp_tests_params[] = }, }; -void nistp_single_test(const struct nistp_test_params *test) +static void nistp_single_test(const struct nistp_test_params *test) { BN_CTX *ctx; BIGNUM *p, *a, *b, *x, *y, *n, *m, *order; @@ -1469,7 +1469,7 @@ void nistp_single_test(const struct nistp_test_params *test) BN_CTX_free(ctx); } -void nistp_tests() +static void nistp_tests() { unsigned i; diff --git a/deps/openssl/openssl/test/ssltest.c b/deps/openssl/openssl/test/ssltest.c index 4f80be8ee4d8e4..08889569f4effc 100644 --- a/deps/openssl/openssl/test/ssltest.c +++ b/deps/openssl/openssl/test/ssltest.c @@ -345,7 +345,7 @@ static void sv_usage(void) #ifndef OPENSSL_NO_SSL2 fprintf(stderr," -ssl2 - use SSLv2\n"); #endif -#ifndef OPENSSL_NO_SSL3 +#ifndef OPENSSL_NO_SSL3_METHOD fprintf(stderr," -ssl3 - use SSLv3\n"); #endif #ifndef OPENSSL_NO_TLS1 @@ -368,7 +368,9 @@ static void sv_usage(void) " Use \"openssl ecparam -list_curves\" for all names\n" \ " (default is sect163r2).\n"); #endif - fprintf(stderr," -test_cipherlist - verifies the order of the ssl cipher lists\n"); + fprintf(stderr," -test_cipherlist - Verifies the order of the ssl cipher lists.\n" + " When this option is requested, the cipherlist\n" + " tests are run instead of handshake tests.\n"); } static void print_details(SSL *c_ssl, const char *prefix) @@ -549,6 +551,7 @@ int main(int argc, char *argv[]) #ifdef OPENSSL_FIPS int fips_mode=0; #endif + int no_protocol = 0; verbose = 0; debug = 0; @@ -658,11 +661,26 @@ int main(int argc, char *argv[]) } #endif else if (strcmp(*argv,"-ssl2") == 0) - ssl2=1; + { +#ifdef OPENSSL_NO_SSL2 + no_protocol = 1; +#endif + ssl2 = 1; + } else if (strcmp(*argv,"-tls1") == 0) - tls1=1; + { +#ifdef OPENSSL_NO_TLS1 + no_protocol = 1; +#endif + tls1 = 1; + } else if (strcmp(*argv,"-ssl3") == 0) - ssl3=1; + { +#ifdef OPENSSL_NO_SSL3_METHOD + no_protocol = 1; +#endif + ssl3 = 1; + } else if (strncmp(*argv,"-num",4) == 0) { if (--argc < 1) goto bad; @@ -781,15 +799,41 @@ int main(int argc, char *argv[]) goto end; } + /* + * test_cipherlist prevails over protocol switch: we test the cipherlist + * for all enabled protocols. + */ if (test_cipherlist == 1) { /* ensure that the cipher list are correctly sorted and exit */ + fprintf(stdout, "Testing cipherlist order only. Ignoring all " + "other options.\n"); if (do_test_cipherlist() == 0) EXIT(1); ret = 0; goto end; } + if (ssl2 + ssl3 + tls1 > 1) + { + fprintf(stderr, "At most one of -ssl2, -ssl3, or -tls1 should " + "be requested.\n"); + EXIT(1); + } + + /* + * Testing was requested for a compiled-out protocol (e.g. SSLv2). + * Ideally, we would error out, but the generic test wrapper can't know + * when to expect failure. So we do nothing and return success. + */ + if (no_protocol) + { + fprintf(stderr, "Testing was requested for a disabled protocol. " + "Skipping tests.\n"); + ret = 0; + goto end; + } + if (!ssl2 && !ssl3 && !tls1 && number > 1 && !reuse && !force) { fprintf(stderr, "This case cannot work. Use -f to perform " @@ -868,30 +912,25 @@ int main(int argc, char *argv[]) } #endif -#if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) +/* At this point, ssl2/ssl3/tls1 is only set if the protocol is available. + * (Otherwise we exit early.) + * However the compiler doesn't know this, so we ifdef. */ +#ifndef OPENSSL_NO_SSL2 if (ssl2) meth=SSLv2_method(); - else - if (tls1) - meth=TLSv1_method(); else +#endif +#ifndef OPENSSL_NO_SSL3 if (ssl3) meth=SSLv3_method(); else - meth=SSLv23_method(); -#else -#ifdef OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_TLS1 if (tls1) meth=TLSv1_method(); else - if (ssl3) - meth=SSLv3_method(); - else - meth=SSLv23_method(); -#else - meth=SSLv2_method(); -#endif #endif + meth=SSLv23_method(); c_ctx=SSL_CTX_new(meth); s_ctx=SSL_CTX_new(meth); diff --git a/deps/openssl/openssl/util/libeay.num b/deps/openssl/openssl/util/libeay.num index aa86b2b8b1bf4b..3821c9c99e89fa 100755 --- a/deps/openssl/openssl/util/libeay.num +++ b/deps/openssl/openssl/util/libeay.num @@ -1807,6 +1807,7 @@ ASN1_UTCTIME_get 2350 NOEXIST::FUNCTION: X509_REQ_digest 2362 EXIST::FUNCTION:EVP X509_CRL_digest 2391 EXIST::FUNCTION:EVP d2i_ASN1_SET_OF_PKCS7 2397 NOEXIST::FUNCTION: +X509_ALGOR_cmp 2398 EXIST::FUNCTION: EVP_CIPHER_CTX_set_key_length 2399 EXIST::FUNCTION: EVP_CIPHER_CTX_ctrl 2400 EXIST::FUNCTION: BN_mod_exp_mont_word 2401 EXIST::FUNCTION: diff --git a/deps/openssl/openssl/util/mk1mf.pl b/deps/openssl/openssl/util/mk1mf.pl index f0c2df02675f69..d3f5424ff30def 100755 --- a/deps/openssl/openssl/util/mk1mf.pl +++ b/deps/openssl/openssl/util/mk1mf.pl @@ -671,12 +671,6 @@ $lib_obj=$lib_obj{$_}; local($slib)=$shlib; - if (($_ eq "SSL") && $no_ssl2 && $no_ssl3) - { - $rules.="\$(O_SSL):\n\n"; - next; - } - $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)"; $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); @@ -1077,12 +1071,17 @@ sub do_copy_rule return($ret); } +# Options picked up from the OPTIONS line in the top level Makefile +# generated by Configure. + sub read_options { # Many options are handled in a similar way. In particular # no-xxx sets zero or more scalars to 1. - # Process these using a hash containing the option name and - # reference to the scalars to set. + # Process these using the %valid_options hash containing the option + # name and reference to the scalars to set. In some cases the option + # needs no special handling and can be ignored: this is done by + # setting the value to 0. my %valid_options = ( "no-rc2" => \$no_rc2, @@ -1116,6 +1115,7 @@ sub read_options "gaswin" => \$gaswin, "no-ssl2" => \$no_ssl2, "no-ssl3" => \$no_ssl3, + "no-ssl3-method" => 0, "no-tlsext" => \$no_tlsext, "no-srp" => \$no_srp, "no-cms" => \$no_cms, diff --git a/deps/openssl/openssl/util/mkbuildinf.pl b/deps/openssl/openssl/util/mkbuildinf.pl new file mode 100755 index 00000000000000..ffa8a39933f138 --- /dev/null +++ b/deps/openssl/openssl/util/mkbuildinf.pl @@ -0,0 +1,35 @@ +#!/usr/local/bin/perl + +my ($cflags, $platform) = @ARGV; + +$cflags = "compiler: $cflags"; +$date = localtime(); +print <<"END_OUTPUT"; +#ifndef MK1MF_BUILD + /* auto-generated by util/mkbuildinf.pl for crypto/cversion.c */ + #define CFLAGS cflags + /* + * Generate CFLAGS as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ + static const char cflags[] = { +END_OUTPUT +my $ctr = 0; +foreach my $c (split //, $cflags) { + # Max 18 characters per line + if (($ctr++ % 18) == 0) { + if ($ctr != 1) { + print "\n"; + } + print " "; + } + print "'$c',"; +} +print <<"END_OUTPUT"; +'\\0' + }; + #define PLATFORM "platform: $platform" + #define DATE "built on: $date" +#endif +END_OUTPUT diff --git a/deps/openssl/openssl/util/mkdef.pl b/deps/openssl/openssl/util/mkdef.pl index 1eaa7b8acd290c..894f0529fc475e 100755 --- a/deps/openssl/openssl/util/mkdef.pl +++ b/deps/openssl/openssl/util/mkdef.pl @@ -107,6 +107,8 @@ "CAPIENG", # SSL v2 "SSL2", + # SSL v3 method + "SSL3_METHOD", # JPAKE "JPAKE", # NEXTPROTONEG @@ -141,7 +143,7 @@ my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc; my $no_nextprotoneg; my $no_sctp; my $no_srtp; -my $no_unit_test; +my $no_unit_test; my $no_ssl3_method; my $fips; @@ -236,6 +238,7 @@ elsif (/^no-ec_nistp_64_gcc_128$/) { $no_nistp_gcc=1; } elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; } elsif (/^no-ssl2$/) { $no_ssl2=1; } + elsif (/^no-ssl3-method$/) { $no_ssl3_method=1; } elsif (/^no-capieng$/) { $no_capieng=1; } elsif (/^no-jpake$/) { $no_jpake=1; } elsif (/^no-srp$/) { $no_srp=1; } @@ -1208,6 +1211,7 @@ sub is_valid if ($keyword eq "EC_NISTP_64_GCC_128" && $no_nistp_gcc) { return 0; } if ($keyword eq "SSL2" && $no_ssl2) { return 0; } + if ($keyword eq "SSL3_METHOD" && $no_ssl3_method) { return 0; } if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } if ($keyword eq "JPAKE" && $no_jpake) { return 0; } if ($keyword eq "SRP" && $no_srp) { return 0; } diff --git a/deps/openssl/openssl/util/pl/netware.pl b/deps/openssl/openssl/util/pl/netware.pl index c78bcfc874223a..fe80a9bb89909e 100644 --- a/deps/openssl/openssl/util/pl/netware.pl +++ b/deps/openssl/openssl/util/pl/netware.pl @@ -212,7 +212,7 @@ # Turned off the "possible" warnings ( -w nopossible ). Metrowerks # complained a lot about various stuff. May want to turn back # on for further development. - $cflags.=" -nostdinc -ir crypto -ir engines -ir apps -I$include_path \\ + $cflags.=" -nostdinc -ir crypto -ir ssl -ir engines -ir apps -I$include_path \\ -msgstyle gcc -align 4 -processor pentium -char unsigned \\ -w on -w nolargeargs -w nopossible -w nounusedarg -w nounusedexpr \\ -w noimplicitconv -relax_pointers -nosyspath -maxerrors 20"; diff --git a/deps/openssl/openssl/util/ssleay.num b/deps/openssl/openssl/util/ssleay.num index dd21e95779d3d8..dd1c5e88239e3a 100755 --- a/deps/openssl/openssl/util/ssleay.num +++ b/deps/openssl/openssl/util/ssleay.num @@ -101,9 +101,9 @@ SSLv23_server_method 112 EXIST::FUNCTION:RSA SSLv2_client_method 113 EXIST::FUNCTION:RSA,SSL2 SSLv2_method 114 EXIST::FUNCTION:RSA,SSL2 SSLv2_server_method 115 EXIST::FUNCTION:RSA,SSL2 -SSLv3_client_method 116 EXIST::FUNCTION: -SSLv3_method 117 EXIST::FUNCTION: -SSLv3_server_method 118 EXIST::FUNCTION: +SSLv3_client_method 116 EXIST::FUNCTION:SSL3_METHOD +SSLv3_method 117 EXIST::FUNCTION:SSL3_METHOD +SSLv3_server_method 118 EXIST::FUNCTION:SSL3_METHOD d2i_SSL_SESSION 119 EXIST::FUNCTION: i2d_SSL_SESSION 120 EXIST::FUNCTION: BIO_f_ssl 121 EXIST::FUNCTION:BIO diff --git a/deps/uv/.gitignore b/deps/uv/.gitignore index 14a174adf63de7..e7f8f3f59fa7ee 100644 --- a/deps/uv/.gitignore +++ b/deps/uv/.gitignore @@ -34,9 +34,6 @@ vgcore.* Makefile Makefile.in -# Generated by dtrace(1) when doing an in-tree build. -/include/uv-dtrace.h - # Generated by gyp for android *.target.mk @@ -52,7 +49,10 @@ Makefile.in /test/run-benchmarks.dSYM *.sln +*.sln.cache +*.ncb *.vcproj +*.vcproj*.user *.vcxproj *.vcxproj.filters *.vcxproj.user diff --git a/deps/uv/.mailmap b/deps/uv/.mailmap index 34f5e4daf35007..3a350a4b9ac0b4 100644 --- a/deps/uv/.mailmap +++ b/deps/uv/.mailmap @@ -17,12 +17,8 @@ Keno Fischer Leonard Hecker Maciej Małecki Marc Schlaich -Rasmus Christian Pedersen -Rasmus Christian Pedersen -Rasmus Christian Pedersen -Rasmus Christian Pedersen +Rasmus Christian Pedersen Rasmus Christian Pedersen -Rasmus Pedersen Robert Mustacchi Ryan Dahl Ryan Emery diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index 72fa470dab518a..aa860db57bc83d 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -86,9 +86,7 @@ Nicholas Vavilov Miroslav Bajtoš Sean Silva Wynn Wilkes -Linus Mårtensson Andrei Sedoi -Navaneeth Kedaram Nambiathan Alex Crichton Brent Cook Brian Kaisner @@ -110,7 +108,6 @@ Yazhong Liu Sam Roberts River Tarnell Nathan Sweet -Luca Bruno Trevor Norris Oguz Bastemur Dylan Cali @@ -173,3 +170,11 @@ Yuri D'Elia Manos Nikolaidis Elijah Andrews Michael Ira Krufky +Helge Deller +Joey Geralnik +Tim Caswell +Logan Rosen +Kenneth Perry +John Marino +Alexey Melnichuk +Johan Bergström diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index 78600b78edd92e..a9d0829c917129 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,244 @@ +2015.01.15, Version 1.2.1 (Stable), 4ca78e989062a1099dc4b9ad182a98e8374134b1 + +Changes since version 1.2.0: + +* unix: remove unused dtrace file (Saúl Ibarra Corretgé) + +* test: skip TTY select test if /dev/tty can't be opened (Saúl Ibarra Corretgé) + +* doc: clarify the behavior of uv_tty_init (Saúl Ibarra Corretgé) + +* doc: clarify how uv_async_send behaves (Saúl Ibarra Corretgé) + +* build: make dist now generates a full tarball (Johan Bergström) + +* freebsd: make uv_exepath more resilient (Saúl Ibarra Corretgé) + +* unix: make setting the tty mode to the same value a no-op (Saúl Ibarra + Corretgé) + +* win,tcp: support uv_try_write (Bert Belder) + +* test: enable test-tcp-try-write on windows (Bert Belder) + +* win,tty: support uv_try_write (Bert Belder) + +* unix: set non-block mode in uv_{pipe,tcp,udp}_open (Ben Noordhuis) + + +2015.01.06, Version 1.2.0 (Stable), 09f25b13cd149c7981108fc1a75611daf1277f83 + +Changes since version 1.1.0: + +* linux: fix epoll_pwait() sigmask size calculation (Ben Noordhuis) + +* tty: implement binary I/O terminal mode (Yuri D'Elia) + +* test: fix spawn test with autotools build (Ben Noordhuis) + +* test: skip ipv6 tests when ipv6 is not supported (Ben Noordhuis) + +* common: move STATIC_ASSERT to uv-common.h (Alexey Melnichuk) + +* win/thread: store thread handle in a TLS slot (Alexey Melnichuk) + +* unix: fix ttl, multicast ttl and loop options on IPv6 (Saúl Ibarra Corretgé) + +* linux: fix support for preadv/pwritev-less kernels (Ben Noordhuis) + +* unix: make uv_exepath(size=0) return UV_EINVAL (Ben Noordhuis) + +* darwin: fix uv_exepath(smallbuf) UV_EPERM error (Ben Noordhuis) + +* openbsd: fix uv_exepath(smallbuf) UV_EINVAL error (Ben Noordhuis) + +* linux: fix uv_exepath(size=1) UV_EINVAL error (Ben Noordhuis) + +* sunos: preemptively fix uv_exepath(size=1) (Ben Noordhuis) + +* win: fix and clarify comments in winapi.h (Bert Belder) + +* win: make available NtQueryDirectoryFile (Bert Belder) + +* win: add definitions for directory information types (Bert Belder) + +* win: use NtQueryDirectoryFile to implement uv_fs_scandir (Bert Belder) + +* unix: don't unlink unix socket on bind error (Ben Noordhuis) + +* build: fix bad comment in autogen.sh (Ben Noordhuis) + +* build: add AC_PROG_LIBTOOL to configure.ac (Ben Noordhuis) + +* test: skip udp_options6 if there no IPv6 support (Saúl Ibarra Corretgé) + +* win: add definitions for MUI errors mingw lacks (Bert Belder) + +* build: enable warnings in autotools build (Ben Noordhuis) + +* build: remove -Wno-dollar-in-identifier-extension (Ben Noordhuis) + +* build: move flags from Makefile.am to configure.ac (Ben Noordhuis) + + +2015.01.06, Version 0.10.32 (Stable), 378de30c59aef5fdb6d130fa5cfcb0a68fce571c + +Changes since version 0.10.31: + +* linux: fix epoll_pwait() sigmask size calculation (Ben Noordhuis) + + +2014.12.25, Version 1.1.0 (Stable), 9572f3e74a167f59a8017e57ca3ebe91ffd88e18 + +Changes since version 1.0.2: + +* test: test that closing a poll handle doesn't corrupt the stack (Bert Belder) + +* win: fix compilation of tests (Marc Schlaich) + +* Revert "win: keep a reference to AFD_POLL_INFO in cancel poll" (Bert Belder) + +* win: avoid stack corruption when closing a poll handle (Bert Belder) + +* test: fix test-fs-file-loop on Windows (Bert Belder) + +* test: fix test-cwd-and-chdir (Bert Belder) + +* doc: indicate what version uv_loop_configure was added on (Saúl Ibarra + Corretgé) + +* doc: fix sphinx warning (Saúl Ibarra Corretgé) + +* test: skip spawn_setuid_setgid if we get EACCES (Saúl Ibarra Corretgé) + +* test: silence some Clang warnings (Saúl Ibarra Corretgé) + +* test: relax osx_select_many_fds (Saúl Ibarra Corretgé) + +* test: fix compilation warnings when building with Clang (Saúl Ibarra + Corretgé) + +* win: fix autotools build of tests (Luis Lavena) + +* gitignore: ignore Visual Studio files (Marc Schlaich) + +* win: set fallback message if FormatMessage fails (Marc Schlaich) + +* win: fall back to default language in uv_dlerror (Marc Schlaich) + +* test: improve compatibility for dlerror test (Marc Schlaich) + +* test: check dlerror is "no error" in no error case (Marc Schlaich) + +* unix: change uv_cwd not to return a trailing slash (Saúl Ibarra Corretgé) + +* test: fix cwd_and_chdir test on Unix (Saúl Ibarra Corretgé) + +* test: add uv_cwd output to platform_output test (Saúl Ibarra Corretgé) + +* build: fix dragonflybsd autotools build (John Marino) + +* win: scandir use 'ls' for formatting long strings (Kenneth Perry) + +* build: remove clang and gcc_version gyp defines (Ben Noordhuis) + +* unix, windows: don't treat uv_run_mode as a bitmask (Saúl Ibarra Corretgé) + +* unix, windows: fix UV_RUN_ONCE mode if progress was made (Saúl Ibarra + Corretgé) + + +2014.12.25, Version 0.10.31 (Stable), 4dbd27e2219069a6daa769fb37f98673b77b4261 + +Changes since version 0.10.30: + +* test: test that closing a poll handle doesn't corrupt the stack (Bert Belder) + +* win: fix compilation of tests (Marc Schlaich) + +* Revert "win: keep a reference to AFD_POLL_INFO in cancel poll" (Bert Belder) + +* win: avoid stack corruption when closing a poll handle (Bert Belder) + +* gitignore: ignore Visual Studio files (Marc Schlaich) + +* win: set fallback message if FormatMessage fails (Marc Schlaich) + +* win: fall back to default language in uv_dlerror (Marc Schlaich) + +* test: improve compatibility for dlerror test (Marc Schlaich) + +* test: check dlerror is "no error" in no error case (Marc Schlaich) + +* build: link against -pthread (Logan Rosen) + +* win: scandir use 'ls' for formatting long strings (Kenneth Perry) + + +2014.12.10, Version 1.0.2 (Stable), eec671f0059953505f9a3c9aeb7f9f31466dd7cd + +Changes since version 1.0.1: + +* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis) + +* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller) + +* doc: fix spelling (Joey Geralnik) + +* unix, windows: fix typos in comments (Joey Geralnik) + +* test: canonicalize test runner path (Ben Noordhuis) + +* test: fix compilation warnings (Saúl Ibarra Corretgé) + +* test: skip tty test if detected width and height are 0 (Saúl Ibarra Corretgé) + +* doc: update README with IRC channel (Saúl Ibarra Corretgé) + +* Revert "unix: use cfmakeraw() for setting raw TTY mode" (Ben Noordhuis) + +* doc: document how to get result of uv_fs_mkdtemp (Tim Caswell) + +* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis) + +* unix, windows: add uv_loop_configure() function (Ben Noordhuis) + +* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich) + +* test: raise fd limit for OSX select test (Saúl Ibarra Corretgé) + +* unix: remove overzealous assert in uv_read_stop (Saúl Ibarra Corretgé) + +* unix: reset the reading flag when a stream gets EOF (Saúl Ibarra Corretgé) + +* unix: stop reading if an error is produced (Saúl Ibarra Corretgé) + +* cleanup: remove all dead assignments (Maciej Małecki) + +* linux: return early if we have no interfaces (Maciej Małecki) + +* cleanup: remove a dead increment (Maciej Małecki) + + +2014.12.10, Version 0.10.30 (Stable), 5a63f5e9546dca482eeebc3054139b21f509f21f + +Changes since version 0.10.29: + +* linux: fix sigmask size arg in epoll_pwait() call (Ben Noordhuis) + +* linux: handle O_NONBLOCK != SOCK_NONBLOCK case (Helge Deller) + +* doc: update project links (Ben Noordhuis) + +* windows: fix compilation of tests (Marc Schlaich) + +* unix: add flag for blocking SIGPROF during poll (Ben Noordhuis) + +* unix, windows: add uv_loop_configure() function (Ben Noordhuis) + +* win: keep a reference to AFD_POLL_INFO in cancel poll (Marc Schlaich) + + 2014.11.27, Version 1.0.1 (Stable), 0a8e81374e861d425b56c45c8599595d848911d2 Changes since version 1.0.0: @@ -85,6 +326,17 @@ Changes since version 1.0.0-rc1: * windows: fix fs_write with nbufs > 1 and offset (Unknown W. Brackets) +2014.10.21, Version 0.10.29 (Stable), 2d728542d3790183417f8f122a110693cd85db14 + +Changes since version 0.10.28: + +* darwin: allocate enough space for select() hack (Fedor Indutny) + +* linux: try epoll_pwait if epoll_wait is missing (Michael Hudson-Doyle) + +* windows: map ERROR_INVALID_DRIVE to UV_ENOENT (Saúl Ibarra Corretgé) + + 2014.09.18, Version 1.0.0-rc1 (Unstable), 0c28bbf7b42882853d1799ab96ff68b07f7f8d49 Changes since version 0.11.29: @@ -273,6 +525,20 @@ Changes since version 0.11.26: * windows: relay TCP bind errors via ipc (Alexis Campailla) +2014.07.32, Version 0.10.28 (Stable), 9c14b616f5fb84bfd7d45707bab4bbb85894443e + +Changes since version 0.10.27: + +* windows: fix handling closed socket while poll handle is closing (Saúl Ibarra + Corretgé) + +* unix: return system error on EAI_SYSTEM (Saúl Ibarra Corretgé) + +* unix: fix bogus structure field name (Saúl Ibarra Corretgé) + +* darwin: invoke `mach_timebase_info` only once (Fedor Indutny) + + 2014.06.28, Version 0.11.26 (Unstable), 115281a1058c4034d5c5ccedacb667fe3f6327ea Changes since version 0.11.25: diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index 371df711d65633..e6af91d0726db8 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -34,6 +34,8 @@ libuv_la_SOURCES = src/fs-poll.c \ src/version.c if SUNOS +# Can't be turned into a CC_CHECK_CFLAGS in configure.ac, it makes compilers +# on other platforms complain that the argument is unused during compilation. libuv_la_CFLAGS += -pthread endif @@ -81,7 +83,6 @@ else # WINNT include_HEADERS += include/uv-unix.h AM_CPPFLAGS += -I$(top_srcdir)/src/unix -libuv_la_CFLAGS += -g --std=gnu89 -pedantic -Wall -Wextra -Wno-unused-parameter libuv_la_SOURCES += src/unix/async.c \ src/unix/atomic-ops.h \ src/unix/core.c \ @@ -107,7 +108,24 @@ libuv_la_SOURCES += src/unix/async.c \ endif # WINNT EXTRA_DIST = test/fixtures/empty_file \ - test/fixtures/load_error.node + test/fixtures/load_error.node \ + include \ + test \ + docs \ + img \ + samples \ + android-configure \ + CONTRIBUTING.md \ + LICENSE \ + README.md \ + checksparse.sh \ + vcbuild.bat \ + Makefile.mingw \ + common.gypi \ + gyp_uv.py \ + uv.gyp + + TESTS = test/run-tests check_PROGRAMS = test/run-tests @@ -159,6 +177,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-loop-close.c \ test/test-loop-stop.c \ test/test-loop-time.c \ + test/test-loop-configure.c \ test/test-multiple-listen.c \ test/test-mutexes.c \ test/test-osx-select.c \ @@ -172,6 +191,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-pipe-close-stdout-read-stdin.c \ test/test-platform-output.c \ test/test-poll-close.c \ + test/test-poll-close-doesnt-corrupt-stack.c \ test/test-poll-closesocket.c \ test/test-poll.c \ test/test-process-title.c \ @@ -274,7 +294,6 @@ endif if DRAGONFLY include_HEADERS += include/uv-bsd.h -libuv_la_SOURCES += src/unix/kqueue.c src/unix/freebsd.c endif if FREEBSD diff --git a/deps/uv/README.md b/deps/uv/README.md index 7fc7cfbd063ed4..a267f0d5b527e5 100644 --- a/deps/uv/README.md +++ b/deps/uv/README.md @@ -36,12 +36,13 @@ used by [Luvit](http://luvit.io/), [Julia](http://julialang.org/), ## Versioning Starting with version 1.0.0 libuv follows the [semantic versioning](http://semver.org/) -scheme. The API change and backwards compatiblity rules are those indicated by +scheme. The API change and backwards compatibility rules are those indicated by SemVer. libuv will keep a stable ABI across major releases. ## Community * [Mailing list](http://groups.google.com/group/libuv) + * [IRC chatroom (#libuv@irc.freenode.org)](http://webchat.freenode.net?channels=libuv&uio=d4) ## Documentation diff --git a/deps/uv/autogen.sh b/deps/uv/autogen.sh index 751b4f5562493a..0574778a4e1040 100755 --- a/deps/uv/autogen.sh +++ b/deps/uv/autogen.sh @@ -33,7 +33,7 @@ UV_EXTRA_AUTOMAKE_FLAGS= if test "$automake_version_major" -gt 1 || \ test "$automake_version_major" -eq 1 && \ test "$automake_version_minor" -gt 11; then - # serial-tests is available in v0.12 and newer. + # serial-tests is available in v1.12 and newer. UV_EXTRA_AUTOMAKE_FLAGS="$UV_EXTRA_AUTOMAKE_FLAGS serial-tests" fi echo "m4_define([UV_EXTRA_AUTOMAKE_FLAGS], [$UV_EXTRA_AUTOMAKE_FLAGS])" \ diff --git a/deps/uv/common.gypi b/deps/uv/common.gypi index a8e2ef44c6131d..ecf9475234f3da 100644 --- a/deps/uv/common.gypi +++ b/deps/uv/common.gypi @@ -6,8 +6,6 @@ 'uv_library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds 'component%': 'static_library', # NB. these names match with what V8 expects 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way - 'gcc_version%': 'unknown', - 'clang%': 0, }, 'target_defaults': { @@ -158,7 +156,7 @@ 'cflags': [ '-pthread' ], 'ldflags': [ '-pthread' ], }], - [ 'visibility=="hidden" and (clang==1 or gcc_version >= 40)', { + [ 'visibility=="hidden"', { 'cflags': [ '-fvisibility=hidden' ], }], ], diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index 247e42bd272679..d765894e115aca 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.0.1], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.2.1], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) @@ -24,9 +24,16 @@ AC_ENABLE_SHARED AC_ENABLE_STATIC AC_PROG_CC AM_PROG_CC_C_O -CC_CHECK_CFLAGS_APPEND([-Wno-dollar-in-identifier-extension]) +CC_CHECK_CFLAGS_APPEND([-g]) +CC_CHECK_CFLAGS_APPEND([-std=gnu89]) +CC_CHECK_CFLAGS_APPEND([-pedantic]) +CC_CHECK_CFLAGS_APPEND([-Wall]) +CC_CHECK_CFLAGS_APPEND([-Wextra]) +CC_CHECK_CFLAGS_APPEND([-Wno-unused-parameter]) # AM_PROG_AR is not available in automake v0.11 but it's essential in v0.12. m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +# autoconf complains if AC_PROG_LIBTOOL precedes AM_PROG_AR. +AC_PROG_LIBTOOL m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) LT_INIT # TODO(bnoordhuis) Check for -pthread vs. -pthreads diff --git a/deps/uv/docs/make.bat b/deps/uv/docs/make.bat index 10eb94b013b791..aa7089ab5cf26a 100644 --- a/deps/uv/docs/make.bat +++ b/deps/uv/docs/make.bat @@ -1,243 +1,243 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set SRCDIR=src -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %SRCDIR% -set I18NSPHINXOPTS=%SPHINXOPTS% %SRCDIR% -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\libuv.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\libuv.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set SRCDIR=src +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% %SRCDIR% +set I18NSPHINXOPTS=%SPHINXOPTS% %SRCDIR% +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\libuv.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\libuv.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/deps/uv/docs/src/async.rst b/deps/uv/docs/src/async.rst index 7afc92a71bcceb..5c400458244a86 100644 --- a/deps/uv/docs/src/async.rst +++ b/deps/uv/docs/src/async.rst @@ -48,9 +48,10 @@ API .. warning:: libuv will coalesce calls to :c:func:`uv_async_send`, that is, not every call to it will - yield an execution of the callback, the only guarantee is that it will be called at least - once. Thus, calling this function may not wakeup the event loop if it was already called - previously within a short period of time. + yield an execution of the callback. For example: if :c:func:`uv_async_send` is called 5 + times in a row before the callback is called, the callback will only be called once. If + :c:func:`uv_async_send` is called again after the callback was called, it will be called + again. .. seealso:: The :c:type:`uv_handle_t` API functions also apply. diff --git a/deps/uv/docs/src/conf.py b/deps/uv/docs/src/conf.py index 9ec9ec2c98ddff..f614fc5b434b24 100644 --- a/deps/uv/docs/src/conf.py +++ b/deps/uv/docs/src/conf.py @@ -261,7 +261,7 @@ def get_libuv_version(): # dir menu entry, description, category) texinfo_documents = [ ('index', 'libuv', u'libuv API documentation', - u'libuv contributors', 'libuv', 'Cross-platform asychronous I/O', + u'libuv contributors', 'libuv', 'Cross-platform asynchronous I/O', 'Miscellaneous'), ] diff --git a/deps/uv/docs/src/design.rst b/deps/uv/docs/src/design.rst index 803a4219835003..63141bedf58438 100644 --- a/deps/uv/docs/src/design.rst +++ b/deps/uv/docs/src/design.rst @@ -8,7 +8,7 @@ libuv is cross-platform support library which was originally written for NodeJS. around the event-driven asynchronous I/O model. The library provides much more than simply abstraction over different I/O polling mechanisms: -'handles' and 'streams' provde a high level abstraction for sockets and other entities; +'handles' and 'streams' provide a high level abstraction for sockets and other entities; cross-platform file I/O and threading functionality is also provided, amongst other things. Here is a diagram illustrating the different parts that compose libuv and what subsystem they @@ -42,7 +42,7 @@ operations, and it's meant to be tied to a single thread. One can run multiple e as long as each runs in a different thread. The libuv event loop (or any other API involving the loop or handles, for that matter) **is not thread-safe** except stated otherwise. -The event loop follows the rather usual single threaded asynchronous I/O approah: all (network) +The event loop follows the rather usual single threaded asynchronous I/O approach: all (network) I/O is performed on non-blocking sockets which are polled using the best mechanism available on the given platform: epoll on Linux, kqueue on OSX and other BSDs, event ports on SunOS and IOCP on Windows. As part of a loop iteration the loop will block waiting for I/O activity on sockets @@ -104,7 +104,7 @@ stages of a loop iteration: #. Iteration ends. If the loop was run with ``UV_RUN_NOWAIT`` or ``UV_RUN_ONCE`` modes the iteration is ended and :c:func:`uv_run` will return. If the loop was run with ``UV_RUN_DEFAULT`` - it will contionue from the start if it's asill *alive*, otherwise it will also end. + it will continue from the start if it's still *alive*, otherwise it will also end. .. important:: diff --git a/deps/uv/docs/src/dll.rst b/deps/uv/docs/src/dll.rst index 3afa31f39d0772..3fb11e192db411 100644 --- a/deps/uv/docs/src/dll.rst +++ b/deps/uv/docs/src/dll.rst @@ -4,7 +4,7 @@ Shared library handling ======================= -libuv prodives cross platform utilities for loading shared libraries and +libuv provides cross platform utilities for loading shared libraries and retrieving symbols from them, using the following API. diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index 27d92d0b45319b..cd535f756fc1c9 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -191,6 +191,9 @@ API Equivalent to ``mkdtemp(3)``. + .. note:: + The result can be found as a null terminated string at `req->path`. + .. c:function:: int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) Equivalent to ``rmdir(2)``. @@ -258,7 +261,7 @@ API * ``UV_FS_SYMLINK_DIR``: indicates that `path` points to a directory. * ``UV_FS_SYMLINK_JUNCTION``: request that the symlink is created - using junktion points. + using junction points. .. c:function:: int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) diff --git a/deps/uv/docs/src/fs_event.rst b/deps/uv/docs/src/fs_event.rst index eeb6bfbcb9916d..9bc9939fc2cea8 100644 --- a/deps/uv/docs/src/fs_event.rst +++ b/deps/uv/docs/src/fs_event.rst @@ -95,7 +95,7 @@ API Get the path being monitored by the handle. The buffer must be preallocated by the user. Returns 0 on success or an error code < 0 in case of failure. - On sucess, `buf` will contain the path and `len` its length. If the buffer + On success, `buf` will contain the path and `len` its length. If the buffer is not big enough UV_ENOBUFS will be returned and len will be set to the required size. diff --git a/deps/uv/docs/src/fs_poll.rst b/deps/uv/docs/src/fs_poll.rst index 7459aac07b8217..df31053521431c 100644 --- a/deps/uv/docs/src/fs_poll.rst +++ b/deps/uv/docs/src/fs_poll.rst @@ -62,7 +62,7 @@ API Get the path being monitored by the handle. The buffer must be preallocated by the user. Returns 0 on success or an error code < 0 in case of failure. - On sucess, `buf` will contain the path and `len` its length. If the buffer + On success, `buf` will contain the path and `len` its length. If the buffer is not big enough UV_ENOBUFS will be returned and len will be set to the required size. diff --git a/deps/uv/docs/src/loop.rst b/deps/uv/docs/src/loop.rst index c63ef7eb67cd02..d347534bfc77cc 100644 --- a/deps/uv/docs/src/loop.rst +++ b/deps/uv/docs/src/loop.rst @@ -50,6 +50,25 @@ API Initializes the given `uv_loop_t` structure. +.. c:function:: int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...) + + .. versionadded:: 1.0.2 + + Set additional loop options. You should normally call this before the + first call to :c:func:`uv_run` unless mentioned otherwise. + + Returns 0 on success or a UV_E* error code on failure. Be prepared to + handle UV_ENOSYS; it means the loop option is not supported by the platform. + + Supported options: + + - UV_LOOP_BLOCK_SIGNAL: Block a signal when polling for new events. The + second argument to :c:func:`uv_loop_configure` is the signal number. + + This operation is currently only implemented for SIGPROF signals, + to suppress unnecessary wakeups when using a sampling profiler. + Requesting other signals will fail with UV_EINVAL. + .. c:function:: int uv_loop_close(uv_loop_t* loop) Closes all internal loop resources. This function must only be called once @@ -59,7 +78,7 @@ API .. c:function:: uv_loop_t* uv_default_loop(void) Returns the initialized default loop. It may return NULL in case of - allocation failture. + allocation failure. .. c:function:: int uv_run(uv_loop_t* loop, uv_run_mode mode) diff --git a/deps/uv/docs/src/migration_010_100.rst b/deps/uv/docs/src/migration_010_100.rst index 83b3865567570c..bb6ac1a8092bc7 100644 --- a/deps/uv/docs/src/migration_010_100.rst +++ b/deps/uv/docs/src/migration_010_100.rst @@ -80,7 +80,7 @@ In libuv 0.10 Unix used a threadpool which defaulted to 4 threads, while Windows threads per process. In 1.0, we unified both implementations, so Windows now uses the same implementation Unix -does. The threadppol size can be set by exporting the ``UV_THREADPOOL_SIZE`` environment +does. The threadpool size can be set by exporting the ``UV_THREADPOOL_SIZE`` environment variable. See :c:ref:`threadpool`. @@ -95,7 +95,7 @@ In libuv 0.10 the callback had to return a filled :c:type:`uv_buf_t` by value: return uv_buf_init(malloc(size), size); } -In libuv 1.0 a pointer to a buffer is passed to the callbck, which the user +In libuv 1.0 a pointer to a buffer is passed to the callback, which the user needs to fill: :: @@ -200,7 +200,7 @@ for such function looked like this: ... } -In libuv 1.0, `uv_read2_start` was removed, and the user needs to check if there are penging +In libuv 1.0, `uv_read2_start` was removed, and the user needs to check if there are pending handles using :c:func:`uv_pipe_pending_count` and :c:func:`uv_pipe_pending_type` while in the read callback: @@ -222,7 +222,7 @@ Extracting the file descriptor out of a handle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ While it wasn't supported by the API, users often accessed the libuv internals in -order to get access to the file descript of a TCP handle, for example. +order to get access to the file descriptor of a TCP handle, for example. :: diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 1e1125ad6b06e6..10c349e9b736f3 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -1,10 +1,10 @@ .. _misc: -Miscelaneous utilities -====================== +Miscellaneous utilities +======================= -This section contains miscelaneous functions that don't really belong in any +This section contains miscellaneous functions that don't really belong in any other section. @@ -186,11 +186,11 @@ API .. c:function:: int uv_ip4_name(const struct sockaddr_in* src, char* dst, size_t size) - Convert a binary structure containing an IPv4 addres to a string. + Convert a binary structure containing an IPv4 address to a string. .. c:function:: int uv_ip6_name(const struct sockaddr_in6* src, char* dst, size_t size) - Convert a binary structure containing an IPv6 addres to a string. + Convert a binary structure containing an IPv6 address to a string. .. c:function:: int uv_inet_ntop(int af, const void* src, char* dst, size_t size) .. c:function:: int uv_inet_pton(int af, const char* src, void* dst) @@ -207,6 +207,10 @@ API Gets the current working directory. + .. versionchanged:: 1.1.0 + + On Unix the path no longer ends in a slash. + .. c:function:: int uv_chdir(const char* dir) Changes the current working directory. diff --git a/deps/uv/docs/src/pipe.rst b/deps/uv/docs/src/pipe.rst index 9a4a19340b893d..9fbb1f6c20919a 100644 --- a/deps/uv/docs/src/pipe.rst +++ b/deps/uv/docs/src/pipe.rst @@ -38,8 +38,7 @@ API Open an existing file descriptor or HANDLE as a pipe. - .. note:: - The user is responsible for setting the dile descriptor in non-blocking mode. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. .. c:function:: int uv_pipe_bind(uv_pipe_t* handle, const char* name) diff --git a/deps/uv/docs/src/stream.rst b/deps/uv/docs/src/stream.rst index 44dccbe94267c6..2c669cf0418fcd 100644 --- a/deps/uv/docs/src/stream.rst +++ b/deps/uv/docs/src/stream.rst @@ -62,7 +62,7 @@ Data types Callback called when a stream server has received an incoming connection. The user can accept the connection by calling :c:func:`uv_accept`. - `status` will de 0 in case of success, < 0 otherwise. + `status` will be 0 in case of success, < 0 otherwise. Public members @@ -200,7 +200,7 @@ API When blocking mode is enabled all writes complete synchronously. The interface remains unchanged otherwise, e.g. completion or failure of the operation will still be reported through a callback which is made - asychronously. + asynchronously. .. warning:: Relying too much on this API is not recommended. It is likely to change diff --git a/deps/uv/docs/src/tcp.rst b/deps/uv/docs/src/tcp.rst index 2c1001b531fde2..8baedde86c5c15 100644 --- a/deps/uv/docs/src/tcp.rst +++ b/deps/uv/docs/src/tcp.rst @@ -36,9 +36,7 @@ API Open an existing file descriptor or SOCKET as a TCP handle. - .. note:: - The user is responsible for setting the file descriptor in - non-blocking mode. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. .. c:function:: int uv_tcp_nodelay(uv_tcp_t* handle, int enable) diff --git a/deps/uv/docs/src/threadpool.rst b/deps/uv/docs/src/threadpool.rst index 875bb36aeab026..66ff53e230599c 100644 --- a/deps/uv/docs/src/threadpool.rst +++ b/deps/uv/docs/src/threadpool.rst @@ -5,7 +5,7 @@ Thread pool work scheduling =========================== libuv provides a threadpool which can be used to run user code and get notified -in the loop thread. This thread pool is internally used to run al filesystem +in the loop thread. This thread pool is internally used to run all filesystem operations, as well as getaddrinfo and getnameinfo requests. Its default size is 4, but it can be changed at startup time by setting the diff --git a/deps/uv/docs/src/tty.rst b/deps/uv/docs/src/tty.rst index 8cb006632038ba..6c20c84bf75e58 100644 --- a/deps/uv/docs/src/tty.rst +++ b/deps/uv/docs/src/tty.rst @@ -16,6 +16,24 @@ Data types TTY handle type. +.. c:type:: uv_tty_mode_t + + .. versionadded:: 1.2.0 + + TTY mode type: + + :: + + typedef enum { + /* Initial/normal terminal mode */ + UV_TTY_MODE_NORMAL, + /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */ + UV_TTY_MODE_RAW, + /* Binary-safe I/O mode for IPC (Unix-only) */ + UV_TTY_MODE_IO + } uv_tty_mode_t; + + Public members ^^^^^^^^^^^^^^ @@ -40,12 +58,20 @@ API `readable`, specifies if you plan on calling :c:func:`uv_read_start` with this stream. stdin is readable, stdout is not. + On Unix this function will try to open ``/dev/tty`` and use it if the passed file + descriptor refers to a TTY. This lets libuv put the tty in non-blocking mode + without affecting other processes that share the tty. + .. note:: - TTY streams which are not readable have blocking writes. + If opening ``/dev/tty`` fails, libuv falls back to blocking writes for non-readable + TTY streams. + +.. c:function:: int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode) -.. c:function:: int uv_tty_set_mode(uv_tty_t*, int mode) + .. versionchanged:: 1.2.0: the mode is specified as a :c:type:`uv_tty_mode_t` + value. - Set the TTY mode. 0 for normal, 1 for raw. + Set the TTY using the specified terminal mode. .. c:function:: int uv_tty_reset_mode(void) diff --git a/deps/uv/docs/src/udp.rst b/deps/uv/docs/src/udp.rst index 175ce07a2dbd19..9c4aa2102bdcfc 100644 --- a/deps/uv/docs/src/udp.rst +++ b/deps/uv/docs/src/udp.rst @@ -120,6 +120,8 @@ API In other words, other datagram-type sockets like raw sockets or netlink sockets can also be passed to this function. + .. versionchanged:: 1.2.1 the file descriptor is set to non-blocking mode. + .. c:function:: int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, unsigned int flags) Bind the UDP handle to an IP address and port. diff --git a/deps/uv/gyp_uv.py b/deps/uv/gyp_uv.py index f5afc6da2d6b0b..0491ff873f1af1 100755 --- a/deps/uv/gyp_uv.py +++ b/deps/uv/gyp_uv.py @@ -1,9 +1,7 @@ #!/usr/bin/env python -import glob -import platform import os -import subprocess +import platform import sys try: @@ -35,16 +33,6 @@ def host_arch(): return machine # Return as-is and hope for the best. -def compiler_version(): - proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE) - is_clang = 'clang' in proc.communicate()[0].split('\n')[0] - proc = subprocess.Popen(CC.split() + ['-dumpversion'], stdout=subprocess.PIPE) - version = proc.communicate()[0].split('.') - version = map(int, version[:2]) - version = tuple(version) - return (version, is_clang) - - def run_gyp(args): rc = gyp.main(args) if rc != 0: @@ -85,9 +73,6 @@ def run_gyp(args): if 'eclipse' not in args and 'ninja' not in args: args.extend(['-Goutput_dir=' + output_dir]) args.extend(['--generator-output', output_dir]) - (major, minor), is_clang = compiler_version() - args.append('-Dgcc_version=%d' % (10 * major + minor)) - args.append('-Dclang=%d' % int(is_clang)) if not any(a.startswith('-Dhost_arch=') for a in args): args.append('-Dhost_arch=%s' % host_arch()) diff --git a/deps/uv/include/uv-version.h b/deps/uv/include/uv-version.h index 889abffca30897..398f0948c3468d 100644 --- a/deps/uv/include/uv-version.h +++ b/deps/uv/include/uv-version.h @@ -31,7 +31,7 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 0 +#define UV_VERSION_MINOR 2 #define UV_VERSION_PATCH 1 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 7f4fa6dd8ad8de..a2332504ca9551 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -229,6 +229,9 @@ typedef struct uv_cpu_info_s uv_cpu_info_t; typedef struct uv_interface_address_s uv_interface_address_t; typedef struct uv_dirent_s uv_dirent_t; +typedef enum { + UV_LOOP_BLOCK_SIGNAL +} uv_loop_option; typedef enum { UV_RUN_DEFAULT = 0, @@ -257,6 +260,7 @@ UV_EXTERN uv_loop_t* uv_loop_new(void); UV_EXTERN void uv_loop_delete(uv_loop_t*); UV_EXTERN size_t uv_loop_size(void); UV_EXTERN int uv_loop_alive(const uv_loop_t* loop); +UV_EXTERN int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...); UV_EXTERN int uv_run(uv_loop_t*, uv_run_mode mode); UV_EXTERN void uv_stop(uv_loop_t*); @@ -624,11 +628,30 @@ struct uv_tty_s { UV_TTY_PRIVATE_FIELDS }; +typedef enum { + /* Initial/normal terminal mode */ + UV_TTY_MODE_NORMAL, + /* Raw input mode (On Windows, ENABLE_WINDOW_INPUT is also enabled) */ + UV_TTY_MODE_RAW, + /* Binary-safe I/O mode for IPC (Unix-only) */ + UV_TTY_MODE_IO +} uv_tty_mode_t; + UV_EXTERN int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable); -UV_EXTERN int uv_tty_set_mode(uv_tty_t*, int mode); +UV_EXTERN int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode); UV_EXTERN int uv_tty_reset_mode(void); UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height); +#ifdef __cplusplus +} /* extern "C" */ + +inline int uv_tty_set_mode(uv_tty_t* handle, int mode) { + return uv_tty_set_mode(handle, static_cast(mode)); +} + +extern "C" { +#endif + UV_EXTERN uv_handle_type uv_guess_handle(uv_file file); /* diff --git a/deps/uv/m4/dtrace.m4 b/deps/uv/m4/dtrace.m4 deleted file mode 100644 index 09f7dc89cf5620..00000000000000 --- a/deps/uv/m4/dtrace.m4 +++ /dev/null @@ -1,66 +0,0 @@ -dnl Copyright (C) 2009 Sun Microsystems -dnl This file is free software; Sun Microsystems -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl --------------------------------------------------------------------------- -dnl Macro: PANDORA_ENABLE_DTRACE -dnl --------------------------------------------------------------------------- -AC_DEFUN([PANDORA_ENABLE_DTRACE],[ - AC_ARG_ENABLE([dtrace], - [AS_HELP_STRING([--disable-dtrace], - [enable DTrace USDT probes. @<:@default=yes@:>@])], - [ac_cv_enable_dtrace="$enableval"], - [ac_cv_enable_dtrace="yes"]) - - AS_IF([test "$ac_cv_enable_dtrace" = "yes"],[ - AC_CHECK_PROGS([DTRACE], [dtrace]) - AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[ - - AC_CACHE_CHECK([if dtrace works],[ac_cv_dtrace_works],[ - cat >conftest.d <<_ACEOF -provider Example { - probe increment(int); -}; -_ACEOF - $DTRACE -h -o conftest.h -s conftest.d 2>/dev/zero - AS_IF([test $? -eq 0],[ac_cv_dtrace_works=yes], - [ac_cv_dtrace_works=no]) - rm -f conftest.h conftest.d - ]) - AS_IF([test "x$ac_cv_dtrace_works" = "xyes"],[ - AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support]) - AC_CACHE_CHECK([if dtrace should instrument object files], - [ac_cv_dtrace_needs_objects],[ - dnl DTrace on MacOSX does not use -G option - cat >conftest.d <<_ACEOF -provider Example { - probe increment(int); -}; -_ACEOF - cat > conftest.c <<_ACEOF -#include "conftest.h" -void foo() { - EXAMPLE_INCREMENT(1); -} -_ACEOF - $DTRACE -h -o conftest.h -s conftest.d 2>/dev/zero - $CC -c -o conftest.o conftest.c - $DTRACE -G -o conftest.d.o -s conftest.d conftest.o 2>/dev/zero - AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes], - [ac_cv_dtrace_needs_objects=no]) - rm -f conftest.d.o conftest.d conftest.h conftest.o conftest.c - ]) - ]) - AC_SUBST(DTRACEFLAGS) dnl TODO: test for -G on OSX - ac_cv_have_dtrace=yes - ])]) - -AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_dtrace_works" = "xyes"]) -AM_CONDITIONAL([DTRACE_NEEDS_OBJECTS], - [test "x$ac_cv_dtrace_needs_objects" = "xyes"]) - -]) -dnl --------------------------------------------------------------------------- -dnl End Macro: PANDORA_ENABLE_DTRACE -dnl --------------------------------------------------------------------------- diff --git a/deps/uv/src/unix/aix.c b/deps/uv/src/unix/aix.c index eb901113451d9f..0c5d1f4b508453 100644 --- a/deps/uv/src/unix/aix.c +++ b/deps/uv/src/unix/aix.c @@ -151,7 +151,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { * Could maybe mod if we knew for sure no events are removed, but * content of w->events is handled above as not reliable (falls back) * so may require a pollset_query() which would have to be pretty cheap - * compared to a PS_DELETE to be worth optimising. Alternatively, could + * compared to a PS_DELETE to be worth optimizing. Alternatively, could * lazily remove events, squelching them in the mean time. */ pc.cmd = PS_DELETE; if (pollset_ctl(loop->backend_fd, &pc, 1)) { @@ -294,7 +294,7 @@ int uv_exepath(char* buffer, size_t* size) { int fd; char **argv; - if ((buffer == NULL) || (size == NULL)) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid()); @@ -332,7 +332,7 @@ int uv_exepath(char* buffer, size_t* size) { res = readlink(symlink, temp_buffer, PATH_MAX-1); /* if readlink fails, it is a normal file just copy symlink to the - * outbut buffer. + * output buffer. */ if (res < 0) { assert(*size > strlen(symlink)); diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index e6a076831ccf4a..6f284ffa7aea31 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -74,7 +74,7 @@ #include #endif -static void uv__run_pending(uv_loop_t* loop); +static int uv__run_pending(uv_loop_t* loop); /* Verify that uv_buf_t is ABI-compatible with struct iovec. */ STATIC_ASSERT(sizeof(uv_buf_t) == sizeof(struct iovec)); @@ -304,6 +304,7 @@ int uv_loop_alive(const uv_loop_t* loop) { int uv_run(uv_loop_t* loop, uv_run_mode mode) { int timeout; int r; + int ran_pending; r = uv__loop_alive(loop); if (!r) @@ -312,12 +313,12 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) { while (r != 0 && loop->stop_flag == 0) { uv__update_time(loop); uv__run_timers(loop); - uv__run_pending(loop); + ran_pending = uv__run_pending(loop); uv__run_idle(loop); uv__run_prepare(loop); timeout = 0; - if ((mode & UV_RUN_NOWAIT) == 0) + if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT) timeout = uv_backend_timeout(loop); uv__io_poll(loop, timeout); @@ -325,7 +326,7 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) { uv__run_closing_handles(loop); if (mode == UV_RUN_ONCE) { - /* UV_RUN_ONCE implies forward progess: at least one callback must have + /* UV_RUN_ONCE implies forward progress: at least one callback must have * been invoked when it returns. uv__io_poll() can return without doing * I/O (meaning: no callbacks) when its timeout expires - which means we * have pending timers that satisfy the forward progress constraint. @@ -338,8 +339,7 @@ int uv_run(uv_loop_t* loop, uv_run_mode mode) { } r = uv__loop_alive(loop); - - if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT)) + if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT) break; } @@ -635,6 +635,11 @@ int uv_cwd(char* buffer, size_t* size) { return -errno; *size = strlen(buffer); + if (*size > 1 && buffer[*size - 1] == '/') { + buffer[*size-1] = '\0'; + (*size)--; + } + return 0; } @@ -689,10 +694,13 @@ int uv_fileno(const uv_handle_t* handle, uv_os_fd_t* fd) { } -static void uv__run_pending(uv_loop_t* loop) { +static int uv__run_pending(uv_loop_t* loop) { QUEUE* q; uv__io_t* w; + if (QUEUE_EMPTY(&loop->pending_queue)) + return 0; + while (!QUEUE_EMPTY(&loop->pending_queue)) { q = QUEUE_HEAD(&loop->pending_queue); QUEUE_REMOVE(q); @@ -701,6 +709,8 @@ static void uv__run_pending(uv_loop_t* loop) { w = QUEUE_DATA(q, uv__io_t, pending_queue); w->cb(loop, w, UV__POLLOUT); } + + return 1; } diff --git a/deps/uv/src/unix/darwin.c b/deps/uv/src/unix/darwin.c index c9a45edee42520..651545f85ee3d1 100644 --- a/deps/uv/src/unix/darwin.c +++ b/deps/uv/src/unix/darwin.c @@ -65,28 +65,33 @@ uint64_t uv__hrtime(uv_clocktype_t type) { int uv_exepath(char* buffer, size_t* size) { - uint32_t usize; - int result; - char* path; - char* fullpath; + /* realpath(exepath) may be > PATH_MAX so double it to be on the safe side. */ + char abspath[PATH_MAX * 2 + 1]; + char exepath[PATH_MAX + 1]; + uint32_t exepath_size; + size_t abspath_size; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; - usize = *size; - result = _NSGetExecutablePath(buffer, &usize); - if (result) return result; + exepath_size = sizeof(exepath); + if (_NSGetExecutablePath(exepath, &exepath_size)) + return -EIO; - path = malloc(2 * PATH_MAX); - fullpath = realpath(buffer, path); - if (fullpath == NULL) { - SAVE_ERRNO(free(path)); + if (realpath(exepath, abspath) != abspath) return -errno; - } - strncpy(buffer, fullpath, *size); - free(fullpath); - *size = strlen(buffer); + abspath_size = strlen(abspath); + if (abspath_size == 0) + return -EIO; + + *size -= 1; + if (*size > abspath_size) + *size = abspath_size; + + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; + return 0; } diff --git a/deps/uv/src/unix/freebsd.c b/deps/uv/src/unix/freebsd.c index d59e3773a557ca..d87b74b9bca028 100644 --- a/deps/uv/src/unix/freebsd.c +++ b/deps/uv/src/unix/freebsd.c @@ -75,10 +75,11 @@ uint64_t uv__hrtime(uv_clocktype_t type) { int uv_exepath(char* buffer, size_t* size) { + char abspath[PATH_MAX * 2 + 1]; int mib[4]; - size_t cb; + size_t abspath_size; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; #ifdef __DragonFly__ @@ -93,10 +94,19 @@ int uv_exepath(char* buffer, size_t* size) { mib[3] = -1; #endif - cb = *size; - if (sysctl(mib, 4, buffer, &cb, NULL, 0)) + abspath_size = sizeof abspath;; + if (sysctl(mib, 4, abspath, &abspath_size, NULL, 0)) return -errno; - *size = strlen(buffer); + + assert(abspath_size > 0); + abspath_size -= 1; + *size -= 1; + + if (*size > abspath_size) + *size = abspath_size; + + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; return 0; } diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index 65fd01230b3e09..e7eee2f9abc4ed 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -35,8 +35,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -48,30 +50,12 @@ defined(__OpenBSD__) || \ defined(__NetBSD__) # define HAVE_PREADV 1 -#elif defined(__linux__) -# include -# if defined(__GLIBC_PREREQ) -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) && \ - __GLIBC_PREREQ(2,10) -# define HAVE_PREADV 1 -# else -# define HAVE_PREADV 0 -# endif -# else -# define HAVE_PREADV 0 -# endif #else # define HAVE_PREADV 0 #endif #if defined(__linux__) || defined(__sun) # include -#elif defined(__APPLE__) || defined(__FreeBSD__) -# include -#endif - -#if HAVE_PREADV || defined(__APPLE__) -# include #endif #define INIT(type) \ @@ -219,6 +203,9 @@ static ssize_t uv__fs_mkdtemp(uv_fs_t* req) { static ssize_t uv__fs_read(uv_fs_t* req) { +#if defined(__linux__) + static int no_preadv; +#endif ssize_t result; #if defined(_AIX) @@ -245,16 +232,12 @@ static ssize_t uv__fs_read(uv_fs_t* req) { result = preadv(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); #else # if defined(__linux__) - static int no_preadv; - if (no_preadv) + if (no_preadv) retry: # endif { off_t nread; size_t index; -# if defined(__linux__) - retry: -# endif nread = 0; index = 0; result = 1; @@ -578,6 +561,9 @@ static ssize_t uv__fs_utime(uv_fs_t* req) { static ssize_t uv__fs_write(uv_fs_t* req) { +#if defined(__linux__) + static int no_pwritev; +#endif ssize_t r; /* Serialize writes on OS X, concurrent write() and pwrite() calls result in @@ -603,16 +589,12 @@ static ssize_t uv__fs_write(uv_fs_t* req) { r = pwritev(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); #else # if defined(__linux__) - static int no_pwritev; - if (no_pwritev) + if (no_pwritev) retry: # endif { off_t written; size_t index; -# if defined(__linux__) - retry: -# endif written = 0; index = 0; r = 0; diff --git a/deps/uv/src/unix/getaddrinfo.c b/deps/uv/src/unix/getaddrinfo.c index f6c2de9b438773..faf9add9285e14 100644 --- a/deps/uv/src/unix/getaddrinfo.c +++ b/deps/uv/src/unix/getaddrinfo.c @@ -182,10 +182,8 @@ int uv_getaddrinfo(uv_loop_t* loop, len += service_len; } - if (hostname) { + if (hostname) req->hostname = memcpy(buf + len, hostname, hostname_len); - len += hostname_len; - } uv__work_submit(loop, &req->work_req, diff --git a/deps/uv/src/unix/internal.h b/deps/uv/src/unix/internal.h index b94508cba5932d..03a9226101dd7b 100644 --- a/deps/uv/src/unix/internal.h +++ b/deps/uv/src/unix/internal.h @@ -52,9 +52,6 @@ # include #endif -#define STATIC_ASSERT(expr) \ - void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)]) - #define ACCESS_ONCE(type, var) \ (*(volatile type*) &(var)) @@ -146,6 +143,11 @@ enum { UV_HANDLE_IPV6 = 0x10000 /* Handle is bound to a IPv6 socket. */ }; +/* loop flags */ +enum { + UV_LOOP_BLOCK_SIGPROF = 1 +}; + typedef enum { UV_CLOCK_PRECISE = 0, /* Use the highest resolution clock available. */ UV_CLOCK_FAST = 1 /* Use the fastest clock with <= 1ms granularity. */ diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index b4f9f5d8405521..aaadcd8419a3f3 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -55,9 +55,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { unsigned int nevents; unsigned int revents; QUEUE* q; + uv__io_t* w; + sigset_t* pset; + sigset_t set; uint64_t base; uint64_t diff; - uv__io_t* w; int filter; int fflags; int count; @@ -117,6 +119,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w->events = w->pevents; } + pset = NULL; + if (loop->flags & UV_LOOP_BLOCK_SIGPROF) { + pset = &set; + sigemptyset(pset); + sigaddset(pset, SIGPROF); + } + assert(timeout >= -1); base = loop->time; count = 48; /* Benchmarks suggest this gives the best throughput. */ @@ -127,6 +136,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { spec.tv_nsec = (timeout % 1000) * 1000000; } + if (pset != NULL) + pthread_sigmask(SIG_BLOCK, pset, NULL); + nfds = kevent(loop->backend_fd, events, nevents, @@ -134,6 +146,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { ARRAY_SIZE(events), timeout == -1 ? NULL : &spec); + if (pset != NULL) + pthread_sigmask(SIG_UNBLOCK, pset, NULL); + /* Update loop->time unconditionally. It's tempting to skip the update when * timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the * operating system didn't reschedule our process while in the syscall. diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c index 7a43630494df38..d77b13fd6fddb5 100644 --- a/deps/uv/src/unix/linux-core.c +++ b/deps/uv/src/unix/linux-core.c @@ -141,6 +141,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { struct uv__epoll_event e; QUEUE* q; uv__io_t* w; + uint64_t sigmask; uint64_t base; uint64_t diff; int nevents; @@ -191,12 +192,22 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w->events = w->pevents; } + sigmask = 0; + if (loop->flags & UV_LOOP_BLOCK_SIGPROF) + sigmask |= 1 << (SIGPROF - 1); + assert(timeout >= -1); base = loop->time; count = 48; /* Benchmarks suggest this gives the best throughput. */ for (;;) { - if (!no_epoll_wait) { + if (no_epoll_wait || sigmask) { + nfds = uv__epoll_pwait(loop->backend_fd, + events, + ARRAY_SIZE(events), + timeout, + sigmask); + } else { nfds = uv__epoll_wait(loop->backend_fd, events, ARRAY_SIZE(events), @@ -205,12 +216,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { no_epoll_wait = 1; continue; } - } else { - nfds = uv__epoll_pwait(loop->backend_fd, - events, - ARRAY_SIZE(events), - timeout, - NULL); } /* Update loop->time unconditionally. It's tempting to skip the update when @@ -373,10 +378,13 @@ void uv_loadavg(double avg[3]) { int uv_exepath(char* buffer, size_t* size) { ssize_t n; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; - n = readlink("/proc/self/exe", buffer, *size - 1); + n = *size - 1; + if (n > 0) + n = readlink("/proc/self/exe", buffer, n); + if (n == -1) return -errno; @@ -744,6 +752,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, return -errno; *count = 0; + *addresses = NULL; /* Count the number of interfaces */ for (ent = addrs; ent != NULL; ent = ent->ifa_next) { @@ -756,6 +765,9 @@ int uv_interface_addresses(uv_interface_address_t** addresses, (*count)++; } + if (*count == 0) + return 0; + *addresses = malloc(*count * sizeof(**addresses)); if (!(*addresses)) return -ENOMEM; diff --git a/deps/uv/src/unix/linux-syscalls.c b/deps/uv/src/unix/linux-syscalls.c index 1ff8abd197fbf3..7bf2c0f87dbea4 100644 --- a/deps/uv/src/unix/linux-syscalls.c +++ b/deps/uv/src/unix/linux-syscalls.c @@ -21,6 +21,7 @@ #include "linux-syscalls.h" #include +#include #include #include #include @@ -320,15 +321,15 @@ int uv__epoll_pwait(int epfd, struct uv__epoll_event* events, int nevents, int timeout, - const sigset_t* sigmask) { + uint64_t sigmask) { #if defined(__NR_epoll_pwait) return syscall(__NR_epoll_pwait, epfd, events, nevents, timeout, - sigmask, - sizeof(*sigmask)); + &sigmask, + sizeof(sigmask)); #else return errno = ENOSYS, -1; #endif diff --git a/deps/uv/src/unix/linux-syscalls.h b/deps/uv/src/unix/linux-syscalls.h index 0f0b34b1ed32f9..6f249b72453675 100644 --- a/deps/uv/src/unix/linux-syscalls.h +++ b/deps/uv/src/unix/linux-syscalls.h @@ -44,7 +44,7 @@ #if defined(__alpha__) # define UV__O_NONBLOCK 0x4 #elif defined(__hppa__) -# define UV__O_NONBLOCK 0x10004 +# define UV__O_NONBLOCK O_NONBLOCK #elif defined(__mips__) # define UV__O_NONBLOCK 0x80 #elif defined(__sparc__) @@ -60,7 +60,11 @@ #define UV__IN_NONBLOCK UV__O_NONBLOCK #define UV__SOCK_CLOEXEC UV__O_CLOEXEC -#define UV__SOCK_NONBLOCK UV__O_NONBLOCK +#if defined(SOCK_NONBLOCK) +# define UV__SOCK_NONBLOCK SOCK_NONBLOCK +#else +# define UV__SOCK_NONBLOCK UV__O_NONBLOCK +#endif /* epoll flags */ #define UV__EPOLL_CLOEXEC UV__O_CLOEXEC @@ -127,7 +131,7 @@ int uv__epoll_pwait(int epfd, struct uv__epoll_event* events, int nevents, int timeout, - const sigset_t* sigmask); + uint64_t sigmask); int uv__eventfd2(unsigned int count, int flags); int uv__inotify_init(void); int uv__inotify_init1(int flags); diff --git a/deps/uv/src/unix/loop.c b/deps/uv/src/unix/loop.c index 002224855c2bef..616cf5bc43b030 100644 --- a/deps/uv/src/unix/loop.c +++ b/deps/uv/src/unix/loop.c @@ -192,3 +192,15 @@ static void uv__loop_close(uv_loop_t* loop) { loop->watchers = NULL; loop->nwatchers = 0; } + + +int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { + if (option != UV_LOOP_BLOCK_SIGNAL) + return UV_ENOSYS; + + if (va_arg(ap, int) != SIGPROF) + return UV_EINVAL; + + loop->flags |= UV_LOOP_BLOCK_SIGPROF; + return 0; +} diff --git a/deps/uv/src/unix/netbsd.c b/deps/uv/src/unix/netbsd.c index 5f1182f8b43edc..de99d135f7aa60 100644 --- a/deps/uv/src/unix/netbsd.c +++ b/deps/uv/src/unix/netbsd.c @@ -83,7 +83,7 @@ int uv_exepath(char* buffer, size_t* size) { size_t cb; pid_t mypid; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; mypid = getpid(); diff --git a/deps/uv/src/unix/openbsd.c b/deps/uv/src/unix/openbsd.c index cde8d4d0c962ad..3e7ae848eec7d2 100644 --- a/deps/uv/src/unix/openbsd.c +++ b/deps/uv/src/unix/openbsd.c @@ -85,7 +85,7 @@ int uv_exepath(char* buffer, size_t* size) { pid_t mypid; int err; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; mypid = getpid(); @@ -108,17 +108,19 @@ int uv_exepath(char* buffer, size_t* size) { } argsbuf_size *= 2U; } + if (argsbuf[0] == NULL) { err = -EINVAL; /* FIXME(bnoordhuis) More appropriate error. */ goto out; } + + *size -= 1; exepath_size = strlen(argsbuf[0]); - if (exepath_size >= *size) { - err = -EINVAL; - goto out; - } - memcpy(buffer, argsbuf[0], exepath_size + 1U); - *size = exepath_size; + if (*size > exepath_size) + *size = exepath_size; + + memcpy(buffer, argsbuf[0], *size); + buffer[*size] = '\0'; err = 0; out: diff --git a/deps/uv/src/unix/pipe.c b/deps/uv/src/unix/pipe.c index a26c3dbc135095..ba833d3f54702c 100644 --- a/deps/uv/src/unix/pipe.c +++ b/deps/uv/src/unix/pipe.c @@ -44,13 +44,10 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { struct sockaddr_un saddr; const char* pipe_fname; int sockfd; - int bound; int err; pipe_fname = NULL; sockfd = -1; - bound = 0; - err = -EINVAL; /* Already bound? */ if (uv__stream_fd(handle) >= 0) @@ -58,17 +55,15 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { /* Make a copy of the file name, it outlives this function's scope. */ pipe_fname = strdup(name); - if (pipe_fname == NULL) { - err = -ENOMEM; - goto out; - } + if (pipe_fname == NULL) + return -ENOMEM; /* We've got a copy, don't touch the original any more. */ name = NULL; err = uv__socket(AF_UNIX, SOCK_STREAM, 0); if (err < 0) - goto out; + goto err_socket; sockfd = err; memset(&saddr, 0, sizeof saddr); @@ -81,22 +76,18 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { /* Convert ENOENT to EACCES for compatibility with Windows. */ if (err == -ENOENT) err = -EACCES; - goto out; + goto err_bind; } - bound = 1; /* Success. */ handle->pipe_fname = pipe_fname; /* Is a strdup'ed copy. */ handle->io_watcher.fd = sockfd; return 0; -out: - if (bound) { - /* unlink() before uv__close() to avoid races. */ - assert(pipe_fname != NULL); - unlink(pipe_fname); - } +err_bind: uv__close(sockfd); + +err_socket: free((void*)pipe_fname); return err; } @@ -134,9 +125,13 @@ void uv__pipe_close(uv_pipe_t* handle) { int uv_pipe_open(uv_pipe_t* handle, uv_file fd) { -#if defined(__APPLE__) int err; + err = uv__nonblock(fd, 1); + if (err) + return err; + +#if defined(__APPLE__) err = uv__stream_try_select((uv_stream_t*) handle, &fd); if (err) return err; @@ -158,7 +153,6 @@ void uv_pipe_connect(uv_connect_t* req, int r; new_sock = (uv__stream_fd(handle) == -1); - err = -EINVAL; if (new_sock) { err = uv__socket(AF_UNIX, SOCK_STREAM, 0); diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index 9c7d28cbf4d792..d41a3429a78b2e 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -549,7 +549,6 @@ int uv_accept(uv_stream_t* server, uv_stream_t* client) { if (server->accepted_fd == -1) return -EAGAIN; - err = 0; switch (client->type) { case UV_NAMED_PIPE: case UV_TCP: @@ -951,6 +950,7 @@ static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) { uv__handle_stop(stream); uv__stream_osx_interrupt_select(stream); stream->read_cb(stream, UV_EOF, buf); + stream->flags &= ~UV_STREAM_READING; } @@ -1117,8 +1117,13 @@ static void uv__read(uv_stream_t* stream) { } else { /* Error. User should call uv_close(). */ stream->read_cb(stream, -errno, &buf); - assert(!uv__io_active(&stream->io_watcher, UV__POLLIN) && - "stream->read_cb(status=-1) did not call uv_close()"); + if (stream->flags & UV_STREAM_READING) { + stream->flags &= ~UV_STREAM_READING; + uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN); + if (!uv__io_active(&stream->io_watcher, UV__POLLOUT)) + uv__handle_stop(stream); + uv__stream_osx_interrupt_select(stream); + } } return; } else if (nread == 0) { @@ -1319,7 +1324,7 @@ int uv_write2(uv_write_t* req, /* It's legal for write_queue_size > 0 even when the write_queue is empty; * it means there are error-state requests in the write_completed_queue that * will touch up write_queue_size later, see also uv__write_req_finish(). - * We chould check that write_queue is empty instead but that implies making + * We could check that write_queue is empty instead but that implies making * a write() syscall when we know that the handle is in error mode. */ empty_queue = (stream->write_queue_size == 0); @@ -1471,15 +1476,8 @@ int uv_read_start(uv_stream_t* stream, int uv_read_stop(uv_stream_t* stream) { - /* Sanity check. We're going to stop the handle unless it's primed for - * writing but that means there should be some kind of write action in - * progress. - */ - assert(!uv__io_active(&stream->io_watcher, UV__POLLOUT) || - !QUEUE_EMPTY(&stream->write_completed_queue) || - !QUEUE_EMPTY(&stream->write_queue) || - stream->shutdown_req != NULL || - stream->connect_req != NULL); + if (!(stream->flags & UV_STREAM_READING)) + return 0; stream->flags &= ~UV_STREAM_READING; uv__io_stop(stream->loop, &stream->io_watcher, UV__POLLIN); diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index a630dba759a6a2..ca183a62279a5e 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -122,6 +122,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { struct timespec spec; QUEUE* q; uv__io_t* w; + sigset_t* pset; + sigset_t set; uint64_t base; uint64_t diff; unsigned int nfds; @@ -129,6 +131,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { int saved_errno; int nevents; int count; + int err; int fd; if (loop->nfds == 0) { @@ -150,6 +153,13 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { w->events = w->pevents; } + pset = NULL; + if (loop->flags & UV_LOOP_BLOCK_SIGPROF) { + pset = &set; + sigemptyset(pset); + sigaddset(pset, SIGPROF); + } + assert(timeout >= -1); base = loop->time; count = 48; /* Benchmarks suggest this gives the best throughput. */ @@ -165,11 +175,20 @@ void uv__io_poll(uv_loop_t* loop, int timeout) { nfds = 1; saved_errno = 0; - if (port_getn(loop->backend_fd, - events, - ARRAY_SIZE(events), - &nfds, - timeout == -1 ? NULL : &spec)) { + + if (pset != NULL) + pthread_sigmask(SIG_BLOCK, pset, NULL); + + err = port_getn(loop->backend_fd, + events, + ARRAY_SIZE(events), + &nfds, + timeout == -1 ? NULL : &spec); + + if (pset != NULL) + pthread_sigmask(SIG_UNBLOCK, pset, NULL); + + if (err) { /* Work around another kernel bug: port_getn() may return events even * on error. */ @@ -281,11 +300,15 @@ int uv_exepath(char* buffer, size_t* size) { ssize_t res; char buf[128]; - if (buffer == NULL || size == NULL) + if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; snprintf(buf, sizeof(buf), "/proc/%lu/path/a.out", (unsigned long) getpid()); - res = readlink(buf, buffer, *size - 1); + + res = *size - 1; + if (res > 0) + res = readlink(buf, buffer, res); + if (res == -1) return -errno; diff --git a/deps/uv/src/unix/tcp.c b/deps/uv/src/unix/tcp.c index 8c19c1ab95606c..4060e7bd7094e8 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -156,6 +156,12 @@ int uv__tcp_connect(uv_connect_t* req, int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) { + int err; + + err = uv__nonblock(sock, 1); + if (err) + return err; + return uv__stream_open((uv_stream_t*)handle, sock, UV_STREAM_READABLE | UV_STREAM_WRITABLE); diff --git a/deps/uv/src/unix/tty.c b/deps/uv/src/unix/tty.c index 7ae19905fbffcb..a1ea433f81792b 100644 --- a/deps/uv/src/unix/tty.c +++ b/deps/uv/src/unix/tty.c @@ -98,19 +98,21 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { uv__nonblock(fd, 1); uv__stream_open((uv_stream_t*) tty, fd, flags); - tty->mode = 0; + tty->mode = UV_TTY_MODE_NORMAL; return 0; } -int uv_tty_set_mode(uv_tty_t* tty, int mode) { - struct termios raw; +int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) { + struct termios tmp; int fd; - fd = uv__stream_fd(tty); + if (tty->mode == (int) mode) + return 0; - if (mode && tty->mode == 0) { /* on */ + fd = uv__stream_fd(tty); + if (tty->mode == UV_TTY_MODE_NORMAL && mode != UV_TTY_MODE_NORMAL) { if (tcgetattr(fd, &tty->orig_termios)) return -errno; @@ -121,27 +123,30 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) { orig_termios_fd = fd; } uv_spinlock_unlock(&termios_spinlock); + } - raw = tty->orig_termios; - raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); - raw.c_oflag |= (ONLCR); - raw.c_cflag |= (CS8); - raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); - raw.c_cc[VMIN] = 1; - raw.c_cc[VTIME] = 0; - - /* Put terminal in raw mode after draining */ - if (tcsetattr(fd, TCSADRAIN, &raw)) - return -errno; - - tty->mode = 1; - } else if (mode == 0 && tty->mode) { /* off */ - /* Put terminal in original mode after flushing */ - if (tcsetattr(fd, TCSAFLUSH, &tty->orig_termios)) - return -errno; - tty->mode = 0; + tmp = tty->orig_termios; + switch (mode) { + case UV_TTY_MODE_NORMAL: + break; + case UV_TTY_MODE_RAW: + tmp.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); + tmp.c_oflag |= (ONLCR); + tmp.c_cflag |= (CS8); + tmp.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG); + tmp.c_cc[VMIN] = 1; + tmp.c_cc[VTIME] = 0; + break; + case UV_TTY_MODE_IO: + cfmakeraw(&tmp); + break; } + /* Apply changes after draining */ + if (tcsetattr(fd, TCSADRAIN, &tmp)) + return -errno; + + tty->mode = mode; return 0; } diff --git a/deps/uv/src/unix/udp.c b/deps/uv/src/unix/udp.c index 7cafea1d089f27..941c0aec6e2f0b 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -278,9 +278,6 @@ int uv__udp_bind(uv_udp_t* handle, int yes; int fd; - err = -EINVAL; - fd = -1; - /* Check for bad flags. */ if (flags & ~(UV_UDP_IPV6ONLY | UV_UDP_REUSEADDR)) return -EINVAL; @@ -568,6 +565,10 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { if (handle->io_watcher.fd != -1) return -EALREADY; /* FIXME(bnoordhuis) Should be -EBUSY. */ + err = uv__nonblock(sock, 1); + if (err) + return err; + err = uv__set_reuse(sock); if (err) return err; @@ -601,7 +602,11 @@ int uv_udp_set_membership(uv_udp_t* handle, } -static int uv__setsockopt_maybe_char(uv_udp_t* handle, int option, int val) { +static int uv__setsockopt_maybe_char(uv_udp_t* handle, + int option4, + int option6, + int val) { + int r; #if defined(__sun) || defined(_AIX) char arg = val; #else @@ -611,7 +616,20 @@ static int uv__setsockopt_maybe_char(uv_udp_t* handle, int option, int val) { if (val < 0 || val > 255) return -EINVAL; - if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, option, &arg, sizeof(arg))) + if (handle->flags & UV_HANDLE_IPV6) + r = setsockopt(handle->io_watcher.fd, + IPPROTO_IPV6, + option6, + &arg, + sizeof(arg)); + else + r = setsockopt(handle->io_watcher.fd, + IPPROTO_IP, + option4, + &arg, + sizeof(arg)); + + if (r) return -errno; return 0; @@ -635,20 +653,26 @@ int uv_udp_set_ttl(uv_udp_t* handle, int ttl) { if (ttl < 1 || ttl > 255) return -EINVAL; - if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl))) - return -errno; - - return 0; + return uv__setsockopt_maybe_char(handle, + IP_TTL, + IPV6_UNICAST_HOPS, + ttl); } int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) { - return uv__setsockopt_maybe_char(handle, IP_MULTICAST_TTL, ttl); + return uv__setsockopt_maybe_char(handle, + IP_MULTICAST_TTL, + IPV6_MULTICAST_HOPS, + ttl); } int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) { - return uv__setsockopt_maybe_char(handle, IP_MULTICAST_LOOP, on); + return uv__setsockopt_maybe_char(handle, + IP_MULTICAST_LOOP, + IPV6_MULTICAST_LOOP, + on); } int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr) { diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 5ba1ea4df4df47..f84f8c4ae10d50 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -24,6 +24,7 @@ #include #include +#include #include /* NULL */ #include /* malloc */ #include /* memset */ @@ -442,3 +443,16 @@ int uv_fs_scandir_next(uv_fs_t* req, uv_dirent_t* ent) { return 0; } + + +int uv_loop_configure(uv_loop_t* loop, uv_loop_option option, ...) { + va_list ap; + int err; + + va_start(ap, option); + /* Any platform-agnostic options should be handled here. */ + err = uv__loop_configure(loop, option, ap); + va_end(ap); + + return err; +} diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h index e06606c19baecf..11e7fc395c43eb 100644 --- a/deps/uv/src/uv-common.h +++ b/deps/uv/src/uv-common.h @@ -28,6 +28,7 @@ #define UV_COMMON_H_ #include +#include #include #if defined(_MSC_VER) && _MSC_VER < 1600 @@ -45,6 +46,9 @@ #define container_of(ptr, type, member) \ ((type *) ((char *) (ptr) - offsetof(type, member))) +#define STATIC_ASSERT(expr) \ + void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)]) + #ifndef _WIN32 enum { UV__HANDLE_INTERNAL = 0x8000, @@ -59,6 +63,8 @@ enum { # define UV__HANDLE_CLOSING 0x01 #endif +int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap); + int uv__tcp_bind(uv_tcp_t* tcp, const struct sockaddr* addr, unsigned int addrlen, diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c index c9e4c88fa731a9..2bef8b7f332062 100644 --- a/deps/uv/src/win/core.c +++ b/deps/uv/src/win/core.c @@ -39,7 +39,7 @@ static uv_loop_t default_loop_struct; static uv_loop_t* default_loop_ptr; -/* uv_once intialization guards */ +/* uv_once initialization guards */ static uv_once_t uv_init_guard_ = UV_ONCE_INIT; @@ -103,7 +103,7 @@ static void uv_init(void) { #endif /* Fetch winapi function pointers. This must be done first because other - * intialization code might need these function pointers to be loaded. + * initialization code might need these function pointers to be loaded. */ uv_winapi_init(); @@ -133,7 +133,7 @@ int uv_loop_init(uv_loop_t* loop) { if (loop->iocp == NULL) return uv_translate_sys_error(GetLastError()); - /* To prevent uninitialized memory access, loop->time must be intialized + /* To prevent uninitialized memory access, loop->time must be initialized * to zero before calling uv_update_time for the first time. */ loop->time = 0; @@ -199,7 +199,7 @@ uv_loop_t* uv_default_loop(void) { static void uv__loop_close(uv_loop_t* loop) { size_t i; - /* close the async handle without needeing an extra loop iteration */ + /* close the async handle without needing an extra loop iteration */ assert(!loop->wq_async.async_sent); loop->wq_async.close_cb = NULL; uv__handle_closing(&loop->wq_async); @@ -272,6 +272,11 @@ void uv_loop_delete(uv_loop_t* loop) { } +int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap) { + return UV_ENOSYS; +} + + int uv_backend_fd(const uv_loop_t* loop) { return -1; } @@ -382,6 +387,7 @@ int uv_loop_alive(const uv_loop_t* loop) { int uv_run(uv_loop_t *loop, uv_run_mode mode) { DWORD timeout; int r; + int ran_pending; void (*poll)(uv_loop_t* loop, DWORD timeout); if (pGetQueuedCompletionStatusEx) @@ -397,12 +403,12 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) { uv_update_time(loop); uv_process_timers(loop); - uv_process_reqs(loop); + ran_pending = uv_process_reqs(loop); uv_idle_invoke(loop); uv_prepare_invoke(loop); timeout = 0; - if ((mode & UV_RUN_NOWAIT) == 0) + if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT) timeout = uv_backend_timeout(loop); (*poll)(loop, timeout); @@ -411,7 +417,7 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) { uv_process_endgames(loop); if (mode == UV_RUN_ONCE) { - /* UV_RUN_ONCE implies forward progess: at least one callback must have + /* UV_RUN_ONCE implies forward progress: at least one callback must have * been invoked when it returns. uv__io_poll() can return without doing * I/O (meaning: no callbacks) when its timeout expires - which means we * have pending timers that satisfy the forward progress constraint. @@ -423,7 +429,7 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) { } r = uv__loop_alive(loop); - if (mode & (UV_RUN_ONCE | UV_RUN_NOWAIT)) + if (mode == UV_RUN_ONCE || mode == UV_RUN_NOWAIT) break; } diff --git a/deps/uv/src/win/dl.c b/deps/uv/src/win/dl.c index 2ef1f6c54f2fa7..e5f3407f8eb27e 100644 --- a/deps/uv/src/win/dl.c +++ b/deps/uv/src/win/dl.c @@ -69,17 +69,44 @@ const char* uv_dlerror(const uv_lib_t* lib) { } +static void uv__format_fallback_error(uv_lib_t* lib, int errorno){ + DWORD_PTR args[1] = { (DWORD_PTR) errorno }; + LPSTR fallback_error = "error: %1!d!"; + + FormatMessageA(FORMAT_MESSAGE_FROM_STRING | + FORMAT_MESSAGE_ARGUMENT_ARRAY | + FORMAT_MESSAGE_ALLOCATE_BUFFER, + fallback_error, 0, 0, + (LPSTR) &lib->errmsg, + 0, (va_list*) args); +} + + + static int uv__dlerror(uv_lib_t* lib, int errorno) { + DWORD res; + if (lib->errmsg) { LocalFree((void*)lib->errmsg); lib->errmsg = NULL; } if (errorno) { - FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorno, - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), - (LPSTR)&lib->errmsg, 0, NULL); + res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorno, + MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + (LPSTR) &lib->errmsg, 0, NULL); + if (!res && GetLastError() == ERROR_MUI_FILE_NOT_FOUND) { + res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorno, + 0, (LPSTR) &lib->errmsg, 0, NULL); + } + + if (!res) { + uv__format_fallback_error(lib, errorno); + } } return errorno ? -1 : 0; diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index 7208a65c424e06..33bc9da304054f 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -43,8 +43,6 @@ #define UV_FS_FREE_PTR 0x0008 #define UV_FS_CLEANEDUP 0x0010 -static const int uv__fs_dirent_slide = 0x20; - #define QUEUE_FS_TP_JOB(loop, req) \ do { \ @@ -788,123 +786,203 @@ void fs__mkdtemp(uv_fs_t* req) { void fs__scandir(uv_fs_t* req) { - WCHAR* pathw = req->pathw; - size_t len = wcslen(pathw); - int result; - WCHAR* name; - HANDLE dir; - WIN32_FIND_DATAW ent = { 0 }; - WCHAR* path2; - const WCHAR* fmt; - uv__dirent_t** dents; - int dent_size; - - if (len == 0) { - fmt = L"./*"; - } else if (pathw[len - 1] == L'/' || pathw[len - 1] == L'\\') { - fmt = L"%s*"; - } else { - fmt = L"%s\\*"; - } + static const size_t dirents_initial_size = 32; - /* Figure out whether path is a file or a directory. */ - if (!(GetFileAttributesW(pathw) & FILE_ATTRIBUTE_DIRECTORY)) { - req->result = UV_ENOTDIR; - req->sys_errno_ = ERROR_SUCCESS; - return; - } - - path2 = (WCHAR*)malloc(sizeof(WCHAR) * (len + 4)); - if (!path2) { - SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); - return; - } + HANDLE dir_handle = INVALID_HANDLE_VALUE; - _snwprintf(path2, len + 3, fmt, pathw); - dir = FindFirstFileW(path2, &ent); - free(path2); + uv__dirent_t** dirents = NULL; + size_t dirents_size = 0; + size_t dirents_used = 0; - if(dir == INVALID_HANDLE_VALUE) { - SET_REQ_WIN32_ERROR(req, GetLastError()); - return; - } - - result = 0; - dents = NULL; - dent_size = 0; - - do { - uv__dirent_t* dent; - int utf8_len; + IO_STATUS_BLOCK iosb; + NTSTATUS status; - name = ent.cFileName; + /* Buffer to hold directory entries returned by NtQueryDirectoryFile. + * It's important that this buffer can hold at least one entry, regardless + * of the length of the file names present in the enumerated directory. + * A file name is at most 256 WCHARs long. + * According to MSDN, the buffer must be aligned at an 8-byte boundary. + */ + __declspec(align(8)) char buffer[8192]; + + STATIC_ASSERT(sizeof buffer >= + sizeof(FILE_DIRECTORY_INFORMATION) + 256 * sizeof(WCHAR)); + + /* Open the directory. */ + dir_handle = + CreateFileW(req->pathw, + FILE_LIST_DIRECTORY | SYNCHRONIZE, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, + NULL); + if (dir_handle == INVALID_HANDLE_VALUE) + goto win32_error; + + /* Read the first chunk. */ + status = pNtQueryDirectoryFile(dir_handle, + NULL, + NULL, + NULL, + &iosb, + &buffer, + sizeof buffer, + FileDirectoryInformation, + FALSE, + NULL, + TRUE); + + /* If the handle is not a directory, we'll get STATUS_INVALID_PARAMETER. + * This should be reported back as UV_ENOTDIR. + */ + if (status == STATUS_INVALID_PARAMETER) + goto not_a_directory_error; + + while (NT_SUCCESS(status)) { + char* position = buffer; + size_t next_entry_offset = 0; + + do { + FILE_DIRECTORY_INFORMATION* info; + uv__dirent_t* dirent; + + size_t wchar_len; + size_t utf8_len; + + /* Obtain a pointer to the current directory entry. */ + position += next_entry_offset; + info = (FILE_DIRECTORY_INFORMATION*) position; + + /* Fetch the offset to the next directory entry. */ + next_entry_offset = info->NextEntryOffset; + + /* Compute the length of the filename in WCHARs. */ + wchar_len = info->FileNameLength / sizeof info->FileName[0]; + + /* Skip over '.' and '..' entries. */ + if (wchar_len == 1 && info->FileName[0] == L'.') + continue; + if (wchar_len == 2 && info->FileName[0] == L'.' && + info->FileName[1] == L'.') + continue; + + /* Compute the space required to store the filename as UTF-8. */ + utf8_len = WideCharToMultiByte( + CP_UTF8, 0, &info->FileName[0], wchar_len, NULL, 0, NULL, NULL); + if (utf8_len == 0) + goto win32_error; + + /* Resize the dirent array if needed. */ + if (dirents_used >= dirents_size) { + size_t new_dirents_size = + dirents_size == 0 ? dirents_initial_size : dirents_size << 1; + uv__dirent_t** new_dirents = + realloc(dirents, new_dirents_size * sizeof *dirents); + + if (new_dirents == NULL) + goto out_of_memory_error; + + dirents_size = new_dirents_size; + dirents = new_dirents; + } - if (!(name[0] != L'.' || (name[1] && (name[1] != L'.' || name[2])))) - continue; + /* Allocate space for the uv dirent structure. The dirent structure + * includes room for the first character of the filename, but `utf8_len` + * doesn't count the NULL terminator at this point. + */ + dirent = malloc(sizeof *dirent + utf8_len); + if (dirent == NULL) + goto out_of_memory_error; + + dirents[dirents_used++] = dirent; + + /* Convert file name to UTF-8. */ + if (WideCharToMultiByte(CP_UTF8, + 0, + &info->FileName[0], + wchar_len, + &dirent->d_name[0], + utf8_len, + NULL, + NULL) == 0) + goto win32_error; + + /* Add a null terminator to the filename. */ + dirent->d_name[utf8_len] = '\0'; + + /* Fill out the type field. */ + if (info->FileAttributes & FILE_ATTRIBUTE_DEVICE) + dirent->d_type = UV__DT_CHAR; + else if (info->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) + dirent->d_type = UV__DT_LINK; + else if (info->FileAttributes & FILE_ATTRIBUTE_DIRECTORY) + dirent->d_type = UV__DT_DIR; + else + dirent->d_type = UV__DT_FILE; + } while (next_entry_offset != 0); + + /* Read the next chunk. */ + status = pNtQueryDirectoryFile(dir_handle, + NULL, + NULL, + NULL, + &iosb, + &buffer, + sizeof buffer, + FileDirectoryInformation, + FALSE, + NULL, + FALSE); + + /* After the first pNtQueryDirectoryFile call, the function may return + * STATUS_SUCCESS even if the buffer was too small to hold at least one + * directory entry. + */ + if (status == STATUS_SUCCESS && iosb.Information == 0) + status = STATUS_BUFFER_OVERFLOW; + } - /* Grow dents buffer, if needed */ - if (result >= dent_size) { - uv__dirent_t** tmp; + if (status != STATUS_NO_MORE_FILES) + goto nt_error; - dent_size += uv__fs_dirent_slide; - tmp = realloc(dents, dent_size * sizeof(*dents)); - if (tmp == NULL) { - SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); - goto fatal; - } - dents = tmp; - } + CloseHandle(dir_handle); - /* Allocate enough space to fit utf8 encoding of file name */ - len = wcslen(name); - utf8_len = uv_utf16_to_utf8(name, len, NULL, 0); - if (!utf8_len) { - SET_REQ_WIN32_ERROR(req, GetLastError()); - goto fatal; - } + /* Store the result in the request object. */ + req->ptr = dirents; + if (dirents != NULL) + req->flags |= UV_FS_FREE_PTR; - dent = malloc(sizeof(*dent) + utf8_len + 1); - if (dent == NULL) { - SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); - goto fatal; - } + SET_REQ_RESULT(req, dirents_used); - /* Copy file name */ - utf8_len = uv_utf16_to_utf8(name, len, dent->d_name, utf8_len); - if (!utf8_len) { - free(dent); - SET_REQ_WIN32_ERROR(req, GetLastError()); - goto fatal; - } - dent->d_name[utf8_len] = '\0'; + /* `nbufs` will be used as index by uv_fs_scandir_next. */ + req->nbufs = 0; - /* Copy file type */ - if ((ent.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) - dent->d_type = UV__DT_DIR; - else if ((ent.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0) - dent->d_type = UV__DT_LINK; - else - dent->d_type = UV__DT_FILE; + return; - dents[result++] = dent; - } while(FindNextFileW(dir, &ent)); +nt_error: + SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(status)); + goto cleanup; - FindClose(dir); +win32_error: + SET_REQ_WIN32_ERROR(req, GetLastError()); + goto cleanup; - if (dents != NULL) - req->flags |= UV_FS_FREE_PTR; +not_a_directory_error: + SET_REQ_UV_ERROR(req, UV_ENOTDIR, ERROR_DIRECTORY); + goto cleanup; - /* NOTE: nbufs will be used as index */ - req->nbufs = 0; - req->ptr = dents; - SET_REQ_RESULT(req, result); - return; +out_of_memory_error: + SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY); + goto cleanup; -fatal: - /* Deallocate dents */ - for (result--; result >= 0; result--) - free(dents[result]); - free(dents); +cleanup: + if (dir_handle != INVALID_HANDLE_VALUE) + CloseHandle(dir_handle); + while (dirents_used > 0) + free(dirents[--dirents_used]); + if (dirents != NULL) + free(dirents); } @@ -947,7 +1025,7 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { * * Currently it's based on whether the 'readonly' attribute is set, which * makes little sense because the semantics are so different: the 'read-only' - * flag is just a way for a user to protect against accidental deleteion, and + * flag is just a way for a user to protect against accidental deletion, and * serves no security purpose. Windows uses ACLs for that. * * Also people now use uv_fs_chmod() to take away the writable bit for good @@ -956,7 +1034,7 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf) { * deleted. * * IOW it's all just a clusterfuck and we should think of something that - * makes slighty more sense. + * makes slightly more sense. * * And uv_fs_chmod should probably just fail on windows or be a total no-op. * There's nothing sensible it can do anyway. diff --git a/deps/uv/src/win/getaddrinfo.c b/deps/uv/src/win/getaddrinfo.c index 787cfd53664d35..53a6084efe5bb3 100644 --- a/deps/uv/src/win/getaddrinfo.c +++ b/deps/uv/src/win/getaddrinfo.c @@ -296,7 +296,7 @@ int uv_getaddrinfo(uv_loop_t* loop, req->alloc = (void*)alloc_ptr; /* convert node string to UTF16 into allocated memory and save pointer in */ - /* the reques. */ + /* the request. */ if (node != NULL) { req->node = (WCHAR*)alloc_ptr; if (uv_utf8_to_utf16(node, diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h index d87402b73a0952..04b2a548ca88cc 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -136,6 +136,8 @@ int uv_tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb, uv_read_cb read_cb); int uv_tcp_write(uv_loop_t* loop, uv_write_t* req, uv_tcp_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tcp_try_write(uv_tcp_t* handle, const uv_buf_t bufs[], + unsigned int nbufs); void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req); void uv_process_tcp_write_req(uv_loop_t* loop, uv_tcp_t* handle, @@ -211,6 +213,8 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb, int uv_tty_read_stop(uv_tty_t* handle); int uv_tty_write(uv_loop_t* loop, uv_write_t* req, uv_tty_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb); +int uv__tty_try_write(uv_tty_t* handle, const uv_buf_t bufs[], + unsigned int nbufs); void uv_tty_close(uv_tty_t* handle); void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle, @@ -364,8 +368,8 @@ int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers, int* addr_len, WSAOVERLAPPED *overlapped, LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine); -int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info, - OVERLAPPED* overlapped); +int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in, + AFD_POLL_INFO* info_out, OVERLAPPED* overlapped); /* Whether there are any non-IFS LSPs stacked on TCP */ extern int uv_tcp_non_ifs_lsp_ipv4; diff --git a/deps/uv/src/win/poll.c b/deps/uv/src/win/poll.c index 85c314828bc197..578d9fff17fd7a 100644 --- a/deps/uv/src/win/poll.c +++ b/deps/uv/src/win/poll.c @@ -46,6 +46,8 @@ typedef struct uv_single_fd_set_s { static OVERLAPPED overlapped_dummy_; static uv_once_t overlapped_dummy_init_guard_ = UV_ONCE_INIT; +static AFD_POLL_INFO afd_poll_info_dummy_; + static void uv__init_overlapped_dummy(void) { HANDLE event; @@ -65,6 +67,11 @@ static OVERLAPPED* uv__get_overlapped_dummy() { } +static AFD_POLL_INFO* uv__get_afd_poll_info_dummy() { + return &afd_poll_info_dummy_; +} + + static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) { uv_req_t* req; AFD_POLL_INFO* afd_poll_info; @@ -108,6 +115,7 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) { memset(&req->overlapped, 0, sizeof req->overlapped); result = uv_msafd_poll((SOCKET) handle->peer_socket, + afd_poll_info, afd_poll_info, &req->overlapped); if (result != 0 && WSAGetLastError() != WSA_IO_PENDING) { @@ -120,7 +128,7 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) { static int uv__fast_poll_cancel_poll_req(uv_loop_t* loop, uv_poll_t* handle) { AFD_POLL_INFO afd_poll_info; - int result; + DWORD result; afd_poll_info.Exclusive = TRUE; afd_poll_info.NumberOfHandles = 1; @@ -131,13 +139,13 @@ static int uv__fast_poll_cancel_poll_req(uv_loop_t* loop, uv_poll_t* handle) { result = uv_msafd_poll(handle->socket, &afd_poll_info, + uv__get_afd_poll_info_dummy(), uv__get_overlapped_dummy()); if (result == SOCKET_ERROR) { DWORD error = WSAGetLastError(); - if (error != WSA_IO_PENDING) { - return WSAGetLastError(); - } + if (error != WSA_IO_PENDING) + return error; } return 0; @@ -546,7 +554,7 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle, handle->flags |= UV_HANDLE_POLL_SLOW; } - /* Intialize 2 poll reqs. */ + /* Initialize 2 poll reqs. */ handle->submitted_events_1 = 0; uv_req_init(loop, (uv_req_t*) &(handle->poll_req_1)); handle->poll_req_1.type = UV_POLL_REQ; diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c index 4d04a0e906194f..3a0106f82d63e3 100644 --- a/deps/uv/src/win/process.c +++ b/deps/uv/src/win/process.c @@ -1063,7 +1063,7 @@ int uv_spawn(uv_loop_t* loop, if (options->flags & UV_PROCESS_DETACHED) { /* Note that we're not setting the CREATE_BREAKAWAY_FROM_JOB flag. That - * means that libuv might not let you create a fully deamonized process + * means that libuv might not let you create a fully daemonized process * when run under job control. However the type of job control that libuv * itself creates doesn't trickle down to subprocesses so they can still * daemonize. @@ -1141,7 +1141,7 @@ int uv_spawn(uv_loop_t* loop, assert(!err); /* Make the handle active. It will remain active until the exit callback */ - /* iis made or the handle is closed, whichever happens first. */ + /* is made or the handle is closed, whichever happens first. */ uv__handle_start(process); /* Cleanup, whether we succeeded or failed. */ @@ -1177,7 +1177,7 @@ static int uv__kill(HANDLE process_handle, int signum) { return 0; /* If the process already exited before TerminateProcess was called, */ - /* TerminateProcess will fail with ERROR_ACESS_DENIED. */ + /* TerminateProcess will fail with ERROR_ACCESS_DENIED. */ err = GetLastError(); if (err == ERROR_ACCESS_DENIED && GetExitCodeProcess(process_handle, &status) && diff --git a/deps/uv/src/win/req-inl.h b/deps/uv/src/win/req-inl.h index 97342e5c7e0017..46c7d9b106a869 100644 --- a/deps/uv/src/win/req-inl.h +++ b/deps/uv/src/win/req-inl.h @@ -130,14 +130,13 @@ INLINE static void uv_insert_pending_req(uv_loop_t* loop, uv_req_t* req) { } while (0) -INLINE static void uv_process_reqs(uv_loop_t* loop) { +INLINE static int uv_process_reqs(uv_loop_t* loop) { uv_req_t* req; uv_req_t* first; uv_req_t* next; - if (loop->pending_reqs_tail == NULL) { - return; - } + if (loop->pending_reqs_tail == NULL) + return 0; first = loop->pending_reqs_tail->next_req; next = first; @@ -207,6 +206,8 @@ INLINE static void uv_process_reqs(uv_loop_t* loop) { assert(0); } } + + return 1; } #endif /* UV_WIN_REQ_INL_H_ */ diff --git a/deps/uv/src/win/stream.c b/deps/uv/src/win/stream.c index 057f72ecad8408..36d88d00bd9893 100644 --- a/deps/uv/src/win/stream.c +++ b/deps/uv/src/win/stream.c @@ -184,8 +184,22 @@ int uv_write2(uv_write_t* req, int uv_try_write(uv_stream_t* stream, const uv_buf_t bufs[], unsigned int nbufs) { - /* NOTE: Won't work with overlapped writes */ - return UV_ENOSYS; + if (stream->flags & UV__HANDLE_CLOSING) + return UV_EBADF; + if (!(stream->flags & UV_HANDLE_WRITABLE)) + return UV_EPIPE; + + switch (stream->type) { + case UV_TCP: + return uv__tcp_try_write((uv_tcp_t*) stream, bufs, nbufs); + case UV_TTY: + return uv__tty_try_write((uv_tty_t*) stream, bufs, nbufs); + case UV_NAMED_PIPE: + return UV_EAGAIN; + default: + assert(0); + return UV_ENOSYS; + } } diff --git a/deps/uv/src/win/tcp.c b/deps/uv/src/win/tcp.c index 23fadc220da03c..c5ddbed08f75ae 100644 --- a/deps/uv/src/win/tcp.c +++ b/deps/uv/src/win/tcp.c @@ -241,7 +241,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) { * allow binding to addresses that are in use by sockets in TIME_WAIT, it * effectively allows 'stealing' a port which is in use by another application. * - * SO_EXCLUSIVEADDRUSE is also not good here because it does cehck all sockets, + * SO_EXCLUSIVEADDRUSE is also not good here because it does check all sockets, * regardless of state, so we'd get an error even if the port is in use by a * socket in TIME_WAIT state. * @@ -590,7 +590,7 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) { } /* Initialize other unused requests too, because uv_tcp_endgame */ - /* doesn't know how how many requests were intialized, so it will */ + /* doesn't know how how many requests were initialized, so it will */ /* try to clean up {uv_simultaneous_server_accepts} requests. */ for (i = simultaneous_accepts; i < uv_simultaneous_server_accepts; i++) { req = &handle->accept_reqs[i]; @@ -876,6 +876,30 @@ int uv_tcp_write(uv_loop_t* loop, } +int uv__tcp_try_write(uv_tcp_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs) { + int result; + DWORD bytes; + + if (handle->write_reqs_pending > 0) + return UV_EAGAIN; + + result = WSASend(handle->socket, + (WSABUF*) bufs, + nbufs, + &bytes, + 0, + NULL, + NULL); + + if (result == SOCKET_ERROR) + return uv_translate_sys_error(WSAGetLastError()); + else + return bytes; +} + + void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle, uv_req_t* req) { DWORD bytes, flags, err; @@ -1342,7 +1366,7 @@ void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp) { if (uv_tcp_try_cancel_io(tcp) != 0) { /* When cancellation is not possible, there is another option: we can */ /* close the incoming sockets, which will also cancel the accept */ - /* operations. However this is not cool because we might inadvertedly */ + /* operations. However this is not cool because we might inadvertently */ /* close a socket that just accepted a new connection, which will */ /* cause the connection to be aborted. */ unsigned int i; diff --git a/deps/uv/src/win/thread.c b/deps/uv/src/win/thread.c index 7143743926eee0..993d66162c40fa 100644 --- a/deps/uv/src/win/thread.c +++ b/deps/uv/src/win/thread.c @@ -100,7 +100,7 @@ static NOINLINE void uv__once_inner(uv_once_t* guard, } else { /* We lost the race. Destroy the event we created and wait for the */ - /* existing one todv become signaled. */ + /* existing one to become signaled. */ CloseHandle(created_event); result = WaitForSingleObject(existing_event, INFINITE); assert(result == WAIT_OBJECT_0); @@ -117,7 +117,19 @@ void uv_once(uv_once_t* guard, void (*callback)(void)) { uv__once_inner(guard, callback); } -static UV_THREAD_LOCAL uv_thread_t uv__current_thread = NULL; + +/* Verify that uv_thread_t can be stored in a TLS slot. */ +STATIC_ASSERT(sizeof(uv_thread_t) <= sizeof(void*)); + +static uv_key_t uv__current_thread_key; +static uv_once_t uv__current_thread_init_guard = UV_ONCE_INIT; + + +static void uv__init_current_thread_key(void) { + if (uv_key_create(&uv__current_thread_key)) + abort(); +} + struct thread_ctx { void (*entry)(void* arg); @@ -126,8 +138,7 @@ struct thread_ctx { }; -static UINT __stdcall uv__thread_start(void* arg) -{ +static UINT __stdcall uv__thread_start(void* arg) { struct thread_ctx *ctx_p; struct thread_ctx ctx; @@ -135,7 +146,9 @@ static UINT __stdcall uv__thread_start(void* arg) ctx = *ctx_p; free(ctx_p); - uv__current_thread = ctx.self; + uv_once(&uv__current_thread_init_guard, uv__init_current_thread_key); + uv_key_set(&uv__current_thread_key, (void*) ctx.self); + ctx.entry(ctx.arg); return 0; @@ -155,7 +168,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { ctx->arg = arg; /* Create the thread in suspended state so we have a chance to pass - * its own creation handle to it */ + * its own creation handle to it */ thread = (HANDLE) _beginthreadex(NULL, 0, uv__thread_start, @@ -177,9 +190,10 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { uv_thread_t uv_thread_self(void) { - return uv__current_thread; + return (uv_thread_t) uv_key_get(&uv__current_thread_key); } + int uv_thread_join(uv_thread_t *tid) { if (WaitForSingleObject(*tid, INFINITE)) return uv_translate_sys_error(GetLastError()); diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index 6d6709f79e1170..603421045cac58 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -170,7 +170,7 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { } -int uv_tty_set_mode(uv_tty_t* tty, int mode) { +int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) { DWORD flags; unsigned char was_reading; uv_alloc_cb alloc_cb; @@ -185,12 +185,15 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) { return 0; } - if (mode) { - /* Raw input */ - flags = ENABLE_WINDOW_INPUT; - } else { - /* Line-buffered mode. */ - flags = ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + switch (mode) { + case UV_TTY_MODE_NORMAL: + flags = ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + break; + case UV_TTY_MODE_RAW: + flags = ENABLE_WINDOW_INPUT; + break; + case UV_TTY_MODE_IO: + return UV_ENOTSUP; } if (!SetConsoleMode(tty->handle, flags)) { @@ -1875,6 +1878,21 @@ int uv_tty_write(uv_loop_t* loop, } +int uv__tty_try_write(uv_tty_t* handle, + const uv_buf_t bufs[], + unsigned int nbufs) { + DWORD error; + + if (handle->write_reqs_pending > 0) + return UV_EAGAIN; + + if (uv_tty_write_bufs(handle, bufs, nbufs, &error)) + return uv_translate_sys_error(error); + + return uv__count_bufs(bufs, nbufs); +} + + void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle, uv_write_t* req) { int err; diff --git a/deps/uv/src/win/udp.c b/deps/uv/src/win/udp.c index 99fd80fce9dafc..73b5bd5e467b40 100644 --- a/deps/uv/src/win/udp.c +++ b/deps/uv/src/win/udp.c @@ -83,7 +83,7 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket, } if (pSetFileCompletionNotificationModes) { - /* All know windowses that support SetFileCompletionNotificationModes */ + /* All known Windows that support SetFileCompletionNotificationModes */ /* have a bug that makes it impossible to use this function in */ /* conjunction with datagram sockets. We can work around that but only */ /* if the user is using the default UDP driver (AFD) and has no other */ diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index 0bcb721a524a2d..43d843ff5c42b5 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -44,7 +44,7 @@ * of the console title is that it is smaller than 64K. However in practice * it is much smaller, and there is no way to figure out what the exact length * of the title is or can be, at least not on XP. To make it even more - * annoying, GetConsoleTitle failes when the buffer to be read into is bigger + * annoying, GetConsoleTitle fails when the buffer to be read into is bigger * than the actual maximum length. So we make a conservative guess here; * just don't put the novel you're writing in the title, unless the plot * survives truncation. @@ -64,7 +64,7 @@ static double hrtime_interval_ = 0; /* - * One-time intialization code for functionality defined in util.c. + * One-time initialization code for functionality defined in util.c. */ void uv__util_init() { LARGE_INTEGER perf_frequency; diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c index 84ce73e3a023b6..f3f27f77c15a4e 100644 --- a/deps/uv/src/win/winapi.c +++ b/deps/uv/src/win/winapi.c @@ -31,6 +31,7 @@ sNtDeviceIoControlFile pNtDeviceIoControlFile; sNtQueryInformationFile pNtQueryInformationFile; sNtSetInformationFile pNtSetInformationFile; sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile; +sNtQueryDirectoryFile pNtQueryDirectoryFile; sNtQuerySystemInformation pNtQuerySystemInformation; @@ -97,6 +98,12 @@ void uv_winapi_init() { uv_fatal_error(GetLastError(), "GetProcAddress"); } + pNtQueryDirectoryFile = (sNtQueryDirectoryFile) + GetProcAddress(ntdll_module, "NtQueryDirectoryFile"); + if (pNtQueryVolumeInformationFile == NULL) { + uv_fatal_error(GetLastError(), "GetProcAddress"); + } + pNtQuerySystemInformation = (sNtQuerySystemInformation) GetProcAddress( ntdll_module, "NtQuerySystemInformation"); diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h index 1bb0e9aae1eed9..f4f9145b388f00 100644 --- a/deps/uv/src/win/winapi.h +++ b/deps/uv/src/win/winapi.h @@ -4104,12 +4104,23 @@ # define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x00002000 #endif +/* from winternl.h */ +typedef struct _UNICODE_STRING { + USHORT Length; + USHORT MaximumLength; + PWSTR Buffer; +} UNICODE_STRING, *PUNICODE_STRING; + +typedef const UNICODE_STRING *PCUNICODE_STRING; + +/* from ntifs.h */ #ifndef DEVICE_TYPE # define DEVICE_TYPE DWORD #endif -/* from ntifs.h */ -/* MinGW already has it, mingw-w64 does not. */ +/* MinGW already has a definition for REPARSE_DATA_BUFFER, but mingw-w64 does + * not. + */ #if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) typedef struct _REPARSE_DATA_BUFFER { ULONG ReparseTag; @@ -4205,6 +4216,37 @@ typedef enum _FILE_INFORMATION_CLASS { FileMaximumInformation } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; +typedef struct _FILE_DIRECTORY_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + WCHAR FileName[1]; +} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION; + +typedef struct _FILE_BOTH_DIR_INFORMATION { + ULONG NextEntryOffset; + ULONG FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + ULONG FileAttributes; + ULONG FileNameLength; + ULONG EaSize; + CCHAR ShortNameLength; + WCHAR ShortName[12]; + WCHAR FileName[1]; +} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION; + typedef struct _FILE_BASIC_INFORMATION { LARGE_INTEGER CreationTime; LARGE_INTEGER LastAccessTime; @@ -4512,6 +4554,19 @@ typedef NTSTATUS (NTAPI *sNtQuerySystemInformation) ULONG SystemInformationLength, PULONG ReturnLength); +typedef NTSTATUS (NTAPI *sNtQueryDirectoryFile) + (HANDLE FileHandle, + HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, + PVOID FileInformation, + ULONG Length, + FILE_INFORMATION_CLASS FileInformationClass, + BOOLEAN ReturnSingleEntry, + PUNICODE_STRING FileName, + BOOLEAN RestartScan + ); /* * Kernel32 headers @@ -4555,6 +4610,30 @@ typedef NTSTATUS (NTAPI *sNtQuerySystemInformation) # define ERROR_SYMLINK_NOT_SUPPORTED 1464 #endif +#ifndef ERROR_MUI_FILE_NOT_FOUND +# define ERROR_MUI_FILE_NOT_FOUND 15100 +#endif + +#ifndef ERROR_MUI_INVALID_FILE +# define ERROR_MUI_INVALID_FILE 15101 +#endif + +#ifndef ERROR_MUI_INVALID_RC_CONFIG +# define ERROR_MUI_INVALID_RC_CONFIG 15102 +#endif + +#ifndef ERROR_MUI_INVALID_LOCALE_NAME +# define ERROR_MUI_INVALID_LOCALE_NAME 15103 +#endif + +#ifndef ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME +# define ERROR_MUI_INVALID_ULTIMATEFALLBACK_NAME 15104 +#endif + +#ifndef ERROR_MUI_FILE_NOT_LOADED +# define ERROR_MUI_FILE_NOT_LOADED 15105 +#endif + typedef BOOL (WINAPI *sGetQueuedCompletionStatusEx) (HANDLE CompletionPort, LPOVERLAPPED_ENTRY lpCompletionPortEntries, @@ -4626,6 +4705,7 @@ extern sNtDeviceIoControlFile pNtDeviceIoControlFile; extern sNtQueryInformationFile pNtQueryInformationFile; extern sNtSetInformationFile pNtSetInformationFile; extern sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile; +extern sNtQueryDirectoryFile pNtQueryDirectoryFile; extern sNtQuerySystemInformation pNtQuerySystemInformation; diff --git a/deps/uv/src/win/winsock.c b/deps/uv/src/win/winsock.c index 3711ee9cb6735a..d2e667e9f7546a 100644 --- a/deps/uv/src/win/winsock.c +++ b/deps/uv/src/win/winsock.c @@ -474,8 +474,8 @@ int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers, } -int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info, - OVERLAPPED* overlapped) { +int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in, + AFD_POLL_INFO* info_out, OVERLAPPED* overlapped) { IO_STATUS_BLOCK iosb; IO_STATUS_BLOCK* iosb_ptr; HANDLE event = NULL; @@ -513,10 +513,10 @@ int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info, apc_context, iosb_ptr, IOCTL_AFD_POLL, - info, - sizeof *info, - info, - sizeof *info); + info_in, + sizeof *info_in, + info_out, + sizeof *info_out); if (overlapped == NULL) { /* If this is a blocking operation, wait for the event to become */ diff --git a/deps/uv/test/run-benchmarks.c b/deps/uv/test/run-benchmarks.c index 61f062f99aa90a..8d4f549799e8b3 100644 --- a/deps/uv/test/run-benchmarks.c +++ b/deps/uv/test/run-benchmarks.c @@ -33,7 +33,8 @@ static int maybe_run_test(int argc, char **argv); int main(int argc, char **argv) { - platform_init(argc, argv); + if (platform_init(argc, argv)) + return EXIT_FAILURE; switch (argc) { case 1: return run_tests(1); @@ -41,8 +42,10 @@ int main(int argc, char **argv) { case 3: return run_test_part(argv[1], argv[2]); default: LOGF("Too many arguments.\n"); - return 1; + return EXIT_FAILURE; } + + return EXIT_SUCCESS; } diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c index d8f3cda540a819..e92c93008e72ef 100644 --- a/deps/uv/test/run-tests.c +++ b/deps/uv/test/run-tests.c @@ -46,7 +46,8 @@ static int maybe_run_test(int argc, char **argv); int main(int argc, char **argv) { - platform_init(argc, argv); + if (platform_init(argc, argv)) + return EXIT_FAILURE; argv = uv_setup_args(argc, argv); @@ -56,8 +57,10 @@ int main(int argc, char **argv) { case 3: return run_test_part(argv[1], argv[2]); default: LOGF("Too many arguments.\n"); - return 1; + return EXIT_FAILURE; } + + return EXIT_SUCCESS; } diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c index 9afcd1e48813ce..5da720fad43a9d 100644 --- a/deps/uv/test/runner-unix.c +++ b/deps/uv/test/runner-unix.c @@ -22,10 +22,11 @@ #include "runner-unix.h" #include "runner.h" +#include #include /* uintptr_t */ #include -#include /* usleep */ +#include /* readlink, usleep */ #include /* strdup */ #include #include @@ -40,7 +41,7 @@ /* Do platform-specific initialization. */ -void platform_init(int argc, char **argv) { +int platform_init(int argc, char **argv) { const char* tap; tap = getenv("UV_TAP_OUTPUT"); @@ -49,8 +50,14 @@ void platform_init(int argc, char **argv) { /* Disable stdio output buffering. */ setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); - strncpy(executable_path, argv[0], sizeof(executable_path) - 1); signal(SIGPIPE, SIG_IGN); + + if (realpath(argv[0], executable_path) == NULL) { + perror("realpath"); + return -1; + } + + return 0; } @@ -61,6 +68,7 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) { const char* arg; char* args[16]; int n; + pid_t pid; stdout_file = tmpfile(); if (!stdout_file) { @@ -71,7 +79,7 @@ int process_start(char* name, char* part, process_info_t* p, int is_helper) { p->terminated = 0; p->status = 0; - pid_t pid = fork(); + pid = fork(); if (pid < 0) { perror("fork"); @@ -160,8 +168,14 @@ static void* dowait(void* data) { /* Return 0 if all processes are terminated, -1 on error, -2 on timeout. */ int process_wait(process_info_t* vec, int n, int timeout) { int i; + int r; + int retval; process_info_t* p; dowait_args args; + pthread_t tid; + struct timeval tv; + fd_set fds; + args.vec = vec; args.n = n; args.pipe[0] = -1; @@ -179,10 +193,7 @@ int process_wait(process_info_t* vec, int n, int timeout) { * we'd need to lock vec. */ - pthread_t tid; - int retval; - - int r = pipe((int*)&(args.pipe)); + r = pipe((int*)&(args.pipe)); if (r) { perror("pipe()"); return -1; @@ -195,11 +206,9 @@ int process_wait(process_info_t* vec, int n, int timeout) { goto terminate; } - struct timeval tv; tv.tv_sec = timeout / 1000; tv.tv_usec = 0; - fd_set fds; FD_ZERO(&fds); FD_SET(args.pipe[0], &fds); @@ -252,15 +261,16 @@ long int process_output_size(process_info_t *p) { /* Copy the contents of the stdio output buffer to `fd`. */ int process_copy_output(process_info_t *p, int fd) { - int r = fseek(p->stdout_file, 0, SEEK_SET); + ssize_t nwritten; + char buf[1024]; + int r; + + r = fseek(p->stdout_file, 0, SEEK_SET); if (r < 0) { perror("fseek"); return -1; } - ssize_t nwritten; - char buf[1024]; - /* TODO: what if the line is longer than buf */ while (fgets(buf, sizeof(buf), p->stdout_file) != NULL) { /* TODO: what if write doesn't write the whole buffer... */ diff --git a/deps/uv/test/runner-win.c b/deps/uv/test/runner-win.c index 83d76783f6b1a0..97ef7599eb8e52 100644 --- a/deps/uv/test/runner-win.c +++ b/deps/uv/test/runner-win.c @@ -43,7 +43,7 @@ /* Do platform-specific initialization. */ -void platform_init(int argc, char **argv) { +int platform_init(int argc, char **argv) { const char* tap; tap = getenv("UV_TAP_OUTPUT"); @@ -66,6 +66,8 @@ void platform_init(int argc, char **argv) { setvbuf(stderr, NULL, _IONBF, 0); strcpy(executable_path, argv[0]); + + return 0; } diff --git a/deps/uv/test/runner.c b/deps/uv/test/runner.c index a934b24c6e5e7b..e896d43b7627df 100644 --- a/deps/uv/test/runner.c +++ b/deps/uv/test/runner.c @@ -26,7 +26,7 @@ #include "task.h" #include "uv.h" -char executable_path[PATHMAX] = { '\0' }; +char executable_path[sizeof(executable_path)]; int tap_output = 0; diff --git a/deps/uv/test/runner.h b/deps/uv/test/runner.h index 97c7312da7ba4a..78f3c880a981fc 100644 --- a/deps/uv/test/runner.h +++ b/deps/uv/test/runner.h @@ -22,6 +22,7 @@ #ifndef RUNNER_H_ #define RUNNER_H_ +#include /* PATH_MAX */ #include /* FILE */ @@ -83,8 +84,11 @@ typedef struct { #define TEST_HELPER HELPER_ENTRY #define BENCHMARK_HELPER HELPER_ENTRY -#define PATHMAX 1024 -extern char executable_path[PATHMAX]; +#ifdef PATH_MAX +extern char executable_path[PATH_MAX]; +#else +extern char executable_path[4096]; +#endif /* * Include platform-dependent definitions @@ -130,7 +134,7 @@ void print_tests(FILE* stream); */ /* Do platform-specific initialization. */ -void platform_init(int argc, char** argv); +int platform_init(int argc, char** argv); /* Invoke "argv[0] test-name [test-part]". Store process info in *p. */ /* Make sure that all stdio output of the processes is buffered up. */ diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h index e890c77fe177d5..07584c52996f8c 100644 --- a/deps/uv/test/task.h +++ b/deps/uv/test/task.h @@ -39,6 +39,11 @@ # include /* setrlimit() */ #endif +#ifdef __clang__ +# pragma clang diagnostic ignored "-Wvariadic-macros" +# pragma clang diagnostic ignored "-Wc99-extensions" +#endif + #define TEST_PORT 9123 #define TEST_PORT_2 9124 @@ -229,4 +234,21 @@ UNUSED static void close_loop(uv_loop_t* loop) { uv_run(loop, UV_RUN_DEFAULT); } +UNUSED static int can_ipv6(void) { + uv_interface_address_t* addr; + int supported; + int count; + int i; + + if (uv_interface_addresses(&addr, &count)) + return 1; /* Assume IPv6 support on failure. */ + + supported = 0; + for (i = 0; supported == 0 && i < count; i += 1) + supported = (AF_INET6 == addr[i].address.address6.sin6_family); + + uv_free_interface_addresses(addr, count); + return supported; +} + #endif /* TASK_H_ */ diff --git a/deps/uv/test/test-close-fd.c b/deps/uv/test/test-close-fd.c index 0d17f07661506f..93a7bd7c021026 100644 --- a/deps/uv/test/test-close-fd.c +++ b/deps/uv/test/test-close-fd.c @@ -54,7 +54,6 @@ TEST_IMPL(close_fd) { int fd[2]; ASSERT(0 == pipe(fd)); - ASSERT(0 == fcntl(fd[0], F_SETFL, O_NONBLOCK)); ASSERT(0 == uv_pipe_init(uv_default_loop(), &pipe_handle, 0)); ASSERT(0 == uv_pipe_open(&pipe_handle, fd[0])); fd[0] = -1; /* uv_pipe_open() takes ownership of the file descriptor. */ diff --git a/deps/uv/test/test-cwd-and-chdir.c b/deps/uv/test/test-cwd-and-chdir.c index 6f6173192dbb3c..1e95043c1775a9 100644 --- a/deps/uv/test/test-cwd-and-chdir.c +++ b/deps/uv/test/test-cwd-and-chdir.c @@ -29,35 +29,22 @@ extern char executable_path[]; TEST_IMPL(cwd_and_chdir) { char buffer_orig[PATHMAX]; char buffer_new[PATHMAX]; - size_t size; - char* last_slash; + size_t size1; + size_t size2; int err; - size = sizeof(buffer_orig); - err = uv_cwd(buffer_orig, &size); + size1 = sizeof buffer_orig; + err = uv_cwd(buffer_orig, &size1); ASSERT(err == 0); - /* Remove trailing slash unless at a root directory. */ -#ifdef _WIN32 - last_slash = strrchr(buffer_orig, '\\'); - ASSERT(last_slash); - if (last_slash > buffer_orig && *(last_slash - 1) != ':') { - *last_slash = '\0'; - } -#else /* Unix */ - last_slash = strrchr(buffer_orig, '/'); - ASSERT(last_slash); - if (last_slash != buffer_orig) { - *last_slash = '\0'; - } -#endif - err = uv_chdir(buffer_orig); ASSERT(err == 0); - err = uv_cwd(buffer_new, &size); + size2 = sizeof buffer_new; + err = uv_cwd(buffer_new, &size2); ASSERT(err == 0); + ASSERT(size1 == size2); ASSERT(strcmp(buffer_orig, buffer_new) == 0); return 0; diff --git a/deps/uv/test/test-dlerror.c b/deps/uv/test/test-dlerror.c index 877ebf3712a213..091200edbed591 100644 --- a/deps/uv/test/test-dlerror.c +++ b/deps/uv/test/test-dlerror.c @@ -26,31 +26,28 @@ TEST_IMPL(dlerror) { const char* path = "test/fixtures/load_error.node"; + const char* dlerror_no_error = "no error"; const char* msg; uv_lib_t lib; int r; -#ifdef __linux__ - const char* dlerror_desc = "file too short"; -#elif defined (__sun__) - const char* dlerror_desc = "unknown file type"; -#elif defined (_WIN32) - const char* dlerror_desc = "%1 is not a valid Win32 application"; -#else - const char* dlerror_desc = ""; -#endif + lib.errmsg = NULL; + lib.handle = NULL; + msg = uv_dlerror(&lib); + ASSERT(msg != NULL); + ASSERT(strstr(msg, dlerror_no_error) != NULL); r = uv_dlopen(path, &lib); ASSERT(r == -1); msg = uv_dlerror(&lib); ASSERT(msg != NULL); - ASSERT(strstr(msg, dlerror_desc) != NULL); + ASSERT(strstr(msg, dlerror_no_error) == NULL); /* Should return the same error twice in a row. */ msg = uv_dlerror(&lib); ASSERT(msg != NULL); - ASSERT(strstr(msg, dlerror_desc) != NULL); + ASSERT(strstr(msg, dlerror_no_error) == NULL); uv_dlclose(&lib); diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 471860a76c4c0e..2c392251f03ce5 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -568,7 +568,17 @@ TEST_IMPL(fs_file_loop) { loop = uv_default_loop(); unlink("test_symlink"); - uv_fs_symlink(loop, &req, "test_symlink", "test_symlink", 0, NULL); + r = uv_fs_symlink(loop, &req, "test_symlink", "test_symlink", 0, NULL); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support symlinks; we'll get UV_ENOTSUP. + * Starting with vista they are supported, but only when elevated, otherwise + * we'll see UV_EPERM. + */ + if (r == UV_ENOTSUP || r == UV_EPERM) + return 0; +#endif + ASSERT(r == 0); uv_fs_req_cleanup(&req); r = uv_fs_open(loop, &req, "test_symlink", O_RDONLY, 0, NULL); diff --git a/deps/uv/test/test-get-currentexe.c b/deps/uv/test/test-get-currentexe.c index be578db75d48bf..0e9d6965402daf 100644 --- a/deps/uv/test/test-get-currentexe.c +++ b/deps/uv/test/test-get-currentexe.c @@ -61,5 +61,26 @@ TEST_IMPL(get_currentexe) { r = uv_exepath(buffer, NULL); ASSERT(r == UV_EINVAL); + size = 0; + r = uv_exepath(buffer, &size); + ASSERT(r == UV_EINVAL); + + memset(buffer, -1, sizeof(buffer)); + + size = 1; + r = uv_exepath(buffer, &size); + ASSERT(r == 0); + ASSERT(size == 0); + ASSERT(buffer[0] == '\0'); + + memset(buffer, -1, sizeof(buffer)); + + size = 2; + r = uv_exepath(buffer, &size); + ASSERT(r == 0); + ASSERT(size == 1); + ASSERT(buffer[0] != '\0'); + ASSERT(buffer[1] == '\0'); + return 0; } diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 85ddac82ae123a..eb78a43cc79787 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -29,6 +29,7 @@ TEST_DECLARE (loop_close) TEST_DECLARE (loop_stop) TEST_DECLARE (loop_update_time) TEST_DECLARE (loop_backend_timeout) +TEST_DECLARE (loop_configure) TEST_DECLARE (default_loop_close) TEST_DECLARE (barrier_1) TEST_DECLARE (barrier_2) @@ -103,6 +104,7 @@ TEST_DECLARE (udp_dgram_too_big) TEST_DECLARE (udp_dual_stack) TEST_DECLARE (udp_ipv6_only) TEST_DECLARE (udp_options) +TEST_DECLARE (udp_options6) TEST_DECLARE (udp_no_autobind) TEST_DECLARE (udp_open) TEST_DECLARE (udp_try_send) @@ -269,6 +271,7 @@ TEST_DECLARE (ip4_addr) TEST_DECLARE (ip6_addr_link_local) #ifdef _WIN32 +TEST_DECLARE (poll_close_doesnt_corrupt_stack) TEST_DECLARE (poll_closesocket) TEST_DECLARE (spawn_detect_pipe_name_collisions_on_windows) TEST_DECLARE (argument_escaping) @@ -312,6 +315,7 @@ TASK_LIST_START TEST_ENTRY (loop_stop) TEST_ENTRY (loop_update_time) TEST_ENTRY (loop_backend_timeout) + TEST_ENTRY (loop_configure) TEST_ENTRY (default_loop_close) TEST_ENTRY (barrier_1) TEST_ENTRY (barrier_2) @@ -410,6 +414,7 @@ TASK_LIST_START TEST_ENTRY (udp_dual_stack) TEST_ENTRY (udp_ipv6_only) TEST_ENTRY (udp_options) + TEST_ENTRY (udp_options6) TEST_ENTRY (udp_no_autobind) TEST_ENTRY (udp_multicast_interface) TEST_ENTRY (udp_multicast_interface6) @@ -558,6 +563,7 @@ TASK_LIST_START TEST_ENTRY (kill) #ifdef _WIN32 + TEST_ENTRY (poll_close_doesnt_corrupt_stack) TEST_ENTRY (poll_closesocket) TEST_ENTRY (spawn_detect_pipe_name_collisions_on_windows) TEST_ENTRY (argument_escaping) diff --git a/deps/uv/test/test-loop-configure.c b/deps/uv/test/test-loop-configure.c new file mode 100644 index 00000000000000..d057c1ed8a7bf8 --- /dev/null +++ b/deps/uv/test/test-loop-configure.c @@ -0,0 +1,38 @@ +/* Copyright (c) 2014, Ben Noordhuis + * + * 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. + */ + +#include "uv.h" +#include "task.h" + +static void timer_cb(uv_timer_t* handle) { + uv_close((uv_handle_t*) handle, NULL); +} + + +TEST_IMPL(loop_configure) { + uv_timer_t timer_handle; + uv_loop_t loop; + ASSERT(0 == uv_loop_init(&loop)); +#ifdef _WIN32 + ASSERT(UV_ENOSYS == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, 0)); +#else + ASSERT(0 == uv_loop_configure(&loop, UV_LOOP_BLOCK_SIGNAL, SIGPROF)); +#endif + ASSERT(0 == uv_timer_init(&loop, &timer_handle)); + ASSERT(0 == uv_timer_start(&timer_handle, timer_cb, 10, 0)); + ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT)); + ASSERT(0 == uv_loop_close(&loop)); + return 0; +} diff --git a/deps/uv/test/test-osx-select.c b/deps/uv/test/test-osx-select.c index 68e5a841678336..6ccf603483488a 100644 --- a/deps/uv/test/test-osx-select.c +++ b/deps/uv/test/test-osx-select.c @@ -54,8 +54,10 @@ TEST_IMPL(osx_select) { uv_tty_t tty; fd = open("/dev/tty", O_RDONLY); - - ASSERT(fd >= 0); + if (fd < 0) { + LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno)); + return TEST_SKIP; + } r = uv_tty_init(uv_default_loop(), &tty, fd, 1); ASSERT(r == 0); @@ -90,6 +92,8 @@ TEST_IMPL(osx_select_many_fds) { uv_tty_t tty; uv_tcp_t tcps[1500]; + TEST_FILE_LIMIT(ARRAY_SIZE(tcps) + 100); + r = uv_ip4_addr("127.0.0.1", 0, &addr); ASSERT(r == 0); @@ -102,7 +106,10 @@ TEST_IMPL(osx_select_many_fds) { } fd = open("/dev/tty", O_RDONLY); - ASSERT(fd >= 0); + if (fd < 0) { + LOGF("Cannot open /dev/tty as read-only: %s\n", strerror(errno)); + return TEST_SKIP; + } r = uv_tty_init(uv_default_loop(), &tty, fd, 1); ASSERT(r == 0); diff --git a/deps/uv/test/test-ping-pong.c b/deps/uv/test/test-ping-pong.c index 81941ab83db3b6..c074178541b0a3 100644 --- a/deps/uv/test/test-ping-pong.c +++ b/deps/uv/test/test-ping-pong.c @@ -246,6 +246,9 @@ TEST_IMPL(tcp_ping_pong) { TEST_IMPL(tcp_ping_pong_v6) { + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + tcp_pinger_v6_new(); uv_run(uv_default_loop(), UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-pipe-close-stdout-read-stdin.c b/deps/uv/test/test-pipe-close-stdout-read-stdin.c index 26a1ee76c93ecf..ee8bb2a9a8bc38 100644 --- a/deps/uv/test/test-pipe-close-stdout-read-stdin.c +++ b/deps/uv/test/test-pipe-close-stdout-read-stdin.c @@ -53,8 +53,10 @@ TEST_IMPL(pipe_close_stdout_read_stdin) { int pid; int fd[2]; int status; + uv_pipe_t stdin_pipe; - pipe(fd); + r = pipe(fd); + ASSERT(r == 0); if ((pid = fork()) == 0) { /* @@ -63,11 +65,10 @@ TEST_IMPL(pipe_close_stdout_read_stdin) { */ close(fd[1]); close(0); - dup(fd[0]); + r = dup(fd[0]); + ASSERT(r != -1); /* Create a stream that reads from the pipe. */ - uv_pipe_t stdin_pipe; - r = uv_pipe_init(uv_default_loop(), (uv_pipe_t *)&stdin_pipe, 0); ASSERT(r == 0); diff --git a/deps/uv/test/test-platform-output.c b/deps/uv/test/test-platform-output.c index 931311985bbdf7..dc6fa32b0d115f 100644 --- a/deps/uv/test/test-platform-output.c +++ b/deps/uv/test/test-platform-output.c @@ -27,6 +27,7 @@ TEST_IMPL(platform_output) { char buffer[512]; size_t rss; + size_t size; double uptime; uv_rusage_t rusage; uv_cpu_info_t* cpus; @@ -39,6 +40,11 @@ TEST_IMPL(platform_output) { ASSERT(err == 0); printf("uv_get_process_title: %s\n", buffer); + size = sizeof(buffer); + err = uv_cwd(buffer, &size); + ASSERT(err == 0); + printf("uv_cwd: %s\n", buffer); + err = uv_resident_set_memory(&rss); ASSERT(err == 0); printf("uv_resident_set_memory: %llu\n", (unsigned long long) rss); diff --git a/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c b/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c new file mode 100644 index 00000000000000..fc2cc004f16ae7 --- /dev/null +++ b/deps/uv/test/test-poll-close-doesnt-corrupt-stack.c @@ -0,0 +1,114 @@ +/* Copyright Bert Belder, and other libuv 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. + */ + +#ifdef _WIN32 + +#include +#include + +#include "uv.h" +#include "task.h" + +#ifdef _MSC_VER /* msvc */ +# define NO_INLINE __declspec(noinline) +#else /* gcc */ +# define NO_INLINE __attribute__ ((noinline)) +#endif + + +uv_os_sock_t sock; +uv_poll_t handle; + +static int close_cb_called = 0; + + +static void close_cb(uv_handle_t* h) { + close_cb_called++; +} + + +static void poll_cb(uv_poll_t* h, int status, int events) { + ASSERT(0 && "should never get here"); +} + + +static void NO_INLINE close_socket_and_verify_stack() { + const uint32_t MARKER = 0xDEADBEEF; + const int VERIFY_AFTER = 10; /* ms */ + int r; + + volatile uint32_t data[65536]; + size_t i; + + for (i = 0; i < ARRAY_SIZE(data); i++) + data[i] = MARKER; + + r = closesocket(sock); + ASSERT(r == 0); + + uv_sleep(VERIFY_AFTER); + + for (i = 0; i < ARRAY_SIZE(data); i++) + ASSERT(data[i] == MARKER); +} + + +TEST_IMPL(poll_close_doesnt_corrupt_stack) { + struct WSAData wsa_data; + int r; + unsigned long on; + struct sockaddr_in addr; + + r = WSAStartup(MAKEWORD(2, 2), &wsa_data); + ASSERT(r == 0); + + sock = socket(AF_INET, SOCK_STREAM, 0); + ASSERT(sock != INVALID_SOCKET); + on = 1; + r = ioctlsocket(sock, FIONBIO, &on); + ASSERT(r == 0); + + r = uv_ip4_addr("127.0.0.1", TEST_PORT, &addr); + ASSERT(r == 0); + + r = connect(sock, (const struct sockaddr*) &addr, sizeof addr); + ASSERT(r != 0); + ASSERT(WSAGetLastError() == WSAEWOULDBLOCK); + + r = uv_poll_init_socket(uv_default_loop(), &handle, sock); + ASSERT(r == 0); + r = uv_poll_start(&handle, UV_READABLE | UV_WRITABLE, poll_cb); + ASSERT(r == 0); + + uv_close((uv_handle_t*) &handle, close_cb); + + close_socket_and_verify_stack(); + + r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); + ASSERT(r == 0); + + ASSERT(close_cb_called == 1); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +#endif /* _WIN32 */ diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index 11f43bdf1341a7..a229d225f1bb58 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -1032,6 +1032,7 @@ TEST_IMPL(spawn_with_an_odd_path) { #ifndef _WIN32 TEST_IMPL(spawn_setuid_setgid) { int r; + struct passwd* pw; /* if not root, then this will fail. */ uv_uid_t uid = getuid(); @@ -1043,7 +1044,6 @@ TEST_IMPL(spawn_setuid_setgid) { init_process_options("spawn_helper1", exit_cb); /* become the "nobody" user. */ - struct passwd* pw; pw = getpwnam("nobody"); ASSERT(pw != NULL); options.uid = pw->pw_uid; @@ -1051,6 +1051,9 @@ TEST_IMPL(spawn_setuid_setgid) { options.flags = UV_PROCESS_SETUID | UV_PROCESS_SETGID; r = uv_spawn(uv_default_loop(), &process, &options); + if (r == UV_EACCES) + RETURN_SKIP("user 'nobody' cannot access the test runner"); + ASSERT(r == 0); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); @@ -1240,7 +1243,6 @@ TEST_IMPL(closed_fd_events) { /* create a pipe and share it with a child process */ ASSERT(0 == pipe(fd)); - ASSERT(0 == fcntl(fd[0], F_SETFL, O_NONBLOCK)); /* spawn_helper4 blocks indefinitely. */ init_process_options("spawn_helper4", exit_cb); @@ -1297,7 +1299,16 @@ TEST_IMPL(spawn_reads_child_path) { int len; char file[64]; char path[1024]; - char *env[2] = {path, NULL}; + char* env[3]; + + /* Need to carry over the dynamic linker path when the test runner is + * linked against libuv.so, see https://github.com/libuv/libuv/issues/85. + */ +#if defined(__APPLE__) + static const char dyld_path_var[] = "DYLD_LIBRARY_PATH"; +#else + static const char dyld_path_var[] = "LD_LIBRARY_PATH"; +#endif /* Set up the process, but make sure that the file to run is relative and */ /* requires a lookup into PATH */ @@ -1312,6 +1323,16 @@ TEST_IMPL(spawn_reads_child_path) { strcpy(path, "PATH="); strcpy(path + 5, exepath); + env[0] = path; + env[1] = getenv(dyld_path_var); + env[2] = NULL; + + if (env[1] != NULL) { + static char buf[1024 + sizeof(dyld_path_var)]; + snprintf(buf, sizeof(buf), "%s=%s", dyld_path_var, env[1]); + env[1] = buf; + } + options.file = file; options.args[0] = file; options.env = env; diff --git a/deps/uv/test/test-tcp-bind6-error.c b/deps/uv/test/test-tcp-bind6-error.c index 1d65f3de3e6eec..b762bcb3d1b8d0 100644 --- a/deps/uv/test/test-tcp-bind6-error.c +++ b/deps/uv/test/test-tcp-bind6-error.c @@ -39,6 +39,9 @@ TEST_IMPL(tcp_bind6_error_addrinuse) { uv_tcp_t server1, server2; int r; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server1); @@ -73,6 +76,9 @@ TEST_IMPL(tcp_bind6_error_addrnotavail) { uv_tcp_t server; int r; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("4:4:4:4:4:4:4:4", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); @@ -98,6 +104,9 @@ TEST_IMPL(tcp_bind6_error_fault) { uv_tcp_t server; int r; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + garbage_addr = (struct sockaddr_in6*) &garbage; r = uv_tcp_init(uv_default_loop(), &server); @@ -123,6 +132,9 @@ TEST_IMPL(tcp_bind6_error_inval) { uv_tcp_t server; int r; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr1)); ASSERT(0 == uv_ip6_addr("::", TEST_PORT_2, &addr2)); @@ -149,6 +161,9 @@ TEST_IMPL(tcp_bind6_localhost_ok) { uv_tcp_t server; int r; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr)); r = uv_tcp_init(uv_default_loop(), &server); diff --git a/deps/uv/test/test-tcp-try-write.c b/deps/uv/test/test-tcp-try-write.c index baff6cf36cc009..8a60136b64e9aa 100644 --- a/deps/uv/test/test-tcp-try-write.c +++ b/deps/uv/test/test-tcp-try-write.c @@ -28,16 +28,6 @@ #define MAX_BYTES 1024 * 1024 -#ifdef _WIN32 - -TEST_IMPL(tcp_try_write) { - - MAKE_VALGRIND_HAPPY(); - return 0; -} - -#else /* !_WIN32 */ - static uv_tcp_t server; static uv_tcp_t client; static uv_tcp_t incoming; @@ -138,5 +128,3 @@ TEST_IMPL(tcp_try_write) { MAKE_VALGRIND_HAPPY(); return 0; } - -#endif /* !_WIN32 */ diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c index fb69910732ca2e..7e1ce2668899f8 100644 --- a/deps/uv/test/test-tty.c +++ b/deps/uv/test/test-tty.c @@ -96,6 +96,13 @@ TEST_IMPL(tty) { printf("width=%d height=%d\n", width, height); + if (width == 0 && height == 0) { + /* Some environments such as containers or Jenkins behave like this + * sometimes */ + MAKE_VALGRIND_HAPPY(); + return TEST_SKIP; + } + /* * Is it a safe assumption that most people have terminals larger than * 10x10? diff --git a/deps/uv/test/test-udp-ipv6.c b/deps/uv/test/test-udp-ipv6.c index 0ca9f4dcff6a6e..1d5720ce73162a 100644 --- a/deps/uv/test/test-udp-ipv6.c +++ b/deps/uv/test/test-udp-ipv6.c @@ -147,23 +147,22 @@ static void do_test(uv_udp_recv_cb recv_cb, int bind_flags) { TEST_IMPL(udp_dual_stack) { -#if defined(__DragonFly__) || \ - defined(__FreeBSD__) || \ - defined(__OpenBSD__) || \ - defined(__NetBSD__) - RETURN_SKIP("dual stack not enabled by default in this OS."); -#else + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + do_test(ipv6_recv_ok, 0); ASSERT(recv_cb_called == 1); ASSERT(send_cb_called == 1); return 0; -#endif } TEST_IMPL(udp_ipv6_only) { + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + do_test(ipv6_recv_fail, UV_UDP_IPV6ONLY); ASSERT(recv_cb_called == 0); diff --git a/deps/uv/test/test-udp-multicast-interface6.c b/deps/uv/test/test-udp-multicast-interface6.c index e54e738b0be301..d3881e83bb1565 100644 --- a/deps/uv/test/test-udp-multicast-interface6.c +++ b/deps/uv/test/test-udp-multicast-interface6.c @@ -60,6 +60,9 @@ TEST_IMPL(udp_multicast_interface6) { struct sockaddr_in6 addr; struct sockaddr_in6 baddr; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); diff --git a/deps/uv/test/test-udp-multicast-join6.c b/deps/uv/test/test-udp-multicast-join6.c index babf61e2bf7dc3..9ba201ab9eba98 100644 --- a/deps/uv/test/test-udp-multicast-join6.c +++ b/deps/uv/test/test-udp-multicast-join6.c @@ -103,6 +103,9 @@ TEST_IMPL(udp_multicast_join6) { uv_buf_t buf; struct sockaddr_in6 addr; + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + ASSERT(0 == uv_ip6_addr("::1", TEST_PORT, &addr)); r = uv_udp_init(uv_default_loop(), &server); diff --git a/deps/uv/test/test-udp-options.c b/deps/uv/test/test-udp-options.c index 19c45c2e31976d..0da1786f506fc4 100644 --- a/deps/uv/test/test-udp-options.c +++ b/deps/uv/test/test-udp-options.c @@ -27,15 +27,12 @@ #include -TEST_IMPL(udp_options) { +static int udp_options_test(const struct sockaddr* addr) { static int invalid_ttls[] = { -1, 0, 256 }; - struct sockaddr_in addr; uv_loop_t* loop; uv_udp_t h; int i, r; - ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); - loop = uv_default_loop(); r = uv_udp_init(loop, &h); @@ -43,7 +40,7 @@ TEST_IMPL(udp_options) { uv_unref((uv_handle_t*)&h); /* don't keep the loop alive */ - r = uv_udp_bind(&h, (const struct sockaddr*) &addr, 0); + r = uv_udp_bind(&h, addr, 0); ASSERT(r == 0); r = uv_udp_set_broadcast(&h, 1); @@ -88,6 +85,25 @@ TEST_IMPL(udp_options) { } +TEST_IMPL(udp_options) { + struct sockaddr_in addr; + + ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + return udp_options_test((const struct sockaddr*) &addr); +} + + +TEST_IMPL(udp_options6) { + struct sockaddr_in6 addr; + + if (!can_ipv6()) + RETURN_SKIP("IPv6 not supported"); + + ASSERT(0 == uv_ip6_addr("::", TEST_PORT, &addr)); + return udp_options_test((const struct sockaddr*) &addr); +} + + TEST_IMPL(udp_no_autobind) { uv_loop_t* loop; uv_udp_t h; diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index a5ba14c315a14a..45af6a1f96aa63 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -17,28 +17,8 @@ }], ], 'xcode_settings': { - 'conditions': [ - [ 'clang==1', { - 'WARNING_CFLAGS': [ - '-Wall', - '-Wextra', - '-Wno-unused-parameter', - '-Wno-dollar-in-identifier-extension' - ]}, { - 'WARNING_CFLAGS': [ - '-Wall', - '-Wextra', - '-Wno-unused-parameter' - ]} - ] - ], - 'OTHER_LDFLAGS': [ - ], - 'OTHER_CFLAGS': [ - '-g', - '--std=gnu89', - '-pedantic' - ], + 'WARNING_CFLAGS': [ '-Wall', '-Wextra', '-Wno-unused-parameter' ], + 'OTHER_CFLAGS': [ '-g', '--std=gnu89', '-pedantic' ], } }, @@ -335,6 +315,7 @@ 'test/test-loop-close.c', 'test/test-loop-stop.c', 'test/test-loop-time.c', + 'test/test-loop-configure.c', 'test/test-walk-handles.c', 'test/test-watcher-cross-stop.c', 'test/test-multiple-listen.c', @@ -350,6 +331,7 @@ 'test/test-platform-output.c', 'test/test-poll.c', 'test/test-poll-close.c', + 'test/test-poll-close-doesnt-corrupt-stack.c', 'test/test-poll-closesocket.c', 'test/test-process-title.c', 'test/test-ref.c', diff --git a/deps/v8/.DEPS.git b/deps/v8/.DEPS.git deleted file mode 100644 index 8f9da45bb6746d..00000000000000 --- a/deps/v8/.DEPS.git +++ /dev/null @@ -1,113 +0,0 @@ -# DO NOT EDIT EXCEPT FOR LOCAL TESTING. -# THIS IS A GENERATED FILE. -# ALL MANUAL CHANGES WILL BE OVERWRITTEN. -# SEE http://code.google.com/p/chromium/wiki/UsingGit -# FOR HOW TO ROLL DEPS -vars = { - 'webkit_url': - 'https://chromium.googlesource.com/chromium/blink.git', - 'git_url': - 'https://chromium.googlesource.com' -} - -deps = { - 'v8/build/gyp': - Var('git_url') + '/external/gyp.git@a3e2a5caf24a1e0a45401e09ad131210bf16b852', - 'v8/buildtools': - Var('git_url') + '/chromium/buildtools.git@fb782d4369d5ae04f17a2fceef7de5a63e50f07b', - 'v8/testing/gmock': - Var('git_url') + '/external/googlemock.git@896ba0e03f520fb9b6ed582bde2bd00847e3c3f2', - 'v8/testing/gtest': - Var('git_url') + '/external/googletest.git@4650552ff637bb44ecf7784060091cbed3252211', - 'v8/third_party/icu': - Var('git_url') + '/chromium/deps/icu52.git@26d8859357ac0bfb86b939bf21c087b8eae22494', -} - -deps_os = { - 'android': - { - 'v8/third_party/android_tools': - Var('git_url') + '/android_tools.git@31869996507de16812bb53a3d0aaa15cd6194c16', - }, - 'win': - { - 'v8/third_party/cygwin': - Var('git_url') + '/chromium/deps/cygwin.git@06a117a90c15174436bfa20ceebbfdf43b7eb820', - 'v8/third_party/python_26': - Var('git_url') + '/chromium/deps/python_26.git@67d19f904470effe3122d27101cc5a8195abd157', - }, -} - -include_rules = [ - '+include', - '+unicode', - '+third_party/fdlibm' -] - -skip_child_includes = [ - 'build', - 'third_party' -] - -hooks = [ - { - 'action': - [ - 'download_from_google_storage', - '--no_resume', - '--platform=win32', - '--no_auth', - '--bucket', - 'chromium-clang-format', - '-s', - 'v8/buildtools/win/clang-format.exe.sha1' -], - 'pattern': - '.', - 'name': - 'clang_format_win' -}, - { - 'action': - [ - 'download_from_google_storage', - '--no_resume', - '--platform=darwin', - '--no_auth', - '--bucket', - 'chromium-clang-format', - '-s', - 'v8/buildtools/mac/clang-format.sha1' -], - 'pattern': - '.', - 'name': - 'clang_format_mac' -}, - { - 'action': - [ - 'download_from_google_storage', - '--no_resume', - '--platform=linux*', - '--no_auth', - '--bucket', - 'chromium-clang-format', - '-s', - 'v8/buildtools/linux64/clang-format.sha1' -], - 'pattern': - '.', - 'name': - 'clang_format_linux' -}, - { - 'action': - [ - 'python', - 'v8/build/gyp_v8' -], - 'pattern': - '.' -} -] diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index d0407f37f124f5..f720bee948660a 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -66,8 +66,11 @@ shell_g /test/test262-es6/tc39-test262-* /testing/gmock /testing/gtest +/third_party /third_party/icu /third_party/llvm +/third_party/llvm-build +/tools/clang /tools/jsfunfuzz /tools/jsfunfuzz.zip /tools/oom_dump/oom_dump diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 1758ee9e1fa86d..6534eea8594810 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -2,9 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +# Because standalone V8 builds are not supported, assume this is part of a +# Chromium build. +import("//build/module_args/v8.gni") + # TODO(jochen): These will need to be user-settable to support standalone V8 # builds. -v8_compress_startup_data = "off" v8_deprecation_warnings = false v8_enable_disassembler = false v8_enable_gdbjit = false @@ -15,7 +18,6 @@ v8_interpreted_regexp = false v8_object_print = false v8_postmortem_support = false v8_use_snapshot = true -v8_use_external_startup_data = false v8_enable_extra_checks = is_debug v8_target_arch = cpu_arch v8_random_seed = "314159265" @@ -95,11 +97,6 @@ config("features") { "V8_I18N_SUPPORT", ] } - if (v8_compress_startup_data == "bz2") { - defines += [ - "COMPRESS_STARTUP_DATA_BZ2", - ] - } if (v8_enable_extra_checks == true) { defines += [ "ENABLE_EXTRA_CHECKS", @@ -216,7 +213,6 @@ action("js2c") { args = [ rebase_path("$target_gen_dir/libraries.cc", root_build_dir), "CORE", - v8_compress_startup_data ] + rebase_path(sources, root_build_dir) if (v8_use_external_startup_data) { @@ -243,9 +239,12 @@ action("js2c_experimental") { "src/generator.js", "src/harmony-string.js", "src/harmony-array.js", + "src/harmony-array-includes.js", "src/harmony-typedarray.js", "src/harmony-classes.js", - "src/harmony-tostring.js" + "src/harmony-tostring.js", + "src/harmony-templates.js", + "src/harmony-regexp.js" ] outputs = [ @@ -255,7 +254,6 @@ action("js2c_experimental") { args = [ rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), "EXPERIMENTAL", - v8_compress_startup_data ] + rebase_path(sources, root_build_dir) if (v8_use_external_startup_data) { @@ -282,7 +280,7 @@ if (v8_use_external_startup_data) { ] outputs = [ - "$root_gen_dir/natives_blob.bin" + "$root_out_dir/natives_blob.bin" ] script = "tools/concatenate-files.py" @@ -335,10 +333,10 @@ action("run_mksnapshot") { } if (v8_use_external_startup_data) { - outputs += [ "$root_gen_dir/snapshot_blob.bin" ] + outputs += [ "$root_out_dir/snapshot_blob.bin" ] args += [ "--startup_blob", - rebase_path("$root_gen_dir/snapshot_blob.bin", root_build_dir) + rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir) ] } } @@ -361,7 +359,6 @@ source_set("v8_nosnapshot") { "$target_gen_dir/libraries.cc", "$target_gen_dir/experimental-libraries.cc", "src/snapshot-empty.cc", - "src/snapshot-common.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -383,7 +380,6 @@ source_set("v8_snapshot") { "$target_gen_dir/libraries.cc", "$target_gen_dir/experimental-libraries.cc", "$target_gen_dir/snapshot.cc", - "src/snapshot-common.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -436,6 +432,8 @@ source_set("v8_base") { "src/assert-scope.cc", "src/ast-numbering.cc", "src/ast-numbering.h", + "src/ast-this-access-visitor.cc", + "src/ast-this-access-visitor.h", "src/ast-value-factory.cc", "src/ast-value-factory.h", "src/ast.cc", @@ -491,22 +489,22 @@ source_set("v8_base") { "src/compiler/code-generator-impl.h", "src/compiler/code-generator.cc", "src/compiler/code-generator.h", + "src/compiler/common-node-cache.cc", "src/compiler/common-node-cache.h", + "src/compiler/common-operator-reducer.cc", + "src/compiler/common-operator-reducer.h", "src/compiler/common-operator.cc", "src/compiler/common-operator.h", "src/compiler/control-builders.cc", "src/compiler/control-builders.h", + "src/compiler/control-equivalence.h", "src/compiler/control-reducer.cc", "src/compiler/control-reducer.h", "src/compiler/diamond.h", "src/compiler/frame.h", "src/compiler/gap-resolver.cc", "src/compiler/gap-resolver.h", - "src/compiler/generic-algorithm-inl.h", "src/compiler/generic-algorithm.h", - "src/compiler/generic-graph.h", - "src/compiler/generic-node-inl.h", - "src/compiler/generic-node.h", "src/compiler/graph-builder.cc", "src/compiler/graph-builder.h", "src/compiler/graph-inl.h", @@ -540,15 +538,23 @@ source_set("v8_base") { "src/compiler/js-operator.h", "src/compiler/js-typed-lowering.cc", "src/compiler/js-typed-lowering.h", + "src/compiler/jump-threading.cc", + "src/compiler/jump-threading.h", "src/compiler/linkage-impl.h", "src/compiler/linkage.cc", "src/compiler/linkage.h", + "src/compiler/load-elimination.cc", + "src/compiler/load-elimination.h", + "src/compiler/loop-analysis.cc", + "src/compiler/loop-analysis.h", "src/compiler/machine-operator-reducer.cc", "src/compiler/machine-operator-reducer.h", "src/compiler/machine-operator.cc", "src/compiler/machine-operator.h", "src/compiler/machine-type.cc", "src/compiler/machine-type.h", + "src/compiler/move-optimizer.cc", + "src/compiler/move-optimizer.h", "src/compiler/node-aux-data-inl.h", "src/compiler/node-aux-data.h", "src/compiler/node-cache.cc", @@ -558,12 +564,12 @@ source_set("v8_base") { "src/compiler/node-properties.h", "src/compiler/node.cc", "src/compiler/node.h", + "src/compiler/opcodes.cc", "src/compiler/opcodes.h", - "src/compiler/operator-properties-inl.h", + "src/compiler/operator-properties.cc", "src/compiler/operator-properties.h", "src/compiler/operator.cc", "src/compiler/operator.h", - "src/compiler/phi-reducer.h", "src/compiler/pipeline.cc", "src/compiler/pipeline.h", "src/compiler/pipeline-statistics.cc", @@ -572,6 +578,8 @@ source_set("v8_base") { "src/compiler/raw-machine-assembler.h", "src/compiler/register-allocator.cc", "src/compiler/register-allocator.h", + "src/compiler/register-allocator-verifier.cc", + "src/compiler/register-allocator-verifier.h", "src/compiler/register-configuration.cc", "src/compiler/register-configuration.h", "src/compiler/representation-change.h", @@ -780,6 +788,9 @@ source_set("v8_base") { "src/jsregexp-inl.h", "src/jsregexp.cc", "src/jsregexp.h", + "src/layout-descriptor-inl.h", + "src/layout-descriptor.cc", + "src/layout-descriptor.h", "src/list-inl.h", "src/list.h", "src/lithium-allocator-inl.h", @@ -873,7 +884,6 @@ source_set("v8_base") { "src/runtime/runtime-utils.h", "src/runtime/runtime.cc", "src/runtime/runtime.h", - "src/runtime/string-builder.h", "src/safepoint-table.cc", "src/safepoint-table.h", "src/sampler.cc", @@ -890,9 +900,12 @@ source_set("v8_base") { "src/serialize.h", "src/small-pointer-list.h", "src/smart-pointers.h", + "src/snapshot-common.cc", "src/snapshot-source-sink.cc", "src/snapshot-source-sink.h", "src/snapshot.h", + "src/string-builder.cc", + "src/string-builder.h", "src/string-search.cc", "src/string-search.h", "src/string-stream.cc", @@ -1210,11 +1223,6 @@ source_set("v8_base") { # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. cflags = [ "/wd4267" ] } - if (is_linux) { - if (v8_compress_startup_data == "bz2") { - libs += [ "bz2" ] - } - } if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] @@ -1260,6 +1268,7 @@ source_set("v8_libbase") { "src/base/flags.h", "src/base/functional.cc", "src/base/functional.h", + "src/base/iterator.h", "src/base/lazy-instance.h", "src/base/logging.cc", "src/base/logging.h", @@ -1388,10 +1397,6 @@ if (current_toolchain == host_toolchain) { ":v8_nosnapshot", "//build/config/sanitizers:deps", ] - - if (v8_compress_startup_data == "bz2") { - libs = [ "bz2" ] - } } } @@ -1406,7 +1411,7 @@ component("v8") { "src/v8dll-main.cc", ] - if (v8_use_external_startup_data) { + if (v8_use_snapshot && v8_use_external_startup_data) { deps = [ ":v8_base", ":v8_external_snapshot", @@ -1417,6 +1422,7 @@ component("v8") { ":v8_snapshot", ] } else { + assert(!v8_use_external_startup_data) deps = [ ":v8_base", ":v8_nosnapshot", @@ -1438,7 +1444,7 @@ component("v8") { } else { group("v8") { - if (v8_use_external_startup_data) { + if (v8_use_snapshot && v8_use_external_startup_data) { deps = [ ":v8_base", ":v8_external_snapshot", @@ -1449,6 +1455,7 @@ group("v8") { ":v8_snapshot", ] } else { + assert(!v8_use_external_startup_data) deps = [ ":v8_base", ":v8_nosnapshot", diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 1e298537caf125..d42a2f1564de79 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,552 @@ +2015-01-07: Version 3.32.3 + + Performance and stability improvements on all platforms. + + +2015-01-07: Version 3.32.2 + + Performance and stability improvements on all platforms. + + +2015-01-07: Version 3.32.1 + + [turbofan] Don't crash when typing load from a Uint8ClampedArray + (Chromium issue 446156). + + [turbofan] Truncation of Bit/Word8/16 to Word32 is a no-op (Chromium + issue 445859). + + [x64] Rearrange code for OOB integer loads (Chromium issue 445858). + + Fix %NeverOptimizeFunction() intrinsic (Chromium issue 445732). + + [turbofan] Fix invalid bounds check with overflowing offset (Chromium + issue 445267). + + [turbofan] Raise max virtual registers and call parameter limit (issue + 3786). + + Performance and stability improvements on all platforms. + + +2014-12-23: Version 3.31.74 + + [turbofan] Turn DCHECK for fixed slot index into a CHECK (Chromium issue + 444681). + + Performance and stability improvements on all platforms. + + +2014-12-23: Version 3.31.73 + + [turbofan] Fix missing ChangeUint32ToUint64 in lowering of LoadBuffer + (Chromium issue 444695). + + Enable the embedder to specify what kind of context was disposed. + + Performance and stability improvements on all platforms. + + +2014-12-22: Version 3.31.72 + + [turbofan] Correctify lowering of Uint8ClampedArray buffer access + (Chromium issue 444508). + + Performance and stability improvements on all platforms. + + +2014-12-20: Version 3.31.71 + + Performance and stability improvements on all platforms. + + +2014-12-20: Version 3.31.70 + + Performance and stability improvements on all platforms. + + +2014-12-20: Version 3.31.69 + + Performance and stability improvements on all platforms. + + +2014-12-19: Version 3.31.68 + + [turbofan] Fix unsafe out-of-bounds check for checked loads/stores + (Chromium issue 443744). + + Performance and stability improvements on all platforms. + + +2014-12-19: Version 3.31.67 + + Performance and stability improvements on all platforms. + + +2014-12-19: Version 3.31.66 + + Ship ES6 template literals (issue 3230). + + Performance and stability improvements on all platforms. + + +2014-12-18: Version 3.31.65 + + ES6 template literals should not use legacy octal strings (issue 3736). + + Performance and stability improvements on all platforms. + + +2014-12-18: Version 3.31.64 + + Fixed -fsanitize=float-cast-overflow problems (issue 3773). + + Performance and stability improvements on all platforms. + + +2014-12-18: Version 3.31.63 + + ES6 computed property names (issue 3754). + + Performance and stability improvements on all platforms. + + +2014-12-17: Version 3.31.62 + + Performance and stability improvements on all platforms. + + +2014-12-17: Version 3.31.61 + + ES6: Update unscopables to match spec (issue 3632). + + ES6 computed property names (issue 3754). + + More -fsanitize=vptr fixes (Chromium issue 441099). + + [turbofan] Cache conversions inserted during typed lowering (issue + 3763). + + Performance and stability improvements on all platforms. + + +2014-12-16: Version 3.31.60 + + Performance and stability improvements on all platforms. + + +2014-12-16: Version 3.31.59 + + Performance and stability improvements on all platforms. + + +2014-12-16: Version 3.31.58 + + Ship ES6 classes (issue 3330). + + ES6 computed property names (issue 3754). + + Performance and stability improvements on all platforms. + + +2014-12-12: Version 3.31.57 + + Consistently use only one of virtual/OVERRIDE/FINAL (issue 3753). + + Performance and stability improvements on all platforms. + + +2014-12-12: Version 3.31.56 + + Performance and stability improvements on all platforms. + + +2014-12-12: Version 3.31.55 + + Performance and stability improvements on all platforms. + + +2014-12-11: Version 3.31.54 + + Implement Array.from() (issue 3336). + + move v8_use_external_startup_data to standalone.gypi (Chromium issue + 421063). + + Performance and stability improvements on all platforms. + + +2014-12-11: Version 3.31.53 + + Performance and stability improvements on all platforms. + + +2014-12-11: Version 3.31.52 + + Ship ES6 block scoping (issue 2198). + + Optimize Object.seal and Object.preventExtensions (issue 3662, Chromium + issue 115960). + + Add Array.prototype.includes (issue 3575). + + Performance and stability improvements on all platforms. + + +2014-12-10: Version 3.31.51 + + [x64] Fix optimization for certain checked load/stores (Chromium issue + 439743). + + Performance and stability improvements on all platforms. + + +2014-12-09: Version 3.31.50 + + Temporarily restore make dependencies. + + Performance and stability improvements on all platforms. + + +2014-12-09: Version 3.31.49 + + Performance and stability improvements on all platforms. + + +2014-12-09: Version 3.31.48 + + Performance and stability improvements on all platforms. + + +2014-12-09: Version 3.31.47 + + Temporarily restore make dependencies. + + Performance and stability improvements on all platforms. + + +2014-12-08: Version 3.31.46 + + Performance and stability improvements on all platforms. + + +2014-12-08: Version 3.31.45 + + Update all DEPS to match chromium's DEPS at edb488e. + + Turn on DCHECKs and other debugging code if dcheck_always_on is 1 (issue + 3731). + + Optimize GetPrototype. + + Performance and stability improvements on all platforms. + + +2014-12-05: Version 3.31.44 + + Performance and stability improvements on all platforms. + + +2014-12-04: Version 3.31.43 + + ES6 template literals: Fix issue with template after rbrace (issue + 3734). + + Stage ES6 template literals (issue 3230). + + Performance and stability improvements on all platforms. + + +2014-12-04: Version 3.31.42 + + Performance and stability improvements on all platforms. + + +2014-12-04: Version 3.31.41 + + Simplify template literal raw string creation (issue 3710). + + Performance and stability improvements on all platforms. + + +2014-12-03: Version 3.31.40 + + Performance and stability improvements on all platforms. + + +2014-12-03: Version 3.31.39 + + Performance and stability improvements on all platforms. + + +2014-12-03: Version 3.31.38 + + Stage ES6 classes and object literal extensions (issue 3330). + + Fixed environment handling for LFlooringDivI on ARM (Chromium issue + 437765). + + Add GetIdentityHash to v8::Name object API (Chromium issue 437416). + + Set V8_CC_GNU or V8_CC_MSVC for clang in gcc / cl mode (Chromium issue + 82385). + + Performance and stability improvements on all platforms. + + +2014-12-02: Version 3.31.37 + + Performance and stability improvements on all platforms. + + +2014-12-02: Version 3.31.36 + + Set V8_CC_GNU or V8_CC_MSVC for clang in gcc / cl mode (Chromium issue + 82385). + + Performance and stability improvements on all platforms. + + +2014-12-02: Version 3.31.35 + + Performance and stability improvements on all platforms. + + +2014-12-01: Version 3.31.34 + + Performance and stability improvements on all platforms. + + +2014-12-01: Version 3.31.33 + + Performance and stability improvements on all platforms. + + +2014-12-01: Version 3.31.32 + + Performance and stability improvements on all platforms. + + +2014-12-01: Version 3.31.31 + + Performance and stability improvements on all platforms. + + +2014-11-29: Version 3.31.30 + + Performance and stability improvements on all platforms. + + +2014-11-28: Version 3.31.29 + + Stage @@toStringTag (--harmony-tostring). + + Performance and stability improvements on all platforms. + + +2014-11-28: Version 3.31.28 + + Performance and stability improvements on all platforms. + + +2014-11-28: Version 3.31.27 + + Ship harmony-strings. + + Performance and stability improvements on all platforms. + + +2014-11-28: Version 3.31.26 + + Abort optimization in corner case (Chromium issue 436893). + + Performance and stability improvements on all platforms. + + +2014-11-26: Version 3.31.25 + + Stage ES6 block scoping (issue 2198). + + Introduce legacy const slots in correct context (Chromium issue 410030). + + Performance and stability improvements on all platforms. + + +2014-11-26: Version 3.31.24 + + Performance and stability improvements on all platforms. + + +2014-11-25: Version 3.31.23 + + Performance and stability improvements on all platforms. + + +2014-11-25: Version 3.31.22 + + Performance and stability improvements on all platforms. + + +2014-11-24: Version 3.31.21 + + Performance and stability improvements on all platforms. + + +2014-11-24: Version 3.31.20 + + Performance and stability improvements on all platforms. + + +2014-11-22: Version 3.31.19 + + Performance and stability improvements on all platforms. + + +2014-11-21: Version 3.31.18 + + Performance and stability improvements on all platforms. + + +2014-11-21: Version 3.31.17 + + Performance and stability improvements on all platforms. + + +2014-11-21: Version 3.31.16 + + Cache template literal callSiteObj (issue 3230). + + Rename String.prototype.contains to 'includes'. + + Reserve code range block for evacuation (Chromium issue 430118). + + Performance and stability improvements on all platforms. + + +2014-11-20: Version 3.31.15 + + Rename String.prototype.contains to 'includes'. + + Performance and stability improvements on all platforms. + + +2014-11-19: Version 3.31.14 + + Remove Weak{Map,Set}.prototype.clear. + + Performance and stability improvements on all platforms. + + +2014-11-19: Version 3.31.13 + + Performance and stability improvements on all platforms. + + +2014-11-19: Version 3.31.12 + + Classes: Expand test to cover strict runtime behavior (issue 3330). + + v8::String::Concat must not throw (Chromium issue 420240). + + Fix disabling all break points from within the debug event callback + (Chromium issue 432493). + + Performance and stability improvements on all platforms. + + +2014-11-18: Version 3.31.11 + + Performance and stability improvements on all platforms. + + +2014-11-17: Version 3.31.10 + + Performance and stability improvements on all platforms. + + +2014-11-17: Version 3.31.9 + + Expose internal properties of map/set iterators via mirrors. + + Performance and stability improvements on all platforms. + + +2014-11-17: Version 3.31.8 + + Performance and stability improvements on all platforms. + + +2014-11-15: Version 3.31.7 + + Classes: Add support for stepping through default constructors (issue + 3674). + + Performance and stability improvements on all platforms. + + +2014-11-14: Version 3.31.6 + + Fix desugaring of let bindings in for loops to handle continue properly + (issue 3683). + + Performance and stability improvements on all platforms. + + +2014-11-14: Version 3.31.5 + + Classes: Implement correct name binding (issue 3330). + + Performance and stability improvements on all platforms. + + +2014-11-14: Version 3.31.4 + + Performance and stability improvements on all platforms. + + +2014-11-14: Version 3.31.3 + + Classes: Cleanup default constructor flag. + + Soft fail for invalid cache data. + + Implement .of() on typed arrays (issue 3578). + + Performance and stability improvements on all platforms. + + +2014-11-13: Version 3.31.2 + + MIPS: Leaving a generator via an exception causes it to close (issue + 3096). + + MIPS: ES6: Add support for super in object literals (issue 3571). + + Increase the target new space size to the max new space size (issue + 3626). + + Leaving a generator via an exception causes it to close (issue 3096). + + Correctly compute line numbers in functions from the function + constructor (Chromium issue 109362). + + Rename v8::Exception::GetMessage to CreateMessage. + + Classes: Add support for arguments in default constructor (issue 3672). + + ES6: Add support for super in object literals (issue 3571). + + Performance and stability improvements on all platforms. + + +2014-11-12: Version 3.31.1 + + Fix has_constant_parameter_count() confusion in LReturn (Chromium issue + 431602). + + Performance and stability improvements on all platforms. + + 2014-11-05: Version 3.30.33 `1..isPrototypeOf.call(null)` should return false, not throw TypeError diff --git a/deps/v8/DEPS b/deps/v8/DEPS index d4139c6098545b..a81c7ecc38837f 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -3,44 +3,32 @@ # all paths in here must match this assumption. vars = { - "chromium_git": "https://chromium.googlesource.com", - - "chromium_trunk": "https://src.chromium.org/svn/trunk", - - "buildtools_revision": "fb782d4369d5ae04f17a2fceef7de5a63e50f07b", + "git_url": "https://chromium.googlesource.com", } deps = { - # Remember to keep the revision in sync with the Makefile. "v8/build/gyp": - "http://gyp.googlecode.com/svn/trunk@1831", - + Var("git_url") + "/external/gyp.git" + "@" + "fe00999dfaee449d3465a9316778434884da4fa7", # from svn revision 2010 "v8/third_party/icu": - Var("chromium_trunk") + "/deps/third_party/icu52@277999", - + Var("git_url") + "/chromium/deps/icu.git" + "@" + "51c1a4ce5f362676aa1f1cfdb5b7e52edabfa5aa", "v8/buildtools": - "https://chromium.googlesource.com/chromium/buildtools.git@" + - Var("buildtools_revision"), - + Var("git_url") + "/chromium/buildtools.git" + "@" + "23a4e2f545c7b6340d7e5a2b74801941b0a86535", "v8/testing/gtest": - "http://googletest.googlecode.com/svn/trunk@692", - + Var("git_url") + "/external/googletest.git" + "@" + "8245545b6dc9c4703e6496d1efd19e975ad2b038", # from svn revision 700 "v8/testing/gmock": - "http://googlemock.googlecode.com/svn/trunk@485", + Var("git_url") + "/external/googlemock.git" + "@" + "29763965ab52f24565299976b936d1265cb6a271", # from svn revision 501 + "v8/tools/clang": + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "c945be21f6485fa177b43814f910b76cce921653", } deps_os = { "android": { "v8/third_party/android_tools": - Var("chromium_git") + "/android_tools.git" + "@" + - "31869996507de16812bb53a3d0aaa15cd6194c16", + Var("git_url") + "/android_tools.git" + "@" + "4f723e2a5fa5b7b8a198072ac19b92344be2b271", }, "win": { "v8/third_party/cygwin": - Var("chromium_trunk") + "/deps/third_party/cygwin@66844", - - "v8/third_party/python_26": - Var("chromium_trunk") + "/tools/third_party/python_26@89111", + Var("git_url") + "/chromium/deps/cygwin.git" + "@" + "c89e446b273697fadf3a10ff1007a97c0b7de6df", } } @@ -92,6 +80,13 @@ hooks = [ "-s", "v8/buildtools/linux64/clang-format.sha1", ], }, + { + # Pull clang if needed or requested via GYP_DEFINES. + # Note: On Win, this should run after win_toolchain, as it may use it. + 'name': 'clang', + 'pattern': '.', + 'action': ['python', 'v8/tools/clang/scripts/update.py', '--if-needed'], + }, { # A change to a .gyp, .gypi, or to GYP itself should run the generator. "pattern": ".", diff --git a/deps/v8/Makefile b/deps/v8/Makefile index 3b02f52d2ad65d..606b5d7bf176ab 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -64,6 +64,10 @@ endif ifeq ($(verifyheap), on) GYPFLAGS += -Dv8_enable_verify_heap=1 endif +# tracemaps=on +ifeq ($(tracemaps), on) + GYPFLAGS += -Dv8_trace_maps=1 +endif # backtrace=off ifeq ($(backtrace), off) GYPFLAGS += -Dv8_enable_backtrace=0 @@ -78,6 +82,9 @@ endif ifeq ($(snapshot), off) GYPFLAGS += -Dv8_use_snapshot='false' endif +ifeq ($(snapshot), external) + GYPFLAGS += -Dv8_use_external_startup_data=1 +endif # extrachecks=on/off ifeq ($(extrachecks), on) GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1 @@ -486,7 +493,7 @@ gtags.clean: # "dependencies" includes also dependencies required for development. # Remember to keep these in sync with the DEPS file. builddeps: - svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ + svn checkout --force https://gyp.googlecode.com/svn/trunk build/gyp \ --revision 1831 if svn info third_party/icu 2>&1 | grep -q icu46 ; then \ svn switch --force \ @@ -497,9 +504,9 @@ builddeps: https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \ third_party/icu --revision 277999 ; \ fi - svn checkout --force http://googletest.googlecode.com/svn/trunk \ + svn checkout --force https://googletest.googlecode.com/svn/trunk \ testing/gtest --revision 692 - svn checkout --force http://googlemock.googlecode.com/svn/trunk \ + svn checkout --force https://googlemock.googlecode.com/svn/trunk \ testing/gmock --revision 485 dependencies: builddeps diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index 8e200f1f246caf..2a3640382b4f5f 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -38,12 +38,10 @@ HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') ANDROID_NDK_HOST_ARCH ?= $(shell uname -m | sed -e 's/i[3456]86/x86/') ifeq ($(HOST_OS), linux) TOOLCHAIN_DIR = linux-$(ANDROID_NDK_HOST_ARCH) +else ifeq ($(HOST_OS), mac) + TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) else - ifeq ($(HOST_OS), mac) - TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) - else - $(error Host platform "${HOST_OS}" is not supported) - endif + $(error Host platform "${HOST_OS}" is not supported) endif ifeq ($(ARCH), android_arm) @@ -52,38 +50,29 @@ ifeq ($(ARCH), android_arm) TOOLCHAIN_ARCH = arm-linux-androideabi TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) TOOLCHAIN_VER = 4.8 +else ifeq ($(ARCH), android_arm64) + DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=21 + TOOLCHAIN_ARCH = aarch64-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.9 +else ifeq ($(ARCH), android_mipsel) + DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_platform=14 + DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 + TOOLCHAIN_ARCH = mipsel-linux-android + TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) + TOOLCHAIN_VER = 4.8 +else ifeq ($(ARCH), android_ia32) + DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 android_target_platform=14 + TOOLCHAIN_ARCH = x86 + TOOLCHAIN_PREFIX = i686-linux-android + TOOLCHAIN_VER = 4.8 +else ifeq ($(ARCH), android_x87) + DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 + TOOLCHAIN_ARCH = x86 + TOOLCHAIN_PREFIX = i686-linux-android + TOOLCHAIN_VER = 4.8 else - ifeq ($(ARCH), android_arm64) - DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=L - TOOLCHAIN_ARCH = aarch64-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.9 - else - ifeq ($(ARCH), android_mipsel) - DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_platform=14 - DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 - TOOLCHAIN_ARCH = mipsel-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 - - else - ifeq ($(ARCH), android_ia32) - DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 - else - ifeq ($(ARCH), android_x87) - DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 - else - $(error Target architecture "${ARCH}" is not supported) - endif - endif - endif - endif + $(error Target architecture "${ARCH}" is not supported) endif TOOLCHAIN_PATH = \ diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index aa5f64449ec68c..22a05cb17782de 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -1,3 +1,4 @@ +adamk@chromium.org bmeurer@chromium.org danno@chromium.org dcarney@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index 3a9895db8df028..6d19a4e57408d7 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -244,11 +244,11 @@ def GetPreferredTryMasters(project, change): 'v8_linux_rel': set(['defaulttests']), 'v8_linux_dbg': set(['defaulttests']), 'v8_linux_nosnap_rel': set(['defaulttests']), - 'v8_linux_nosnap_dbg': set(['defaulttests']), 'v8_linux64_rel': set(['defaulttests']), 'v8_linux_arm_dbg': set(['defaulttests']), 'v8_linux_arm64_rel': set(['defaulttests']), 'v8_linux_layout_dbg': set(['defaulttests']), + 'v8_linux_chromium_gn_rel': set(['defaulttests']), 'v8_mac_rel': set(['defaulttests']), 'v8_win_rel': set(['defaulttests']), 'v8_win64_compile_rel': set(['defaulttests']), diff --git a/deps/v8/README.md b/deps/v8/README.md index 7ce52a0b03a200..bc1685affa99dc 100644 --- a/deps/v8/README.md +++ b/deps/v8/README.md @@ -16,8 +16,15 @@ V8 Project page: https://code.google.com/p/v8/ Getting the Code ============= -V8 Git repository: https://chromium.googlesource.com/v8/v8.git -GitHub mirror: https://github.com/v8/v8-git-mirror +Checkout [depot tools](http://www.chromium.org/developers/how-tos/install-depot-tools), and run + +> `fetch v8` + +This will checkout V8 into the directory `v8` and fetch all of its dependencies. +To stay up to date, run + +> `git pull origin` +> `gclient sync` For fetching all branches, add the following into your remote configuration in `.git/config`: diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi index f984ea3af61b32..5d3b25a74636ca 100644 --- a/deps/v8/build/android.gypi +++ b/deps/v8/build/android.gypi @@ -74,13 +74,13 @@ ], }, # Release }, # configurations - 'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter', - '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions', - # Note: Using -std=c++0x will define __STRICT_ANSI__, which in - # turn will leave out some template stuff for 'long long'. What - # we want is -std=c++11, but this is not supported by GCC 4.6 or - # Xcode 4.2 - '-std=gnu++0x' ], + 'cflags': [ '-Wno-abi', '-Wall', '-W', '-Wno-unused-parameter'], + 'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-fno-exceptions', + # Note: Using -std=c++0x will define __STRICT_ANSI__, which + # in turn will leave out some template stuff for 'long + # long'. What we want is -std=c++11, but this is not + # supported by GCC 4.6 or Xcode 4.2 + '-std=gnu++0x' ], 'target_conditions': [ ['_toolset=="target"', { 'cflags!': [ @@ -93,11 +93,13 @@ '-fno-short-enums', '-finline-limit=64', '-Wa,--noexecstack', - '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. # Note: This include is in cflags to ensure that it comes after # all of the includes. '-I<(android_include)', ], + 'cflags_cc': [ + '-Wno-error=non-virtual-dtor', # TODO(michaelbai): Fix warnings. + ], 'defines': [ 'ANDROID', #'__GNU_SOURCE=1', # Necessary for clone() @@ -213,8 +215,7 @@ '-fno-stack-protector', ], }], - ['target_arch=="arm64" or target_arch=="x64"', { - # TODO(ulan): Enable PIE for other architectures (crbug.com/373219). + ['(target_arch=="arm" or target_arch=="arm64" or target_arch=="x64") and component!="shared_library"', { 'cflags': [ '-fPIE', ], diff --git a/deps/v8/build/features.gypi b/deps/v8/build/features.gypi index 7ce66e4c98e87c..465eba91480d72 100644 --- a/deps/v8/build/features.gypi +++ b/deps/v8/build/features.gypi @@ -29,8 +29,6 @@ { 'variables': { - 'v8_compress_startup_data%': 'off', - 'v8_enable_disassembler%': 0, 'v8_enable_gdbjit%': 0, @@ -39,6 +37,8 @@ 'v8_enable_verify_heap%': 0, + 'v8_trace_maps%': 0, + 'v8_use_snapshot%': 'true', 'v8_enable_verify_predictable%': 0, @@ -59,9 +59,8 @@ # Enable compiler warnings when using V8_DEPRECATED apis. 'v8_deprecation_warnings%': 0, - # Use external files for startup data blobs: - # the JS builtins sources and the start snapshot. - 'v8_use_external_startup_data%': 0, + # Set to 1 to enable DCHECKs in release builds. + 'dcheck_always_on%': 0, }, 'target_defaults': { 'conditions': [ @@ -77,6 +76,9 @@ ['v8_enable_verify_heap==1', { 'defines': ['VERIFY_HEAP',], }], + ['v8_trace_maps==1', { + 'defines': ['TRACE_MAPS',], + }], ['v8_enable_verify_predictable==1', { 'defines': ['VERIFY_PREDICTABLE',], }], @@ -89,12 +91,12 @@ ['v8_enable_i18n_support==1', { 'defines': ['V8_I18N_SUPPORT',], }], - ['v8_compress_startup_data=="bz2"', { - 'defines': ['COMPRESS_STARTUP_DATA_BZ2',], - }], ['v8_use_external_startup_data==1', { 'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',], }], + ['dcheck_always_on!=0', { + 'defines': ['DEBUG',], + }], ], # conditions 'configurations': { 'DebugBaseCommon': { @@ -115,7 +117,7 @@ 'Release': { 'variables': { 'v8_enable_extra_checks%': 0, - 'v8_enable_handle_zapping%': 1, + 'v8_enable_handle_zapping%': 0, }, 'conditions': [ ['v8_enable_extra_checks==1', { diff --git a/deps/v8/build/standalone.gypi b/deps/v8/build/standalone.gypi index 47b276311d90a5..ee91e78899f0b9 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/build/standalone.gypi @@ -33,6 +33,8 @@ 'includes': ['toolchain.gypi'], 'variables': { 'component%': 'static_library', + 'make_clang_dir%': '../third_party/llvm-build/Release+Asserts', + 'clang_xcode%': 0, 'asan%': 0, 'tsan%': 0, 'visibility%': 'hidden', @@ -91,6 +93,12 @@ # near-release speeds. 'v8_optimized_debug%': 0, + # Use external files for startup data blobs: + # the JS builtins sources and the start snapshot. + # Embedders that don't use standalone.gypi will need to add + # their own default value. + 'v8_use_external_startup_data%': 0, + # Relative path to icu.gyp from this file. 'icu_gyp_path': '../third_party/icu/icu.gyp', @@ -127,6 +135,16 @@ 'arm_fpu%': 'vfpv3', 'arm_float_abi%': 'default', 'arm_thumb': 'default', + + # Default MIPS variable settings. + 'mips_arch_variant%': 'r2', + # Possible values fp32, fp64, fpxx. + # fp32 - 32 32-bit FPU registers are available, doubles are placed in + # register pairs. + # fp64 - 32 64-bit FPU registers are available. + # fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime + # detection + 'mips_fpu_mode%': 'fp32', }, 'target_defaults': { 'variables': { @@ -368,6 +386,7 @@ }], # OS=="win" ['OS=="mac"', { 'xcode_settings': { + 'SDKROOT': 'macosx', 'SYMROOT': '<(DEPTH)/xcodebuild', }, 'target_defaults': { @@ -422,5 +441,20 @@ ], # target_conditions }, # target_defaults }], # OS=="mac" + ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) ' + 'and OS!="win"', { + 'make_global_settings': [ + ['CC', '<(make_clang_dir)/bin/clang'], + ['CXX', '<(make_clang_dir)/bin/clang++'], + ['CC.host', '$(CC)'], + ['CXX.host', '$(CXX)'], + ], + }], + ['clang==1 and OS=="win"', { + 'make_global_settings': [ + # On Windows, gyp's ninja generator only looks at CC. + ['CC', '<(make_clang_dir)/bin/clang-cl'], + ], + }], ], } diff --git a/deps/v8/build/toolchain.gypi b/deps/v8/build/toolchain.gypi index 20c2c943bb9f72..ac10065601a0c1 100644 --- a/deps/v8/build/toolchain.gypi +++ b/deps/v8/build/toolchain.gypi @@ -30,7 +30,6 @@ { 'variables': { 'msvs_use_common_release': 0, - 'gcc_version%': 'unknown', 'clang%': 0, 'v8_target_arch%': '<(target_arch)', # Native Client builds currently use the V8 ARM JIT and @@ -55,17 +54,6 @@ # Similar to the ARM hard float ABI but on MIPS. 'v8_use_mips_abi_hardfloat%': 'true', - # Default arch variant for MIPS. - 'mips_arch_variant%': 'r2', - - # Possible values fp32, fp64, fpxx. - # fp32 - 32 32-bit FPU registers are available, doubles are placed in - # register pairs. - # fp64 - 32 64-bit FPU registers are available. - # fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime - # detection - 'mips_fpu_mode%': 'fp32', - 'v8_enable_backtrace%': 0, # Enable profiling support. Only required on Windows. @@ -278,10 +266,27 @@ 'V8_TARGET_ARCH_MIPS', ], 'conditions': [ - ['v8_target_arch==target_arch and android_webview_build==0', { - # Target built with a Mips CXX compiler. - 'target_conditions': [ - ['_toolset=="target"', { + [ 'v8_can_use_fpu_instructions=="true"', { + 'defines': [ + 'CAN_USE_FPU_INSTRUCTIONS', + ], + }], + [ 'v8_use_mips_abi_hardfloat=="true"', { + 'defines': [ + '__mips_hard_float=1', + 'CAN_USE_FPU_INSTRUCTIONS', + ], + }, { + 'defines': [ + '__mips_soft_float=1' + ] + }], + ], + 'target_conditions': [ + ['_toolset=="target"', { + 'conditions': [ + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with a Mips CXX compiler. 'cflags': ['-EB'], 'ldflags': ['-EB'], 'conditions': [ @@ -292,16 +297,11 @@ 'cflags': ['-msoft-float'], 'ldflags': ['-msoft-float'], }], - ['mips_fpu_mode=="fp64"', { - 'cflags': ['-mfp64'], - }], - ['mips_fpu_mode=="fpxx"', { - 'cflags': ['-mfpxx'], - }], - ['mips_fpu_mode=="fp32"', { - 'cflags': ['-mfp32'], - }], ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], 'cflags!': ['-mfp32', '-mfpxx'], 'cflags': ['-mips32r6', '-Wa,-mips32r6'], 'ldflags': [ @@ -311,23 +311,145 @@ ], }], ['mips_arch_variant=="r2"', { + 'conditions': [ + [ 'mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + 'cflags': ['-mfp64'], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + 'cflags': ['-mfpxx'], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32', + ], + 'cflags': ['-mfp32'], + }], + ], 'cflags': ['-mips32r2', '-Wa,-mips32r2'], 'ldflags': ['-mips32r2'], }], ['mips_arch_variant=="r1"', { + 'defines': [ + 'FPU_MODE_FP32', + ], 'cflags!': ['-mfp64', '-mfpxx'], 'cflags': ['-mips32', '-Wa,-mips32'], 'ldflags': ['-mips32'], }], ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], 'cflags!': ['-mfp64', '-mfp32'], 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'], 'ldflags': ['-mips32'], }], ], + }, { + # 'v8_target_arch!=target_arch' + # Target not built with an MIPS CXX compiler (simulator build). + 'conditions': [ + ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], + }], + ['mips_arch_variant=="r2"', { + 'conditions': [ + [ 'mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32', + ], + }], + ], + }], + ['mips_arch_variant=="r1"', { + 'defines': [ + 'FPU_MODE_FP32', + ], + }], + ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], + }], + ], }], ], - }], + }], #_toolset=="target" + ['_toolset=="host"', { + 'conditions': [ + ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], + }], + ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], + }], + ['mips_arch_variant=="r2"', { + 'conditions': [ + ['mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32' + ], + }], + ], + }], + ['mips_arch_variant=="r1"', { + 'defines': ['FPU_MODE_FP32',], + }], + ] + }], #_toolset=="host" + ], + }], # v8_target_arch=="mips" + ['v8_target_arch=="mipsel"', { + 'defines': [ + 'V8_TARGET_ARCH_MIPS', + ], + 'conditions': [ [ 'v8_can_use_fpu_instructions=="true"', { 'defines': [ 'CAN_USE_FPU_INSTRUCTIONS', @@ -343,46 +465,12 @@ '__mips_soft_float=1' ], }], - ['mips_arch_variant=="rx"', { - 'defines': [ - '_MIPS_ARCH_MIPS32RX', - 'FPU_MODE_FPXX', - ], - }], - ['mips_arch_variant=="r6"', { - 'defines': [ - '_MIPS_ARCH_MIPS32R6', - 'FPU_MODE_FP64', - ], - }], - ['mips_arch_variant=="r2"', { - 'defines': ['_MIPS_ARCH_MIPS32R2',], - 'conditions': [ - ['mips_fpu_mode=="fp64"', { - 'defines': ['FPU_MODE_FP64',], - }], - ['mips_fpu_mode=="fpxx"', { - 'defines': ['FPU_MODE_FPXX',], - }], - ['mips_fpu_mode=="fp32"', { - 'defines': ['FPU_MODE_FP32',], - }], - ], - }], - ['mips_arch_variant=="r1"', { - 'defines': ['FPU_MODE_FP32',], - }], ], - }], # v8_target_arch=="mips" - ['v8_target_arch=="mipsel"', { - 'defines': [ - 'V8_TARGET_ARCH_MIPS', - ], - 'conditions': [ - ['v8_target_arch==target_arch and android_webview_build==0', { - # Target built with a Mips CXX compiler. - 'target_conditions': [ - ['_toolset=="target"', { + 'target_conditions': [ + ['_toolset=="target"', { + 'conditions': [ + ['v8_target_arch==target_arch and android_webview_build==0', { + # Target built with a Mips CXX compiler. 'cflags': ['-EL'], 'ldflags': ['-EL'], 'conditions': [ @@ -393,16 +481,11 @@ 'cflags': ['-msoft-float'], 'ldflags': ['-msoft-float'], }], - ['mips_fpu_mode=="fp64"', { - 'cflags': ['-mfp64'], - }], - ['mips_fpu_mode=="fpxx"', { - 'cflags': ['-mfpxx'], - }], - ['mips_fpu_mode=="fp32"', { - 'cflags': ['-mfp32'], - }], ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], 'cflags!': ['-mfp32', '-mfpxx'], 'cflags': ['-mips32r6', '-Wa,-mips32r6'], 'ldflags': [ @@ -412,6 +495,29 @@ ], }], ['mips_arch_variant=="r2"', { + 'conditions': [ + [ 'mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + 'cflags': ['-mfp64'], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + 'cflags': ['-mfpxx'], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32', + ], + 'cflags': ['-mfp32'], + }], + ], 'cflags': ['-mips32r2', '-Wa,-mips32r2'], 'ldflags': ['-mips32r2'], }], @@ -421,18 +527,130 @@ 'ldflags': ['-mips32'], }], ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], 'cflags!': ['-mfp64', '-mfp32'], 'cflags': ['-mips32', '-Wa,-mips32', '-mfpxx'], 'ldflags': ['-mips32'], }], ['mips_arch_variant=="loongson"', { + 'defines': [ + '_MIPS_ARCH_LOONGSON', + 'FPU_MODE_FP32', + ], 'cflags!': ['-mfp64', '-mfp32', '-mfpxx'], 'cflags': ['-mips3', '-Wa,-mips3'], }], ], + }, { + # 'v8_target_arch!=target_arch' + # Target not built with an MIPS CXX compiler (simulator build). + 'conditions': [ + ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], + }], + ['mips_arch_variant=="r2"', { + 'conditions': [ + [ 'mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32', + ], + }], + ], + }], + ['mips_arch_variant=="r1"', { + 'defines': [ + 'FPU_MODE_FP32', + ], + }], + ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], + }], + ['mips_arch_variant=="loongson"', { + 'defines': [ + '_MIPS_ARCH_LOONGSON', + 'FPU_MODE_FP32', + ], + }], + ], }], ], + }], #_toolset=="target + ['_toolset=="host"', { + 'conditions': [ + ['mips_arch_variant=="rx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32RX', + 'FPU_MODE_FPXX', + ], + }], + ['mips_arch_variant=="r6"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R6', + 'FPU_MODE_FP64', + ], + }], + ['mips_arch_variant=="r2"', { + 'conditions': [ + ['mips_fpu_mode=="fp64"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP64', + ], + }], + ['mips_fpu_mode=="fpxx"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FPXX', + ], + }], + ['mips_fpu_mode=="fp32"', { + 'defines': [ + '_MIPS_ARCH_MIPS32R2', + 'FPU_MODE_FP32' + ], + }], + ], + }], + ['mips_arch_variant=="r1"', { + 'defines': ['FPU_MODE_FP32',], + }], + ['mips_arch_variant=="loongson"', { + 'defines': [ + '_MIPS_ARCH_LOONGSON', + 'FPU_MODE_FP32', + ], + }], + ] }], + ], + }], # v8_target_arch=="mipsel" + ['v8_target_arch=="mips64el"', { + 'defines': [ + 'V8_TARGET_ARCH_MIPS64', + ], + 'conditions': [ [ 'v8_can_use_fpu_instructions=="true"', { 'defines': [ 'CAN_USE_FPU_INSTRUCTIONS', @@ -448,52 +666,11 @@ '__mips_soft_float=1' ], }], - ['mips_arch_variant=="rx"', { - 'defines': [ - '_MIPS_ARCH_MIPS32RX', - 'FPU_MODE_FPXX', - ], - }], - ['mips_arch_variant=="r6"', { - 'defines': [ - '_MIPS_ARCH_MIPS32R6', - 'FPU_MODE_FP64', - ], - }], - ['mips_arch_variant=="r2"', { - 'defines': ['_MIPS_ARCH_MIPS32R2',], + ], + 'target_conditions': [ + ['_toolset=="target"', { 'conditions': [ - ['mips_fpu_mode=="fp64"', { - 'defines': ['FPU_MODE_FP64',], - }], - ['mips_fpu_mode=="fpxx"', { - 'defines': ['FPU_MODE_FPXX',], - }], - ['mips_fpu_mode=="fp32"', { - 'defines': ['FPU_MODE_FP32',], - }], - ], - }], - ['mips_arch_variant=="r1"', { - 'defines': ['FPU_MODE_FP32',], - }], - ['mips_arch_variant=="loongson"', { - 'defines': [ - '_MIPS_ARCH_LOONGSON', - 'FPU_MODE_FP32', - ], - }], - ], - }], # v8_target_arch=="mipsel" - ['v8_target_arch=="mips64el"', { - 'defines': [ - 'V8_TARGET_ARCH_MIPS64', - ], - 'conditions': [ - ['v8_target_arch==target_arch and android_webview_build==0', { - # Target built with a Mips CXX compiler. - 'target_conditions': [ - ['_toolset=="target"', { + ['v8_target_arch==target_arch and android_webview_build==0', { 'cflags': ['-EL'], 'ldflags': ['-EL'], 'conditions': [ @@ -505,6 +682,7 @@ 'ldflags': ['-msoft-float'], }], ['mips_arch_variant=="r6"', { + 'defines': ['_MIPS_ARCH_MIPS64R6',], 'cflags': ['-mips64r6', '-mabi=64', '-Wa,-mips64r6'], 'ldflags': [ '-mips64r6', '-mabi=64', @@ -513,6 +691,7 @@ ], }], ['mips_arch_variant=="r2"', { + 'defines': ['_MIPS_ARCH_MIPS64R2',], 'cflags': ['-mips64r2', '-mabi=64', '-Wa,-mips64r2'], 'ldflags': [ '-mips64r2', '-mabi=64', @@ -521,30 +700,30 @@ ], }], ], + }, { + # 'v8_target_arch!=target_arch' + # Target not built with an MIPS CXX compiler (simulator build). + 'conditions': [ + ['mips_arch_variant=="r6"', { + 'defines': ['_MIPS_ARCH_MIPS64R6',], + }], + ['mips_arch_variant=="r2"', { + 'defines': ['_MIPS_ARCH_MIPS64R2',], + }], + ], }], ], - }], - [ 'v8_can_use_fpu_instructions=="true"', { - 'defines': [ - 'CAN_USE_FPU_INSTRUCTIONS', - ], - }], - [ 'v8_use_mips_abi_hardfloat=="true"', { - 'defines': [ - '__mips_hard_float=1', - 'CAN_USE_FPU_INSTRUCTIONS', - ], - }, { - 'defines': [ - '__mips_soft_float=1' + }], #'_toolset=="target" + ['_toolset=="host"', { + 'conditions': [ + ['mips_arch_variant=="r6"', { + 'defines': ['_MIPS_ARCH_MIPS64R6',], + }], + ['mips_arch_variant=="r2"', { + 'defines': ['_MIPS_ARCH_MIPS64R2',], + }], ], - }], - ['mips_arch_variant=="r6"', { - 'defines': ['_MIPS_ARCH_MIPS64R6',], - }], - ['mips_arch_variant=="r2"', { - 'defines': ['_MIPS_ARCH_MIPS64R2',], - }], + }], #'_toolset=="host" ], }], # v8_target_arch=="mips64el" ['v8_target_arch=="x64"', { @@ -724,6 +903,9 @@ }, }], ], + 'defines': [ + 'ENABLE_SLOW_DCHECKS', + ], }, # DebugBase0 # Abstract configuration for v8_optimized_debug == 1. 'DebugBase1': { @@ -748,6 +930,9 @@ 'LinkIncremental': '2', }, }, + 'defines': [ + 'ENABLE_SLOW_DCHECKS', + ], 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ OS=="qnx"', { @@ -762,14 +947,6 @@ '-ffunction-sections', '-O1', # TODO(2807) should be -O3. ], - 'conditions': [ - ['gcc_version==44 and clang==0', { - 'cflags': [ - # Avoid crashes with gcc 4.4 in the v8 test suite. - '-fno-tree-vrp', - ], - }], - ], }], ['OS=="mac"', { 'xcode_settings': { @@ -816,9 +993,6 @@ '-fdata-sections', '-ffunction-sections', ], - 'defines': [ - 'OPTIMIZED_DEBUG' - ], 'conditions': [ # TODO(crbug.com/272548): Avoid -O3 in NaCl ['nacl_target_arch=="none"', { @@ -828,12 +1002,6 @@ 'cflags': ['-O2'], 'cflags!': ['-O3'], }], - ['gcc_version==44 and clang==0', { - 'cflags': [ - # Avoid crashes with gcc 4.4 in the v8 test suite. - '-fno-tree-vrp', - ], - }], ], }], ['OS=="mac"', { @@ -852,7 +1020,8 @@ 'V8_ENABLE_CHECKS', 'OBJECT_PRINT', 'VERIFY_HEAP', - 'DEBUG' + 'DEBUG', + 'TRACE_MAPS' ], 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" or \ @@ -873,6 +1042,7 @@ # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG. 'defines!': [ 'DEBUG', + 'ENABLE_SLOW_DCHECKS', ], }], ], @@ -905,12 +1075,6 @@ '<(wno_array_bounds)', ], 'conditions': [ - [ 'gcc_version==44 and clang==0', { - 'cflags': [ - # Avoid crashes with gcc 4.4 in the v8 test suite. - '-fno-tree-vrp', - ], - }], # TODO(crbug.com/272548): Avoid -O3 in NaCl ['nacl_target_arch=="none"', { 'cflags': ['-O3'], @@ -931,14 +1095,6 @@ '-ffunction-sections', '-O2', ], - 'conditions': [ - [ 'gcc_version==44 and clang==0', { - 'cflags': [ - # Avoid crashes with gcc 4.4 in the v8 test suite. - '-fno-tree-vrp', - ], - }], - ], }], ['OS=="mac"', { 'xcode_settings': { diff --git a/deps/v8/codereview.settings b/deps/v8/codereview.settings index b7f853cd594d6d..a7ee88e3612792 100644 --- a/deps/v8/codereview.settings +++ b/deps/v8/codereview.settings @@ -1,8 +1,9 @@ CODE_REVIEW_SERVER: https://codereview.chromium.org CC_LIST: v8-dev@googlegroups.com -VIEW_VC: https://code.google.com/p/v8/source/detail?r= +VIEW_VC: https://chromium.googlesource.com/v8/v8/+/ STATUS: http://v8-status.appspot.com/status TRY_ON_UPLOAD: False TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try-v8 TRYSERVER_ROOT: v8 PROJECT: v8 +PENDING_REF_PREFIX: refs/pending/ diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index d5433a6a269836..d35f2fcb27fabe 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -140,6 +140,17 @@ template class CustomArguments; class PropertyCallbackArguments; class FunctionCallbackArguments; class GlobalHandles; + +class CallbackData { + public: + V8_INLINE v8::Isolate* GetIsolate() const { return isolate_; } + + protected: + explicit CallbackData(v8::Isolate* isolate) : isolate_(isolate) {} + + private: + v8::Isolate* isolate_; +}; } @@ -418,22 +429,53 @@ template class Eternal { }; -template -class WeakCallbackData { +template +class PhantomCallbackData : public internal::CallbackData { + public: + typedef void (*Callback)(const PhantomCallbackData& data); + + V8_INLINE T* GetParameter() const { return parameter_; } + + PhantomCallbackData(Isolate* isolate, T* parameter) + : internal::CallbackData(isolate), parameter_(parameter) {} + + private: + T* parameter_; +}; + + +template +class WeakCallbackData : public PhantomCallbackData

        { public: typedef void (*Callback)(const WeakCallbackData& data); - V8_INLINE Isolate* GetIsolate() const { return isolate_; } V8_INLINE Local GetValue() const { return handle_; } - V8_INLINE P* GetParameter() const { return parameter_; } private: friend class internal::GlobalHandles; - WeakCallbackData(Isolate* isolate, Local handle, P* parameter) - : isolate_(isolate), handle_(handle), parameter_(parameter) { } - Isolate* isolate_; + WeakCallbackData(Isolate* isolate, P* parameter, Local handle) + : PhantomCallbackData

        (isolate, parameter), handle_(handle) {} Local handle_; - P* parameter_; +}; + + +template +class InternalFieldsCallbackData : public internal::CallbackData { + public: + typedef void (*Callback)(const InternalFieldsCallbackData& data); + + InternalFieldsCallbackData(Isolate* isolate, T* internalField1, + U* internalField2) + : internal::CallbackData(isolate), + internal_field1_(internalField1), + internal_field2_(internalField2) {} + + V8_INLINE T* GetInternalField1() const { return internal_field1_; } + V8_INLINE U* GetInternalField2() const { return internal_field2_; } + + private: + T* internal_field1_; + U* internal_field2_; }; @@ -471,22 +513,23 @@ template class PersistentBase { template V8_INLINE void Reset(Isolate* isolate, const PersistentBase& other); - V8_INLINE bool IsEmpty() const { return val_ == 0; } + V8_INLINE bool IsEmpty() const { return val_ == NULL; } + V8_INLINE void Empty() { val_ = 0; } template V8_INLINE bool operator==(const PersistentBase& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == 0) return b == 0; - if (b == 0) return false; + if (a == NULL) return b == NULL; + if (b == NULL) return false; return *a == *b; } template V8_INLINE bool operator==(const Handle& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); - if (a == 0) return b == 0; - if (b == 0) return false; + if (a == NULL) return b == NULL; + if (b == NULL) return false; return *a == *b; } @@ -519,14 +562,17 @@ template class PersistentBase { // Phantom persistents work like weak persistents, except that the pointer to // the object being collected is not available in the finalization callback. // This enables the garbage collector to collect the object and any objects - // it references transitively in one GC cycle. + // it references transitively in one GC cycle. At the moment you can either + // specify a parameter for the callback or the location of two internal + // fields in the dying object. template V8_INLINE void SetPhantom(P* parameter, - typename WeakCallbackData::Callback callback); + typename PhantomCallbackData

        ::Callback callback); - template - V8_INLINE void SetPhantom(P* parameter, - typename WeakCallbackData::Callback callback); + template + V8_INLINE void SetPhantom( + void (*callback)(const InternalFieldsCallbackData&), + int internal_field_index1, int internal_field_index2); template V8_INLINE P* ClearWeak(); @@ -1011,7 +1057,7 @@ class V8_EXPORT Script { /** * Runs the script returning the resulting value. It will be run in the * context in which it was created (ScriptCompiler::CompileBound or - * UnboundScript::BindToGlobalContext()). + * UnboundScript::BindToCurrentContext()). */ Local Run(); @@ -1045,7 +1091,11 @@ class V8_EXPORT ScriptCompiler { BufferOwned }; - CachedData() : data(NULL), length(0), buffer_policy(BufferNotOwned) {} + CachedData() + : data(NULL), + length(0), + rejected(false), + buffer_policy(BufferNotOwned) {} // If buffer_policy is BufferNotOwned, the caller keeps the ownership of // data and guarantees that it stays alive until the CachedData object is @@ -1058,6 +1108,7 @@ class V8_EXPORT ScriptCompiler { // which will be called when V8 no longer needs the data. const uint8_t* data; int length; + bool rejected; BufferPolicy buffer_policy; private: @@ -1238,6 +1289,26 @@ class V8_EXPORT ScriptCompiler { static Local - + + - diff --git a/doc/thin-white-stripe.jpg b/doc/thin-white-stripe.jpg index 8dc3d4ae8f9bde..5cd363ec4aab0c 100644 Binary files a/doc/thin-white-stripe.jpg and b/doc/thin-white-stripe.jpg differ diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js index d0e6dff257a655..221b6728a6995f 100644 --- a/lib/_debug_agent.js +++ b/lib/_debug_agent.js @@ -83,8 +83,9 @@ Agent.prototype.notifyWait = function notifyWait() { }; function Client(agent, socket) { - Transform.call(this); - this._readableState.objectMode = true; + Transform.call(this, { + readableObjectMode: true + }); this.agent = agent; this.binding = this.agent.binding; diff --git a/lib/_debugger.js b/lib/_debugger.js index 3886d3530ed1be..73674018ecfa00 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'), @@ -35,7 +14,7 @@ exports.start = function(argv, stdin, stdout) { argv || (argv = process.argv.slice(2)); if (argv.length < 1) { - console.error('Usage: node debug script.js'); + console.error('Usage: iojs debug script.js'); process.exit(1); } @@ -1290,11 +1269,11 @@ Interface.prototype.unwatch = function(expr) { // List watchers Interface.prototype.watchers = function() { - var self = this, - verbose = arguments[0] || false, - callback = arguments[1] || function() {}, - waiting = this._watchers.length, - values = []; + var self = this; + var verbose = arguments[0] || false; + var callback = arguments[1] || function() {}; + var waiting = this._watchers.length; + var values = []; this.pause(); @@ -1364,6 +1343,12 @@ Interface.prototype.setBreakpoint = function(script, line, script = this.client.currentScript; } + if (script === undefined) { + this.print('Cannot determine the current script, ' + + 'make sure the debugged process is paused.'); + return; + } + if (/\(\)$/.test(script)) { // setBreakpoint('functionname()'); var req = { diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 96797b2e822812..8afaba08173912 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var net = require('net'); diff --git a/lib/_http_client.js b/lib/_http_client.js index 52582dee52f620..b9dd6bd52c63a9 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); @@ -521,7 +500,7 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) { if (cb) { cb(); } }); } - } + }; if (!self.socket) { self.once('socket', onSocket); } else { diff --git a/lib/_http_common.js b/lib/_http_common.js index 8edc6713940c74..d7bbcf47cdca0a 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var FreeList = require('freelist').FreeList; @@ -57,16 +36,14 @@ function parserOnHeaders(headers, url) { this._url += url; } -// info.headers and info.url are set only if .onHeaders() -// has not been called for this request. -// -// info.url is not set for response parsers but that's not -// applicable here since all our parsers are request parsers. -function parserOnHeadersComplete(info) { - debug('parserOnHeadersComplete', info); +// `headers` and `url` are set only if .onHeaders() has not been called for +// this request. +// `url` is not set for response parsers but that's not applicable here since +// all our parsers are request parsers. +function parserOnHeadersComplete(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { var parser = this; - var headers = info.headers; - var url = info.url; if (!headers) { headers = parser._headers; @@ -79,38 +56,37 @@ function parserOnHeadersComplete(info) { } parser.incoming = new IncomingMessage(parser.socket); - parser.incoming.httpVersionMajor = info.versionMajor; - parser.incoming.httpVersionMinor = info.versionMinor; - parser.incoming.httpVersion = info.versionMajor + '.' + info.versionMinor; + parser.incoming.httpVersionMajor = versionMajor; + parser.incoming.httpVersionMinor = versionMinor; + parser.incoming.httpVersion = versionMajor + '.' + versionMinor; parser.incoming.url = url; var n = headers.length; - // If parser.maxHeaderPairs <= 0 - assume that there're no limit - if (parser.maxHeaderPairs > 0) { + // If parser.maxHeaderPairs <= 0 assume that there's no limit. + if (parser.maxHeaderPairs > 0) n = Math.min(n, parser.maxHeaderPairs); - } parser.incoming._addHeaderLines(headers, n); - if (isNumber(info.method)) { + if (isNumber(method)) { // server only - parser.incoming.method = HTTPParser.methods[info.method]; + parser.incoming.method = HTTPParser.methods[method]; } else { // client only - parser.incoming.statusCode = info.statusCode; - parser.incoming.statusMessage = info.statusMessage; + parser.incoming.statusCode = statusCode; + parser.incoming.statusMessage = statusMessage; } - parser.incoming.upgrade = info.upgrade; + parser.incoming.upgrade = upgrade; var skipBody = false; // response to HEAD or CONNECT - if (!info.upgrade) { - // For upgraded connections and CONNECT method request, - // we'll emit this after parser.execute - // so that we can capture the first part of the new protocol - skipBody = parser.onIncoming(parser.incoming, info.shouldKeepAlive); + if (!upgrade) { + // For upgraded connections and CONNECT method request, we'll emit this + // after parser.execute so that we can capture the first part of the new + // protocol. + skipBody = parser.onIncoming(parser.incoming, shouldKeepAlive); } return skipBody; diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index a252c114bf84a3..1b6f424af2f7c7 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index cef135c39927f1..7231ae0dff098a 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var assert = require('assert').ok; diff --git a/lib/_http_server.js b/lib/_http_server.js index 5927ed26893eda..c37c0c4e991967 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); diff --git a/lib/_linklist.js b/lib/_linklist.js index 048e933ee3a725..02186cfedcb9f6 100644 --- a/lib/_linklist.js +++ b/lib/_linklist.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; function init(list) { diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 9ed2950c08373f..a4fbd72579b722 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // a 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 diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js index ae83d5d4a83b3b..8898f1891d7cad 100644 --- a/lib/_stream_passthrough.js +++ b/lib/_stream_passthrough.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 67d6969aa4e810..4e4fbd7813debc 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; module.exports = Readable; diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 8706816255de0c..28173ae83ce018 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index e9e29680c2ffe0..9ed7e52cd3a7e1 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // A bit simpler than readable streams. // Implement an async ._write(chunk, cb), and it'll handle all // the drain event emission and buffering. @@ -30,6 +9,7 @@ Writable.WritableState = WritableState; var util = require('util'); var Stream = require('stream'); +var debug = util.debuglog('stream'); util.inherits(Writable, Stream); @@ -37,6 +17,7 @@ function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; + this.next = null; } function WritableState(options, stream) { @@ -111,7 +92,8 @@ function WritableState(options, stream) { // the amount that is being written when _write is called. this.writelen = 0; - this.buffer = []; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted @@ -125,6 +107,23 @@ function WritableState(options, stream) { this.errorEmitted = false; } +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +Object.defineProperty(WritableState.prototype, 'buffer', { + get: util.deprecate(function() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use ' + + '_writableState.getBuffer() instead.') +}); + function Writable(options) { // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. @@ -218,7 +217,7 @@ Writable.prototype.uncork = function() { !state.corked && !state.finished && !state.bufferProcessing && - state.buffer.length) + state.bufferedRequest) clearBuffer(this, state); } }; @@ -257,8 +256,15 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) { if (!ret) state.needDrain = true; - if (state.writing || state.corked) - state.buffer.push(new WriteReq(chunk, encoding, cb)); + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + } else doWrite(stream, state, false, len, chunk, encoding, cb); @@ -315,7 +321,7 @@ function onwrite(stream, er) { if (!finished && !state.corked && !state.bufferProcessing && - state.buffer.length) { + state.bufferedRequest) { clearBuffer(stream, state); } @@ -351,17 +357,23 @@ function onwriteDrain(stream, state) { // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; + var entry = state.bufferedRequest; - if (stream._writev && state.buffer.length > 1) { + if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() + var buffer = []; var cbs = []; - for (var c = 0; c < state.buffer.length; c++) - cbs.push(state.buffer[c].callback); + while (entry) { + cbs.push(entry.callback); + buffer.push(entry); + entry = entry.next; + } // count the one we are adding, as well. // TODO(isaacs) clean this up state.pendingcb++; - doWrite(stream, state, true, state.length, state.buffer, '', function(err) { + 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); @@ -369,34 +381,29 @@ function clearBuffer(stream, state) { }); // Clear buffer - state.buffer = []; } else { // Slow case, write chunks one-by-one - for (var c = 0; c < state.buffer.length; c++) { - var entry = state.buffer[c]; + while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); - + entry = entry.next; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { - c++; break; } } - if (c < state.buffer.length) - state.buffer = state.buffer.slice(c); - else - state.buffer.length = 0; + if (entry === null) + state.lastBufferedRequest = null; } - + state.bufferedRequest = entry; state.bufferProcessing = false; } @@ -437,7 +444,7 @@ Writable.prototype.end = function(chunk, encoding, cb) { function needFinish(stream, state) { return (state.ending && state.length === 0 && - state.buffer.length === 0 && + state.bufferedRequest === null && !state.finished && !state.writing); } diff --git a/lib/_tls_common.js b/lib/_tls_common.js index a3309ead0a5387..48585b6b477c30 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js index 70082a41566b3a..b52755f440d9f7 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var assert = require('assert'); diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 671a5e85206faf..22ba8c54c82c53 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// // Emit `beforeExit` if the loop became alive either after emitting -// event, or after running some callbacks. -// -// 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 assert = require('assert'); diff --git a/lib/assert.js b/lib/assert.js index 7e18a071e9c988..863651d2dcc364 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -283,6 +283,10 @@ function expectedException(actual, expected) { function _throws(shouldThrow, block, expected, message) { var actual; + if (!util.isFunction(block)) { + throw new TypeError('block must be a function'); + } + if (util.isString(expected)) { message = expected; expected = null; diff --git a/lib/buffer.js b/lib/buffer.js index f14783d62650cf..3130817178779f 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var buffer = process.binding('buffer'); @@ -951,3 +930,80 @@ Buffer.prototype.writeDoubleBE = function writeDoubleBE(val, offset, noAssert) { internal.writeDoubleBE(this, val, offset); return offset + 8; }; + +// ES6 iterator + +var ITERATOR_KIND_KEYS = 1; +var ITERATOR_KIND_ENTRIES = 3; + +function BufferIteratorResult(value, done) { + this.value = value; + this.done = done; +} + +var resultCache = new Array(256); + +for (var i = 0; i < 256; i++) + resultCache[i] = Object.freeze(new BufferIteratorResult(i, false)); + +var finalResult = Object.freeze(new BufferIteratorResult(undefined, true)); + +function BufferIterator(buffer, kind) { + this._buffer = buffer; + this._kind = kind; + this._index = 0; +} + +BufferIterator.prototype.next = function() { + var buffer = this._buffer; + var kind = this._kind; + var index = this._index; + + if (index >= buffer.length) + return finalResult; + + this._index++; + + if (kind === ITERATOR_KIND_ENTRIES) + return new BufferIteratorResult([index, buffer[index]], false); + + return new BufferIteratorResult(index, false); +}; + +function BufferValueIterator(buffer) { + BufferIterator.call(this, buffer, null); +} + +BufferValueIterator.prototype.next = function() { + var buffer = this._buffer; + var index = this._index; + + if (index >= buffer.length) + return finalResult; + + this._index++; + + return resultCache[buffer[index]]; +}; + + +BufferIterator.prototype[Symbol.iterator] = function() { + return this; +}; + +BufferValueIterator.prototype[Symbol.iterator] = + BufferIterator.prototype[Symbol.iterator]; + +Buffer.prototype.keys = function() { + return new BufferIterator(this, ITERATOR_KIND_KEYS); +}; + +Buffer.prototype.entries = function() { + return new BufferIterator(this, ITERATOR_KIND_ENTRIES); +}; + +Buffer.prototype.values = function() { + return new BufferValueIterator(this); +}; + +Buffer.prototype[Symbol.iterator] = Buffer.prototype.values; diff --git a/lib/child_process.js b/lib/child_process.js index 6a6c61cf24878f..f1a8a3a1426ec4 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var StringDecoder = require('string_decoder').StringDecoder; diff --git a/lib/cluster.js b/lib/cluster.js index 62cd69835ab2bd..1051291312cce1 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var EventEmitter = require('events').EventEmitter; @@ -103,7 +82,7 @@ SharedHandle.prototype.add = function(worker, send) { SharedHandle.prototype.remove = function(worker) { var index = this.workers.indexOf(worker); - assert(index !== -1); + if (index === -1) return false; // The worker wasn't sharing this handle. this.workers.splice(index, 1); if (this.workers.length !== 0) return false; this.handle.close(); @@ -287,7 +266,7 @@ function masterInit() { var key; for (key in cluster.workers) { var worker = cluster.workers[key]; - if (worker.state === 'online') { + if (worker.state === 'online' || worker.state === 'listening') { process._debugProcess(worker.process.pid); } else { worker.once('online', function() { @@ -308,7 +287,7 @@ function masterInit() { workerEnv.NODE_UNIQUE_ID = '' + id; for (var i = 0; i < execArgv.length; i++) { - var match = execArgv[i].match(/^(--debug|--debug-brk)(=\d+)?$/); + var match = execArgv[i].match(/^(--debug|--debug-(brk|port))(=\d+)?$/); if (match) { execArgv[i] = match[1] + '=' + debugPort; @@ -409,7 +388,8 @@ function masterInit() { } else { for (var key in workers) { key = workers[key]; - cluster.workers[key].disconnect(); + if (cluster.workers[key].isConnected()) + cluster.workers[key].disconnect(); } } if (cb) intercom.once('disconnect', cb); diff --git a/lib/console.js b/lib/console.js index ff7fd4dadb5c3d..cf4ba5a5b44a8c 100644 --- a/lib/console.js +++ b/lib/console.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); diff --git a/lib/constants.js b/lib/constants.js index 816dc853e1bb51..9fa017904ceb45 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; module.exports = process.binding('constants'); diff --git a/lib/crypto.js b/lib/crypto.js index 18b1b271d1de9f..d08c29ca7229f5 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Note: In 0.8 and before, crypto functions all defaulted to using // binary-encoded strings rather than buffers. diff --git a/lib/dgram.js b/lib/dgram.js index 255b9fb5941372..2595ce7a7ca725 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var assert = require('assert'); @@ -38,6 +17,7 @@ var cluster = null; var dns = null; var errnoException = util._errnoException; +var exceptionWithHostPort = util._exceptionWithHostPort; function lookup(address, family, callback) { if (!dns) @@ -199,7 +179,8 @@ Socket.prototype.bind = function(port /*, address, callback*/) { if (cluster.isWorker && !exclusive) { cluster._getServer(self, ip, port, self.type, -1, function(err, handle) { if (err) { - self.emit('error', errnoException(err, 'bind')); + var ex = exceptionWithHostPort(err, 'bind', ip, port); + self.emit('error', ex); self._bindState = BIND_STATE_UNBOUND; return; } @@ -222,7 +203,8 @@ Socket.prototype.bind = function(port /*, address, callback*/) { var err = self._handle.bind(ip, port || 0, flags); if (err) { - self.emit('error', errnoException(err, 'bind')); + var ex = exceptionWithHostPort(err, 'bind', ip, port); + self.emit('error', ex); self._bindState = BIND_STATE_UNBOUND; // Todo: close? return; @@ -325,6 +307,8 @@ Socket.prototype.send = function(buffer, var req = new SendWrap(); req.buffer = buffer; // Keep reference alive. req.length = length; + req.address = address; + req.port = port; if (callback) { req.callback = callback; req.oncomplete = afterSend; @@ -339,7 +323,8 @@ Socket.prototype.send = function(buffer, if (err && callback) { // don't emit as error, dgram_legacy.js compatibility process.nextTick(function() { - callback(errnoException(err, 'send')); + var ex = exceptionWithHostPort(err, 'send', address, port); + callback(ex); }); } } @@ -348,7 +333,10 @@ Socket.prototype.send = function(buffer, function afterSend(err) { - this.callback(err ? errnoException(err, 'send') : null, this.length); + if (err) { + err = exceptionWithHostPort(err, 'send', this.address, this.port); + } + this.callback(err, this.length); } diff --git a/lib/dns.js b/lib/dns.js index 45349718521328..cb36430ee32814 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// 'Software'), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var net = require('net'); @@ -127,6 +106,11 @@ exports.lookup = function lookup(hostname, options, callback) { hints !== (exports.ADDRCONFIG | exports.V4MAPPED)) { throw new TypeError('invalid argument: hints must use valid flags'); } + + // FIXME(indutny): V4MAPPED on FreeBSD results in EAI_BADFLAGS, because + // the libc does not support it + if (process.platform === 'freebsd' && family !== 6) + hints &= ~exports.V4MAPPED; } else { family = options >>> 0; } diff --git a/lib/domain.js b/lib/domain.js index 7d0e4f2cb7c793..e65ba53ef884fb 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; // WARNING: THIS MODULE IS PENDING DEPRECATION. diff --git a/lib/events.js b/lib/events.js index 49b49e6f1198b1..2f3215a4112ca7 100644 --- a/lib/events.js +++ b/lib/events.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var domain; @@ -212,90 +191,90 @@ EventEmitter.prototype.once = function once(type, listener) { // emits a 'removeListener' event iff the listener was removed EventEmitter.prototype.removeListener = function removeListener(type, listener) { - var list, position, length, i; - - if (!util.isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (util.isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (util.isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; + var list, position, length, i; + + if (!util.isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (util.isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (util.isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + spliceOne(list, position); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); } - } - if (position < 0) return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - spliceOne(list, position); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; + }; EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } - listeners = this._events[type]; + listeners = this._events[type]; - if (util.isFunction(listeners)) { - this.removeListener(type, listeners); - } else if (Array.isArray(listeners)) { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; + if (util.isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (Array.isArray(listeners)) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; - return this; -}; + return this; + }; EventEmitter.prototype.listeners = function listeners(type) { var ret; diff --git a/lib/freelist.js b/lib/freelist.js index 561ca53458c2b8..78a581d6acb37b 100644 --- a/lib/freelist.js +++ b/lib/freelist.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; // This is a free list to avoid creating so many of the same object. diff --git a/lib/fs.js b/lib/fs.js index 66549ee5a7f7e5..3c0c9a95676e42 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1,29 +1,5 @@ -// 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. - -// Maintainers, keep in mind that octal literals are not allowed -// in strict mode. Use the decimal value and add a comment with -// the octal value. Example: -// -// var mode = 438; /* mode=0666 */ +// Maintainers, keep in mind that ES1-style octal literals (`0666`) are not +// allowed in strict mode. Use ES6-style octal literals instead (`0o666`). 'use strict'; @@ -110,6 +86,7 @@ function assertEncoding(encoding) { function nullCheck(path, callback) { if (('' + path).indexOf('\u0000') !== -1) { var er = new Error('Path must be a string without null bytes.'); + er.code = 'ENOENT'; if (!callback) throw er; process.nextTick(function() { @@ -220,7 +197,7 @@ fs.accessSync = function(path, mode) { binding.access(pathModule._makeLong(path), mode); }; -fs.exists = util.deprecate(function(path, callback) { +fs.exists = function(path, callback) { if (!nullCheck(path, cb)) return; var req = new FSReqWrap(); req.oncomplete = cb; @@ -228,9 +205,9 @@ fs.exists = util.deprecate(function(path, callback) { function cb(err, stats) { if (callback) callback(err ? false : true); } -}, 'fs.exists() is deprecated. Use fs.access() instead.'); +}; -fs.existsSync = util.deprecate(function(path) { +fs.existsSync = function(path) { try { nullCheck(path); binding.stat(pathModule._makeLong(path)); @@ -238,7 +215,7 @@ fs.existsSync = util.deprecate(function(path) { } catch (e) { return false; } -}, 'fs.existsSync() is deprecated. Use fs.accessSync() instead.'); +}; fs.readFile = function(path, options, callback_) { var callback = maybeCallback(arguments[arguments.length - 1]); @@ -262,7 +239,7 @@ fs.readFile = function(path, options, callback_) { var fd; var flag = options.flag || 'r'; - fs.open(path, flag, 438 /*=0666*/, function(er, fd_) { + fs.open(path, flag, 0o666, function(er, fd_) { if (er) return callback(er); fd = fd_; @@ -352,7 +329,7 @@ fs.readFileSync = function(path, options) { assertEncoding(encoding); var flag = options.flag || 'r'; - var fd = fs.openSync(path, flag, 438 /*=0666*/); + var fd = fs.openSync(path, flag, 0o666); var size; var threw = true; @@ -484,7 +461,7 @@ function modeNum(m, def) { fs.open = function(path, flags, mode, callback) { callback = makeCallback(arguments[arguments.length - 1]); - mode = modeNum(mode, 438 /*=0666*/); + mode = modeNum(mode, 0o666); if (!nullCheck(path, callback)) return; @@ -498,7 +475,7 @@ fs.open = function(path, flags, mode, callback) { }; fs.openSync = function(path, flags, mode) { - mode = modeNum(mode, 438 /*=0666*/); + mode = modeNum(mode, 0o666); nullCheck(path); return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); }; @@ -743,14 +720,14 @@ fs.mkdir = function(path, mode, callback) { var req = new FSReqWrap(); req.oncomplete = callback; binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/), + modeNum(mode, 0o777), req); }; fs.mkdirSync = function(path, mode) { nullCheck(path); return binding.mkdir(pathModule._makeLong(path), - modeNum(mode, 511 /*=0777*/)); + modeNum(mode, 0o777)); }; fs.readdir = function(path, callback) { @@ -1069,9 +1046,9 @@ fs.writeFile = function(path, data, options, callback) { var callback = maybeCallback(arguments[arguments.length - 1]); if (util.isFunction(options) || !options) { - options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'w' }; + options = { encoding: 'utf8', mode: 0o666, flag: 'w' }; } else if (util.isString(options)) { - options = { encoding: options, mode: 438, flag: 'w' }; + options = { encoding: options, mode: 0o666, flag: 'w' }; } else if (!util.isObject(options)) { throw new TypeError('Bad arguments'); } @@ -1093,9 +1070,9 @@ fs.writeFile = function(path, data, options, callback) { fs.writeFileSync = function(path, data, options) { if (!options) { - options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'w' }; + options = { encoding: 'utf8', mode: 0o666, flag: 'w' }; } else if (util.isString(options)) { - options = { encoding: options, mode: 438, flag: 'w' }; + options = { encoding: options, mode: 0o666, flag: 'w' }; } else if (!util.isObject(options)) { throw new TypeError('Bad arguments'); } @@ -1124,9 +1101,9 @@ fs.appendFile = function(path, data, options, callback_) { var callback = maybeCallback(arguments[arguments.length - 1]); if (util.isFunction(options) || !options) { - options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'a' }; + options = { encoding: 'utf8', mode: 0o666, flag: 'a' }; } else if (util.isString(options)) { - options = { encoding: options, mode: 438, flag: 'a' }; + options = { encoding: options, mode: 0o666, flag: 'a' }; } else if (!util.isObject(options)) { throw new TypeError('Bad arguments'); } @@ -1138,9 +1115,9 @@ fs.appendFile = function(path, data, options, callback_) { fs.appendFileSync = function(path, data, options) { if (!options) { - options = { encoding: 'utf8', mode: 438 /*=0666*/, flag: 'a' }; + options = { encoding: 'utf8', mode: 0o666, flag: 'a' }; } else if (util.isString(options)) { - options = { encoding: options, mode: 438, flag: 'a' }; + options = { encoding: options, mode: 0o666, flag: 'a' }; } else if (!util.isObject(options)) { throw new TypeError('Bad arguments'); } @@ -1578,7 +1555,7 @@ function ReadStream(path, options) { this.path = path; this.fd = options.hasOwnProperty('fd') ? options.fd : null; this.flags = options.hasOwnProperty('flags') ? options.flags : 'r'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ + this.mode = options.hasOwnProperty('mode') ? options.mode : 0o666; this.start = options.hasOwnProperty('start') ? options.start : undefined; this.end = options.hasOwnProperty('end') ? options.end : undefined; @@ -1746,7 +1723,7 @@ function WriteStream(path, options) { this.fd = options.hasOwnProperty('fd') ? options.fd : null; this.flags = options.hasOwnProperty('flags') ? options.flags : 'w'; - this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ + this.mode = options.hasOwnProperty('mode') ? options.mode : 0o666; this.start = options.hasOwnProperty('start') ? options.start : undefined; this.pos = undefined; diff --git a/lib/http.js b/lib/http.js index c0b2b0af1128e0..8264c1b0c894c0 100644 --- a/lib/http.js +++ b/lib/http.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var util = require('util'); diff --git a/lib/https.js b/lib/https.js index 4c2731ab581c5d..0773255b441856 100644 --- a/lib/https.js +++ b/lib/https.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var tls = require('tls'); diff --git a/lib/module.js b/lib/module.js index 5c18d943037eef..0a4195cf7b7504 100644 --- a/lib/module.js +++ b/lib/module.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var NativeModule = require('native_module'); diff --git a/lib/net.js b/lib/net.js index 6256b022b9d437..85789c365a1785 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var events = require('events'); @@ -38,6 +17,7 @@ var WriteWrap = process.binding('stream_wrap').WriteWrap; var cluster; var errnoException = util._errnoException; +var exceptionWithHostPort = util._exceptionWithHostPort; function noop() {} @@ -68,26 +48,6 @@ function isPipeName(s) { return util.isString(s) && toNumber(s) === false; } -// format exceptions -function detailedException(err, syscall, address, port, additional) { - var details; - if (port && port > 0) { - details = address + ':' + port; - } else { - details = address; - } - - if (additional) { - details += ' - Local (' + additional + ')'; - } - var ex = errnoException(err, syscall, details); - ex.address = address; - if (port) { - ex.port = port; - } - return ex; -} - exports.createServer = function() { return new Server(arguments[0], arguments[1]); }; @@ -752,7 +712,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() { data = this._pendingData, encoding = this._pendingEncoding; - state.buffer.forEach(function(el) { + state.getBuffer().forEach(function(el) { if (util.isBuffer(el.chunk)) bytes += el.chunk.length; else @@ -782,7 +742,7 @@ function afterWrite(status, handle, req, err) { } if (status < 0) { - var ex = detailedException(status, 'write', req.address, req.port); + var ex = exceptionWithHostPort(status, 'write', req.address, req.port); debug('write failure', ex); self._destroy(ex, req.cb); return; @@ -805,34 +765,18 @@ function connect(self, address, port, addressType, localAddress, localPort) { assert.ok(self._connecting); var err; - if (localAddress || localPort) { - if (localAddress && !exports.isIP(localAddress)) - err = new TypeError( - 'localAddress should be a valid IP: ' + localAddress); - - if (localPort && !util.isNumber(localPort)) - err = new TypeError('localPort should be a number: ' + localPort); + if (localAddress || localPort) { var bind; - switch (addressType) { - case 4: - if (!localAddress) - localAddress = '0.0.0.0'; - bind = self._handle.bind; - break; - case 6: - if (!localAddress) - localAddress = '::'; - bind = self._handle.bind6; - break; - default: - err = new TypeError('Invalid addressType: ' + addressType); - break; - } - - if (err) { - self._destroy(err); + if (addressType === 4) { + localAddress = localAddress || '0.0.0.0'; + bind = self._handle.bind; + } else if (addressType === 6) { + localAddress = localAddress || '::'; + bind = self._handle.bind6; + } else { + self._destroy(new TypeError('Invalid addressType: ' + addressType)); return; } @@ -844,7 +788,7 @@ function connect(self, address, port, addressType, localAddress, localPort) { err = bind(localAddress, localPort); if (err) { - var ex = detailedException(err, 'bind', localAddress, localPort); + var ex = exceptionWithHostPort(err, 'bind', localAddress, localPort); self._destroy(ex); return; } @@ -853,17 +797,14 @@ function connect(self, address, port, addressType, localAddress, localPort) { if (addressType === 6 || addressType === 4) { var req = new TCPConnectWrap(); req.oncomplete = afterConnect; - port = port | 0; - if (port <= 0 || port > 65535) - throw new RangeError('Port should be > 0 and < 65536'); - - req.port = port; req.address = address; - if (addressType === 6) { - err = self._handle.connect6(req, address, port); - } else if (addressType === 4) { + req.port = port; + + if (addressType === 4) err = self._handle.connect(req, address, port); - } + else + err = self._handle.connect6(req, address, port); + } else { var req = new PipeConnectWrap(); req.address = address; @@ -872,14 +813,14 @@ function connect(self, address, port, addressType, localAddress, localPort) { } if (err) { - self._getsockname(); + var sockname = self._getsockname(); var details; - if (self._sockname) { - ex.localAddress = self._sockname.address; - ex.localPort = self._sockname.port; - details = ex.localAddress + ':' + ex.localPort; + + if (sockname) { + details = sockname.address + ':' + sockname.port; } - var ex = detailedException(err, 'connect', address, port, details); + + var ex = exceptionWithHostPort(err, 'connect', address, port, details); self._destroy(ex); } } @@ -930,19 +871,26 @@ Socket.prototype.connect = function(options, cb) { if (pipe) { connect(self, options.path); - } else if (!options.host) { - debug('connect: missing host'); - self._host = '127.0.0.1'; - connect(self, self._host, options.port, 4); - } else { var dns = require('dns'); - var host = options.host; + var host = options.host || 'localhost'; + var port = options.port | 0; + var localAddress = options.localAddress; + var localPort = options.localPort; var dnsopts = { family: options.family, hints: 0 }; + if (localAddress && !exports.isIP(localAddress)) + throw new TypeError('localAddress must be a valid IP: ' + localAddress); + + if (localPort && !util.isNumber(localPort)) + throw new TypeError('localPort should be a number: ' + localPort); + + if (port <= 0 || port > 65535) + throw new RangeError('port should be > 0 and < 65536: ' + port); + if (dnsopts.family !== 4 && dnsopts.family !== 6) dnsopts.hints = dns.ADDRCONFIG | dns.V4MAPPED; @@ -971,19 +919,12 @@ Socket.prototype.connect = function(options, cb) { }); } else { timers._unrefActive(self); - - addressType = addressType || 4; - - // node_net.cc handles null host names graciously but user land - // expects remoteAddress to have a meaningful value - ip = ip || (addressType === 4 ? '127.0.0.1' : '0:0:0:0:0:0:0:1'); - connect(self, ip, - options.port, + port, addressType, - options.localAddress, - options.localPort); + localAddress, + localPort); } }); } @@ -1039,11 +980,11 @@ function afterConnect(status, handle, req, readable, writable) { ex.localPort = req.localPort; details = ex.localAddress + ':' + ex.localPort; } - var ex = detailedException(status, - 'connect', - req.address, - req.port, - details); + var ex = exceptionWithHostPort(status, + 'connect', + req.address, + req.port, + details); self._destroy(ex); } } @@ -1173,7 +1114,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { debug('_listen2: create a handle'); var rval = createServerHandle(address, port, addressType, fd); if (util.isNumber(rval)) { - var error = detailedException(rval, 'listen', address, port); + var error = exceptionWithHostPort(rval, 'listen', address, port); process.nextTick(function() { self.emit('error', error); }); @@ -1190,7 +1131,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { var err = _listen(self._handle, backlog); if (err) { - var ex = detailedException(err, 'listen', address, port); + var ex = exceptionWithHostPort(err, 'listen', address, port); self._handle.close(); self._handle = null; process.nextTick(function() { @@ -1239,7 +1180,7 @@ function listen(self, address, port, addressType, backlog, fd, exclusive) { } if (err) { - var ex = detailedException(err, 'bind', address, port); + var ex = exceptionWithHostPort(err, 'bind', address, port); return self.emit('error', ex); } @@ -1480,8 +1421,6 @@ Server.prototype.unref = function() { }; -// TODO: isIP should be moved to the DNS code. Putting it here now because -// this is what the legacy system did. exports.isIP = cares.isIP; diff --git a/lib/os.js b/lib/os.js index cace46173b0c4b..965a9b53d2f883 100644 --- a/lib/os.js +++ b/lib/os.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var binding = process.binding('os'); diff --git a/lib/path.js b/lib/path.js index 1972bdc601aba6..02cdf541b62cc2 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var isWindows = process.platform === 'win32'; diff --git a/lib/process.js b/lib/process.js new file mode 100644 index 00000000000000..288e313726fcb9 --- /dev/null +++ b/lib/process.js @@ -0,0 +1,25 @@ +// Copyright io.js contributors +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// Re-export process as a native module +module.exports = process; diff --git a/lib/querystring.js b/lib/querystring.js index 07eb1d93d8ec6a..248f951acadd47 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Query String Utilities 'use strict'; diff --git a/lib/readline.js b/lib/readline.js index 8c6b1a89b21d21..bf53b02ffd0484 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Inspiration for this code comes from Salvatore Sanfilippo's linenoise. // https://github.com/antirez/linenoise // Reference: diff --git a/lib/repl.js b/lib/repl.js index 2f47163086ceb9..1ecf695efd1ca1 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* A repl library that you can include in your own code to get a runtime * interface to your program. * @@ -108,6 +87,8 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { self.useGlobal = !!useGlobal; self.ignoreUndefined = !!ignoreUndefined; + self._inTemplateLiteral = false; + // just for backwards compat, see github.com/joyent/node/pull/7127 self.rli = this; @@ -123,7 +104,7 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { }); } catch (e) { debug('parse error %j', code, e); - if (isRecoverableError(e)) + if (isRecoverableError(e, self)) err = new Recoverable(e); else err = e; @@ -247,7 +228,13 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { debug('line %j', cmd); sawSIGINT = false; var skipCatchall = false; - cmd = trimWhitespace(cmd); + + // leading whitespaces in template literals should not be trimmed. + if (self._inTemplateLiteral) { + self._inTemplateLiteral = false; + } else { + cmd = trimWhitespace(cmd); + } // Check to see if a REPL keyword was used. If it returns true, // display next prompt and return. @@ -419,7 +406,7 @@ function ArrayStream() { data.forEach(function(line) { self.emit('data', line + '\n'); }); - } + }; } util.inherits(ArrayStream, Stream); ArrayStream.prototype.readable = true; @@ -949,10 +936,17 @@ REPLServer.prototype.convertToContext = function(cmd) { // If the error is that we've unexpectedly ended the input, // then let the user try to recover by adding more input. -function isRecoverableError(e) { - return e && - e.name === 'SyntaxError' && - /^(Unexpected end of input|Unexpected token :)/.test(e.message); +function isRecoverableError(e, self) { + if (e && e.name === 'SyntaxError') { + var message = e.message; + if (message === 'Unterminated template literal' || + message === 'Missing } in template expression') { + self._inTemplateLiteral = true; + return true; + } + return /^(Unexpected end of input|Unexpected token :)/.test(message); + } + return false; } function Recoverable(err) { diff --git a/lib/smalloc.js b/lib/smalloc.js index 994b3f281bae22..26d7d906caf295 100644 --- a/lib/smalloc.js +++ b/lib/smalloc.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var smalloc = process.binding('smalloc'); diff --git a/lib/stream.js b/lib/stream.js index 83815e8404975e..c72215951a678e 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; module.exports = Stream; diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 84ac9a9d4453a4..53d08a8ad47e81 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; function assertEncoding(encoding) { diff --git a/lib/sys.js b/lib/sys.js index 6dc415c31f86c1..57fe1bcfb55dba 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -1,26 +1,13 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; +var util = require('util'); + // the sys module was renamed to 'util'. // this shim remains to keep old programs working. -module.exports = require('util'); +// sys is deprecated and shouldn't be used + +var setExports = util.deprecate(function() { + module.exports = util; +}, 'sys is deprecated. Use util instead.'); + +setExports(); diff --git a/lib/timers.js b/lib/timers.js index 96d57ec34c57f3..99921488003326 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var Timer = process.binding('timer_wrap').Timer; @@ -214,7 +193,7 @@ exports.setTimeout = function(callback, after) { var args = Array.prototype.slice.call(arguments, 2); timer._onTimeout = function() { callback.apply(timer, args); - } + }; } if (process.domain) timer.domain = process.domain; diff --git a/lib/tls.js b/lib/tls.js index 8e8f12a27e9d34..cf5370e773c0e8 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var net = require('net'); diff --git a/lib/tty.js b/lib/tty.js index 3d5c2a664930b0..2e908828b2f939 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var inherits = require('util').inherits; diff --git a/lib/url.js b/lib/url.js index 2d9d436a910275..abe66acfca983b 100644 --- a/lib/url.js +++ b/lib/url.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var punycode = require('punycode'); @@ -72,9 +51,8 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i, nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, - hostnamePatternString = '[^' + nonHostChars.join('') + ']{0,63}', - hostnamePartPattern = new RegExp('^' + hostnamePatternString + '$'), - hostnamePartStart = new RegExp('^(' + hostnamePatternString + ')(.*)$'), + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, @@ -320,6 +298,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); @@ -363,7 +343,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { } // finally, reconstruct the href based on what has been validated. - this.href = this.format(parseQueryString); + this.href = this.format(); return this; }; @@ -378,7 +358,7 @@ function urlFormat(obj) { return obj.format(); } -Url.prototype.format = function(parseQueryString) { +Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); @@ -390,26 +370,7 @@ Url.prototype.format = function(parseQueryString) { pathname = this.pathname || '', hash = this.hash || '', host = false, - query = '', - search = ''; - - if (this.path) { - var qm = this.path.indexOf('?'); - if (qm !== -1) { - query = this.path.slice(qm + 1); - search = '?' + query; - pathname = this.path.slice(0, qm); - } else { - if (parseQueryString) { - this.query = {}; - this.search = ''; - } else { - this.query = null; - this.search = null; - } - pathname = this.path; - } - } + query = ''; if (this.host) { host = auth + this.host; @@ -422,15 +383,13 @@ Url.prototype.format = function(parseQueryString) { } } - if (!query && - this.query && + if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } - if (!search) - search = this.search || (query && ('?' + query)) || ''; + var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; diff --git a/lib/util.js b/lib/util.js index 4fed8311a0902a..b2bfa7c5ddd56b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var formatRegExp = /%[sdj%]/g; @@ -240,6 +219,7 @@ function formatValue(ctx, value, recurseTimes) { if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); + keys = keys.concat(Object.getOwnPropertySymbols(value)); } // This could be a boxed primitive (new String(), etc.), check valueOf() @@ -375,8 +355,8 @@ function formatPrimitive(ctx, value) { return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) { @@ -422,7 +402,7 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { } } keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { + if (isSymbol(key) || !key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } @@ -446,7 +426,11 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { } } if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; + if (isSymbol(key)) { + name = '[' + ctx.stylize(key.toString(), 'symbol') + ']'; + } else { + name = '[' + key + ']'; + } } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { @@ -751,3 +735,27 @@ exports._errnoException = function(err, syscall, original) { e.syscall = syscall; return e; }; + + +exports._exceptionWithHostPort = function(err, + syscall, + address, + port, + additional) { + var details; + if (port && port > 0) { + details = address + ':' + port; + } else { + details = address; + } + + if (additional) { + details += ' - Local (' + additional + ')'; + } + var ex = exports._errnoException(err, syscall, details); + ex.address = address; + if (port) { + ex.port = port; + } + return ex; +}; diff --git a/lib/vm.js b/lib/vm.js index 653c27c0d857f3..32aa522a46301d 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var binding = process.binding('contextify'); diff --git a/lib/zlib.js b/lib/zlib.js index 724f9a37b6895e..63eeac5d744349 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; var Transform = require('_stream_transform'); @@ -582,7 +561,7 @@ Zlib.prototype._processChunk = function(chunk, flushFlag, cb) { self._buffer = new Buffer(self._chunkSize); } - if (availOutAfter === 0 || availInAfter > 0) { + if (availOutAfter === 0) { // Not actually done. Need to reprocess. // Also, update the availInBefore to the availInAfter value, // so that if we have to hit it a third (fourth, etc.) time, @@ -590,13 +569,6 @@ Zlib.prototype._processChunk = function(chunk, flushFlag, cb) { inOff += (availInBefore - availInAfter); availInBefore = availInAfter; - if (availOutAfter !== 0) { - // There is still some data available for reading. - // This is usually a concatenated stream, so, reset and restart. - self.reset(); - self._offset = 0; - } - if (!async) return true; diff --git a/node.gyp b/node.gyp index be266825bf7293..b00ab2937cba99 100644 --- a/node.gyp +++ b/node.gyp @@ -43,6 +43,7 @@ 'lib/net.js', 'lib/os.js', 'lib/path.js', + 'lib/process.js', 'lib/punycode.js', 'lib/querystring.js', 'lib/readline.js', @@ -72,7 +73,7 @@ 'targets': [ { - 'target_name': 'node', + 'target_name': 'iojs', 'type': 'executable', 'dependencies': [ @@ -163,11 +164,11 @@ ], 'defines': [ - 'NODE_WANT_INTERNALS=1', - 'ARCH="<(target_arch)"', - 'PLATFORM="<(OS)"', + 'NODE_ARCH="<(target_arch)"', + 'NODE_PLATFORM="<(OS)"', 'NODE_TAG="<(node_tag)"', 'NODE_V8_OPTIONS="<(node_v8_options)"', + 'NODE_WANT_INTERNALS=1', ], 'conditions': [ @@ -248,8 +249,7 @@ 'conditions': [ [ 'OS=="linux"', { 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o', - '<(SHARED_INTERMEDIATE_DIR)/libuv_dtrace_provider.o', + '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o' ], }], [ 'OS!="mac" and OS!="linux"', { @@ -322,10 +322,13 @@ 'sources': [ 'src/res/node.rc', ], + 'defines!': [ + 'NODE_PLATFORM="win"', + ], 'defines': [ 'FD_SETSIZE=1024', # we need to use node's preferred "win32" rather than gyp's preferred "win" - 'PLATFORM="win32"', + 'NODE_PLATFORM="win32"', '_UNICODE=1', ], 'libraries': [ '-lpsapi.lib' ] @@ -337,11 +340,11 @@ # like Instruments require it for some features 'libraries': [ '-framework CoreFoundation' ], 'defines!': [ - 'PLATFORM="mac"', + 'NODE_PLATFORM="mac"', ], 'defines': [ # we need to use node's preferred "darwin" rather than gyp's preferred "mac" - 'PLATFORM="darwin"', + 'NODE_PLATFORM="darwin"', ], }], [ 'OS=="freebsd"', { @@ -356,12 +359,12 @@ '-lumem', ], 'defines!': [ - 'PLATFORM="solaris"', + 'NODE_PLATFORM="solaris"', ], 'defines': [ # we need to use node's preferred "sunos" # rather than gyp's preferred "solaris" - 'PLATFORM="sunos"', + 'NODE_PLATFORM="sunos"', ], }], [ 'OS=="freebsd" or OS=="linux"', { @@ -378,9 +381,6 @@ }], ], 'msvs_settings': { - 'VCLinkerTool': { - 'SubSystem': 1, # /subsystem:console - }, 'VCManifestTool': { 'EmbedManifest': 'true', 'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest' @@ -526,15 +526,13 @@ { 'action_name': 'node_dtrace_provider_o', 'inputs': [ - '<(OBJ_DIR)/libuv/deps/uv/src/unix/core.o', '<(OBJ_DIR)/node/src/node_dtrace.o', ], 'outputs': [ '<(OBJ_DIR)/node/src/node_dtrace_provider.o' ], 'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d', - '-s', 'deps/uv/src/unix/uv-dtrace.d', '<@(_inputs)', - '-o', '<@(_outputs)' ] + '<@(_inputs)', '-o', '<@(_outputs)' ] } ] }], @@ -549,17 +547,7 @@ 'action': [ 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)' ], - }, - { - 'action_name': 'libuv_dtrace_provider_o', - 'inputs': [ 'deps/uv/src/unix/uv-dtrace.d' ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/libuv_dtrace_provider.o' - ], - 'action': [ - 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)' - ], - }, + } ], }], ] diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 4dbb3a6cfc42bd..647a381e88f7d2 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_ASYNC_WRAP_INL_H_ #define SRC_ASYNC_WRAP_INL_H_ diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 3526512c6e0089..eee020b788aa2f 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" diff --git a/src/async-wrap.h b/src/async-wrap.h index 0e42a00855c9a3..5bed59498aa668 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_ASYNC_WRAP_H_ #define SRC_ASYNC_WRAP_H_ diff --git a/src/base-object-inl.h b/src/base-object-inl.h index ac9c052813eb61..0b220bb74bf0fe 100644 --- a/src/base-object-inl.h +++ b/src/base-object-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_BASE_OBJECT_INL_H_ #define SRC_BASE_OBJECT_INL_H_ diff --git a/src/base-object.h b/src/base-object.h index 733346e68842c1..6665662c7b3497 100644 --- a/src/base-object.h +++ b/src/base-object.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_BASE_OBJECT_H_ #define SRC_BASE_OBJECT_H_ diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index e59d2a87f93b26..f170f07e40957c 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #define CARES_STATICLIB #include "ares.h" #include "async-wrap.h" @@ -45,6 +24,9 @@ # include #endif +#if defined(__OpenBSD__) +# define AI_V4MAPPED 0 +#endif namespace node { namespace cares_wrap { @@ -884,7 +866,7 @@ static void Query(const FunctionCallbackInfo& args) { Local string = args[1].As(); Wrap* wrap = new Wrap(env, req_wrap_obj); - node::Utf8Value name(string); + node::Utf8Value name(env->isolate(), string); int err = wrap->Send(*name); if (err) delete wrap; @@ -1023,7 +1005,7 @@ void AfterGetNameInfo(uv_getnameinfo_t* req, static void IsIP(const FunctionCallbackInfo& args) { - node::Utf8Value ip(args[0]); + node::Utf8Value ip(args.GetIsolate(), args[0]); char address_buffer[sizeof(struct in6_addr)]; int rc = 0; @@ -1043,7 +1025,7 @@ static void GetAddrInfo(const FunctionCallbackInfo& args) { CHECK(args[1]->IsString()); CHECK(args[2]->IsInt32()); Local req_wrap_obj = args[0].As(); - node::Utf8Value hostname(args[1]); + node::Utf8Value hostname(env->isolate(), args[1]); int32_t flags = (args[3]->IsInt32()) ? args[3]->Int32Value() : 0; int family; @@ -1092,7 +1074,7 @@ static void GetNameInfo(const FunctionCallbackInfo& args) { CHECK(args[1]->IsString()); CHECK(args[2]->IsUint32()); Local req_wrap_obj = args[0].As(); - node::Utf8Value ip(args[1]); + node::Utf8Value ip(env->isolate(), args[1]); const unsigned port = args[2]->Uint32Value(); struct sockaddr_storage addr; @@ -1171,7 +1153,7 @@ static void SetServers(const FunctionCallbackInfo& args) { CHECK(elm->Get(1)->IsString()); int fam = elm->Get(0)->Int32Value(); - node::Utf8Value ip(elm->Get(1)); + node::Utf8Value ip(env->isolate(), elm->Get(1)); ares_addr_node* cur = &servers[i]; diff --git a/src/env-inl.h b/src/env-inl.h index e38f5a8d166031..c5f2328e1259ea 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_ENV_INL_H_ #define SRC_ENV_INL_H_ diff --git a/src/env.h b/src/env.h index 76f7284f1edfd5..e2002ee92fd44c 100644 --- a/src/env.h +++ b/src/env.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_ENV_H_ #define SRC_ENV_H_ @@ -113,7 +92,6 @@ namespace node { V(fsevent_string, "FSEvent") \ V(gid_string, "gid") \ V(handle_string, "handle") \ - V(headers_string, "headers") \ V(heap_size_limit_string, "heap_size_limit") \ V(heap_total_string, "heapTotal") \ V(heap_used_string, "heapUsed") \ @@ -135,7 +113,6 @@ namespace node { V(mark_sweep_compact_string, "mark-sweep-compact") \ V(max_buffer_string, "maxBuffer") \ V(message_string, "message") \ - V(method_string, "method") \ V(minttl_string, "minttl") \ V(mode_string, "mode") \ V(model_string, "model") \ @@ -197,7 +174,6 @@ namespace node { V(service_string, "service") \ V(servername_string, "servername") \ V(session_id_string, "sessionId") \ - V(should_keep_alive_string, "shouldKeepAlive") \ V(signal_string, "signal") \ V(size_string, "size") \ V(smalloc_p_string, "_smalloc_p") \ @@ -205,8 +181,6 @@ namespace node { V(sni_context_string, "sni_context") \ V(speed_string, "speed") \ V(stack_string, "stack") \ - V(status_code_string, "statusCode") \ - V(status_message_string, "statusMessage") \ V(status_string, "status") \ V(stdio_string, "stdio") \ V(subject_string, "subject") \ @@ -230,16 +204,12 @@ namespace node { V(type_string, "type") \ V(uid_string, "uid") \ V(unknown_string, "") \ - V(upgrade_string, "upgrade") \ - V(url_string, "url") \ V(used_heap_size_string, "used_heap_size") \ V(user_string, "user") \ V(uv_string, "uv") \ V(valid_from_string, "valid_from") \ V(valid_to_string, "valid_to") \ V(verify_error_string, "verifyError") \ - V(version_major_string, "versionMajor") \ - V(version_minor_string, "versionMinor") \ V(version_string, "version") \ V(weight_string, "weight") \ V(windows_verbatim_arguments_string, "windowsVerbatimArguments") \ diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 57d07272ecc58f..1719942ce3e099 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" @@ -110,7 +89,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo& args) { return env->ThrowTypeError("Bad arguments"); } - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); unsigned int flags = 0; if (args[2]->IsTrue()) diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index b42fa00446080b..f0e5896372967f 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "handle_wrap.h" #include "async-wrap.h" #include "async-wrap-inl.h" diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 8c5898e134ab77..901c12213d14b3 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_HANDLE_WRAP_H_ #define SRC_HANDLE_WRAP_H_ diff --git a/src/node.cc b/src/node.cc index e2a506680b4c94..59a5b31901fc47 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_buffer.h" #include "node_constants.h" @@ -757,7 +736,7 @@ Local ErrnoException(Isolate* isolate, e = Exception::Error(cons2); } - Local obj = e->ToObject(); + Local obj = e->ToObject(env->isolate()); obj->Set(env->errno_string(), Integer::New(env->isolate(), errorno)); obj->Set(env->code_string(), estring); @@ -819,7 +798,7 @@ Local UVException(Isolate* isolate, e = Exception::Error(cons2); } - Local obj = e->ToObject(); + Local obj = e->ToObject(env->isolate()); // TODO(piscisaureus) errno should probably go obj->Set(env->errno_string(), Integer::New(env->isolate(), errorno)); obj->Set(env->code_string(), estring); @@ -899,7 +878,7 @@ Local WinapiErrnoException(Isolate* isolate, e = Exception::Error(message); } - Local obj = e->ToObject(); + Local obj = e->ToObject(env->isolate()); obj->Set(env->errno_string(), Integer::New(isolate, errorno)); if (path != nullptr) { @@ -1177,7 +1156,7 @@ enum encoding ParseEncoding(Isolate* isolate, if (!encoding_v->IsString()) return _default; - node::Utf8Value encoding(encoding_v); + node::Utf8Value encoding(isolate, encoding_v); if (strcasecmp(*encoding, "utf8") == 0) { return UTF8; @@ -1275,11 +1254,11 @@ void AppendExceptionLine(Environment* env, char arrow[1024]; // Print (filename):(line number): (message). - node::Utf8Value filename(message->GetScriptResourceName()); + node::Utf8Value filename(env->isolate(), message->GetScriptResourceName()); const char* filename_string = *filename; int linenum = message->GetLineNumber(); // Print line of source code. - node::Utf8Value sourceline(message->GetSourceLine()); + node::Utf8Value sourceline(env->isolate(), message->GetSourceLine()); const char* sourceline_string = *sourceline; // Because of how node modules work, all scripts are wrapped with a @@ -1350,9 +1329,9 @@ void AppendExceptionLine(Environment* env, goto print; err_obj->Set(env->message_string(), - String::Concat(arrow_str, msg->ToString())); + String::Concat(arrow_str, msg->ToString(env->isolate()))); err_obj->Set(env->stack_string(), - String::Concat(arrow_str, stack->ToString())); + String::Concat(arrow_str, stack->ToString(env->isolate()))); return; print: @@ -1376,9 +1355,9 @@ static void ReportException(Environment* env, if (er->IsUndefined() || er->IsNull()) trace_value = Undefined(env->isolate()); else - trace_value = er->ToObject()->Get(env->stack_string()); + trace_value = er->ToObject(env->isolate())->Get(env->stack_string()); - node::Utf8Value trace(trace_value); + node::Utf8Value trace(env->isolate(), trace_value); // range errors have a trace member set to undefined if (trace.length() > 0 && !trace_value->IsUndefined()) { @@ -1401,11 +1380,11 @@ static void ReportException(Environment* env, name.IsEmpty() || name->IsUndefined()) { // Not an error object. Just print as-is. - node::Utf8Value message(er); + node::Utf8Value message(env->isolate(), er); fprintf(stderr, "%s\n", *message); } else { - node::Utf8Value name_string(name); - node::Utf8Value message_string(message); + node::Utf8Value name_string(env->isolate(), name); + node::Utf8Value message_string(env->isolate(), message); fprintf(stderr, "%s: %s\n", *name_string, *message_string); } } @@ -1499,11 +1478,10 @@ static void Chdir(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); if (args.Length() != 1 || !args[0]->IsString()) { - // FIXME(bnoordhuis) ThrowTypeError? - return env->ThrowError("Bad argument."); + return env->ThrowTypeError("Bad argument."); } - node::Utf8Value path(args[0]); + node::Utf8Value path(args.GetIsolate(), args[0]); int err = uv_chdir(*path); if (err) { return env->ThrowUVException(err, "uv_chdir"); @@ -1549,7 +1527,7 @@ static void Umask(const FunctionCallbackInfo& args) { oct = args[0]->Uint32Value(); } else { oct = 0; - node::Utf8Value str(args[0]); + node::Utf8Value str(env->isolate(), args[0]); // Parse the octal string. for (size_t i = 0; i < str.length(); i++) { @@ -1656,7 +1634,8 @@ static uid_t uid_by_name(Handle value) { if (value->IsUint32()) { return static_cast(value->Uint32Value()); } else { - node::Utf8Value name(value); + // TODO(trevnorris): Fix to not use GetCurrent(). + node::Utf8Value name(Isolate::GetCurrent(), value); return uid_by_name(*name); } } @@ -1666,7 +1645,8 @@ static gid_t gid_by_name(Handle value) { if (value->IsUint32()) { return static_cast(value->Uint32Value()); } else { - node::Utf8Value name(value); + // TODO(trevnorris): Fix to not use GetCurrent(). + node::Utf8Value name(Isolate::GetCurrent(), value); return gid_by_name(*name); } } @@ -1802,7 +1782,7 @@ static void InitGroups(const FunctionCallbackInfo& args) { return env->ThrowTypeError("argument 2 must be a number or a string"); } - node::Utf8Value arg0(args[0]); + node::Utf8Value arg0(env->isolate(), args[0]); gid_t extra_group; bool must_free; char* user; @@ -1983,13 +1963,13 @@ void DLOpen(const FunctionCallbackInfo& args) { CHECK_EQ(modpending, nullptr); - if (args.Length() < 2) { + if (args.Length() != 2) { env->ThrowError("process.dlopen takes exactly 2 arguments."); return; } - Local module = args[0]->ToObject(); // Cast - node::Utf8Value filename(args[1]); // Cast + Local module = args[0]->ToObject(env->isolate()); // Cast + node::Utf8Value filename(env->isolate(), args[1]); // Cast const bool is_dlopen_error = uv_dlopen(*filename, &lib); // Objects containing v14 or later modules will have registered themselves @@ -2002,7 +1982,7 @@ void DLOpen(const FunctionCallbackInfo& args) { Local errmsg = OneByteString(env->isolate(), uv_dlerror(&lib)); #ifdef _WIN32 // Windows needs to add the filename into the error message - errmsg = String::Concat(errmsg, args[1]->ToString()); + errmsg = String::Concat(errmsg, args[1]->ToString(env->isolate())); #endif // _WIN32 env->isolate()->ThrowException(Exception::Error(errmsg)); return; @@ -2031,7 +2011,7 @@ void DLOpen(const FunctionCallbackInfo& args) { modlist_addon = mp; Local exports_string = env->exports_string(); - Local exports = module->Get(exports_string)->ToObject(); + Local exports = module->Get(exports_string)->ToObject(env->isolate()); if (mp->nm_context_register_func != nullptr) { mp->nm_context_register_func(exports, module, env->context(), mp->nm_priv); @@ -2123,14 +2103,14 @@ void OnMessage(Handle message, Handle error) { static void Binding(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - Local module = args[0]->ToString(); - node::Utf8Value module_v(module); + Local module = args[0]->ToString(env->isolate()); + node::Utf8Value module_v(env->isolate(), module); Local cache = env->binding_cache_object(); Local exports; if (cache->Has(module)) { - exports = cache->Get(module)->ToObject(); + exports = cache->Get(module)->ToObject(env->isolate()); args.GetReturnValue().Set(exports); return; } @@ -2176,7 +2156,7 @@ static void Binding(const FunctionCallbackInfo& args) { static void LinkedBinding(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args.GetIsolate()); - Local module = args[0]->ToString(); + Local module = args[0]->ToString(env->isolate()); Local cache = env->binding_cache_object(); Local exports_v = cache->Get(module); @@ -2184,7 +2164,7 @@ static void LinkedBinding(const FunctionCallbackInfo& args) { if (exports_v->IsObject()) return args.GetReturnValue().Set(exports_v.As()); - node::Utf8Value module_v(module); + node::Utf8Value module_v(env->isolate(), module); node_module* mod = get_linked_module(*module_v); if (mod == nullptr) { @@ -2229,7 +2209,7 @@ static void ProcessTitleSetter(Local property, const PropertyCallbackInfo& info) { Environment* env = Environment::GetCurrent(info.GetIsolate()); HandleScope scope(env->isolate()); - node::Utf8Value title(value); + node::Utf8Value title(env->isolate(), value); // TODO(piscisaureus): protect with a lock uv_set_process_title(*title); } @@ -2240,7 +2220,7 @@ static void EnvGetter(Local property, Environment* env = Environment::GetCurrent(info.GetIsolate()); HandleScope scope(env->isolate()); #ifdef __POSIX__ - node::Utf8Value key(property); + node::Utf8Value key(env->isolate(), property); const char* val = getenv(*key); if (val) { return info.GetReturnValue().Set(String::NewFromUtf8(env->isolate(), val)); @@ -2273,8 +2253,8 @@ static void EnvSetter(Local property, Environment* env = Environment::GetCurrent(info.GetIsolate()); HandleScope scope(env->isolate()); #ifdef __POSIX__ - node::Utf8Value key(property); - node::Utf8Value val(value); + node::Utf8Value key(env->isolate(), property); + node::Utf8Value val(env->isolate(), value); setenv(*key, *val, 1); #else // _WIN32 String::Value key(property); @@ -2296,7 +2276,7 @@ static void EnvQuery(Local property, HandleScope scope(env->isolate()); int32_t rc = -1; // Not found unless proven otherwise. #ifdef __POSIX__ - node::Utf8Value key(property); + node::Utf8Value key(env->isolate(), property); if (getenv(*key)) rc = 0; #else // _WIN32 @@ -2324,7 +2304,7 @@ static void EnvDeleter(Local property, HandleScope scope(env->isolate()); bool rc = true; #ifdef __POSIX__ - node::Utf8Value key(property); + node::Utf8Value key(env->isolate(), property); rc = getenv(*key) != nullptr; if (rc) unsetenv(*key); @@ -2590,6 +2570,9 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(versions, "zlib", FIXED_ONE_BYTE_STRING(env->isolate(), ZLIB_VERSION)); + READONLY_PROPERTY(versions, + "ares", + FIXED_ONE_BYTE_STRING(env->isolate(), ARES_VERSION_STR)); const char node_modules_version[] = NODE_STRINGIFY(NODE_MODULE_VERSION); READONLY_PROPERTY( @@ -2621,12 +2604,12 @@ void SetupProcessObject(Environment* env, #endif // process.arch - READONLY_PROPERTY(process, "arch", OneByteString(env->isolate(), ARCH)); + READONLY_PROPERTY(process, "arch", OneByteString(env->isolate(), NODE_ARCH)); // process.platform READONLY_PROPERTY(process, "platform", - OneByteString(env->isolate(), PLATFORM)); + OneByteString(env->isolate(), NODE_PLATFORM)); // process.argv Local arguments = Array::New(env->isolate(), argc); @@ -2783,7 +2766,7 @@ static void SignalExit(int signo) { static void RawDebug(const FunctionCallbackInfo& args) { CHECK(args.Length() == 1 && args[0]->IsString() && "must be called with a single string"); - node::Utf8Value message(args[0]); + node::Utf8Value message(args.GetIsolate(), args[0]); fprintf(stderr, "%s\n", *message); fflush(stderr); } @@ -2792,8 +2775,8 @@ static void RawDebug(const FunctionCallbackInfo& args) { void LoadEnvironment(Environment* env) { HandleScope handle_scope(env->isolate()); - V8::SetFatalErrorHandler(node::OnFatalError); - V8::AddMessageListener(OnMessage); + env->isolate()->SetFatalErrorHandler(node::OnFatalError); + env->isolate()->AddMessageListener(OnMessage); // Compile, execute the src/node.js file. (Which was included as static C // string in node_natives.h. 'natve_node' is the string containing that @@ -2887,8 +2870,8 @@ static bool ParseDebugOpt(const char* arg) { } static void PrintHelp() { - printf("Usage: node [options] [ -e script | script.js ] [arguments] \n" - " node debug script.js [arguments] \n" + printf("Usage: iojs [options] [ -e script | script.js ] [arguments] \n" + " iojs debug script.js [arguments] \n" "\n" "Options:\n" " -v, --version print node's version\n" @@ -2928,7 +2911,7 @@ static void PrintHelp() { #endif #endif "\n" - "Documentation can be found at http://nodejs.org/\n"); + "Documentation can be found at https://iojs.org/\n"); } @@ -3485,7 +3468,7 @@ void EmitBeforeExit(Environment* env) { Local exit_code = FIXED_ONE_BYTE_STRING(env->isolate(), "exitCode"); Local args[] = { FIXED_ONE_BYTE_STRING(env->isolate(), "beforeExit"), - process_object->Get(exit_code)->ToInteger() + process_object->Get(exit_code)->ToInteger(env->isolate()) }; MakeCallback(env, process_object, "emit", ARRAY_SIZE(args), args); } diff --git a/src/node.h b/src/node.h index d31bd6d72219da..6a25f9740a412c 100644 --- a/src/node.h +++ b/src/node.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_H_ #define SRC_NODE_H_ @@ -137,7 +116,7 @@ NODE_EXTERN v8::Handle MakeCallback( } // namespace node -#if NODE_WANT_INTERNALS +#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node_internals.h" #endif diff --git a/src/node.js b/src/node.js index 27c06be252eaea..3179378fbc5ae6 100644 --- a/src/node.js +++ b/src/node.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Hello, and welcome to hacking node.js! // // This file is invoked by node::Load in src/node.cc, and responsible for @@ -273,10 +252,10 @@ // strip the gyp comment line at the beginning config = config.split('\n') - .slice(1) - .join('\n') - .replace(/"/g, '\\"') - .replace(/'/g, '"'); + .slice(1) + .join('\n') + .replace(/"/g, '\\"') + .replace(/'/g, '"'); process.config = JSON.parse(config, function(key, value) { if (value === 'true') return true; @@ -794,15 +773,15 @@ NativeModule.getCached = function(id) { return NativeModule._cache[id]; - } + }; NativeModule.exists = function(id) { return NativeModule._source.hasOwnProperty(id); - } + }; NativeModule.getSource = function(id) { return NativeModule._source[id]; - } + }; NativeModule.wrap = function(script) { return NativeModule.wrapper[0] + script + NativeModule.wrapper[1]; diff --git a/src/node.stp b/src/node.stp index f49c37aef1dcf3..55c25aae960b0f 100644 --- a/src/node.stp +++ b/src/node.stp @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - probe node_net_server_connection = process("node").mark("net__server__connection") { remote = user_string($arg2); diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 420dc293af5684..d92c4d1f67309d 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - #include "node.h" #include "node_buffer.h" @@ -336,7 +314,7 @@ void Base64Slice(const FunctionCallbackInfo& args) { void Copy(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args); - Local target = args[0]->ToObject(); + Local target = args[0]->ToObject(env->isolate()); if (!HasInstance(target)) return env->ThrowTypeError("first arg should be a Buffer"); @@ -386,7 +364,7 @@ void Fill(const FunctionCallbackInfo& args) { return; } - node::Utf8Value str(args[1]); + node::Utf8Value str(args.GetIsolate(), args[1]); size_t str_length = str.length(); size_t in_there = str_length; char* ptr = obj_data + start + str_length; @@ -421,7 +399,7 @@ void StringWrite(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return env->ThrowTypeError("Argument must be a string"); - Local str = args[0]->ToString(); + Local str = args[0]->ToString(env->isolate()); if (encoding == HEX && str->Length() % 2 != 0) return env->ThrowTypeError("Invalid hex string"); @@ -583,7 +561,7 @@ void ByteLength(const FunctionCallbackInfo &args) { if (!args[0]->IsString()) return env->ThrowTypeError("Argument must be a string"); - Local s = args[0]->ToString(); + Local s = args[0]->ToString(env->isolate()); enum encoding e = ParseEncoding(env->isolate(), args[1], UTF8); uint32_t size = StringBytes::Size(env->isolate(), s, e); diff --git a/src/node_buffer.h b/src/node_buffer.h index 1d58c309bc60ae..2e649970c4793a 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_BUFFER_H_ #define SRC_NODE_BUFFER_H_ diff --git a/src/node_constants.cc b/src/node_constants.cc index 86fa544d19ab5c..ce715a32462655 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_constants.h" #include "uv.h" diff --git a/src/node_constants.h b/src/node_constants.h index f8bc0ce202fe97..8493d4d13b3d2a 100644 --- a/src/node_constants.h +++ b/src/node_constants.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CONSTANTS_H_ #define SRC_NODE_CONSTANTS_H_ diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ead5e3efc3bf42..6985a33982d749 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_internals.h" #include "node_watchdog.h" @@ -144,7 +123,8 @@ class ContextifyContext { HandleScope scope(env()->isolate()); Local context = PersistentToLocal(env()->isolate(), context_); - Local global = context->Global()->GetPrototype()->ToObject(); + Local global = + context->Global()->GetPrototype()->ToObject(env()->isolate()); Local sandbox = PersistentToLocal(env()->isolate(), sandbox_); Local clone_property_method; @@ -152,7 +132,7 @@ class ContextifyContext { Local names = global->GetOwnPropertyNames(); int length = names->Length(); for (int i = 0; i < length; i++) { - Local key = names->Get(i)->ToString(); + Local key = names->Get(i)->ToString(env()->isolate()); bool has = sandbox->HasOwnProperty(key); if (!has) { // Could also do this like so: @@ -253,7 +233,7 @@ class ContextifyContext { static void RunInDebugContext(const FunctionCallbackInfo& args) { - Local script_source(args[0]->ToString()); + Local script_source(args[0]->ToString(args.GetIsolate())); if (script_source.IsEmpty()) return; // Exception pending. Context::Scope context_scope(Debug::GetDebugContext()); @@ -476,7 +456,7 @@ class ContextifyScript : public BaseObject { new ContextifyScript(env, args.This()); TryCatch try_catch; - Local code = args[0]->ToString(); + Local code = args[0]->ToString(env->isolate()); Local filename = GetFilenameArg(args, 1); bool display_errors = GetDisplayErrorsArg(args, 1); if (try_catch.HasCaught()) { @@ -643,7 +623,9 @@ class ContextifyScript : public BaseObject { Local key = FIXED_ONE_BYTE_STRING(args.GetIsolate(), "filename"); Local value = args[i].As()->Get(key); - return value->IsUndefined() ? defaultFilename : value->ToString(); + if (value->IsUndefined()) + return defaultFilename; + return value->ToString(args.GetIsolate()); } diff --git a/src/node_counters.cc b/src/node_counters.cc index 82bfa07808e094..4e2cc0a5c23424 100644 --- a/src/node_counters.cc +++ b/src/node_counters.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_counters.h" #include "uv.h" #include "env.h" diff --git a/src/node_counters.h b/src/node_counters.h index 9a15bd889aef07..b9e56ed362e12f 100644 --- a/src/node_counters.h +++ b/src/node_counters.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_COUNTERS_H_ #define SRC_NODE_COUNTERS_H_ diff --git a/src/node_crypto.cc b/src/node_crypto.cc index f65a7b902f510a..c088fe25db0d98 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_buffer.h" #include "node_crypto.h" @@ -307,44 +286,24 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { OPENSSL_CONST SSL_METHOD *method = SSLv23_method(); if (args.Length() == 1 && args[0]->IsString()) { - const node::Utf8Value sslmethod(args[0]); + const node::Utf8Value sslmethod(env->isolate(), args[0]); + // Note that SSLv2 and SSLv3 are disallowed but SSLv2_method and friends + // are still accepted. They are OpenSSL's way of saying that all known + // protocols are supported unless explicitly disabled (which we do below + // for SSLv2 and SSLv3.) if (strcmp(*sslmethod, "SSLv2_method") == 0) { -#ifndef OPENSSL_NO_SSL2 - method = SSLv2_method(); -#else return env->ThrowError("SSLv2 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv2_server_method") == 0) { -#ifndef OPENSSL_NO_SSL2 - method = SSLv2_server_method(); -#else return env->ThrowError("SSLv2 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv2_client_method") == 0) { -#ifndef OPENSSL_NO_SSL2 - method = SSLv2_client_method(); -#else return env->ThrowError("SSLv2 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv3_method") == 0) { -#ifndef OPENSSL_NO_SSL3 - method = SSLv3_method(); -#else return env->ThrowError("SSLv3 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) { -#ifndef OPENSSL_NO_SSL3 - method = SSLv3_server_method(); -#else return env->ThrowError("SSLv3 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) { -#ifndef OPENSSL_NO_SSL3 - method = SSLv3_client_method(); -#else return env->ThrowError("SSLv3 methods disabled"); -#endif } else if (strcmp(*sslmethod, "SSLv23_method") == 0) { method = SSLv23_method(); } else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) { @@ -376,6 +335,13 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { sc->ctx_ = SSL_CTX_new(method); + // Disable SSLv2 in the case when method == SSLv23_method() and the + // cipher list contains SSLv2 ciphers (not the default, should be rare.) + // The bundled OpenSSL doesn't have SSLv2 support but the system OpenSSL may. + // SSLv3 is disabled because it's susceptible to downgrade attacks (POODLE.) + SSL_CTX_set_options(sc->ctx_, SSL_OP_NO_SSLv2); + SSL_CTX_set_options(sc->ctx_, SSL_OP_NO_SSLv3); + // SSL session cache configuration SSL_CTX_set_session_cache_mode(sc->ctx_, SSL_SESS_CACHE_SERVER | @@ -400,7 +366,7 @@ static BIO* LoadBIO(Environment* env, Handle v) { int r = -1; if (v->IsString()) { - const node::Utf8Value s(v); + const node::Utf8Value s(env->isolate(), v); r = BIO_write(bio, *s, s.length()); } else if (Buffer::HasInstance(v)) { char* buffer_data = Buffer::Data(v); @@ -454,7 +420,7 @@ void SecureContext::SetKey(const FunctionCallbackInfo& args) { if (!bio) return; - node::Utf8Value passphrase(args[1]); + node::Utf8Value passphrase(env->isolate(), args[1]); EVP_PKEY* key = PEM_read_bio_PrivateKey(bio, nullptr, @@ -719,7 +685,7 @@ void SecureContext::SetCiphers(const FunctionCallbackInfo& args) { return sc->env()->ThrowTypeError("Bad parameter"); } - const node::Utf8Value ciphers(args[0]); + const node::Utf8Value ciphers(args.GetIsolate(), args[0]); SSL_CTX_set_cipher_list(sc->ctx_, *ciphers); } @@ -731,7 +697,7 @@ void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { if (args.Length() != 1 || !args[0]->IsString()) return env->ThrowTypeError("First argument should be a string"); - node::Utf8Value curve(args[0]); + node::Utf8Value curve(env->isolate(), args[0]); int nid = OBJ_sn2nid(*curve); @@ -798,7 +764,7 @@ void SecureContext::SetSessionIdContext( return sc->env()->ThrowTypeError("Bad parameter"); } - const node::Utf8Value sessionIdContext(args[0]); + const node::Utf8Value sessionIdContext(args.GetIsolate(), args[0]); const unsigned char* sid_ctx = reinterpret_cast(*sessionIdContext); unsigned int sid_ctx_len = sessionIdContext.length(); @@ -1686,7 +1652,7 @@ void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); Local reason_string = OneByteString(isolate, reason); Local exception_value = Exception::Error(reason_string); - Local exception_object = exception_value->ToObject(); + Local exception_object = exception_value->ToObject(isolate); exception_object->Set(FIXED_ONE_BYTE_STRING(isolate, "code"), OneByteString(isolate, code)); args.GetReturnValue().Set(exception_object); @@ -2169,7 +2135,7 @@ void Connection::New(const FunctionCallbackInfo& args) { return; } - SecureContext* sc = Unwrap(args[0]->ToObject()); + SecureContext* sc = Unwrap(args[0]->ToObject(env->isolate())); bool is_server = args[1]->BooleanValue(); @@ -2190,7 +2156,7 @@ void Connection::New(const FunctionCallbackInfo& args) { if (is_server) { SSL_CTX_set_tlsext_servername_callback(sc->ctx_, SelectSNIContextCallback_); } else if (args[2]->IsString()) { - const node::Utf8Value servername(args[2]); + const node::Utf8Value servername(env->isolate(), args[2]); SSL_set_tlsext_host_name(conn->ssl_, *servername); } #endif @@ -2591,7 +2557,7 @@ void CipherBase::Init(const FunctionCallbackInfo& args) { return cipher->env()->ThrowError("Must give cipher-type, key"); } - const node::Utf8Value cipher_type(args[0]); + const node::Utf8Value cipher_type(args.GetIsolate(), args[0]); const char* key_buf = Buffer::Data(args[1]); ssize_t key_buf_len = Buffer::Length(args[1]); cipher->Init(*cipher_type, key_buf, key_buf_len); @@ -2645,7 +2611,7 @@ void CipherBase::InitIv(const FunctionCallbackInfo& args) { ASSERT_IS_BUFFER(args[1]); ASSERT_IS_BUFFER(args[2]); - const node::Utf8Value cipher_type(args[0]); + const node::Utf8Value cipher_type(env->isolate(), args[0]); ssize_t key_len = Buffer::Length(args[1]); const char* key_buf = Buffer::Data(args[1]); ssize_t iv_len = Buffer::Length(args[2]); @@ -2936,7 +2902,7 @@ void Hmac::HmacInit(const FunctionCallbackInfo& args) { ASSERT_IS_BUFFER(args[1]); - const node::Utf8Value hash_type(args[0]); + const node::Utf8Value hash_type(env->isolate(), args[0]); const char* buffer_data = Buffer::Data(args[1]); size_t buffer_length = Buffer::Length(args[1]); hmac->HmacInit(*hash_type, buffer_data, buffer_length); @@ -3004,7 +2970,9 @@ void Hmac::HmacDigest(const FunctionCallbackInfo& args) { enum encoding encoding = BUFFER; if (args.Length() >= 1) { - encoding = ParseEncoding(env->isolate(), args[0]->ToString(), BUFFER); + encoding = ParseEncoding(env->isolate(), + args[0]->ToString(env->isolate()), + BUFFER); } unsigned char* md_value = nullptr; @@ -3044,7 +3012,7 @@ void Hash::New(const FunctionCallbackInfo& args) { return env->ThrowError("Must give hashtype string as argument"); } - const node::Utf8Value hash_type(args[0]); + const node::Utf8Value hash_type(env->isolate(), args[0]); Hash* hash = new Hash(env, args.This()); if (!hash->HashInit(*hash_type)) { @@ -3119,7 +3087,9 @@ void Hash::HashDigest(const FunctionCallbackInfo& args) { enum encoding encoding = BUFFER; if (args.Length() >= 1) { - encoding = ParseEncoding(env->isolate(), args[0]->ToString(), BUFFER); + encoding = ParseEncoding(env->isolate(), + args[0]->ToString(env->isolate()), + BUFFER); } unsigned char md_value[EVP_MAX_MD_SIZE]; @@ -3218,7 +3188,7 @@ void Sign::SignInit(const FunctionCallbackInfo& args) { return sign->env()->ThrowError("Must give signtype string as argument"); } - const node::Utf8Value sign_type(args[0]); + const node::Utf8Value sign_type(args.GetIsolate(), args[0]); sign->CheckThrow(sign->SignInit(*sign_type)); } @@ -3319,10 +3289,12 @@ void Sign::SignFinal(const FunctionCallbackInfo& args) { unsigned int len = args.Length(); enum encoding encoding = BUFFER; if (len >= 2 && args[1]->IsString()) { - encoding = ParseEncoding(env->isolate(), args[1]->ToString(), BUFFER); + encoding = ParseEncoding(env->isolate(), + args[1]->ToString(env->isolate()), + BUFFER); } - node::Utf8Value passphrase(args[2]); + node::Utf8Value passphrase(env->isolate(), args[2]); ASSERT_IS_BUFFER(args[0]); size_t buf_len = Buffer::Length(args[0]); @@ -3395,7 +3367,7 @@ void Verify::VerifyInit(const FunctionCallbackInfo& args) { return verify->env()->ThrowError("Must give verifytype string as argument"); } - const node::Utf8Value verify_type(args[0]); + const node::Utf8Value verify_type(args.GetIsolate(), args[0]); verify->CheckThrow(verify->VerifyInit(*verify_type)); } @@ -3532,7 +3504,9 @@ void Verify::VerifyFinal(const FunctionCallbackInfo& args) { // BINARY works for both buffers and binary strings. enum encoding encoding = BINARY; if (args.Length() >= 3) { - encoding = ParseEncoding(env->isolate(), args[2]->ToString(), BINARY); + encoding = ParseEncoding(env->isolate(), + args[2]->ToString(env->isolate()), + BINARY); } ssize_t hlen = StringBytes::Size(env->isolate(), args[1], encoding); @@ -3792,7 +3766,7 @@ void DiffieHellman::DiffieHellmanGroup( bool initialized = false; - const node::Utf8Value group_name(args[0]); + const node::Utf8Value group_name(env->isolate(), args[0]); for (unsigned int i = 0; i < ARRAY_SIZE(modp_groups); ++i) { const modp_group* it = modp_groups + i; @@ -4105,7 +4079,7 @@ void ECDH::New(const FunctionCallbackInfo& args) { // TODO(indutny): Support raw curves? CHECK(args[0]->IsString()); - node::Utf8Value curve(args[0]); + node::Utf8Value curve(env->isolate(), args[0]); int nid = OBJ_sn2nid(*curve); if (nid == NID_undef) @@ -4505,7 +4479,7 @@ void PBKDF2(const FunctionCallbackInfo& args) { } if (args[4]->IsString()) { - node::Utf8Value digest_name(args[4]); + node::Utf8Value digest_name(env->isolate(), args[4]); digest = EVP_get_digestbyname(*digest_name); if (digest == nullptr) { type_error = "Bad digest name"; @@ -5006,7 +4980,7 @@ void SetEngine(const FunctionCallbackInfo& args) { ClearErrorOnReturn clear_error_on_return; (void) &clear_error_on_return; // Silence compiler warning. - const node::Utf8Value engine_id(args[0]); + const node::Utf8Value engine_id(env->isolate(), args[0]); ENGINE* engine = ENGINE_by_id(*engine_id); // Engine not found, try loading dynamically diff --git a/src/node_crypto.h b/src/node_crypto.h index 078077d5663534..4aa9a9e00ba79e 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CRYPTO_H_ #define SRC_NODE_CRYPTO_H_ diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index e6ccb33f8ffe12..95971359cbea20 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_crypto_bio.h" #include "openssl/bio.h" #include "util.h" diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index bac79bab0bbc92..4d19d467efcb78 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CRYPTO_BIO_H_ #define SRC_NODE_CRYPTO_BIO_H_ diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h index 53872903af0dca..9ae9fd41b6de6a 100644 --- a/src/node_crypto_clienthello-inl.h +++ b/src/node_crypto_clienthello-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CRYPTO_CLIENTHELLO_INL_H_ #define SRC_NODE_CRYPTO_CLIENTHELLO_INL_H_ diff --git a/src/node_crypto_clienthello.cc b/src/node_crypto_clienthello.cc index fd7ed798cb1d32..8fbc3161f89969 100644 --- a/src/node_crypto_clienthello.cc +++ b/src/node_crypto_clienthello.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_crypto_clienthello.h" #include "node_crypto_clienthello-inl.h" #include "node_buffer.h" // Buffer @@ -32,7 +11,6 @@ void ClientHelloParser::Parse(const uint8_t* data, size_t avail) { break; // Fall through case kTLSHeader: - case kSSL2Header: ParseHeader(data, avail); break; case kPaused: @@ -59,20 +37,8 @@ bool ClientHelloParser::ParseRecordHeader(const uint8_t* data, size_t avail) { state_ = kTLSHeader; body_offset_ = 5; } else { -#ifdef OPENSSL_NO_SSL2 - frame_len_ = ((data[0] << 8) & kSSL2HeaderMask) + data[1]; - state_ = kSSL2Header; - if (data[0] & kSSL2TwoByteHeaderBit) { - // header without padding - body_offset_ = 2; - } else { - // header with padding - body_offset_ = 3; - } -#else End(); return false; -#endif // OPENSSL_NO_SSL2 } // Sanity check (too big frame, or too small) @@ -85,12 +51,6 @@ bool ClientHelloParser::ParseRecordHeader(const uint8_t* data, size_t avail) { return true; } -#ifdef OPENSSL_NO_SSL2 -# define NODE_SSL2_VER_CHECK(buf) false -#else -# define NODE_SSL2_VER_CHECK(buf) ((buf)[0] == 0x00 && (buf)[1] == 0x02) -#endif // OPENSSL_NO_SSL2 - void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { ClientHello hello; @@ -99,10 +59,15 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { if (body_offset_ + frame_len_ > avail) return; - // Skip unsupported frames and gather some data from frame - // Check hello protocol version - if (!(data[body_offset_ + 4] == 0x03 && data[body_offset_ + 5] <= 0x03) && - !NODE_SSL2_VER_CHECK(data + body_offset_ + 4)) { + // Check hello protocol version. Protocol tuples that we know about: + // + // (3,1) TLS v1.0 + // (3,2) TLS v1.1 + // (3,3) TLS v1.2 + // + if (data[body_offset_ + 4] != 0x03 || + data[body_offset_ + 5] < 0x01 || + data[body_offset_ + 5] > 0x03) { goto fail; } @@ -110,13 +75,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { if (state_ == kTLSHeader) { if (!ParseTLSClientHello(data, avail)) goto fail; - } else if (state_ == kSSL2Header) { -#ifdef OPENSSL_NO_SSL2 - if (!ParseSSL2ClientHello(data, avail)) - goto fail; -#else - abort(); // Unreachable -#endif // OPENSSL_NO_SSL2 } else { // We couldn't get here, but whatever goto fail; @@ -145,9 +103,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { } -#undef NODE_SSL2_VER_CHECK - - void ClientHelloParser::ParseExtension(ClientHelloParser::ExtensionType type, const uint8_t* data, size_t len) { @@ -269,28 +224,4 @@ bool ClientHelloParser::ParseTLSClientHello(const uint8_t* data, size_t avail) { return true; } - -#ifdef OPENSSL_NO_SSL2 -bool ClientHelloParser::ParseSSL2ClientHello(const uint8_t* data, - size_t avail) { - const uint8_t* body; - - // Skip header, version - size_t session_offset = body_offset_ + 3; - - if (session_offset + 4 < avail) { - body = data + session_offset; - - uint16_t ciphers_size = (body[0] << 8) + body[1]; - - if (body + 4 + ciphers_size < data + avail) { - session_size_ = (body[2] << 8) + body[3]; - session_id_ = body + 4 + ciphers_size; - } - } - - return true; -} -#endif // OPENSSL_NO_SSL2 - } // namespace node diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h index bbd46e5a312de1..ec814d84396606 100644 --- a/src/node_crypto_clienthello.h +++ b/src/node_crypto_clienthello.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CRYPTO_CLIENTHELLO_H_ #define SRC_NODE_CRYPTO_CLIENTHELLO_H_ @@ -77,8 +56,6 @@ class ClientHelloParser { inline bool IsEnded() const; private: - static const uint8_t kSSL2TwoByteHeaderBit = 0x80; - static const uint8_t kSSL2HeaderMask = 0x3f; static const size_t kMaxTLSFrameLen = 16 * 1024 + 5; static const size_t kMaxSSLExFrameLen = 32 * 1024; static const uint8_t kServernameHostname = 0; @@ -88,7 +65,6 @@ class ClientHelloParser { enum ParseState { kWaiting, kTLSHeader, - kSSL2Header, kPaused, kEnded }; @@ -117,9 +93,6 @@ class ClientHelloParser { const uint8_t* data, size_t len); bool ParseTLSClientHello(const uint8_t* data, size_t avail); -#ifdef OPENSSL_NO_SSL2 - bool ParseSSL2ClientHello(const uint8_t* data, size_t avail); -#endif // OPENSSL_NO_SSL2 ParseState state_; OnHelloCb onhello_cb_; diff --git a/src/node_crypto_groups.h b/src/node_crypto_groups.h index 7ef0d8dc8e2f97..ffbf671307e1b2 100644 --- a/src/node_crypto_groups.h +++ b/src/node_crypto_groups.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_CRYPTO_GROUPS_H_ #define SRC_NODE_CRYPTO_GROUPS_H_ diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc index 7fb2312c9a86f3..36f2433e27d192 100644 --- a/src/node_dtrace.cc +++ b/src/node_dtrace.cc @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - #include "util.h" #ifdef HAVE_DTRACE @@ -76,8 +54,8 @@ using v8::Value; return env->ThrowError( \ "expected object for " #obj " to contain string member " #member); \ } \ - node::Utf8Value _##member(obj->Get(OneByteString(env->isolate(), \ - #member))); \ + node::Utf8Value _##member(env->isolate(), \ + obj->Get(OneByteString(env->isolate(), #member))); \ if ((*(const char **)valp = *_##member) == nullptr) \ *(const char **)valp = ""; @@ -87,7 +65,7 @@ using v8::Value; "expected object for " #obj " to contain integer member " #member); \ } \ *valp = obj->Get(OneByteString(env->isolate(), #member)) \ - ->ToInteger()->Value(); + ->ToInteger(env->isolate())->Value(); #define SLURP_OBJECT(obj, member, valp) \ if (!(obj)->IsObject()) { \ @@ -215,7 +193,7 @@ void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo& args) { } Local strfwdfor = headers->Get(env->x_forwarded_string()); - node::Utf8Value fwdfor(strfwdfor); + node::Utf8Value fwdfor(env->isolate(), strfwdfor); if (!strfwdfor->IsString() || (req.forwardedFor = *fwdfor) == nullptr) req.forwardedFor = const_cast(""); diff --git a/src/node_dtrace.h b/src/node_dtrace.h index 4f61fbd6adeb00..fad453b1ec40fc 100644 --- a/src/node_dtrace.h +++ b/src/node_dtrace.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_DTRACE_H_ #define SRC_NODE_DTRACE_H_ diff --git a/src/node_file.cc b/src/node_file.cc index 88b1262e168953..972e0abb53e177 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_file.h" #include "node_buffer.h" @@ -329,7 +308,7 @@ static void Access(const FunctionCallbackInfo& args) { if (!args[1]->IsInt32()) return TYPE_ERROR("mode must be an integer"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); int mode = static_cast(args[1]->Int32Value()); if (args[2]->IsObject()) { @@ -462,7 +441,7 @@ static void Stat(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(stat, args[1], *path) @@ -481,7 +460,7 @@ static void LStat(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(lstat, args[1], *path) @@ -523,12 +502,12 @@ static void Symlink(const FunctionCallbackInfo& args) { if (!args[1]->IsString()) return TYPE_ERROR("src path must be a string"); - node::Utf8Value dest(args[0]); - node::Utf8Value path(args[1]); + node::Utf8Value dest(env->isolate(), args[0]); + node::Utf8Value path(env->isolate(), args[1]); int flags = 0; if (args[2]->IsString()) { - node::Utf8Value mode(args[2]); + node::Utf8Value mode(env->isolate(), args[2]); if (strcmp(*mode, "dir") == 0) { flags |= UV_FS_SYMLINK_DIR; } else if (strcmp(*mode, "junction") == 0) { @@ -558,8 +537,8 @@ static void Link(const FunctionCallbackInfo& args) { if (!args[1]->IsString()) return TYPE_ERROR("src path must be a string"); - node::Utf8Value orig_path(args[0]); - node::Utf8Value new_path(args[1]); + node::Utf8Value orig_path(env->isolate(), args[0]); + node::Utf8Value new_path(env->isolate(), args[1]); if (args[2]->IsObject()) { ASYNC_DEST_CALL(link, args[2], *new_path, *orig_path, *new_path) @@ -576,7 +555,7 @@ static void ReadLink(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(readlink, args[1], *path) @@ -601,8 +580,8 @@ static void Rename(const FunctionCallbackInfo& args) { if (!args[1]->IsString()) return TYPE_ERROR("new path must be a string"); - node::Utf8Value old_path(args[0]); - node::Utf8Value new_path(args[1]); + node::Utf8Value old_path(env->isolate(), args[0]); + node::Utf8Value new_path(env->isolate(), args[1]); if (args[2]->IsObject()) { ASYNC_DEST_CALL(rename, args[2], *new_path, *old_path, *new_path) @@ -670,7 +649,7 @@ static void Unlink(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(unlink, args[1], *path) @@ -687,7 +666,7 @@ static void RMDir(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(rmdir, args[1], *path) @@ -703,7 +682,7 @@ static void MKDir(const FunctionCallbackInfo& args) { return THROW_BAD_ARGS; } - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); int mode = static_cast(args[1]->Int32Value()); if (args[2]->IsObject()) { @@ -721,7 +700,7 @@ static void ReadDir(const FunctionCallbackInfo& args) { if (!args[0]->IsString()) return TYPE_ERROR("path must be a string"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); if (args[1]->IsObject()) { ASYNC_CALL(scandir, args[1], *path, 0 /*flags*/) @@ -767,7 +746,7 @@ static void Open(const FunctionCallbackInfo& args) { if (!args[2]->IsInt32()) return TYPE_ERROR("mode must be an int"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); int flags = args[1]->Int32Value(); int mode = static_cast(args[2]->Int32Value()); @@ -927,7 +906,7 @@ static void Read(const FunctionCallbackInfo& args) { return env->ThrowError("Second argument needs to be a buffer"); } - Local buffer_obj = args[1]->ToObject(); + Local buffer_obj = args[1]->ToObject(env->isolate()); char *buffer_data = Buffer::Data(buffer_obj); size_t buffer_length = Buffer::Length(buffer_obj); @@ -966,7 +945,7 @@ static void Chmod(const FunctionCallbackInfo& args) { if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsInt32()) { return THROW_BAD_ARGS; } - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); int mode = static_cast(args[1]->Int32Value()); if (args[2]->IsObject()) { @@ -1017,7 +996,7 @@ static void Chown(const FunctionCallbackInfo& args) { if (!args[2]->IsUint32()) return TYPE_ERROR("gid must be an unsigned int"); - node::Utf8Value path(args[0]); + node::Utf8Value path(env->isolate(), args[0]); uv_uid_t uid = static_cast(args[1]->Uint32Value()); uv_gid_t gid = static_cast(args[2]->Uint32Value()); @@ -1078,7 +1057,7 @@ static void UTimes(const FunctionCallbackInfo& args) { if (!args[2]->IsNumber()) return TYPE_ERROR("mtime must be a number"); - const node::Utf8Value path(args[0]); + const node::Utf8Value path(env->isolate(), args[0]); const double atime = static_cast(args[1]->NumberValue()); const double mtime = static_cast(args[2]->NumberValue()); diff --git a/src/node_file.h b/src/node_file.h index dc5deedb0a1c14..f242ee4f4f10b7 100644 --- a/src/node_file.h +++ b/src/node_file.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_FILE_H_ #define SRC_NODE_FILE_H_ diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index ee312ddedf071a..f71302d3130a16 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_buffer.h" #include "node_http_parser.h" @@ -55,6 +34,7 @@ namespace node { using v8::Array; +using v8::Boolean; using v8::Context; using v8::Exception; using v8::Function; @@ -67,6 +47,7 @@ using v8::Local; using v8::Object; using v8::String; using v8::Uint32; +using v8::Undefined; using v8::Value; const uint32_t kOnHeaders = 0; @@ -239,55 +220,68 @@ class Parser : public BaseObject { HTTP_CB(on_headers_complete) { + // Arguments for the on-headers-complete javascript callback. This + // list needs to be kept in sync with the actual argument list for + // `parserOnHeadersComplete` in lib/_http_common.js. + enum on_headers_complete_arg_index { + A_VERSION_MAJOR = 0, + A_VERSION_MINOR, + A_HEADERS, + A_METHOD, + A_URL, + A_STATUS_CODE, + A_STATUS_MESSAGE, + A_UPGRADE, + A_SHOULD_KEEP_ALIVE, + A_MAX + }; + + Local argv[A_MAX]; Local obj = object(); Local cb = obj->Get(kOnHeadersComplete); if (!cb->IsFunction()) return 0; - Local message_info = Object::New(env()->isolate()); + Local undefined = Undefined(env()->isolate()); + for (size_t i = 0; i < ARRAY_SIZE(argv); i++) + argv[i] = undefined; if (have_flushed_) { // Slow case, flush remaining headers. Flush(); } else { // Fast case, pass headers and URL to JS land. - message_info->Set(env()->headers_string(), CreateHeaders()); + argv[A_HEADERS] = CreateHeaders(); if (parser_.type == HTTP_REQUEST) - message_info->Set(env()->url_string(), url_.ToString(env())); + argv[A_URL] = url_.ToString(env()); } - num_fields_ = num_values_ = 0; + + num_fields_ = 0; + num_values_ = 0; // METHOD if (parser_.type == HTTP_REQUEST) { - message_info->Set(env()->method_string(), - Uint32::NewFromUnsigned(env()->isolate(), - parser_.method)); + argv[A_METHOD] = + Uint32::NewFromUnsigned(env()->isolate(), parser_.method); } // STATUS if (parser_.type == HTTP_RESPONSE) { - message_info->Set(env()->status_code_string(), - Integer::New(env()->isolate(), parser_.status_code)); - message_info->Set(env()->status_message_string(), - status_message_.ToString(env())); + argv[A_STATUS_CODE] = + Integer::New(env()->isolate(), parser_.status_code); + argv[A_STATUS_MESSAGE] = status_message_.ToString(env()); } // VERSION - message_info->Set(env()->version_major_string(), - Integer::New(env()->isolate(), parser_.http_major)); - message_info->Set(env()->version_minor_string(), - Integer::New(env()->isolate(), parser_.http_minor)); + argv[A_VERSION_MAJOR] = Integer::New(env()->isolate(), parser_.http_major); + argv[A_VERSION_MINOR] = Integer::New(env()->isolate(), parser_.http_minor); - message_info->Set(env()->should_keep_alive_string(), - http_should_keep_alive(&parser_) ? - True(env()->isolate()) : False(env()->isolate())); + argv[A_SHOULD_KEEP_ALIVE] = + Boolean::New(env()->isolate(), http_should_keep_alive(&parser_)); - message_info->Set(env()->upgrade_string(), - parser_.upgrade ? True(env()->isolate()) - : False(env()->isolate())); + argv[A_UPGRADE] = Boolean::New(env()->isolate(), parser_.upgrade); - Local argv[1] = { message_info }; Local head_response = cb.As()->Call(obj, ARRAY_SIZE(argv), argv); @@ -421,7 +415,7 @@ class Parser : public BaseObject { enum http_errno err = HTTP_PARSER_ERRNO(&parser->parser_); Local e = Exception::Error(env->parse_error_string()); - Local obj = e->ToObject(); + Local obj = e->ToObject(env->isolate()); obj->Set(env->bytes_parsed_string(), nparsed_obj); obj->Set(env->code_string(), OneByteString(env->isolate(), http_errno_name(err))); @@ -450,7 +444,7 @@ class Parser : public BaseObject { enum http_errno err = HTTP_PARSER_ERRNO(&parser->parser_); Local e = env->parse_error_string(); - Local obj = e->ToObject(); + Local obj = e->ToObject(env->isolate()); obj->Set(env->bytes_parsed_string(), Integer::New(env->isolate(), 0)); obj->Set(env->code_string(), OneByteString(env->isolate(), http_errno_name(err))); diff --git a/src/node_http_parser.h b/src/node_http_parser.h index e376f52145d5bd..6fd8b76c6c3a6d 100644 --- a/src/node_http_parser.h +++ b/src/node_http_parser.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_HTTP_PARSER_H_ #define SRC_NODE_HTTP_PARSER_H_ diff --git a/src/node_i18n.cc b/src/node_i18n.cc index d4f8b30bae11bf..0f59b45c23915f 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - /* * notes: by srl295 * - When in NODE_HAVE_SMALL_ICU mode, ICU is linked against "stub" (null) data diff --git a/src/node_i18n.h b/src/node_i18n.h index f6807a911ec6c1..ec38b66be4a39f 100644 --- a/src/node_i18n.h +++ b/src/node_i18n.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_I18N_H_ #define SRC_NODE_I18N_H_ diff --git a/src/node_internals.h b/src/node_internals.h index 01081f1d1d0ed0..cb8a4a802d3749 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_INTERNALS_H_ #define SRC_NODE_INTERNALS_H_ diff --git a/src/node_javascript.cc b/src/node_javascript.cc index dbf5326d4f7759..bd94a645cf5dfb 100644 --- a/src/node_javascript.cc +++ b/src/node_javascript.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_natives.h" #include "v8.h" diff --git a/src/node_javascript.h b/src/node_javascript.h index 6b7edcb7446e05..247c3b8c2b374e 100644 --- a/src/node_javascript.h +++ b/src/node_javascript.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_JAVASCRIPT_H_ #define SRC_NODE_JAVASCRIPT_H_ diff --git a/src/node_main.cc b/src/node_main.cc index 28ce29fa97d710..13a70b2d0d33d7 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #ifdef _WIN32 diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index b604e67095ebc2..d00e1484b7c10c 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_OBJECT_WRAP_H_ #define SRC_NODE_OBJECT_WRAP_H_ diff --git a/src/node_os.cc b/src/node_os.cc index e4d90234b97ab2..e29e22973984e7 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - #include "node.h" #include "v8.h" #include "env.h" @@ -106,12 +84,15 @@ static void GetOSRelease(const FunctionCallbackInfo& args) { return env->ThrowErrnoException(errno, "uname"); } rval = info.release; -#else // __MINGW32__ +#else // Windows char release[256]; - OSVERSIONINFO info; + OSVERSIONINFOW info; info.dwOSVersionInfoSize = sizeof(info); - if (GetVersionEx(&info) == 0) + + // Don't complain that GetVersionEx is deprecated; there is no alternative. + #pragma warning(suppress : 4996) + if (GetVersionExW(&info) == 0) return; snprintf(release, diff --git a/src/node_root_certs.h b/src/node_root_certs.h index 67bf765fe0bc94..6af5e9c97dfb8d 100644 --- a/src/node_root_certs.h +++ b/src/node_root_certs.h @@ -88,6 +88,21 @@ "2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4\n" "-----END CERTIFICATE-----\n", +/* Verisign Class 3 Public Primary Certification Authority */ +"-----BEGIN CERTIFICATE-----\n" +"MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMC\n" +"VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQ\n" +"cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgw\n" +"MTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYD\n" +"VQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGf\n" +"MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ\n" +"2RHP7gJYHyX3KqhEBarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaO\n" +"IG+YD/isI19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G\n" +"CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2ws\n" +"qFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzk\n" +"uxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k\n" +"-----END CERTIFICATE-----\n", + /* Verisign Class 3 Public Primary Certification Authority - G2 */ "-----BEGIN CERTIFICATE-----\n" "MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYT\n" diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 43112933fefaff..8d27cbc9eba99b 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_stat_watcher.h" #include "async-wrap.h" #include "async-wrap-inl.h" @@ -107,7 +86,7 @@ void StatWatcher::Start(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 3); StatWatcher* wrap = Unwrap(args.Holder()); - node::Utf8Value path(args[0]); + node::Utf8Value path(args.GetIsolate(), args[0]); const bool persistent = args[1]->BooleanValue(); const uint32_t interval = args[2]->Uint32Value(); diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h index ce4b0142a7c203..bd214791048317 100644 --- a/src/node_stat_watcher.h +++ b/src/node_stat_watcher.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_STAT_WATCHER_H_ #define SRC_NODE_STAT_WATCHER_H_ diff --git a/src/node_v8.cc b/src/node_v8.cc index 2a080f98c3e141..47e802e41b37e5 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "env.h" #include "env-inl.h" diff --git a/src/node_version.h b/src/node_version.h index ca154026c7fa8e..414c831de5f4c8 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -1,52 +1,33 @@ -// 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. - #ifndef SRC_NODE_VERSION_H_ #define SRC_NODE_VERSION_H_ -#define NODE_MAJOR_VERSION 0 -#define NODE_MINOR_VERSION 11 -#define NODE_PATCH_VERSION 15 +#define NODE_MAJOR_VERSION 1 +#define NODE_MINOR_VERSION 0 +#define NODE_PATCH_VERSION 4 #define NODE_VERSION_IS_RELEASE 0 -#ifndef NODE_TAG -# define NODE_TAG "" -#endif - #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) #define NODE_STRINGIFY_HELPER(n) #n #endif #if NODE_VERSION_IS_RELEASE +# ifndef NODE_TAG +# define NODE_TAG "" +# endif # define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \ NODE_STRINGIFY(NODE_MINOR_VERSION) "." \ NODE_STRINGIFY(NODE_PATCH_VERSION) \ NODE_TAG #else +# ifndef NODE_TAG +# define NODE_TAG "-pre" +# endif # define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \ NODE_STRINGIFY(NODE_MINOR_VERSION) "." \ NODE_STRINGIFY(NODE_PATCH_VERSION) \ - NODE_TAG "-pre" + NODE_TAG #endif #define NODE_VERSION "v" NODE_VERSION_STRING @@ -64,6 +45,6 @@ * an API is broken in the C++ side, including in v8 or * other dependencies. */ -#define NODE_MODULE_VERSION 14 /* v0.12 */ +#define NODE_MODULE_VERSION 42 /* io.js v1.0.0 */ #endif /* SRC_NODE_VERSION_H_ */ diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 147cc10b9ebfe6..5789a5e47171cc 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_watchdog.h" #include "env.h" #include "env-inl.h" diff --git a/src/node_watchdog.h b/src/node_watchdog.h index 284c65d5e70d53..887404eb11fdda 100644 --- a/src/node_watchdog.h +++ b/src/node_watchdog.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_WATCHDOG_H_ #define SRC_NODE_WATCHDOG_H_ diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index 1934712361d9ba..6104687a25520f 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_WIN32_ETW_PROVIDER_INL_H_ #define SRC_NODE_WIN32_ETW_PROVIDER_INL_H_ diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc index 1941b5a566c378..c6bfbeaaf6c989 100644 --- a/src/node_win32_etw_provider.cc +++ b/src/node_win32_etw_provider.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node_dtrace.h" #include "node_win32_etw_provider.h" #include "node_etw_provider.h" @@ -167,7 +146,7 @@ void NTAPI etw_events_enable_callback( void init_etw() { events_enabled = 0; - advapi = LoadLibrary("advapi32.dll"); + advapi = LoadLibraryW(L"advapi32.dll"); if (advapi) { event_register = (EventRegisterFunc) GetProcAddress(advapi, "EventRegister"); diff --git a/src/node_win32_etw_provider.h b/src/node_win32_etw_provider.h index 69f20a2b18dbba..7ee3ff15cfd56d 100644 --- a/src/node_win32_etw_provider.h +++ b/src/node_win32_etw_provider.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_WIN32_ETW_PROVIDER_H_ #define SRC_NODE_WIN32_ETW_PROVIDER_H_ @@ -92,8 +71,9 @@ INLINE bool NODE_NET_SOCKET_READ_ENABLED(); INLINE bool NODE_NET_SOCKET_WRITE_ENABLED(); INLINE bool NODE_V8SYMBOL_ENABLED(); -#define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3) -#define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3) +#define NODE_NET_SOCKET_READ(...) /* no-op */ +#define NODE_NET_SOCKET_WRITE(...) /* no-op */ + } // namespace node #endif // SRC_NODE_WIN32_ETW_PROVIDER_H_ diff --git a/src/node_win32_perfctr_provider.cc b/src/node_win32_perfctr_provider.cc index bfe28e74f61f48..00491caf50675f 100644 --- a/src/node_win32_perfctr_provider.cc +++ b/src/node_win32_perfctr_provider.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #define __INIT_node_perfctr_provider_IMP #include "node_counters.h" #include "node_win32_perfctr_provider.h" @@ -135,7 +114,7 @@ void InitPerfCountersWin32() { wcscpy_s(Inst, INST_MAX_LEN, INST_PREFIX); _itow_s(pid, Inst + INST_PREFIX_LEN, INST_MAX_LEN - INST_PREFIX_LEN, 10); - advapimod = LoadLibrary("advapi32.dll"); + advapimod = LoadLibraryW(L"advapi32.dll"); if (advapimod) { perfctr_startProvider = (PerfStartProviderExFunc) GetProcAddress(advapimod, "PerfStartProviderEx"); diff --git a/src/node_win32_perfctr_provider.h b/src/node_win32_perfctr_provider.h index 6e6c4048b6f797..f1645f4bf8bb8c 100644 --- a/src/node_win32_perfctr_provider.h +++ b/src/node_win32_perfctr_provider.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_WIN32_PERFCTR_PROVIDER_H_ #define SRC_NODE_WIN32_PERFCTR_PROVIDER_H_ diff --git a/src/node_wrap.h b/src/node_wrap.h index 5403f711fee82e..80d679606e9169 100644 --- a/src/node_wrap.h +++ b/src/node_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_NODE_WRAP_H_ #define SRC_NODE_WRAP_H_ diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 5b8024330b0163..884c244f9f0afc 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "node.h" #include "node_buffer.h" @@ -63,11 +42,6 @@ enum node_zlib_mode { UNZIP }; -enum node_zlib_error { - kNoError, - kFailed, - kWritePending -}; void InitZlib(v8::Handle target); @@ -178,7 +152,7 @@ class ZCtx : public AsyncWrap { } else { CHECK(Buffer::HasInstance(args[1])); Local in_buf; - in_buf = args[1]->ToObject(); + in_buf = args[1]->ToObject(args.GetIsolate()); in_off = args[2]->Uint32Value(); in_len = args[3]->Uint32Value(); @@ -187,7 +161,7 @@ class ZCtx : public AsyncWrap { } CHECK(Buffer::HasInstance(args[4])); - Local out_buf = args[4]->ToObject(); + Local out_buf = args[4]->ToObject(args.GetIsolate()); out_off = args[5]->Uint32Value(); out_len = args[6]->Uint32Value(); CHECK(Buffer::IsWithinBounds(out_off, out_len, Buffer::Length(out_buf))); @@ -208,7 +182,7 @@ class ZCtx : public AsyncWrap { if (!async) { // sync version Process(work_req); - if (CheckError(ctx) == kNoError) + if (CheckError(ctx)) AfterSync(ctx, args); return; } @@ -292,7 +266,7 @@ class ZCtx : public AsyncWrap { } - static node_zlib_error CheckError(ZCtx* ctx) { + static bool CheckError(ZCtx* ctx) { // Acceptable error states depend on the type of zlib stream. switch (ctx->err_) { case Z_OK: @@ -305,18 +279,14 @@ class ZCtx : public AsyncWrap { ZCtx::Error(ctx, "Missing dictionary"); else ZCtx::Error(ctx, "Bad dictionary"); - return kFailed; + return false; default: // something else. - if (ctx->strm_.total_out == 0) { - ZCtx::Error(ctx, "Zlib error"); - return kFailed; - } else { - return kWritePending; - } + ZCtx::Error(ctx, "Zlib error"); + return false; } - return kNoError; + return true; } @@ -330,8 +300,7 @@ class ZCtx : public AsyncWrap { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); - node_zlib_error error = CheckError(ctx); - if (error == kFailed) + if (!CheckError(ctx)) return; Local avail_out = Integer::New(env->isolate(), @@ -345,11 +314,6 @@ class ZCtx : public AsyncWrap { Local args[2] = { avail_in, avail_out }; ctx->MakeCallback(env->callback_string(), ARRAY_SIZE(args), args); - if (error == kWritePending) { - ZCtx::Error(ctx, "Zlib error"); - return; - } - ctx->Unref(); if (ctx->pending_close_) ctx->Close(); @@ -373,8 +337,9 @@ class ZCtx : public AsyncWrap { ctx->MakeCallback(env->onerror_string(), ARRAY_SIZE(args), args); // no hope of rescue. + if (ctx->write_in_progress_) + ctx->Unref(); ctx->write_in_progress_ = false; - ctx->Unref(); if (ctx->pending_close_) ctx->Close(); } @@ -420,7 +385,7 @@ class ZCtx : public AsyncWrap { char* dictionary = nullptr; size_t dictionary_len = 0; if (args.Length() >= 5 && Buffer::HasInstance(args[4])) { - Local dictionary_ = args[4]->ToObject(); + Local dictionary_ = args[4]->ToObject(args.GetIsolate()); dictionary_len = Buffer::Length(dictionary_); dictionary = new char[dictionary_len]; @@ -554,12 +519,10 @@ class ZCtx : public AsyncWrap { switch (ctx->mode_) { case DEFLATE: case DEFLATERAW: - case GZIP: ctx->err_ = deflateReset(&ctx->strm_); break; case INFLATE: case INFLATERAW: - case GUNZIP: ctx->err_ = inflateReset(&ctx->strm_); break; default: diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index b91ebe0e5ed09e..fe2013bb680247 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "pipe_wrap.h" #include "async-wrap.h" @@ -177,7 +156,7 @@ PipeWrap::PipeWrap(Environment* env, void PipeWrap::Bind(const FunctionCallbackInfo& args) { PipeWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value name(args[0]); + node::Utf8Value name(args.GetIsolate(), args[0]); int err = uv_pipe_bind(&wrap->handle_, *name); args.GetReturnValue().Set(err); } @@ -300,7 +279,7 @@ void PipeWrap::Connect(const FunctionCallbackInfo& args) { CHECK(args[1]->IsString()); Local req_wrap_obj = args[0].As(); - node::Utf8Value name(args[1]); + node::Utf8Value name(env->isolate(), args[1]); PipeConnectWrap* req_wrap = new PipeConnectWrap(env, req_wrap_obj); uv_pipe_connect(&req_wrap->req_, diff --git a/src/pipe_wrap.h b/src/pipe_wrap.h index 959f28f4dca92f..6dc9a01bcd1687 100644 --- a/src/pipe_wrap.h +++ b/src/pipe_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_PIPE_WRAP_H_ #define SRC_PIPE_WRAP_H_ diff --git a/src/process_wrap.cc b/src/process_wrap.cc index ab7d9bfddbf05a..56d1f28e4a2985 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "env.h" #include "env-inl.h" #include "handle_wrap.h" @@ -130,7 +109,7 @@ class ProcessWrap : public HandleWrap { ProcessWrap* wrap = Unwrap(args.Holder()); - Local js_options = args[0]->ToObject(); + Local js_options = args[0]->ToObject(env->isolate()); uv_process_options_t options; memset(&options, 0, sizeof(uv_process_options_t)); @@ -167,7 +146,8 @@ class ProcessWrap : public HandleWrap { // options.file Local file_v = js_options->Get(env->file_string()); - node::Utf8Value file(file_v->IsString() ? file_v : Local()); + node::Utf8Value file(env->isolate(), + file_v->IsString() ? file_v : Local()); if (file.length() > 0) { options.file = *file; } else { @@ -182,7 +162,7 @@ class ProcessWrap : public HandleWrap { // Heap allocate to detect errors. +1 is for nullptr. options.args = new char*[argc + 1]; for (int i = 0; i < argc; i++) { - node::Utf8Value arg(js_argv->Get(i)); + node::Utf8Value arg(env->isolate(), js_argv->Get(i)); options.args[i] = strdup(*arg); } options.args[argc] = nullptr; @@ -190,7 +170,8 @@ class ProcessWrap : public HandleWrap { // options.cwd Local cwd_v = js_options->Get(env->cwd_string()); - node::Utf8Value cwd(cwd_v->IsString() ? cwd_v : Local()); + node::Utf8Value cwd(env->isolate(), + cwd_v->IsString() ? cwd_v : Local()); if (cwd.length() > 0) { options.cwd = *cwd; } @@ -198,11 +179,11 @@ class ProcessWrap : public HandleWrap { // options.env Local env_v = js_options->Get(env->env_pairs_string()); if (!env_v.IsEmpty() && env_v->IsArray()) { - Local env = Local::Cast(env_v); - int envc = env->Length(); + Local env_opt = Local::Cast(env_v); + int envc = env_opt->Length(); options.env = new char*[envc + 1]; // Heap allocated to detect errors. for (int i = 0; i < envc; i++) { - node::Utf8Value pair(env->Get(i)); + node::Utf8Value pair(env->isolate(), env_opt->Get(i)); options.env[i] = strdup(*pair); } options.env[envc] = nullptr; diff --git a/src/req_wrap.h b/src/req_wrap.h index 22263fac7c40cb..6ec0251434f0ee 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_REQ_WRAP_H_ #define SRC_REQ_WRAP_H_ diff --git a/src/res/iojs.ico b/src/res/iojs.ico new file mode 100644 index 00000000000000..fed2026a926b47 Binary files /dev/null and b/src/res/iojs.ico differ diff --git a/src/res/node.ico b/src/res/node.ico deleted file mode 100644 index dad74d3cc0c123..00000000000000 Binary files a/src/res/node.ico and /dev/null differ diff --git a/src/res/node.rc b/src/res/node.rc index 90836d7375fe24..526f795b1829e6 100644 --- a/src/res/node.rc +++ b/src/res/node.rc @@ -1,30 +1,9 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "winresrc.h" #include "node_version.h" // Application icon -1 ICON node.ico +1 ICON iojs.ico // Version resource @@ -50,14 +29,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "Joyent, Inc" - VALUE "ProductName", "Node.js" - VALUE "FileDescription", "Node.js: Evented I/O for V8 JavaScript" - VALUE "FileVersion", NODE_VERSION_STRING - VALUE "ProductVersion", NODE_VERSION_STRING - VALUE "OriginalFilename", "node.exe" - VALUE "InternalName", "node" - VALUE "LegalCopyright", "Copyright Joyent, Inc. and other Node contributors. MIT license." + VALUE "CompanyName", "io.js" + VALUE "ProductName", "io.js" + VALUE "FileDescription", "io.js: Server-side JavaScript" + VALUE "FileVersion", "NODE_VERSION_STRING" + VALUE "ProductVersion", "NODE_VERSION_STRING" + VALUE "OriginalFilename", "iojs.exe" + VALUE "InternalName", "iojs" + VALUE "LegalCopyright", "Copyright io.js contributors. MIT license." END END BLOCK "VarFileInfo" diff --git a/src/res/node_etw_provider.man b/src/res/node_etw_provider.man index efdc26d3dee722..9e8c477b117021 100644 --- a/src/res/node_etw_provider.man +++ b/src/res/node_etw_provider.man @@ -7,8 +7,8 @@ + resourceFileName="iojs.exe" + messageFileName="iojs.exe"> object) { object->GetIndexedPropertiesExternalArrayDataType(); size_t array_size = ExternalArraySize(array_type); CHECK_GT(array_size, 0); - if (array_size > 1) { + if (array_size > 1 && array_data != NULL) { CHECK_GT(array_length * array_size, array_length); // Overflow check. array_length *= array_size; } @@ -493,7 +472,8 @@ const char RetainedAllocInfo::label_[] = "smalloc"; RetainedAllocInfo::RetainedAllocInfo(Handle wrapper) { - Local obj = wrapper->ToObject(); + // TODO(trevnorris): Fix to properly acquire the Isolate. + Local obj = wrapper->ToObject(Isolate::GetCurrent()); length_ = obj->GetIndexedPropertiesExternalArrayDataLength(); data_ = static_cast(obj->GetIndexedPropertiesExternalArrayData()); } diff --git a/src/smalloc.h b/src/smalloc.h index 3321b4a8953d44..7f79d9cb7354da 100644 --- a/src/smalloc.h +++ b/src/smalloc.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_SMALLOC_H_ #define SRC_SMALLOC_H_ diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index bb5c606afceec9..8b0271f3d1ecfb 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "spawn_sync.h" #include "env-inl.h" #include "string_bytes.h" @@ -958,7 +937,7 @@ int SyncProcessRunner::CopyJsString(Local js_value, if (js_value->IsString()) js_string = js_value.As(); else - js_string = js_value->ToString(); + js_string = js_value->ToString(env()->isolate()); // Include space for null terminator byte. size = StringBytes::StorageSize(isolate, js_string, UTF8) + 1; @@ -992,7 +971,7 @@ int SyncProcessRunner::CopyJsStringArray(Local js_value, // needed - it's okay since we cloned the original object. for (uint32_t i = 0; i < length; i++) { if (!js_array->Get(i)->IsString()) - js_array->Set(i, js_array->Get(i)->ToString()); + js_array->Set(i, js_array->Get(i)->ToString(env()->isolate())); } // Index has a pointer to every string element, plus one more for a final diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 615e1b9b888d6f..4a71b75202b5b2 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_SPAWN_SYNC_H_ #define SRC_SPAWN_SYNC_H_ diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 2d13ae0f8887e8..515030a019e932 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "stream_wrap.h" #include "env-inl.h" #include "env.h" @@ -433,7 +412,7 @@ void StreamWrap::Writev(const FunctionCallbackInfo& args) { // Buffer chunk, no additional storage required // String chunk - Handle string = chunk->ToString(); + Handle string = chunk->ToString(env->isolate()); enum encoding encoding = ParseEncoding(env->isolate(), chunks->Get(i * 2 + 1)); size_t chunk_size; @@ -477,7 +456,7 @@ void StreamWrap::Writev(const FunctionCallbackInfo& args) { char* str_storage = storage + offset; size_t str_size = storage_size - offset; - Handle string = chunk->ToString(); + Handle string = chunk->ToString(env->isolate()); enum encoding encoding = ParseEncoding(env->isolate(), chunks->Get(i * 2 + 1)); str_size = StringBytes::Write(env->isolate(), diff --git a/src/stream_wrap.h b/src/stream_wrap.h index ded78eeecb25f7..d9dd93b24bb4bb 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_STREAM_WRAP_H_ #define SRC_STREAM_WRAP_H_ diff --git a/src/string_bytes.cc b/src/string_bytes.cc index f1ff697452f58c..fa7e820df9f687 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "string_bytes.h" #include "node.h" @@ -409,7 +388,7 @@ size_t StringBytes::StorageSize(Isolate* isolate, return Buffer::Length(val); } - Local str = val->ToString(); + Local str = val->ToString(isolate); switch (encoding) { case BINARY: @@ -461,7 +440,7 @@ size_t StringBytes::Size(Isolate* isolate, if (GetExternalParts(isolate, val, &data, &data_size)) return data_size; - Local str = val->ToString(); + Local str = val->ToString(isolate); switch (encoding) { case BINARY: diff --git a/src/string_bytes.h b/src/string_bytes.h index 1f798752883d00..711e593a0f4f6c 100644 --- a/src/string_bytes.h +++ b/src/string_bytes.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_STRING_BYTES_H_ #define SRC_STRING_BYTES_H_ diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 3b280990436dd1..910cf4280edf85 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "tcp_wrap.h" #include "env.h" @@ -279,7 +258,7 @@ void TCPWrap::Open(const FunctionCallbackInfo& args) { void TCPWrap::Bind(const FunctionCallbackInfo& args) { TCPWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value ip_address(args[0]); + node::Utf8Value ip_address(args.GetIsolate(), args[0]); int port = args[1]->Int32Value(); sockaddr_in addr; int err = uv_ip4_addr(*ip_address, port, &addr); @@ -294,7 +273,7 @@ void TCPWrap::Bind(const FunctionCallbackInfo& args) { void TCPWrap::Bind6(const FunctionCallbackInfo& args) { TCPWrap* wrap = Unwrap(args.Holder()); - node::Utf8Value ip6_address(args[0]); + node::Utf8Value ip6_address(args.GetIsolate(), args[0]); int port = args[1]->Int32Value(); sockaddr_in6 addr; int err = uv_ip6_addr(*ip6_address, port, &addr); @@ -391,7 +370,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo& args) { CHECK(args[2]->Uint32Value()); Local req_wrap_obj = args[0].As(); - node::Utf8Value ip_address(args[1]); + node::Utf8Value ip_address(env->isolate(), args[1]); int port = args[2]->Uint32Value(); sockaddr_in addr; @@ -422,7 +401,7 @@ void TCPWrap::Connect6(const FunctionCallbackInfo& args) { CHECK(args[2]->Uint32Value()); Local req_wrap_obj = args[0].As(); - node::Utf8Value ip_address(args[1]); + node::Utf8Value ip_address(env->isolate(), args[1]); int port = args[2]->Int32Value(); sockaddr_in6 addr; diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index c923b387f0e7cc..c41a36fbeb8ce6 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_TCP_WRAP_H_ #define SRC_TCP_WRAP_H_ diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 8ccdca5961126d..d71213f2202984 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "async-wrap.h" #include "async-wrap-inl.h" #include "env.h" diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 3d8097042240f2..bee38e390a54b7 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "tls_wrap.h" #include "async-wrap.h" #include "async-wrap-inl.h" @@ -748,7 +727,7 @@ void TLSCallbacks::SetServername(const FunctionCallbackInfo& args) { return; #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB - node::Utf8Value servername(args[0].As()); + node::Utf8Value servername(env->isolate(), args[0].As()); SSL_set_tlsext_host_name(wrap->ssl_, *servername); #endif // SSL_CTRL_SET_TLSEXT_SERVERNAME_CB } diff --git a/src/tls_wrap.h b/src/tls_wrap.h index d25c2e6f36cd15..a4ac764fe2da00 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_TLS_WRAP_H_ #define SRC_TLS_WRAP_H_ diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index cf1c72c64699ed..0570d352bcc95a 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "tty_wrap.h" #include "env.h" diff --git a/src/tty_wrap.h b/src/tty_wrap.h index 91abfeb414503c..09cd71e7819e38 100644 --- a/src/tty_wrap.h +++ b/src/tty_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_TTY_WRAP_H_ #define SRC_TTY_WRAP_H_ diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index e58503b40acfa8..6138dac50ceadb 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "udp_wrap.h" #include "env.h" #include "env-inl.h" @@ -170,7 +149,7 @@ void UDPWrap::DoBind(const FunctionCallbackInfo& args, int family) { // bind(ip, port, flags) CHECK_EQ(args.Length(), 3); - node::Utf8Value address(args[0]); + node::Utf8Value address(args.GetIsolate(), args[0]); const int port = args[1]->Uint32Value(); const int flags = args[2]->Uint32Value(); char addr[sizeof(sockaddr_in6)]; @@ -231,8 +210,8 @@ void UDPWrap::SetMembership(const FunctionCallbackInfo& args, CHECK_EQ(args.Length(), 2); - node::Utf8Value address(args[0]); - node::Utf8Value iface(args[1]); + node::Utf8Value address(args.GetIsolate(), args[0]); + node::Utf8Value iface(args.GetIsolate(), args[1]); const char* iface_cstr = *iface; if (args[1]->IsUndefined() || args[1]->IsNull()) { @@ -276,7 +255,7 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { size_t offset = args[2]->Uint32Value(); size_t length = args[3]->Uint32Value(); const unsigned short port = args[4]->Uint32Value(); - node::Utf8Value address(args[5]); + node::Utf8Value address(env->isolate(), args[5]); const bool have_callback = args[6]->IsTrue(); CHECK_LE(length, Buffer::Length(buffer_obj) - offset); diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 9e62d82c31f8b5..d491209d932a32 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_UDP_WRAP_H_ #define SRC_UDP_WRAP_H_ diff --git a/src/util-inl.h b/src/util-inl.h index b0264fbbd2aa5c..6e962feffaf3e1 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_UTIL_INL_H_ #define SRC_UTIL_INL_H_ diff --git a/src/util.cc b/src/util.cc index 5a652663c87103..01ea76a8f89450 100644 --- a/src/util.cc +++ b/src/util.cc @@ -1,36 +1,15 @@ -// 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. - #include "util.h" #include "string_bytes.h" namespace node { -Utf8Value::Utf8Value(v8::Handle value) +Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Handle value) : length_(0), str_(nullptr) { if (value.IsEmpty()) return; - v8::Local val_ = value->ToString(); + v8::Local val_ = value->ToString(isolate); if (val_.IsEmpty()) return; diff --git a/src/util.h b/src/util.h index 7bafe79e3010bf..daf93ea9d205fd 100644 --- a/src/util.h +++ b/src/util.h @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #ifndef SRC_UTIL_H_ #define SRC_UTIL_H_ @@ -121,7 +100,7 @@ inline TypeName* Unwrap(v8::Local object); class Utf8Value { public: - explicit Utf8Value(v8::Handle value); + explicit Utf8Value(v8::Isolate* isolate, v8::Handle value); ~Utf8Value() { free(str_); diff --git a/src/uv.cc b/src/uv.cc index d437001bd7f890..2208ebde3c4f20 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include "uv.h" #include "node.h" #include "env.h" diff --git a/test/addons/repl-domain-abort/binding.cc b/test/addons/repl-domain-abort/binding.cc index 1337395c1b9269..a875eabb71142d 100644 --- a/test/addons/repl-domain-abort/binding.cc +++ b/test/addons/repl-domain-abort/binding.cc @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - #include #include diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index c35faafb455901..f0d968d173f005 100644 --- a/test/addons/repl-domain-abort/test.js +++ b/test/addons/repl-domain-abort/test.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var repl = require('repl'); var stream = require('stream'); diff --git a/test/common.js b/test/common.js index 6908a315376fe6..b9b03c738f7657 100644 --- a/test/common.js +++ b/test/common.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var path = require('path'); var fs = require('fs'); var assert = require('assert'); @@ -314,6 +293,14 @@ exports.getServiceName = function getServiceName(port, protocol) { return serviceName; } +exports.hasMultiLocalhost = function hasMultiLocalhost() { + var TCP = process.binding('tcp_wrap').TCP; + var t = new TCP(); + var ret = t.bind('127.0.0.2', exports.PORT); + t.close(); + return ret === 0; +}; + exports.isValidHostname = function(str) { // See http://stackoverflow.com/a/3824105 var re = new RegExp( diff --git a/test/debugger/helper-debugger-repl.js b/test/debugger/helper-debugger-repl.js index 6346457af2bae3..c3f219874e43af 100644 --- a/test/debugger/helper-debugger-repl.js +++ b/test/debugger/helper-debugger-repl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - process.env.NODE_DEBUGGER_TIMEOUT = 2000; var common = require('../common'); var assert = require('assert'); diff --git a/test/debugger/test-debug-break-on-uncaught.js b/test/debugger/test-debug-break-on-uncaught.js index c41d940b8770be..57095d93abf9a0 100644 --- a/test/debugger/test-debug-break-on-uncaught.js +++ b/test/debugger/test-debug-break-on-uncaught.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var path = require('path'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/debugger/test-debugger-client.js b/test/debugger/test-debugger-client.js index af3be214aefcdc..4bb27c277eab72 100644 --- a/test/debugger/test-debugger-client.js +++ b/test/debugger/test-debugger-client.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - process.env.NODE_DEBUGGER_TIMEOUT = 2000; var common = require('../common'); var assert = require('assert'); diff --git a/test/debugger/test-debugger-debug-brk.js b/test/debugger/test-debugger-debug-brk.js index eabef593c406e4..7bf7d639f5362c 100644 --- a/test/debugger/test-debugger-debug-brk.js +++ b/test/debugger/test-debugger-debug-brk.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/debugger/test-debugger-repl-break-in-module.js b/test/debugger/test-debugger-repl-break-in-module.js index 1fe0aba841ea16..8d33d126438064 100644 --- a/test/debugger/test-debugger-repl-break-in-module.js +++ b/test/debugger/test-debugger-repl-break-in-module.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var repl = require('./helper-debugger-repl.js'); repl.startDebugger('break-in-module/main.js'); diff --git a/test/debugger/test-debugger-repl-restart.js b/test/debugger/test-debugger-repl-restart.js index 5bfc3bbed7e3fb..9d83d67188a63c 100644 --- a/test/debugger/test-debugger-repl-restart.js +++ b/test/debugger/test-debugger-repl-restart.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); diff --git a/test/debugger/test-debugger-repl-term.js b/test/debugger/test-debugger-repl-term.js index edd54203c5623d..a42a253c5a9aee 100644 --- a/test/debugger/test-debugger-repl-term.js +++ b/test/debugger/test-debugger-repl-term.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - process.env.NODE_FORCE_READLINE = 1; var repl = require('./helper-debugger-repl.js'); diff --git a/test/debugger/test-debugger-repl-utf8.js b/test/debugger/test-debugger-repl-utf8.js index 73314b8a6a5b77..0fccf2477b03ab 100644 --- a/test/debugger/test-debugger-repl-utf8.js +++ b/test/debugger/test-debugger-repl-utf8.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var script = common.fixturesDir + '/breakpoints_utf8.js'; process.env.NODE_DEBUGGER_TEST_SCRIPT = script; diff --git a/test/debugger/test-debugger-repl.js b/test/debugger/test-debugger-repl.js index 92c3c9a8a6ebc3..788ea9cb6a273f 100644 --- a/test/debugger/test-debugger-repl.js +++ b/test/debugger/test-debugger-repl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var repl = require('./helper-debugger-repl.js'); repl.startDebugger('breakpoints.js'); diff --git a/test/disabled/GH-670.js b/test/disabled/GH-670.js index 746d8d17945f62..af65bbdc0ffc95 100644 --- a/test/disabled/GH-670.js +++ b/test/disabled/GH-670.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var https = require('https'); diff --git a/test/disabled/test-cat.js b/test/disabled/test-cat.js index d11497c022eb7d..02d2d41a6663c8 100644 --- a/test/disabled/test-cat.js +++ b/test/disabled/test-cat.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common.js'); var assert = require('assert'); var http = require('http'); diff --git a/test/disabled/test-child-process-custom-fds.js b/test/disabled/test-child-process-custom-fds.js index 02f394e7847503..d64586c508d9f1 100644 --- a/test/disabled/test-child-process-custom-fds.js +++ b/test/disabled/test-child-process-custom-fds.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-child-process-customfd-bounded.js b/test/disabled/test-child-process-customfd-bounded.js index c1efd8378df554..203e6acaf379c5 100644 --- a/test/disabled/test-child-process-customfd-bounded.js +++ b/test/disabled/test-child-process-customfd-bounded.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var bigish = Array(200); diff --git a/test/disabled/test-child-process-uid-gid.js b/test/disabled/test-child-process-uid-gid.js index 41c2169d9abe02..5ab570b813f48f 100644 --- a/test/disabled/test-child-process-uid-gid.js +++ b/test/disabled/test-child-process-uid-gid.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/disabled/test-debug-brk-file.js b/test/disabled/test-debug-brk-file.js index ee9f4a58a06d10..ca2af1b7121811 100644 --- a/test/disabled/test-debug-brk-file.js +++ b/test/disabled/test-debug-brk-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/disabled/test-debug-brk-no-arg.js b/test/disabled/test-debug-brk-no-arg.js index f02527cf66e8cf..547cd1b287a9ed 100644 --- a/test/disabled/test-debug-brk-no-arg.js +++ b/test/disabled/test-debug-brk-no-arg.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/disabled/test-dgram-multicast.js b/test/disabled/test-dgram-multicast.js index 8795026fa75d11..d66bd63e50dcbe 100644 --- a/test/disabled/test-dgram-multicast.js +++ b/test/disabled/test-dgram-multicast.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-dgram-send-error.js b/test/disabled/test-dgram-send-error.js index 346f36dbe29aad..00901dd563f7d8 100644 --- a/test/disabled/test-dgram-send-error.js +++ b/test/disabled/test-dgram-send-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Some operating systems report errors when an UDP message is sent to an // unreachable host. This error can be reported by sendto() and even by // recvfrom(). Node should not propagate this error to the user. diff --git a/test/disabled/test-dgram-unix-anon.js b/test/disabled/test-dgram-unix-anon.js index db14ea1d971f3a..1a8b5e3a57bd73 100644 --- a/test/disabled/test-dgram-unix-anon.js +++ b/test/disabled/test-dgram-unix-anon.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-dgram-unix.js b/test/disabled/test-dgram-unix.js index 4da05259ad6e6e..f2a24a9c361c8e 100644 --- a/test/disabled/test-dgram-unix.js +++ b/test/disabled/test-dgram-unix.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-eio-race.js b/test/disabled/test-eio-race.js index ec9e4490d84f7e..b9e14f76b22f5d 100644 --- a/test/disabled/test-eio-race.js +++ b/test/disabled/test-eio-race.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-eio-race2.js b/test/disabled/test-eio-race2.js index df63a3150d326e..487486a15d8245 100644 --- a/test/disabled/test-eio-race2.js +++ b/test/disabled/test-eio-race2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/disabled/test-eio-race3.js b/test/disabled/test-eio-race3.js index eb76fa7a835165..820128ae463fcd 100644 --- a/test/disabled/test-eio-race3.js +++ b/test/disabled/test-eio-race3.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - /* XXX Can this test be modified to not call the now-removed wait()? */ var common = require('../common'); diff --git a/test/disabled/test-eio-race4.js b/test/disabled/test-eio-race4.js index 8eaeda21710769..e8a2e591362d83 100644 --- a/test/disabled/test-eio-race4.js +++ b/test/disabled/test-eio-race4.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/disabled/test-fs-largefile.js b/test/disabled/test-fs-largefile.js index ffd6261d8749ad..21406e3aad0431 100644 --- a/test/disabled/test-fs-largefile.js +++ b/test/disabled/test-fs-largefile.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'), diff --git a/test/disabled/test-http-abort-stream-end.js b/test/disabled/test-http-abort-stream-end.js index e2ffa4590a6125..b0a23d92defe26 100644 --- a/test/disabled/test-http-abort-stream-end.js +++ b/test/disabled/test-http-abort-stream-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-http-agent2.js b/test/disabled/test-http-agent2.js index dc41dbdb3f4339..c1ccd70a1e4fd4 100644 --- a/test/disabled/test-http-agent2.js +++ b/test/disabled/test-http-agent2.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/disabled/test-http-big-proxy-responses.js b/test/disabled/test-http-big-proxy-responses.js index bac0ddf11a4a03..fe70473f587a30 100644 --- a/test/disabled/test-http-big-proxy-responses.js +++ b/test/disabled/test-http-big-proxy-responses.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var util = require('util'), diff --git a/test/disabled/test-http-head-request.js b/test/disabled/test-http-head-request.js index 226d8e8ecc3273..2dfe20bc3d06d8 100644 --- a/test/disabled/test-http-head-request.js +++ b/test/disabled/test-http-head-request.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-http-stress.js b/test/disabled/test-http-stress.js index 875c84030e29a6..09a0b7e48a9e47 100644 --- a/test/disabled/test-http-stress.js +++ b/test/disabled/test-http-stress.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-http-tls.js b/test/disabled/test-http-tls.js index 7ea084f9e903ac..384849d00df140 100644 --- a/test/disabled/test-http-tls.js +++ b/test/disabled/test-http-tls.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-https-loop-to-google.js b/test/disabled/test-https-loop-to-google.js index 112902b1f7bf9d..cb29f2c226fb14 100644 --- a/test/disabled/test-https-loop-to-google.js +++ b/test/disabled/test-https-loop-to-google.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Failing test for https // Will fail with "socket hang up" for 4 out of 10 requests diff --git a/test/disabled/test-idle-watcher.js b/test/disabled/test-idle-watcher.js index 4a46bd06166f19..b1038d56fd1b9e 100644 --- a/test/disabled/test-idle-watcher.js +++ b/test/disabled/test-idle-watcher.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-net-fd-passing.js b/test/disabled/test-net-fd-passing.js index 55b214cbb3a595..7b73056393ec3f 100644 --- a/test/disabled/test-net-fd-passing.js +++ b/test/disabled/test-net-fd-passing.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/disabled/test-net-tls-pummel.js b/test/disabled/test-net-tls-pummel.js index 178c275889e18d..0312d70ea722cb 100644 --- a/test/disabled/test-net-tls-pummel.js +++ b/test/disabled/test-net-tls-pummel.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-net-tls.js b/test/disabled/test-net-tls.js index 48344bae0d3f3c..9783b7ee3c81a1 100644 --- a/test/disabled/test-net-tls.js +++ b/test/disabled/test-net-tls.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/disabled/test-process-title.js b/test/disabled/test-process-title.js index 591c949d993ada..1cd361dd87c572 100644 --- a/test/disabled/test-process-title.js +++ b/test/disabled/test-process-title.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/disabled/test-readline.js b/test/disabled/test-readline.js index 4a67b5d65f54f7..1572036a8749d9 100644 --- a/test/disabled/test-readline.js +++ b/test/disabled/test-readline.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Can't test this when 'make test' doesn't assign a tty to the stdout. // Yet another use-case for require('tty').spawn ? var common = require('../common'); diff --git a/test/disabled/test-remote-module-loading.js b/test/disabled/test-remote-module-loading.js index 183d3c2fe612d1..c4d90fb80d0c50 100644 --- a/test/disabled/test-remote-module-loading.js +++ b/test/disabled/test-remote-module-loading.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-sendfd.js b/test/disabled/test-sendfd.js index 7f1cb6b9c5a1c1..0e1dd6f1bff37a 100644 --- a/test/disabled/test-sendfd.js +++ b/test/disabled/test-sendfd.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Test sending and receiving a file descriptor. // // This test is pretty complex. It ends up spawning test/fixtures/recvfd.js diff --git a/test/disabled/test-setuidgid.js b/test/disabled/test-setuidgid.js index 47cff97bfc9a1b..90923b922d7711 100644 --- a/test/disabled/test-setuidgid.js +++ b/test/disabled/test-setuidgid.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Requires special privileges var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/test-tls-large-push.js b/test/disabled/test-tls-large-push.js index 9b168cd1def7b4..a5e206e477bef2 100644 --- a/test/disabled/test-tls-large-push.js +++ b/test/disabled/test-tls-large-push.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Server sends a large string. Client counts bytes and pauses every few // seconds. Makes sure that pause and resume work properly. var common = require('../common'); diff --git a/test/disabled/test-tls-server.js b/test/disabled/test-tls-server.js index 6450d46a0f0a57..20cc3f9fc79c39 100644 --- a/test/disabled/test-tls-server.js +++ b/test/disabled/test-tls-server.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Example of new TLS API. Test with: // // $> openssl s_client -connect localhost:12346 \ diff --git a/test/disabled/test-tty-stdio.js b/test/disabled/test-tty-stdio.js index 558f1b176adaff..0d963958abb5bd 100644 --- a/test/disabled/test-tty-stdio.js +++ b/test/disabled/test-tty-stdio.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Can't test this when 'make test' doesn't assign a tty to the stdout. var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/tls-client.js b/test/disabled/tls-client.js index d144603fb6a338..48c715b29baf47 100644 --- a/test/disabled/tls-client.js +++ b/test/disabled/tls-client.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var tls = require('tls'); var fs = require('fs'); diff --git a/test/disabled/tls_client.js b/test/disabled/tls_client.js index 462bceb968c859..65d18dd7f21256 100644 --- a/test/disabled/tls_client.js +++ b/test/disabled/tls_client.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/disabled/tls_server.js b/test/disabled/tls_server.js index 031e196efdabd1..1174b8f6d04fcc 100644 --- a/test/disabled/tls_server.js +++ b/test/disabled/tls_server.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/fixtures/GH-1899-output.js b/test/fixtures/GH-1899-output.js index d6b513324a52f6..0baac9eab9bf15 100644 --- a/test/fixtures/GH-1899-output.js +++ b/test/fixtures/GH-1899-output.js @@ -1,23 +1,2 @@ -// 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. - console.log('hello, world!'); diff --git a/test/fixtures/GH-892-request.js b/test/fixtures/GH-892-request.js index 58b95a93222f8a..498a537a12784c 100644 --- a/test/fixtures/GH-892-request.js +++ b/test/fixtures/GH-892-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Called by test/pummel/test-regress-GH-892.js var https = require('https'); diff --git a/test/fixtures/a.js b/test/fixtures/a.js index fa010b07b48122..990a78534a68c9 100644 --- a/test/fixtures/a.js +++ b/test/fixtures/a.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var c = require('./b/c'); console.error('load fixtures/a.js'); diff --git a/test/fixtures/a1.js b/test/fixtures/a1.js index fa010b07b48122..990a78534a68c9 100644 --- a/test/fixtures/a1.js +++ b/test/fixtures/a1.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var c = require('./b/c'); console.error('load fixtures/a.js'); diff --git a/test/fixtures/b/c.js b/test/fixtures/b/c.js index 6e5080d776570e..1b568c2fc9a66e 100644 --- a/test/fixtures/b/c.js +++ b/test/fixtures/b/c.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var d = require('./d'); var assert = require('assert'); diff --git a/test/fixtures/b/d.js b/test/fixtures/b/d.js index 37fefc2d340a00..3307d8b8584f7f 100644 --- a/test/fixtures/b/d.js +++ b/test/fixtures/b/d.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error('load fixtures/b/d.js'); var string = 'D'; diff --git a/test/fixtures/b/package/index.js b/test/fixtures/b/package/index.js index c88d605ea0bb31..cbf16fdc28ce5a 100644 --- a/test/fixtures/b/package/index.js +++ b/test/fixtures/b/package/index.js @@ -1,23 +1,2 @@ -// 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. - exports.hello = 'world'; console.error('load package/index.js'); diff --git a/test/fixtures/break-in-module/mod.js b/test/fixtures/break-in-module/mod.js index 57bf58bb31aa11..13582e760eb2fb 100644 --- a/test/fixtures/break-in-module/mod.js +++ b/test/fixtures/break-in-module/mod.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - exports.hello = function() { return 'hello from module'; }; diff --git a/test/fixtures/catch-stdout-error.js b/test/fixtures/catch-stdout-error.js index bdd09b5ab8f450..90068efd691f86 100644 --- a/test/fixtures/catch-stdout-error.js +++ b/test/fixtures/catch-stdout-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - function write() { try { process.stdout.write('Hello, world\n'); diff --git a/test/fixtures/child_process_should_emit_error.js b/test/fixtures/child_process_should_emit_error.js index 6e63235c4f921d..9f7b2bb80ffcbb 100644 --- a/test/fixtures/child_process_should_emit_error.js +++ b/test/fixtures/child_process_should_emit_error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var exec = require('child_process').exec; [0, 1].forEach(function(i) { diff --git a/test/fixtures/create-file.js b/test/fixtures/create-file.js index f2d89f3a1940ea..d6f731b784d6d5 100644 --- a/test/fixtures/create-file.js +++ b/test/fixtures/create-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var fs = require('fs'); var file_name = process.argv[2]; diff --git a/test/fixtures/cycles/folder/foo.js b/test/fixtures/cycles/folder/foo.js index 07da5c9685c672..a6b284dd56e1b9 100644 --- a/test/fixtures/cycles/folder/foo.js +++ b/test/fixtures/cycles/folder/foo.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var root = require('./../root'); exports.hello = function() { diff --git a/test/fixtures/cycles/root.js b/test/fixtures/cycles/root.js index ddce47d187aae6..9b8b2459e6743f 100644 --- a/test/fixtures/cycles/root.js +++ b/test/fixtures/cycles/root.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var foo = exports.foo = require('./folder/foo'); exports.hello = 'hello'; diff --git a/test/fixtures/echo-close-check.js b/test/fixtures/echo-close-check.js index 1681553290edff..c71b63ec901ae8 100644 --- a/test/fixtures/echo-close-check.js +++ b/test/fixtures/echo-close-check.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/fixtures/echo.js b/test/fixtures/echo.js index abfdb329481607..c03e661d1c5704 100644 --- a/test/fixtures/echo.js +++ b/test/fixtures/echo.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/fixtures/exit.js b/test/fixtures/exit.js index 7e0fd7dd6beb6d..c6c8b8209db51c 100644 --- a/test/fixtures/exit.js +++ b/test/fixtures/exit.js @@ -1,22 +1 @@ -// 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. - process.exit(process.argv[2] || 1); diff --git a/test/fixtures/global/plain.js b/test/fixtures/global/plain.js index f983d7c68ba93f..42567881d6537f 100644 --- a/test/fixtures/global/plain.js +++ b/test/fixtures/global/plain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - foo = 'foo'; global.bar = 'bar'; diff --git a/test/fixtures/json-with-directory-name-module/module-stub/index.js b/test/fixtures/json-with-directory-name-module/module-stub/index.js index 5cbb00b63c1ad5..c24489954e90d3 100644 --- a/test/fixtures/json-with-directory-name-module/module-stub/index.js +++ b/test/fixtures/json-with-directory-name-module/module-stub/index.js @@ -1,22 +1 @@ -// 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. - module.exports = "hello from module-stub!" diff --git a/test/fixtures/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js b/test/fixtures/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js index a02399ef8be629..1a3628d4e11084 100644 --- a/test/fixtures/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js +++ b/test/fixtures/json-with-directory-name-module/module-stub/one-trailing-slash/two/three.js @@ -1,22 +1 @@ -// 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. - module.exports = require('../../'); diff --git a/test/fixtures/json-with-directory-name-module/module-stub/one/two/three.js b/test/fixtures/json-with-directory-name-module/module-stub/one/two/three.js index 19025cdc74e20e..bf59a728db5cde 100644 --- a/test/fixtures/json-with-directory-name-module/module-stub/one/two/three.js +++ b/test/fixtures/json-with-directory-name-module/module-stub/one/two/three.js @@ -1,22 +1 @@ -// 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. - module.exports = require('../..'); diff --git a/test/fixtures/listen-on-socket-and-exit.js b/test/fixtures/listen-on-socket-and-exit.js index 61a3aec2cb734e..9d844f071cd7fe 100644 --- a/test/fixtures/listen-on-socket-and-exit.js +++ b/test/fixtures/listen-on-socket-and-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // child process that listens on a socket, allows testing of an EADDRINUSE condition var common = require('../common'); diff --git a/test/fixtures/module-load-order/file1.js b/test/fixtures/module-load-order/file1.js index d378d845415ab3..d4ab32cb7a39e3 100644 --- a/test/fixtures/module-load-order/file1.js +++ b/test/fixtures/module-load-order/file1.js @@ -1,22 +1 @@ -// 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. - exports.file1 = 'file1.js'; diff --git a/test/fixtures/module-load-order/file2.js b/test/fixtures/module-load-order/file2.js index e87d59568e3e71..0b1af928cabb3a 100644 --- a/test/fixtures/module-load-order/file2.js +++ b/test/fixtures/module-load-order/file2.js @@ -1,22 +1 @@ -// 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. - exports.file2 = 'file2.js'; diff --git a/test/fixtures/module-load-order/file2/index.js b/test/fixtures/module-load-order/file2/index.js index 720da3147a9f4c..20c642bf2e3651 100644 --- a/test/fixtures/module-load-order/file2/index.js +++ b/test/fixtures/module-load-order/file2/index.js @@ -1,22 +1 @@ -// 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. - exports.file2 = 'file2/index.js'; diff --git a/test/fixtures/module-load-order/file3/index.js b/test/fixtures/module-load-order/file3/index.js index 2d9936a8d1fcfb..5ec373cad7ba22 100644 --- a/test/fixtures/module-load-order/file3/index.js +++ b/test/fixtures/module-load-order/file3/index.js @@ -1,22 +1 @@ -// 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. - exports.file3 = 'file3/index.js'; diff --git a/test/fixtures/module-load-order/file4/index.js b/test/fixtures/module-load-order/file4/index.js index 0ded410d3c0273..f28889d98aa441 100644 --- a/test/fixtures/module-load-order/file4/index.js +++ b/test/fixtures/module-load-order/file4/index.js @@ -1,22 +1 @@ -// 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. - exports.file4 = 'file4/index.js'; diff --git a/test/fixtures/module-load-order/file5/index.js b/test/fixtures/module-load-order/file5/index.js index 9d3a033941466c..737945ffb5e4ea 100644 --- a/test/fixtures/module-load-order/file5/index.js +++ b/test/fixtures/module-load-order/file5/index.js @@ -1,22 +1 @@ -// 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. - exports.file5 = 'file5/index.js'; diff --git a/test/fixtures/module-load-order/file6/index.js b/test/fixtures/module-load-order/file6/index.js index 9d890bf4f915bb..4228429e92bb13 100644 --- a/test/fixtures/module-load-order/file6/index.js +++ b/test/fixtures/module-load-order/file6/index.js @@ -1,22 +1 @@ -// 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. - exports.file6 = 'file6/index.js'; diff --git a/test/fixtures/nested-index/one/hello.js b/test/fixtures/nested-index/one/hello.js index c0c8c4fb158368..f139fee4d2f108 100644 --- a/test/fixtures/nested-index/one/hello.js +++ b/test/fixtures/nested-index/one/hello.js @@ -1,23 +1,2 @@ -// 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. - exports.hello = 'hello from one!'; diff --git a/test/fixtures/nested-index/one/index.js b/test/fixtures/nested-index/one/index.js index 9beac591df2a8e..d959a288b18f19 100644 --- a/test/fixtures/nested-index/one/index.js +++ b/test/fixtures/nested-index/one/index.js @@ -1,22 +1 @@ -// 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. - exports.hello = require('./hello').hello; diff --git a/test/fixtures/nested-index/three.js b/test/fixtures/nested-index/three.js index dcceb09f9ed032..e69de29bb2d1d6 100644 --- a/test/fixtures/nested-index/three.js +++ b/test/fixtures/nested-index/three.js @@ -1,21 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/test/fixtures/nested-index/three/index.js b/test/fixtures/nested-index/three/index.js index dcceb09f9ed032..e69de29bb2d1d6 100644 --- a/test/fixtures/nested-index/three/index.js +++ b/test/fixtures/nested-index/three/index.js @@ -1,21 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/test/fixtures/nested-index/two/hello.js b/test/fixtures/nested-index/two/hello.js index 339276cc7a3930..8ec14b950e758a 100644 --- a/test/fixtures/nested-index/two/hello.js +++ b/test/fixtures/nested-index/two/hello.js @@ -1,23 +1,2 @@ -// 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. - exports.hello = 'hello from two!'; diff --git a/test/fixtures/nested-index/two/index.js b/test/fixtures/nested-index/two/index.js index 9beac591df2a8e..d959a288b18f19 100644 --- a/test/fixtures/nested-index/two/index.js +++ b/test/fixtures/nested-index/two/index.js @@ -1,22 +1 @@ -// 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. - exports.hello = require('./hello').hello; diff --git a/test/fixtures/net-fd-passing-receiver.js b/test/fixtures/net-fd-passing-receiver.js index 8e0ba14a7099f4..99f69be2a40101 100644 --- a/test/fixtures/net-fd-passing-receiver.js +++ b/test/fixtures/net-fd-passing-receiver.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - process.mixin(require('../common')); net = require('net'); diff --git a/test/fixtures/node_modules/asdf.js b/test/fixtures/node_modules/asdf.js index 84b74de9d9d8f3..7ec6711d1f85b0 100644 --- a/test/fixtures/node_modules/asdf.js +++ b/test/fixtures/node_modules/asdf.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); throw new Error('Should not ever get here.'); diff --git a/test/fixtures/node_modules/bar.js b/test/fixtures/node_modules/bar.js index 5d00c9592ee046..95823eb1417524 100644 --- a/test/fixtures/node_modules/bar.js +++ b/test/fixtures/node_modules/bar.js @@ -1,23 +1,2 @@ -// 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. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); diff --git a/test/fixtures/node_modules/baz/index.js b/test/fixtures/node_modules/baz/index.js index 043c6d0dc02034..346f068ec52a2b 100644 --- a/test/fixtures/node_modules/baz/index.js +++ b/test/fixtures/node_modules/baz/index.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); // this should work, and get the one that doesn't throw diff --git a/test/fixtures/node_modules/baz/node_modules/asdf.js b/test/fixtures/node_modules/baz/node_modules/asdf.js index 5d00c9592ee046..95823eb1417524 100644 --- a/test/fixtures/node_modules/baz/node_modules/asdf.js +++ b/test/fixtures/node_modules/baz/node_modules/asdf.js @@ -1,23 +1,2 @@ -// 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. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); diff --git a/test/fixtures/node_modules/foo.js b/test/fixtures/node_modules/foo.js index 5f0236de3c04e4..f69ac7b00e5a4b 100644 --- a/test/fixtures/node_modules/foo.js +++ b/test/fixtures/node_modules/foo.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); var assert = require('assert'); diff --git a/test/fixtures/node_modules/node_modules/bar.js b/test/fixtures/node_modules/node_modules/bar.js index 84b74de9d9d8f3..7ec6711d1f85b0 100644 --- a/test/fixtures/node_modules/node_modules/bar.js +++ b/test/fixtures/node_modules/node_modules/bar.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error(__filename); console.error(module.paths.join('\n') + '\n'); throw new Error('Should not ever get here.'); diff --git a/test/fixtures/not-main-module.js b/test/fixtures/not-main-module.js index 0bee4027282b85..3da57f44285910 100644 --- a/test/fixtures/not-main-module.js +++ b/test/fixtures/not-main-module.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); assert.notEqual(module, require.main, 'require.main should not == module'); assert.notEqual(module, process.mainModule, diff --git a/test/fixtures/packages/main-index/package-main-module/index.js b/test/fixtures/packages/main-index/package-main-module/index.js index c361a6dc8d1950..014fa39dc365d1 100644 --- a/test/fixtures/packages/main-index/package-main-module/index.js +++ b/test/fixtures/packages/main-index/package-main-module/index.js @@ -1,22 +1 @@ -// 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. - exports.ok = 'ok'; diff --git a/test/fixtures/packages/main/package-main-module.js b/test/fixtures/packages/main/package-main-module.js index c361a6dc8d1950..014fa39dc365d1 100644 --- a/test/fixtures/packages/main/package-main-module.js +++ b/test/fixtures/packages/main/package-main-module.js @@ -1,22 +1 @@ -// 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. - exports.ok = 'ok'; diff --git a/test/fixtures/path.js b/test/fixtures/path.js index 21c08d3c6bc889..cdfcec876159df 100644 --- a/test/fixtures/path.js +++ b/test/fixtures/path.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // This is actually more a fixture than a test. It is used to make var common = require('../common'); // sure that require('./path') and require('path') do different things. diff --git a/test/fixtures/print-10-lines.js b/test/fixtures/print-10-lines.js index d483fe6bff3899..0aaf3ef293000e 100644 --- a/test/fixtures/print-10-lines.js +++ b/test/fixtures/print-10-lines.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - for (var i = 0; i < 10; i++) { console.log('count ' + i); } diff --git a/test/fixtures/print-chars-from-buffer.js b/test/fixtures/print-chars-from-buffer.js index f7486aae926fb3..e3b5647d6ed615 100644 --- a/test/fixtures/print-chars-from-buffer.js +++ b/test/fixtures/print-chars-from-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/fixtures/print-chars.js b/test/fixtures/print-chars.js index a3bc8add2d0b87..ec97604921fa48 100644 --- a/test/fixtures/print-chars.js +++ b/test/fixtures/print-chars.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/fixtures/readdir/testing.js b/test/fixtures/readdir/testing.js index dcceb09f9ed032..e69de29bb2d1d6 100644 --- a/test/fixtures/readdir/testing.js +++ b/test/fixtures/readdir/testing.js @@ -1,21 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/test/fixtures/recvfd.js b/test/fixtures/recvfd.js index 472387815fd979..75df69a3dc3954 100644 --- a/test/fixtures/recvfd.js +++ b/test/fixtures/recvfd.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // See test/simple/test-sendfd.js for a complete description of what this // script is doing and how it fits into the test as a whole. diff --git a/test/fixtures/semicolon.js b/test/fixtures/semicolon.js index 79a30844992a24..092bc2b0412610 100644 --- a/test/fixtures/semicolon.js +++ b/test/fixtures/semicolon.js @@ -1,22 +1 @@ -// 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/test/fixtures/should_exit.js b/test/fixtures/should_exit.js index fd16817d7c9378..6f45a904f2b455 100644 --- a/test/fixtures/should_exit.js +++ b/test/fixtures/should_exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - function tmp() {} process.on('SIGINT', tmp); process.removeListener('SIGINT', tmp); diff --git a/test/fixtures/stdio-filter.js b/test/fixtures/stdio-filter.js index 9bb9af59ec9161..8e4f50305131f4 100644 --- a/test/fixtures/stdio-filter.js +++ b/test/fixtures/stdio-filter.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var util = require('util'); var regexIn = process.argv[2]; diff --git a/test/fixtures/test-fs-readfile-error.js b/test/fixtures/test-fs-readfile-error.js index 3f8d9a731eff75..0638d01ac7655a 100644 --- a/test/fixtures/test-fs-readfile-error.js +++ b/test/fixtures/test-fs-readfile-error.js @@ -1,22 +1 @@ -// 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. - require('fs').readFile('/'); // throws EISDIR diff --git a/test/fixtures/test-init-index/index.js b/test/fixtures/test-init-index/index.js index 31272c8995b29e..a1946530265e64 100644 --- a/test/fixtures/test-init-index/index.js +++ b/test/fixtures/test-init-index/index.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - (function() { require('util').print('Loaded successfully!'); })(); diff --git a/test/fixtures/test-init-native/fs.js b/test/fixtures/test-init-native/fs.js index 06392c68d17736..6b47b418f44561 100644 --- a/test/fixtures/test-init-native/fs.js +++ b/test/fixtures/test-init-native/fs.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - (function() { var fs = require('fs'); if (fs.readFile) { diff --git a/test/fixtures/throws_error.js b/test/fixtures/throws_error.js index b38000894ba3a9..80055bdf603bec 100644 --- a/test/fixtures/throws_error.js +++ b/test/fixtures/throws_error.js @@ -1,22 +1 @@ -// 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. - throw new Error('blah'); diff --git a/test/fixtures/throws_error1.js b/test/fixtures/throws_error1.js index b38000894ba3a9..80055bdf603bec 100644 --- a/test/fixtures/throws_error1.js +++ b/test/fixtures/throws_error1.js @@ -1,22 +1 @@ -// 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. - throw new Error('blah'); diff --git a/test/fixtures/throws_error2.js b/test/fixtures/throws_error2.js index e1b3a696ecf0a1..f32793fbc36b10 100644 --- a/test/fixtures/throws_error2.js +++ b/test/fixtures/throws_error2.js @@ -1,24 +1,2 @@ -// 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. - - JSON.parse(undefined); diff --git a/test/fixtures/throws_error3.js b/test/fixtures/throws_error3.js index a53084c68cdbc9..080d0311fd2ebd 100644 --- a/test/fixtures/throws_error3.js +++ b/test/fixtures/throws_error3.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - process.nextTick(function() { JSON.parse(undefined); }); diff --git a/test/fixtures/throws_error4.js b/test/fixtures/throws_error4.js index bc7d6f8c6bd6df..8f9666c507bd76 100644 --- a/test/fixtures/throws_error4.js +++ b/test/fixtures/throws_error4.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 01234567890123456789012345/** 01234567890123456789012345678901234567890123456789 01234567890123456789012345678901234567890123456789 diff --git a/test/parallel/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js similarity index 84% rename from test/parallel/test-dgram-broadcast-multi-process.js rename to test/internet/test-dgram-broadcast-multi-process.js index 4d9eebc1012de7..d60fb0bd3442c2 100644 --- a/test/parallel/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), dgram = require('dgram'), diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index 267a801064b12b..66c92b285c2a4c 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), dgram = require('dgram'), diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 623a845c03f3e6..427337c413742b 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'), dns = require('dns'), diff --git a/test/internet/test-http-dns-fail.js b/test/internet/test-http-dns-fail.js index 7d87b8e7f602af..7d1cfbf630472d 100644 --- a/test/internet/test-http-dns-fail.js +++ b/test/internet/test-http-dns-fail.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Repeated requests for a domain that fails to resolve * should trigger the error event after each attempt. diff --git a/test/internet/test-http-https-default-ports.js b/test/internet/test-http-https-default-ports.js index 639bdd6b2d8547..76c6e3a1e4aec9 100644 --- a/test/internet/test-http-https-default-ports.js +++ b/test/internet/test-http-https-default-ports.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/internet/test-net-connect-timeout.js b/test/internet/test-net-connect-timeout.js index a5a11a8b0a4d9a..a55cf5e4bbf260 100644 --- a/test/internet/test-net-connect-timeout.js +++ b/test/internet/test-net-connect-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This example attempts to time out before the connection is established // https://groups.google.com/forum/#!topic/nodejs/UE0ZbfLt6t8 // https://groups.google.com/forum/#!topic/nodejs-dev/jR7-5UDqXkw diff --git a/test/internet/test-net-connect-unref.js b/test/internet/test-net-connect-unref.js index 29f43b10e4a62f..dc0462ffd0238b 100644 --- a/test/internet/test-net-connect-unref.js +++ b/test/internet/test-net-connect-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/internet/test-tls-reuse-host-from-socket.js b/test/internet/test-tls-reuse-host-from-socket.js index 70b3e63f4ff5fb..04098e4ecfc56c 100644 --- a/test/internet/test-tls-reuse-host-from-socket.js +++ b/test/internet/test-tls-reuse-host-from-socket.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/2100bytes.js b/test/message/2100bytes.js index ead08810df9f1d..59fe3c152325ad 100644 --- a/test/message/2100bytes.js +++ b/test/message/2100bytes.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/message/error_exit.js b/test/message/error_exit.js index f872386e95cc5d..64738674c2045a 100644 --- a/test/message/error_exit.js +++ b/test/message/error_exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); diff --git a/test/message/eval_messages.js b/test/message/eval_messages.js index d03c0eb1b1d7e3..157cf881f60e6f 100644 --- a/test/message/eval_messages.js +++ b/test/message/eval_messages.js @@ -1,23 +1,3 @@ - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); diff --git a/test/message/hello_world.js b/test/message/hello_world.js index 6f216f9ffd94cb..996e08d51a2e62 100644 --- a/test/message/hello_world.js +++ b/test/message/hello_world.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/max_tick_depth.js b/test/message/max_tick_depth.js index 9e10b901f03e2f..1e43cae1c1670d 100644 --- a/test/message/max_tick_depth.js +++ b/test/message/max_tick_depth.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); process.maxTickDepth = 10; diff --git a/test/message/nexttick_throw.js b/test/message/nexttick_throw.js index 14b2990debf288..21361edf333abb 100644 --- a/test/message/nexttick_throw.js +++ b/test/message/nexttick_throw.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/stack_overflow.js b/test/message/stack_overflow.js index 166cf1adc33c03..f822afd22c5757 100644 --- a/test/message/stack_overflow.js +++ b/test/message/stack_overflow.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/stdin_messages.js b/test/message/stdin_messages.js index b1eaf4707b2114..8c4e47d00095e6 100644 --- a/test/message/stdin_messages.js +++ b/test/message/stdin_messages.js @@ -1,23 +1,3 @@ - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); diff --git a/test/message/throw_custom_error.js b/test/message/throw_custom_error.js index eab8499e9b634b..34a007920dafea 100644 --- a/test/message/throw_custom_error.js +++ b/test/message/throw_custom_error.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/throw_custom_error.out b/test/message/throw_custom_error.out index 87a99c1ae3e628..f003972940053c 100644 --- a/test/message/throw_custom_error.out +++ b/test/message/throw_custom_error.out @@ -1,5 +1,5 @@ before -*test*message*throw_custom_error.js:31 +*test*message*throw_custom_error.js:7 throw ({ name: 'MyCustomError', message: 'This is a custom message' }); ^ MyCustomError: This is a custom message diff --git a/test/message/throw_in_line_with_tabs.js b/test/message/throw_in_line_with_tabs.js index 80be3f56fcc6eb..dc035c42cade3d 100644 --- a/test/message/throw_in_line_with_tabs.js +++ b/test/message/throw_in_line_with_tabs.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/throw_in_line_with_tabs.out b/test/message/throw_in_line_with_tabs.out index f4e3affea671ff..11eadab34bead1 100644 --- a/test/message/throw_in_line_with_tabs.out +++ b/test/message/throw_in_line_with_tabs.out @@ -1,5 +1,5 @@ before -*test*message*throw_in_line_with_tabs.js:32 +*test*message*throw_in_line_with_tabs.js:8 throw ({ foo: 'bar' }); ^ [object Object] diff --git a/test/message/throw_non_error.js b/test/message/throw_non_error.js index a3de7ad64a0830..817b557906a512 100644 --- a/test/message/throw_non_error.js +++ b/test/message/throw_non_error.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/throw_non_error.out b/test/message/throw_non_error.out index 5f8213eb4ff586..4b39de5acfa7e5 100644 --- a/test/message/throw_non_error.out +++ b/test/message/throw_non_error.out @@ -1,5 +1,5 @@ before -*test*message*throw_non_error.js:31 +*test*message*throw_non_error.js:7 throw ({ foo: 'bar' }); ^ [object Object] diff --git a/test/message/throw_null.js b/test/message/throw_null.js index 7cd27706a8f43a..27e86a8ff0e1e7 100644 --- a/test/message/throw_null.js +++ b/test/message/throw_null.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/throw_null.out b/test/message/throw_null.out index 7ba9662b799b63..be5cb3f7b8729a 100644 --- a/test/message/throw_null.out +++ b/test/message/throw_null.out @@ -1,5 +1,5 @@ -*test*message*throw_null.js:25 +*test*message*throw_null.js:4 throw null; ^ null diff --git a/test/message/throw_undefined.js b/test/message/throw_undefined.js index 74b08fe7473f07..dcc54d74d2d3cc 100644 --- a/test/message/throw_undefined.js +++ b/test/message/throw_undefined.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/throw_undefined.out b/test/message/throw_undefined.out index 23fc53acdd5f94..1aa6e15b37f4f5 100644 --- a/test/message/throw_undefined.out +++ b/test/message/throw_undefined.out @@ -1,5 +1,5 @@ -*test*message*throw_undefined.js:25 +*test*message*throw_undefined.js:4 throw undefined; ^ undefined diff --git a/test/message/timeout_throw.js b/test/message/timeout_throw.js index 6704ee4dac66cb..4ccf0bdd27dfce 100644 --- a/test/message/timeout_throw.js +++ b/test/message/timeout_throw.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index 9ee6ef90a3f67b..01d9698f22b257 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/message/vm_display_runtime_error.js b/test/message/vm_display_runtime_error.js index 43bf9c350c59f4..22c10d6022bd92 100644 --- a/test/message/vm_display_runtime_error.js +++ b/test/message/vm_display_runtime_error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/message/vm_display_syntax_error.js b/test/message/vm_display_syntax_error.js index d862f4121dae82..b0172264e71ffc 100644 --- a/test/message/vm_display_syntax_error.js +++ b/test/message/vm_display_syntax_error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js index d77b19dbe06cf3..7aa81844b8f4ed 100644 --- a/test/message/vm_dont_display_runtime_error.js +++ b/test/message/vm_dont_display_runtime_error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/message/vm_dont_display_syntax_error.js b/test/message/vm_dont_display_syntax_error.js index f2ef19c57d1b5e..724bea22148fdd 100644 --- a/test/message/vm_dont_display_syntax_error.js +++ b/test/message/vm_dont_display_syntax_error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 13dffe2fe011e9..5d5e70ea7ecbc1 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var a = require('assert'); @@ -267,8 +246,6 @@ try { var args = (function() { return arguments; })(); a.throws(makeBlock(a.deepEqual, [], args)); a.throws(makeBlock(a.deepEqual, args, [])); - -console.log('All OK'); assert.ok(gotError); @@ -329,3 +306,38 @@ try { assert.equal(e.generatedMessage, false, 'Message incorrectly marked as generated'); } + +// Verify that throws() and doesNotThrow() throw on non-function block +function testBlockTypeError(method, block) { + var threw = true; + + try { + method(block); + threw = false; + } catch (e) { + assert.equal(e.toString(), 'TypeError: block must be a function'); + } + + assert.ok(threw); +} + +testBlockTypeError(assert.throws, 'string'); +testBlockTypeError(assert.doesNotThrow, 'string'); +testBlockTypeError(assert.throws, 1); +testBlockTypeError(assert.doesNotThrow, 1); +testBlockTypeError(assert.throws, true); +testBlockTypeError(assert.doesNotThrow, true); +testBlockTypeError(assert.throws, false); +testBlockTypeError(assert.doesNotThrow, false); +testBlockTypeError(assert.throws, []); +testBlockTypeError(assert.doesNotThrow, []); +testBlockTypeError(assert.throws, {}); +testBlockTypeError(assert.doesNotThrow, {}); +testBlockTypeError(assert.throws, /foo/); +testBlockTypeError(assert.doesNotThrow, /foo/); +testBlockTypeError(assert.throws, null); +testBlockTypeError(assert.doesNotThrow, null); +testBlockTypeError(assert.throws, undefined); +testBlockTypeError(assert.doesNotThrow, undefined); + +console.log('All OK'); diff --git a/test/parallel/test-bad-unicode.js b/test/parallel/test-bad-unicode.js index 0e57909a60f61e..ba31ba3e234970 100644 --- a/test/parallel/test-bad-unicode.js +++ b/test/parallel/test-bad-unicode.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'), exception = null; diff --git a/test/parallel/test-beforeexit-event-exit.js b/test/parallel/test-beforeexit-event-exit.js index be6f2c607c37ea..8d0d43d45bb4d4 100644 --- a/test/parallel/test-beforeexit-event-exit.js +++ b/test/parallel/test-beforeexit-event-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); process.on('beforeExit', function() { diff --git a/test/parallel/test-beforeexit-event.js b/test/parallel/test-beforeexit-event.js index d1e20935437505..8bfdbe108eccb1 100644 --- a/test/parallel/test-beforeexit-event.js +++ b/test/parallel/test-beforeexit-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var net = require('net'); var util = require('util'); diff --git a/test/parallel/test-buffer-ascii.js b/test/parallel/test-buffer-ascii.js index 784597a48e40ed..e7625f3a0c5458 100644 --- a/test/parallel/test-buffer-ascii.js +++ b/test/parallel/test-buffer-ascii.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-buffer-concat.js b/test/parallel/test-buffer-concat.js index 858d6924f95fac..54c4b13cb9dc90 100644 --- a/test/parallel/test-buffer-concat.js +++ b/test/parallel/test-buffer-concat.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-buffer-inspect.js b/test/parallel/test-buffer-inspect.js index a13c69b4e0dc9c..f663d23edce8dc 100644 --- a/test/parallel/test-buffer-inspect.js +++ b/test/parallel/test-buffer-inspect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-debug-port-from-cmdline.js b/test/parallel/test-buffer-iterator.js similarity index 50% rename from test/sequential/test-debug-port-from-cmdline.js rename to test/parallel/test-buffer-iterator.js index db0f1b382e7c01..9b314a8cdfd447 100644 --- a/test/sequential/test-debug-port-from-cmdline.js +++ b/test/parallel/test-buffer-iterator.js @@ -1,4 +1,4 @@ -// Copyright Joyent, Inc. and other Node contributors. +// Copyright io.js contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the @@ -21,50 +21,62 @@ var common = require('../common'); var assert = require('assert'); -var spawn = require('child_process').spawn; - -var debugPort = common.PORT; -var args = ['--debug-port=' + debugPort]; -var child = spawn(process.execPath, args); - -child.stderr.on('data', function(data) { - var lines = data.toString().replace(/\r/g, '').trim().split('\n'); - lines.forEach(processStderrLine); -}); - -setTimeout(testTimedOut, 3000); -function testTimedOut() { - assert(false, 'test timed out.'); -} - -// Give the child process small amout of time to start -setTimeout(function() { - process._debugProcess(child.pid); -}, 100); - -process.on('exit', function() { - child.kill(); -}); - -var outputLines = []; -function processStderrLine(line) { - console.log('> ' + line); - outputLines.push(line); - - if (/Debugger listening/.test(line)) { - assertOutputLines(); - process.exit(); - } -} - -function assertOutputLines() { - var expectedLines = [ - 'Starting debugger agent.', - 'Debugger listening on port ' + debugPort - ]; - - assert.equal(outputLines.length, expectedLines.length); - for (var i = 0; i < expectedLines.length; i++) - assert.equal(outputLines[i], expectedLines[i]); - -} + +var buffer = new Buffer([1, 2, 3, 4, 5]); +var arr; +var b; + +// buffers should be iterable + +arr = []; + +for (b of buffer) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer iterators should be iterable + +arr = []; + +for (b of buffer[Symbol.iterator]()) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer#values() should return iterator for values + +arr = []; + +for (b of buffer.values()) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer#keys() should return iterator for keys + +arr = []; + +for (b of buffer.keys()) + arr.push(b); + +assert.deepEqual(arr, [0, 1, 2, 3, 4]); + + +// buffer#entries() should return iterator for entries + +arr = []; + +for (var b of buffer.entries()) + arr.push(b); + +assert.deepEqual(arr, [ + [0, 1], + [1, 2], + [2, 3], + [3, 4], + [4, 5] +]); diff --git a/test/parallel/test-buffer-slice.js b/test/parallel/test-buffer-slice.js index 1a462bd0be319e..3d8f9c62d2ce36 100644 --- a/test/parallel/test-buffer-slice.js +++ b/test/parallel/test-buffer-slice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-buffer.js b/test/parallel/test-buffer.js index bf742f93480934..1188c1f019e466 100644 --- a/test/parallel/test-buffer.js +++ b/test/parallel/test-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-c-ares.js b/test/parallel/test-c-ares.js index 3a3a9223d88fcb..2c74a470443b42 100644 --- a/test/parallel/test-c-ares.js +++ b/test/parallel/test-c-ares.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-buffering.js b/test/parallel/test-child-process-buffering.js index 3fb13b6208f4ba..997e64248ababb 100644 --- a/test/parallel/test-child-process-buffering.js +++ b/test/parallel/test-child-process-buffering.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-cwd.js b/test/parallel/test-child-process-cwd.js index b06e8e47938500..2ff459e9a33982 100644 --- a/test/parallel/test-child-process-cwd.js +++ b/test/parallel/test-child-process-cwd.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-default-options.js b/test/parallel/test-child-process-default-options.js index 57ff60441cf73c..ee0cb59842b9be 100644 --- a/test/parallel/test-child-process-default-options.js +++ b/test/parallel/test-child-process-default-options.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-detached.js b/test/parallel/test-child-process-detached.js index 10ce5d15274c17..1cc2a5022ed49a 100644 --- a/test/parallel/test-child-process-detached.js +++ b/test/parallel/test-child-process-detached.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index 5902be8f1eaba8..95b26a7c4ad125 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-double-pipe.js b/test/parallel/test-child-process-double-pipe.js index c09dfa885327e6..cf40dedd8a6eb1 100644 --- a/test/parallel/test-child-process-double-pipe.js +++ b/test/parallel/test-child-process-double-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var is_windows = process.platform === 'win32'; var common = require('../common'); diff --git a/test/parallel/test-child-process-env.js b/test/parallel/test-child-process-env.js index caeb1936c2c392..a6a164a66c4c72 100644 --- a/test/parallel/test-child-process-env.js +++ b/test/parallel/test-child-process-env.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-exec-buffer.js b/test/parallel/test-child-process-exec-buffer.js index 937dce76e6a94c..b680e3b3c1ee5a 100644 --- a/test/parallel/test-child-process-exec-buffer.js +++ b/test/parallel/test-child-process-exec-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-child-process-exec-cwd.js b/test/parallel/test-child-process-exec-cwd.js index 282faec8ba9a60..c91a35de0b8c4b 100644 --- a/test/parallel/test-child-process-exec-cwd.js +++ b/test/parallel/test-child-process-exec-cwd.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-child-process-exec-env.js b/test/parallel/test-child-process-exec-env.js index b14ce741fef7e8..6c8410b9a61793 100644 --- a/test/parallel/test-child-process-exec-env.js +++ b/test/parallel/test-child-process-exec-env.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-child-process-exec-error.js b/test/parallel/test-child-process-exec-error.js index afe199764371a9..7605af98549911 100644 --- a/test/parallel/test-child-process-exec-error.js +++ b/test/parallel/test-child-process-exec-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var child_process = require('child_process'); diff --git a/test/parallel/test-child-process-exit-code.js b/test/parallel/test-child-process-exit-code.js index c0c25858bb13a1..61f298633f8116 100644 --- a/test/parallel/test-child-process-exit-code.js +++ b/test/parallel/test-child-process-exit-code.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-fork-and-spawn.js b/test/parallel/test-child-process-fork-and-spawn.js index 989bf7ee3a1aa4..68e8af0fc3e19f 100644 --- a/test/parallel/test-child-process-fork-and-spawn.js +++ b/test/parallel/test-child-process-fork-and-spawn.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-fork-close.js b/test/parallel/test-child-process-fork-close.js index 342cffec3c3ac6..eddfec5d521436 100644 --- a/test/parallel/test-child-process-fork-close.js +++ b/test/parallel/test-child-process-fork-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'), common = require('../common'), fork = require('child_process').fork, diff --git a/test/parallel/test-child-process-fork-dgram.js b/test/parallel/test-child-process-fork-dgram.js index 1c4e9acc3b75f1..bd21f3f748155b 100644 --- a/test/parallel/test-child-process-fork-dgram.js +++ b/test/parallel/test-child-process-fork-dgram.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * The purpose of this test is to make sure that when forking a process, * sending a fd representing a UDP socket to the child and sending messages diff --git a/test/parallel/test-child-process-fork-exec-argv.js b/test/parallel/test-child-process-fork-exec-argv.js index d0da341c247fe1..34292c551112c1 100644 --- a/test/parallel/test-child-process-fork-exec-argv.js +++ b/test/parallel/test-child-process-fork-exec-argv.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var child_process = require('child_process'); var spawn = child_process.spawn; diff --git a/test/parallel/test-child-process-fork-exec-path.js b/test/parallel/test-child-process-fork-exec-path.js old mode 100755 new mode 100644 index e0cf77c28eb98b..72bb69316814de --- a/test/parallel/test-child-process-fork-exec-path.js +++ b/test/parallel/test-child-process-fork-exec-path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var cp = require('child_process'); var fs = require('fs'); diff --git a/test/parallel/test-child-process-fork-net.js b/test/parallel/test-child-process-fork-net.js index feb2588fe25ef3..a16fb85041b95f 100644 --- a/test/parallel/test-child-process-fork-net.js +++ b/test/parallel/test-child-process-fork-net.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-fork-net2.js b/test/parallel/test-child-process-fork-net2.js index 098870d48e7efc..171abb729a4751 100644 --- a/test/parallel/test-child-process-fork-net2.js +++ b/test/parallel/test-child-process-fork-net2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-fork-ref.js b/test/parallel/test-child-process-fork-ref.js index 21954ec733b486..aa38ad7a21c5ad 100644 --- a/test/parallel/test-child-process-fork-ref.js +++ b/test/parallel/test-child-process-fork-ref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-fork-ref2.js b/test/parallel/test-child-process-fork-ref2.js index 3d604142bbac8a..3ccdfc18871055 100644 --- a/test/parallel/test-child-process-fork-ref2.js +++ b/test/parallel/test-child-process-fork-ref2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-fork.js b/test/parallel/test-child-process-fork.js index 41cc28c72e402a..2ec9f402dd5d39 100644 --- a/test/parallel/test-child-process-fork.js +++ b/test/parallel/test-child-process-fork.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-fork3.js b/test/parallel/test-child-process-fork3.js index 0f75b029e339f6..8527257bc53684 100644 --- a/test/parallel/test-child-process-fork3.js +++ b/test/parallel/test-child-process-fork3.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var child_process = require('child_process'); diff --git a/test/parallel/test-child-process-internal.js b/test/parallel/test-child-process-internal.js index dd7ce556b52b44..a1bb52f4b71185 100644 --- a/test/parallel/test-child-process-internal.js +++ b/test/parallel/test-child-process-internal.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-ipc.js b/test/parallel/test-child-process-ipc.js index e8144e439dd332..712b1ee0a5e54c 100644 --- a/test/parallel/test-child-process-ipc.js +++ b/test/parallel/test-child-process-ipc.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-kill.js b/test/parallel/test-child-process-kill.js index 08a0185d33ae25..7e46aada8bbfad 100644 --- a/test/parallel/test-child-process-kill.js +++ b/test/parallel/test-child-process-kill.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-recv-handle.js b/test/parallel/test-child-process-recv-handle.js index dce5bdcbaf74c7..7f2f04f831dbf1 100644 --- a/test/parallel/test-child-process-recv-handle.js +++ b/test/parallel/test-child-process-recv-handle.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Test that a Linux specific quirk in the handle passing protocol is handled // correctly. See https://github.com/joyent/node/issues/5330 for details. diff --git a/test/parallel/test-child-process-send-utf8.js b/test/parallel/test-child-process-send-utf8.js index b3ce24390ed7b6..825913dc2ae4c4 100644 --- a/test/parallel/test-child-process-send-utf8.js +++ b/test/parallel/test-child-process-send-utf8.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fork = require('child_process').fork; diff --git a/test/parallel/test-child-process-set-blocking.js b/test/parallel/test-child-process-set-blocking.js index e07c6cc4db6577..af831b720b2eb0 100644 --- a/test/parallel/test-child-process-set-blocking.js +++ b/test/parallel/test-child-process-set-blocking.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var ch = require('child_process'); diff --git a/test/parallel/test-child-process-silent.js b/test/parallel/test-child-process-silent.js index e34daa3a833e8c..e1e03d0973011e 100644 --- a/test/parallel/test-child-process-silent.js +++ b/test/parallel/test-child-process-silent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var childProcess = require('child_process'); diff --git a/test/parallel/test-child-process-spawn-error.js b/test/parallel/test-child-process-spawn-error.js index 794dafaf8891a2..01ae5944b0c29d 100644 --- a/test/parallel/test-child-process-spawn-error.js +++ b/test/parallel/test-child-process-spawn-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var fs = require('fs'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js index 4fd360a3f8688b..b95b208eb0c87e 100644 --- a/test/parallel/test-child-process-spawn-typeerror.js +++ b/test/parallel/test-child-process-spawn-typeerror.js @@ -1,44 +1,14 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var spawn = require('child_process').spawn, - assert = require('assert'), - windows = (process.platform === 'win32'), - cmd = (windows) ? 'rundll32' : 'ls', - invalidcmd = 'hopefully_you_dont_have_this_on_your_machine', - invalidArgsMsg = /Incorrect value of args option/, - invalidOptionsMsg = /options argument must be an object/, - errors = 0; - -try { - // Ensure this throws a TypeError - var child = spawn(invalidcmd, 'this is not an array'); - - child.on('error', function (err) { - errors++; - }); - -} catch (e) { - assert.equal(e instanceof TypeError, true); -} +var assert = require('assert'); +var child_process = require('child_process'); +var spawn = child_process.spawn; +var cmd = (process.platform === 'win32') ? 'rundll32' : 'ls'; +var invalidArgsMsg = /Incorrect value of args option/; +var invalidOptionsMsg = /options argument must be an object/; + +// verify that args argument must be an array +assert.throws(function() { + spawn(cmd, 'this is not an array'); +}, TypeError); // verify that valid argument combinations do not throw assert.doesNotThrow(function() { @@ -78,6 +48,3 @@ assert.throws(function() { spawn(cmd, [], 1); }, invalidOptionsMsg); -process.on('exit', function() { - assert.equal(errors, 0); -}); diff --git a/test/parallel/test-child-process-spawnsync-env.js b/test/parallel/test-child-process-spawnsync-env.js index 0cde9ffeefa0f7..0ebc66a7459cfe 100644 --- a/test/parallel/test-child-process-spawnsync-env.js +++ b/test/parallel/test-child-process-spawnsync-env.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cp = require('child_process'); diff --git a/test/parallel/test-child-process-spawnsync-input.js b/test/parallel/test-child-process-spawnsync-input.js index 66b2fa354aeae7..e85e9da1fbade9 100644 --- a/test/parallel/test-child-process-spawnsync-input.js +++ b/test/parallel/test-child-process-spawnsync-input.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/parallel/test-child-process-spawnsync-timeout.js b/test/parallel/test-child-process-spawnsync-timeout.js index 691f58786eebf9..f5b5987e4d1eaf 100644 --- a/test/parallel/test-child-process-spawnsync-timeout.js +++ b/test/parallel/test-child-process-spawnsync-timeout.js @@ -1,31 +1,10 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawnSync = require('child_process').spawnSync; var TIMER = 200; -var SLEEP = 1000; +var SLEEP = 5000; switch (process.argv[2]) { case 'child': diff --git a/test/parallel/test-child-process-spawnsync.js b/test/parallel/test-child-process-spawnsync.js index a7cbb8d1dfb7a7..f85dfe53267425 100644 --- a/test/parallel/test-child-process-spawnsync.js +++ b/test/parallel/test-child-process-spawnsync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-stdin-ipc.js b/test/parallel/test-child-process-stdin-ipc.js index cd6a921d005b5b..2758087deac814 100644 --- a/test/parallel/test-child-process-stdin-ipc.js +++ b/test/parallel/test-child-process-stdin-ipc.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-stdin.js b/test/parallel/test-child-process-stdin.js index fdb40cc82c4746..f2a5e1836a6e1d 100644 --- a/test/parallel/test-child-process-stdin.js +++ b/test/parallel/test-child-process-stdin.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-child-process-stdio-big-write-end.js b/test/parallel/test-child-process-stdio-big-write-end.js index 845a23e661a03a..631cecc33d74b1 100644 --- a/test/parallel/test-child-process-stdio-big-write-end.js +++ b/test/parallel/test-child-process-stdio-big-write-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var BUFSIZE = 1024; diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index f7776fecb9a456..15a504099263c8 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-stdio.js b/test/parallel/test-child-process-stdio.js index 32da15f5f5c8f5..2e1875a18041d8 100644 --- a/test/parallel/test-child-process-stdio.js +++ b/test/parallel/test-child-process-stdio.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-stdout-flush-exit.js b/test/parallel/test-child-process-stdout-flush-exit.js index 49a0ec0e5f7108..eba8927204f71c 100644 --- a/test/parallel/test-child-process-stdout-flush-exit.js +++ b/test/parallel/test-child-process-stdout-flush-exit.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-child-process-stdout-flush.js b/test/parallel/test-child-process-stdout-flush.js index adb33f5c035407..58d6a8f46a4b9d 100644 --- a/test/parallel/test-child-process-stdout-flush.js +++ b/test/parallel/test-child-process-stdout-flush.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index d055ad5e300c1a..26e3e0ad0bd6e1 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (module.parent) { // signal we've been loaded as a module console.log('Loaded as a module, exiting with status code 42.'); diff --git a/test/parallel/test-cluster-basic.js b/test/parallel/test-cluster-basic.js index e6adfb5bad2353..75ed9d3a155349 100644 --- a/test/parallel/test-cluster-basic.js +++ b/test/parallel/test-cluster-basic.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index b767577289b0d9..3a75250c53f811 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-bind-twice.js b/test/parallel/test-cluster-bind-twice.js index 311bc60faa1bbe..db1ea8874f4d17 100644 --- a/test/parallel/test-cluster-bind-twice.js +++ b/test/parallel/test-cluster-bind-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This test starts two clustered HTTP servers on the same port. It expects the // first cluster to succeed and the second cluster to fail with EADDRINUSE. // diff --git a/test/parallel/test-cluster-dgram-1.js b/test/parallel/test-cluster-dgram-1.js index c6dc095d0832c3..dada58017f5130 100644 --- a/test/parallel/test-cluster-dgram-1.js +++ b/test/parallel/test-cluster-dgram-1.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var NUM_WORKERS = 4; var PACKETS_PER_WORKER = 10; diff --git a/test/parallel/test-cluster-dgram-2.js b/test/parallel/test-cluster-dgram-2.js index cb5eaf0675fb1f..6b88a18dc2514e 100644 --- a/test/parallel/test-cluster-dgram-2.js +++ b/test/parallel/test-cluster-dgram-2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var NUM_WORKERS = 4; var PACKETS_PER_WORKER = 10; diff --git a/test/parallel/test-cluster-disconnect-before-exit.js b/test/parallel/test-cluster-disconnect-before-exit.js new file mode 100644 index 00000000000000..d249296bab740a --- /dev/null +++ b/test/parallel/test-cluster-disconnect-before-exit.js @@ -0,0 +1,14 @@ +var cluster = require('cluster'); + +if (cluster.isMaster) { + var worker = cluster.fork().on('online', disconnect); + + function disconnect() { + worker.disconnect(); + // The worker remains in cluster.workers until both disconnect AND exit. + // Disconnect is supposed to disconnect all workers, but not workers that + // are already disconnected, since calling disconnect() on an already + // disconnected worker would error. + worker.on('disconnect', cluster.disconnect); + } +} diff --git a/test/parallel/test-cluster-disconnect-idle-worker.js b/test/parallel/test-cluster-disconnect-idle-worker.js index 9c79ad779eab13..28cdd2de4eaf50 100644 --- a/test/parallel/test-cluster-disconnect-idle-worker.js +++ b/test/parallel/test-cluster-disconnect-idle-worker.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-disconnect-unshared-tcp.js b/test/parallel/test-cluster-disconnect-unshared-tcp.js new file mode 100644 index 00000000000000..6fccc58c095930 --- /dev/null +++ b/test/parallel/test-cluster-disconnect-unshared-tcp.js @@ -0,0 +1,23 @@ +process.env.NODE_CLUSTER_SCHED_POLICY = 'none'; + +var cluster = require('cluster'); +var net = require('net'); + +if (cluster.isMaster) { + var unbound = cluster.fork().on('online', bind); + + function bind() { + cluster.fork({BOUND: 'y'}).on('listening', disconnect); + } + + function disconnect() { + unbound.disconnect(); + unbound.on('disconnect', cluster.disconnect); + } +} else { + if (process.env.BOUND === 'y') { + var source = net.createServer() + + source.listen(0); + } +} diff --git a/test/parallel/test-cluster-disconnect-unshared-udp.js b/test/parallel/test-cluster-disconnect-unshared-udp.js new file mode 100644 index 00000000000000..a40c386918b156 --- /dev/null +++ b/test/parallel/test-cluster-disconnect-unshared-udp.js @@ -0,0 +1,26 @@ +if (process.platform === 'win32') { + console.log('skipping test on windows, where clustered dgram is ENOTSUP'); + process.exit(0); +} + +var cluster = require('cluster'); +var dgram = require('dgram'); + +if (cluster.isMaster) { + var unbound = cluster.fork().on('online', bind); + + function bind() { + cluster.fork({BOUND: 'y'}).on('listening', disconnect); + } + + function disconnect() { + unbound.disconnect(); + unbound.on('disconnect', cluster.disconnect); + } +} else { + if (process.env.BOUND === 'y') { + var source = dgram.createSocket('udp4'); + + source.bind(0); + } +} diff --git a/test/parallel/test-cluster-disconnect-with-no-workers.js b/test/parallel/test-cluster-disconnect-with-no-workers.js index 48e3b092599563..e07f5af99ddf9f 100644 --- a/test/parallel/test-cluster-disconnect-with-no-workers.js +++ b/test/parallel/test-cluster-disconnect-with-no-workers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-disconnect.js b/test/parallel/test-cluster-disconnect.js index 797c17d767d556..c557256dcb3bfe 100644 --- a/test/parallel/test-cluster-disconnect.js +++ b/test/parallel/test-cluster-disconnect.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-eaccess.js b/test/parallel/test-cluster-eaccess.js index d5584242cebc32..1be28a38559b0b 100644 --- a/test/parallel/test-cluster-eaccess.js +++ b/test/parallel/test-cluster-eaccess.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test that errors propagated from cluster children are properly received in their master // creates an EADDRINUSE condition by also forking a child process to listen on a socket diff --git a/test/parallel/test-cluster-eaddrinuse.js b/test/parallel/test-cluster-eaddrinuse.js index 73b1df0a547655..c43259c5631bcf 100644 --- a/test/parallel/test-cluster-eaddrinuse.js +++ b/test/parallel/test-cluster-eaddrinuse.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Check that having a worker bind to a port that's already taken doesn't // leave the master process in a confused state. Releasing the port and // trying again should Just Work[TM]. diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index a0b50aebdc33d1..ddcf7d236c9482 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-http-pipe.js b/test/parallel/test-cluster-http-pipe.js index 7123bf62756f45..b9706699615ac1 100644 --- a/test/parallel/test-cluster-http-pipe.js +++ b/test/parallel/test-cluster-http-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // It is not possible to send pipe handles over the IPC pipe on Windows. if (process.platform === 'win32') { process.exit(0); diff --git a/test/parallel/test-cluster-master-error.js b/test/parallel/test-cluster-master-error.js index ee2ed9eb4ee509..e0e92e7cf9e2a4 100644 --- a/test/parallel/test-cluster-master-error.js +++ b/test/parallel/test-cluster-master-error.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-master-kill.js b/test/parallel/test-cluster-master-kill.js index 36254039039686..a5c22855607104 100644 --- a/test/parallel/test-cluster-master-kill.js +++ b/test/parallel/test-cluster-master-kill.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js index 7407515ada69f8..29c9e31159e62a 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-net-listen.js b/test/parallel/test-cluster-net-listen.js index 927169c7296dc6..1d8e08c877481e 100644 --- a/test/parallel/test-cluster-net-listen.js +++ b/test/parallel/test-cluster-net-listen.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-net-send.js b/test/parallel/test-cluster-net-send.js index 1313a624a79cb4..17d77171c50534 100644 --- a/test/parallel/test-cluster-net-send.js +++ b/test/parallel/test-cluster-net-send.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fork = require('child_process').fork; diff --git a/test/parallel/test-cluster-rr-domain-listen.js b/test/parallel/test-cluster-rr-domain-listen.js old mode 100755 new mode 100644 index 574036df23b8a5..fc26c93685a045 --- a/test/parallel/test-cluster-rr-domain-listen.js +++ b/test/parallel/test-cluster-rr-domain-listen.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var cluster = require('cluster'); var domain = require('domain'); diff --git a/test/parallel/test-cluster-send-deadlock.js b/test/parallel/test-cluster-send-deadlock.js index 1b4a90dee00efe..7fd465db5feb13 100644 --- a/test/parallel/test-cluster-send-deadlock.js +++ b/test/parallel/test-cluster-send-deadlock.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Testing mutual send of handles: from master to worker, and from worker to // master. diff --git a/test/parallel/test-cluster-send-handle-twice.js b/test/parallel/test-cluster-send-handle-twice.js index 3215eae79ed0a1..2d2c2cc588eaf8 100644 --- a/test/parallel/test-cluster-send-handle-twice.js +++ b/test/parallel/test-cluster-send-handle-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Testing to send an handle twice to the parent process. var common = require('../common'); diff --git a/test/parallel/test-cluster-setup-master-argv.js b/test/parallel/test-cluster-setup-master-argv.js index d216943c8cee5e..a8274be2e924cb 100644 --- a/test/parallel/test-cluster-setup-master-argv.js +++ b/test/parallel/test-cluster-setup-master-argv.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-setup-master-cumulative.js b/test/parallel/test-cluster-setup-master-cumulative.js index 2f69cd3689220e..cf2d8e90daac36 100644 --- a/test/parallel/test-cluster-setup-master-cumulative.js +++ b/test/parallel/test-cluster-setup-master-cumulative.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-setup-master-emit.js b/test/parallel/test-cluster-setup-master-emit.js index ee3af2ad41dd41..bef10d8cb81ba3 100644 --- a/test/parallel/test-cluster-setup-master-emit.js +++ b/test/parallel/test-cluster-setup-master-emit.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-setup-master-multiple.js b/test/parallel/test-cluster-setup-master-multiple.js index 21756b9c0caa79..da0c03c7320bc9 100644 --- a/test/parallel/test-cluster-setup-master-multiple.js +++ b/test/parallel/test-cluster-setup-master-multiple.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-setup-master.js b/test/parallel/test-cluster-setup-master.js index d9f3879280836e..7cf9631146682b 100644 --- a/test/parallel/test-cluster-setup-master.js +++ b/test/parallel/test-cluster-setup-master.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-shared-handle-bind-error.js b/test/parallel/test-cluster-shared-handle-bind-error.js index ceccd9146d742b..f327de994a1fc6 100644 --- a/test/parallel/test-cluster-shared-handle-bind-error.js +++ b/test/parallel/test-cluster-shared-handle-bind-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js index 67b3a8840258b8..3bbe9fbf2f9cda 100644 --- a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js +++ b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-uncaught-exception.js b/test/parallel/test-cluster-uncaught-exception.js index 48a82512704b0f..9f98d626c8634e 100644 --- a/test/parallel/test-cluster-uncaught-exception.js +++ b/test/parallel/test-cluster-uncaught-exception.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Installing a custom uncaughtException handler should override the default // one that the cluster module installs. // https://github.com/joyent/node/issues/2556 diff --git a/test/parallel/test-cluster-worker-constructor.js b/test/parallel/test-cluster-worker-constructor.js index ce7945cdb4e9d6..331ab777481e59 100644 --- a/test/parallel/test-cluster-worker-constructor.js +++ b/test/parallel/test-cluster-worker-constructor.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // test-cluster-worker-constructor.js // validates correct behavior of the cluster.Worker constructor diff --git a/test/parallel/test-cluster-worker-death.js b/test/parallel/test-cluster-worker-death.js index ccd48552ab9514..d19704c58b3868 100644 --- a/test/parallel/test-cluster-worker-death.js +++ b/test/parallel/test-cluster-worker-death.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-worker-destroy.js b/test/parallel/test-cluster-worker-destroy.js index 318b55caf6f2c6..55ae0fc8c0c172 100644 --- a/test/parallel/test-cluster-worker-destroy.js +++ b/test/parallel/test-cluster-worker-destroy.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * The goal of this test is to cover the Workers' implementation of * Worker.prototype.destroy. Worker.prototype.destroy is called within diff --git a/test/parallel/test-cluster-worker-disconnect.js b/test/parallel/test-cluster-worker-disconnect.js index 632a25f2dba7e9..4bb9b163b64982 100644 --- a/test/parallel/test-cluster-worker-disconnect.js +++ b/test/parallel/test-cluster-worker-disconnect.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-worker-events.js b/test/parallel/test-cluster-worker-events.js index 1276650d16cd8f..fb3b8797e0deac 100644 --- a/test/parallel/test-cluster-worker-events.js +++ b/test/parallel/test-cluster-worker-events.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-cluster-worker-exit.js b/test/parallel/test-cluster-worker-exit.js index 7b9d5d86c4a286..1342a70d6f0c35 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // test-cluster-worker-exit.js // verifies that, when a child process exits (by calling `process.exit(code)`) // - the parent receives the proper events in the proper order, no duplicates diff --git a/test/parallel/test-cluster-worker-forced-exit.js b/test/parallel/test-cluster-worker-forced-exit.js index 66d5f183552efb..144eb0dd3a3be8 100644 --- a/test/parallel/test-cluster-worker-forced-exit.js +++ b/test/parallel/test-cluster-worker-forced-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var cluster = require('cluster') var net = require('net'); diff --git a/test/parallel/test-cluster-worker-init.js b/test/parallel/test-cluster-worker-init.js index f750262e879efa..87e0ce040af98f 100644 --- a/test/parallel/test-cluster-worker-init.js +++ b/test/parallel/test-cluster-worker-init.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // test-cluster-worker-init.js // verifies that, when a child process is forked, the cluster.worker // object can receive messages as expected diff --git a/test/parallel/test-cluster-worker-kill.js b/test/parallel/test-cluster-worker-kill.js index 8c6068e8db9019..01da15fdca6a18 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // test-cluster-worker-kill.js // verifies that, when a child process is killed (we use SIGKILL) // - the parent receives the proper events in the proper order, no duplicates diff --git a/test/parallel/test-cluster-worker-no-exit.js b/test/parallel/test-cluster-worker-no-exit.js index 8634d5424b89d0..034a4952e88c59 100644 --- a/test/parallel/test-cluster-worker-no-exit.js +++ b/test/parallel/test-cluster-worker-no-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var cluster = require('cluster') var net = require('net'); diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 420bd52a09f5bd..d15448bd36afff 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index e0166ebd3148b4..a91410b4091d47 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var Stream = require('stream'); diff --git a/test/parallel/test-console-not-call-toString.js b/test/parallel/test-console-not-call-toString.js index a62004f70af566..9612a0f6ec0ddc 100644 --- a/test/parallel/test-console-not-call-toString.js +++ b/test/parallel/test-console-not-call-toString.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 14ece8af5bc9e7..202ec6eab52769 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index 8b4411607359a6..5d8bfa0635a440 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index fe7da668e21323..4cd5d8dd2ab148 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This is the same as test/simple/test-crypto, but from before the shift // to use buffers by default. diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 60fedee7452984..033ea691cc21cb 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-dh-odd-key.js b/test/parallel/test-crypto-dh-odd-key.js index a3d99e9b55d1b7..21b16e20a5d3a8 100644 --- a/test/parallel/test-crypto-dh-odd-key.js +++ b/test/parallel/test-crypto-dh-odd-key.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-domain.js b/test/parallel/test-crypto-domain.js index 6284afc075ab57..7936bfc35ab934 100644 --- a/test/parallel/test-crypto-domain.js +++ b/test/parallel/test-crypto-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-crypto-domains.js b/test/parallel/test-crypto-domains.js index 1393f6da12510a..59579f022cf324 100644 --- a/test/parallel/test-crypto-domains.js +++ b/test/parallel/test-crypto-domains.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: - -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var crypto = require('crypto'); var domain = require('domain'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-ecb.js b/test/parallel/test-crypto-ecb.js index e5b893cfcbe2e1..12a4517ad1b862 100644 --- a/test/parallel/test-crypto-ecb.js +++ b/test/parallel/test-crypto-ecb.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-from-binary.js b/test/parallel/test-crypto-from-binary.js index 2033617006b32d..90cf5fd2fd8d6d 100644 --- a/test/parallel/test-crypto-from-binary.js +++ b/test/parallel/test-crypto-from-binary.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This is the same as test/simple/test-crypto, but from before the shift // to use buffers by default. diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js index 1394903fab0099..c3f14245eef773 100644 --- a/test/parallel/test-crypto-hash-stream-pipe.js +++ b/test/parallel/test-crypto-hash-stream-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js index dd293feb10481c..a701f3c442603c 100644 --- a/test/parallel/test-crypto-padding-aes256.js +++ b/test/parallel/test-crypto-padding-aes256.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js index 22edbf4814430f..7b46bfba418bb6 100644 --- a/test/parallel/test-crypto-padding.js +++ b/test/parallel/test-crypto-padding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index 24a76f4f1acadf..987f0e41897e22 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js index ff58e8040b834c..2987ed0a218b85 100644 --- a/test/parallel/test-crypto-stream.js +++ b/test/parallel/test-crypto-stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var stream = require('stream'); @@ -70,7 +49,7 @@ var key = new Buffer('48fb56eb10ffeb13fc0ef551bbca3b1b', 'hex'), cipher.pipe(decipher) .on('error', common.mustCall(function end(err) { - assert(/Unsupported/.test(err)); + assert(/bad decrypt/.test(err)); })); cipher.end('Papaya!'); // Should not cause an unhandled exception. diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index 09c43ddc05ac71..0702e16e854e5a 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index d3f1ade321c185..970bee06e672d9 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/sequential/test-debug-port-cluster.js b/test/parallel/test-debug-port-cluster.js similarity index 52% rename from test/sequential/test-debug-port-cluster.js rename to test/parallel/test-debug-port-cluster.js index 34ae3a02938fb4..96a6f6e7f405b7 100644 --- a/test/sequential/test-debug-port-cluster.js +++ b/test/parallel/test-debug-port-cluster.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-debug-port-from-cmdline.js b/test/parallel/test-debug-port-from-cmdline.js new file mode 100644 index 00000000000000..4ed2e84918c8f0 --- /dev/null +++ b/test/parallel/test-debug-port-from-cmdline.js @@ -0,0 +1,48 @@ +var common = require('../common'); +var assert = require('assert'); +var spawn = require('child_process').spawn; + +var debugPort = common.PORT; +var args = ['--debug-port=' + debugPort]; +var childOptions = { stdio: ['pipe', 'pipe', 'pipe', 'ipc'] }; +var child = spawn(process.execPath, args, childOptions); + +child.stdin.end("process.send({ msg: 'childready' });"); + +child.stderr.on('data', function(data) { + var lines = data.toString().replace(/\r/g, '').trim().split('\n'); + lines.forEach(processStderrLine); +}); + +child.on('message', function onChildMsg(message) { + if (message.msg === 'childready') { + process._debugProcess(child.pid); + } +}); + +process.on('exit', function() { + child.kill(); +}); + +var outputLines = []; +function processStderrLine(line) { + console.log('> ' + line); + outputLines.push(line); + + if (/Debugger listening/.test(line)) { + assertOutputLines(); + process.exit(); + } +} + +function assertOutputLines() { + var expectedLines = [ + 'Starting debugger agent.', + 'Debugger listening on port ' + debugPort + ]; + + assert.equal(outputLines.length, expectedLines.length); + for (var i = 0; i < expectedLines.length; i++) + assert.equal(outputLines[i], expectedLines[i]); + +} diff --git a/test/parallel/test-debug-signal-cluster.js b/test/parallel/test-debug-signal-cluster.js new file mode 100644 index 00000000000000..026e2932622e13 --- /dev/null +++ b/test/parallel/test-debug-signal-cluster.js @@ -0,0 +1,83 @@ +var common = require('../common'); +var assert = require('assert'); +var spawn = require('child_process').spawn; + +var port = common.PORT + 42; +var args = ['--debug-port=' + port, + common.fixturesDir + '/clustered-server/app.js']; +var options = { stdio: ['inherit', 'inherit', 'pipe', 'ipc'] }; +var child = spawn(process.execPath, args, options); + +var outputLines = []; +var outputTimerId; +var waitingForDebuggers = false; + +var pids = null; + +child.stderr.on('data', function(data) { + var lines = data.toString().replace(/\r/g, '').trim().split('\n'); + + lines.forEach(function(line) { + console.log('> ' + line); + + if (line === 'all workers are running') { + child.on('message', function(msg) { + if (msg.type !== 'pids') + return; + + pids = msg.pids; + console.error('got pids %j', pids); + + waitingForDebuggers = true; + process._debugProcess(child.pid); + }); + + child.send({ + type: 'getpids' + }); + } else if (waitingForDebuggers) { + outputLines.push(line); + } + + }); + if (outputLines.length >= expectedLines.length) + onNoMoreLines(); +}); + +function onNoMoreLines() { + assertOutputLines(); + process.exit(); +} + +setTimeout(function testTimedOut() { + assert(false, 'test timed out.'); +}, 6000).unref(); + +process.on('exit', function onExit() { + // Kill processes in reverse order to avoid timing problems on Windows where + // the parent process is killed before the children. + pids.reverse().forEach(function(pid) { + process.kill(pid); + }); +}); + +var expectedLines = [ + 'Starting debugger agent.', + 'Debugger listening on port ' + (port + 0), + 'Starting debugger agent.', + 'Debugger listening on port ' + (port + 1), + 'Starting debugger agent.', + 'Debugger listening on port ' + (port + 2), +]; + +function assertOutputLines() { + // Do not assume any particular order of output messages, + // since workers can take different amout of time to + // start up + outputLines.sort(); + expectedLines.sort(); + + assert.equal(outputLines.length, expectedLines.length); + for (var i = 0; i < expectedLines.length; i++) + assert.equal(outputLines[i], expectedLines[i]); +} diff --git a/test/parallel/test-delayed-require.js b/test/parallel/test-delayed-require.js index 31c324976f3290..161f3d2ffa79ae 100644 --- a/test/parallel/test-delayed-require.js +++ b/test/parallel/test-delayed-require.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dgram-address.js b/test/parallel/test-dgram-address.js index 30d8eb0e16cd24..bab45076128c22 100644 --- a/test/parallel/test-dgram-address.js +++ b/test/parallel/test-dgram-address.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-bind-default-address.js b/test/parallel/test-dgram-bind-default-address.js index e7b65c57bf5fe4..74bf9442abb006 100644 --- a/test/parallel/test-dgram-bind-default-address.js +++ b/test/parallel/test-dgram-bind-default-address.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-bind-shared-ports.js b/test/parallel/test-dgram-bind-shared-ports.js index c9e22b5921f2a8..4cfe4b5f9af7f4 100644 --- a/test/parallel/test-dgram-bind-shared-ports.js +++ b/test/parallel/test-dgram-bind-shared-ports.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-dgram-bind.js b/test/parallel/test-dgram-bind.js index 1fe615bb757916..72f2f2c2b052bb 100644 --- a/test/parallel/test-dgram-bind.js +++ b/test/parallel/test-dgram-bind.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-bytes-length.js b/test/parallel/test-dgram-bytes-length.js index 4e90f78c809b6f..9698a0b465e4b8 100644 --- a/test/parallel/test-dgram-bytes-length.js +++ b/test/parallel/test-dgram-bytes-length.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-close.js b/test/parallel/test-dgram-close.js index 6ac19339e4dd42..bd4af66323c05b 100644 --- a/test/parallel/test-dgram-close.js +++ b/test/parallel/test-dgram-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Ensure that if a dgram socket is closed before the DNS lookup completes, it // won't crash. diff --git a/test/parallel/test-dgram-empty-packet.js b/test/parallel/test-dgram-empty-packet.js index 812e88a3b779c2..a629df8e1bc564 100644 --- a/test/parallel/test-dgram-empty-packet.js +++ b/test/parallel/test-dgram-empty-packet.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dgram-error-message-address.js b/test/parallel/test-dgram-error-message-address.js new file mode 100644 index 00000000000000..7842203d80c6c5 --- /dev/null +++ b/test/parallel/test-dgram-error-message-address.js @@ -0,0 +1,34 @@ +var common = require('../common'); +var assert = require('assert'); +var dgram = require('dgram'); + +// IPv4 Test +var socket_ipv4 = dgram.createSocket('udp4'); + +socket_ipv4.on('listening', assert.fail); + +socket_ipv4.on('error', common.mustCall(function(e) { + assert.equal(e.message, 'bind EADDRNOTAVAIL 1.1.1.1:' + common.PORT); + assert.equal(e.address, '1.1.1.1'); + assert.equal(e.port, common.PORT); + assert.equal(e.code, 'EADDRNOTAVAIL'); + socket_ipv4.close(); +})); + +socket_ipv4.bind(common.PORT, '1.1.1.1'); + +// IPv6 Test +var socket_ipv6 = dgram.createSocket('udp6'); +var family_ipv6 = 'IPv6'; + +socket_ipv6.on('listening', assert.fail); + +socket_ipv6.on('error', common.mustCall(function(e) { + assert.equal(e.message, 'bind EADDRNOTAVAIL 111::1:' + common.PORT); + assert.equal(e.address, '111::1'); + assert.equal(e.port, common.PORT); + assert.equal(e.code, 'EADDRNOTAVAIL'); + socket_ipv6.close(); +})); + +socket_ipv6.bind(common.PORT, '111::1'); diff --git a/test/parallel/test-dgram-implicit-bind.js b/test/parallel/test-dgram-implicit-bind.js index 6039629c4183ca..adf6f52b4974a0 100644 --- a/test/parallel/test-dgram-implicit-bind.js +++ b/test/parallel/test-dgram-implicit-bind.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-listen-after-bind.js b/test/parallel/test-dgram-listen-after-bind.js index e5f1c4d653f0e8..c5f09b84677872 100644 --- a/test/parallel/test-dgram-listen-after-bind.js +++ b/test/parallel/test-dgram-listen-after-bind.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-msgsize.js b/test/parallel/test-dgram-msgsize.js index 03f9cb5324c3b1..474ab82f44a47f 100644 --- a/test/parallel/test-dgram-msgsize.js +++ b/test/parallel/test-dgram-msgsize.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); @@ -31,5 +10,8 @@ sock.send(buf, 0, buf.length, 12345, '127.0.0.1', common.mustCall(cb)); function cb(err) { assert(err instanceof Error); assert.equal(err.code, 'EMSGSIZE'); + assert.equal(err.address, '127.0.0.1'); + assert.equal(err.port, 12345); + assert.equal(err.message, 'send EMSGSIZE 127.0.0.1:12345'); sock.close(); } diff --git a/test/parallel/test-dgram-multicast-setTTL.js b/test/parallel/test-dgram-multicast-setTTL.js index 2ef0c167a8837f..d849945fab7837 100644 --- a/test/parallel/test-dgram-multicast-setTTL.js +++ b/test/parallel/test-dgram-multicast-setTTL.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), dgram = require('dgram'), diff --git a/test/parallel/test-dgram-oob-buffer.js b/test/parallel/test-dgram-oob-buffer.js index 061c8417cdcbfc..bbbdc4dafeee19 100644 --- a/test/parallel/test-dgram-oob-buffer.js +++ b/test/parallel/test-dgram-oob-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Some operating systems report errors when an UDP message is sent to an // unreachable host. This error can be reported by sendto() and even by // recvfrom(). Node should not propagate this error to the user. diff --git a/test/parallel/test-dgram-pingpong.js b/test/parallel/test-dgram-pingpong.js index 992153293bac2f..b7d7a0067e89e7 100644 --- a/test/parallel/test-dgram-pingpong.js +++ b/test/parallel/test-dgram-pingpong.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var Buffer = require('buffer').Buffer; diff --git a/test/parallel/test-dgram-ref.js b/test/parallel/test-dgram-ref.js index ebbbac2fc641e3..8d100eb0783f55 100644 --- a/test/parallel/test-dgram-ref.js +++ b/test/parallel/test-dgram-ref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-regress-4496.js b/test/parallel/test-dgram-regress-4496.js index e45824a107f982..a200716c0fb8d8 100644 --- a/test/parallel/test-dgram-regress-4496.js +++ b/test/parallel/test-dgram-regress-4496.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Remove this test once we support sending strings. var common = require('../common'); diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index a9a12d4581530f..ab18784ccc6905 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dgram = require('dgram'); diff --git a/test/parallel/test-dgram-send-callback-buffer-length.js b/test/parallel/test-dgram-send-callback-buffer-length.js index c3b7d5ccc9e421..5596a7242f3a6a 100644 --- a/test/parallel/test-dgram-send-callback-buffer-length.js +++ b/test/parallel/test-dgram-send-callback-buffer-length.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dgram-send-empty-buffer.js b/test/parallel/test-dgram-send-empty-buffer.js index 4eb0ab4fc3f178..e2ca937d6afbb3 100644 --- a/test/parallel/test-dgram-send-empty-buffer.js +++ b/test/parallel/test-dgram-send-empty-buffer.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dgram-udp4.js b/test/parallel/test-dgram-udp4.js index cc1f1c08809b2b..6844c7c449eee4 100644 --- a/test/parallel/test-dgram-udp4.js +++ b/test/parallel/test-dgram-udp4.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dgram-unref.js b/test/parallel/test-dgram-unref.js index 38abbac2741e77..94f7ba739c740c 100644 --- a/test/parallel/test-dgram-unref.js +++ b/test/parallel/test-dgram-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dh-padding.js b/test/parallel/test-dh-padding.js index 753c0eb8195566..3e30fd34e7713d 100644 --- a/test/parallel/test-dh-padding.js +++ b/test/parallel/test-dh-padding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-dns-cares-domains.js b/test/parallel/test-dns-cares-domains.js index 8581ed64db2b85..5c6d07cfe5322a 100644 --- a/test/parallel/test-dns-cares-domains.js +++ b/test/parallel/test-dns-cares-domains.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dns = require('dns'); diff --git a/test/parallel/test-dns-lookup-cb-error.js b/test/parallel/test-dns-lookup-cb-error.js index 0365810984597e..2aa9ffe7d6301f 100644 --- a/test/parallel/test-dns-lookup-cb-error.js +++ b/test/parallel/test-dns-lookup-cb-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cares = process.binding('cares_wrap'); diff --git a/test/parallel/test-dns-regress-6244.js b/test/parallel/test-dns-regress-6244.js index ca2957926e2982..8bed54f1b297f5 100644 --- a/test/parallel/test-dns-regress-6244.js +++ b/test/parallel/test-dns-regress-6244.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var dns = require('dns'); diff --git a/test/parallel/test-dns-regress-7070.js b/test/parallel/test-dns-regress-7070.js index 9aca4f728d502e..79f0d7d9e0ca00 100644 --- a/test/parallel/test-dns-regress-7070.js +++ b/test/parallel/test-dns-regress-7070.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var dns = require('dns'); diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js index 405bcf0a089f36..1de9bbfdf77977 100644 --- a/test/parallel/test-dns.js +++ b/test/parallel/test-dns.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: - -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index 66e962880448b6..dc183b7bda1760 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - try { var crypto = require('crypto'); } catch (e) { diff --git a/test/parallel/test-domain-enter-exit.js b/test/parallel/test-domain-enter-exit.js index 7d248ea15f84c7..32ec0ca2472c8c 100644 --- a/test/parallel/test-domain-enter-exit.js +++ b/test/parallel/test-domain-enter-exit.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Make sure the domain stack is a stack var assert = require('assert'); diff --git a/test/parallel/test-domain-exit-dispose-again.js b/test/parallel/test-domain-exit-dispose-again.js index 22928f2604511d..3a72e3aac6adad 100644 --- a/test/parallel/test-domain-exit-dispose-again.js +++ b/test/parallel/test-domain-exit-dispose-again.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-domain-exit-dispose.js b/test/parallel/test-domain-exit-dispose.js index fd990911c1699e..5293d69b6db3fe 100644 --- a/test/parallel/test-domain-exit-dispose.js +++ b/test/parallel/test-domain-exit-dispose.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-domain-from-timer.js b/test/parallel/test-domain-from-timer.js index 3e73a5c4b89e1a..91dff3875cd7a2 100644 --- a/test/parallel/test-domain-from-timer.js +++ b/test/parallel/test-domain-from-timer.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Simple tests of most basic domain functionality. var common = require('../common'); diff --git a/test/parallel/test-domain-http-server.js b/test/parallel/test-domain-http-server.js index 57e8ac4d14a3f5..2c0574276c6fc7 100644 --- a/test/parallel/test-domain-http-server.js +++ b/test/parallel/test-domain-http-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var domain = require('domain'); var http = require('http'); var assert = require('assert'); diff --git a/test/parallel/test-domain-implicit-fs.js b/test/parallel/test-domain-implicit-fs.js index c701c931582bab..4a00b9a17ad5db 100644 --- a/test/parallel/test-domain-implicit-fs.js +++ b/test/parallel/test-domain-implicit-fs.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Simple tests of most basic domain functionality. var common = require('../common'); diff --git a/test/parallel/test-domain-multi.js b/test/parallel/test-domain-multi.js index 68e4b11a64741d..270ecde4962241 100644 --- a/test/parallel/test-domain-multi.js +++ b/test/parallel/test-domain-multi.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Tests of multiple domains happening at once. var common = require('../common'); diff --git a/test/parallel/test-domain-nested-throw.js b/test/parallel/test-domain-nested-throw.js index e1194866753245..87039bb3f939ce 100644 --- a/test/parallel/test-domain-nested-throw.js +++ b/test/parallel/test-domain-nested-throw.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-domain-nested.js b/test/parallel/test-domain-nested.js index efd672b25f9447..9334c287baedc1 100644 --- a/test/parallel/test-domain-nested.js +++ b/test/parallel/test-domain-nested.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Make sure that the nested domains don't cause the domain stack to grow var assert = require('assert'); diff --git a/test/parallel/test-domain-safe-exit.js b/test/parallel/test-domain-safe-exit.js index a7dcef078ba2e2..029687411a09b9 100644 --- a/test/parallel/test-domain-safe-exit.js +++ b/test/parallel/test-domain-safe-exit.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Make sure the domain stack doesn't get clobbered by un-matched .exit() var assert = require('assert'); diff --git a/test/parallel/test-domain-stack.js b/test/parallel/test-domain-stack.js index eecb85b4bbba63..be611a872117ff 100644 --- a/test/parallel/test-domain-stack.js +++ b/test/parallel/test-domain-stack.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Make sure that the domain stack doesn't get out of hand. var common = require('../common'); diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index 388673c0880a27..8c11d7edc5afbe 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var domain = require('domain'); var assert = require('assert'); var common = require('../common.js'); diff --git a/test/parallel/test-domain.js b/test/parallel/test-domain.js index 41eb602e424ddb..a3af1ff15a4cdf 100644 --- a/test/parallel/test-domain.js +++ b/test/parallel/test-domain.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // Simple tests of most basic domain functionality. var common = require('../common'); diff --git a/test/parallel/test-error-reporting.js b/test/parallel/test-error-reporting.js index c187998dd6f2f0..9caabe0d6160e2 100644 --- a/test/parallel/test-error-reporting.js +++ b/test/parallel/test-error-reporting.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-eval-require.js b/test/parallel/test-eval-require.js index dfef416ce9f8ce..eeaa624b396ab7 100644 --- a/test/parallel/test-eval-require.js +++ b/test/parallel/test-eval-require.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-eval.js b/test/parallel/test-eval.js index 9c656a8770b2cc..769c3a9b1985e5 100644 --- a/test/parallel/test-eval.js +++ b/test/parallel/test-eval.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - require('../common'); var util = require('util'); var assert = require('assert'); diff --git a/test/parallel/test-event-emitter-add-listeners.js b/test/parallel/test-event-emitter-add-listeners.js index 0806e049d48c8e..0a1c148b8f29f8 100644 --- a/test/parallel/test-event-emitter-add-listeners.js +++ b/test/parallel/test-event-emitter-add-listeners.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-check-listener-leaks.js b/test/parallel/test-event-emitter-check-listener-leaks.js index d073e5de13b77b..25e53d2c6a188f 100644 --- a/test/parallel/test-event-emitter-check-listener-leaks.js +++ b/test/parallel/test-event-emitter-check-listener-leaks.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-listeners-side-effects.js b/test/parallel/test-event-emitter-listeners-side-effects.js index c6218e0598a095..46eedf812d2b0e 100644 --- a/test/parallel/test-event-emitter-listeners-side-effects.js +++ b/test/parallel/test-event-emitter-listeners-side-effects.js @@ -1,23 +1,3 @@ - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); diff --git a/test/parallel/test-event-emitter-listeners.js b/test/parallel/test-event-emitter-listeners.js index 3e622835b850dd..6baad62968f549 100644 --- a/test/parallel/test-event-emitter-listeners.js +++ b/test/parallel/test-event-emitter-listeners.js @@ -1,23 +1,3 @@ - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); diff --git a/test/parallel/test-event-emitter-max-listeners.js b/test/parallel/test-event-emitter-max-listeners.js index dfc3e1352d0e55..cea5fbf022ea2c 100644 --- a/test/parallel/test-event-emitter-max-listeners.js +++ b/test/parallel/test-event-emitter-max-listeners.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-method-names.js b/test/parallel/test-event-emitter-method-names.js index 60d16b3977d4bd..27061df4e4a66d 100644 --- a/test/parallel/test-event-emitter-method-names.js +++ b/test/parallel/test-event-emitter-method-names.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-modify-in-emit.js b/test/parallel/test-event-emitter-modify-in-emit.js index 738af098cd45df..3b05a88a3e00a6 100644 --- a/test/parallel/test-event-emitter-modify-in-emit.js +++ b/test/parallel/test-event-emitter-modify-in-emit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-no-error-provided-to-error-event.js b/test/parallel/test-event-emitter-no-error-provided-to-error-event.js index 79f14904e0ab01..5c50c32d489b24 100644 --- a/test/parallel/test-event-emitter-no-error-provided-to-error-event.js +++ b/test/parallel/test-event-emitter-no-error-provided-to-error-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-num-args.js b/test/parallel/test-event-emitter-num-args.js index 037c56965b9d96..20c003f3303a35 100644 --- a/test/parallel/test-event-emitter-num-args.js +++ b/test/parallel/test-event-emitter-num-args.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-once.js b/test/parallel/test-event-emitter-once.js index 2eaebcc7a5e47f..c5cd007ea265da 100644 --- a/test/parallel/test-event-emitter-once.js +++ b/test/parallel/test-event-emitter-once.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-remove-all-listeners.js b/test/parallel/test-event-emitter-remove-all-listeners.js index f9848d682314d3..1c359ce5c262b4 100644 --- a/test/parallel/test-event-emitter-remove-all-listeners.js +++ b/test/parallel/test-event-emitter-remove-all-listeners.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-remove-listeners.js b/test/parallel/test-event-emitter-remove-listeners.js index 78133a4f34dbaf..fd699662cae052 100644 --- a/test/parallel/test-event-emitter-remove-listeners.js +++ b/test/parallel/test-event-emitter-remove-listeners.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-set-max-listeners-side-effects.js b/test/parallel/test-event-emitter-set-max-listeners-side-effects.js index 604129796eaf85..d4842c395ee062 100644 --- a/test/parallel/test-event-emitter-set-max-listeners-side-effects.js +++ b/test/parallel/test-event-emitter-set-max-listeners-side-effects.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var events = require('events'); diff --git a/test/parallel/test-event-emitter-subclass.js b/test/parallel/test-event-emitter-subclass.js index 60b4bf387d697c..d4be78481238ba 100644 --- a/test/parallel/test-event-emitter-subclass.js +++ b/test/parallel/test-event-emitter-subclass.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var EventEmitter = require('events').EventEmitter; diff --git a/test/parallel/test-exception-handler.js b/test/parallel/test-exception-handler.js index 38137b83405208..4a781a0a9cd074 100644 --- a/test/parallel/test-exception-handler.js +++ b/test/parallel/test-exception-handler.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-exception-handler2.js b/test/parallel/test-exception-handler2.js index 6b8afa909f2082..77f3eb1d5cfd77 100644 --- a/test/parallel/test-exception-handler2.js +++ b/test/parallel/test-exception-handler2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-exec-max-buffer.js b/test/parallel/test-exec-max-buffer.js index 3157fc73fa9f10..a5a24eabeae7cb 100644 --- a/test/parallel/test-exec-max-buffer.js +++ b/test/parallel/test-exec-max-buffer.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var exec = require('child_process').exec; var assert = require('assert'); diff --git a/test/parallel/test-file-read-noexist.js b/test/parallel/test-file-read-noexist.js index aa5e761b4f5688..ad8dd5dc664921 100644 --- a/test/parallel/test-file-read-noexist.js +++ b/test/parallel/test-file-read-noexist.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-file-write-stream.js b/test/parallel/test-file-write-stream.js index d4d146a84a8c1c..9f0d66a84f722e 100644 --- a/test/parallel/test-file-write-stream.js +++ b/test/parallel/test-file-write-stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 68361bb52b6528..049d7d25e1c029 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index 013946217bdb17..2acb7053042c87 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-append-file-sync.js b/test/parallel/test-fs-append-file-sync.js index 7bc6a0199fa8a9..72cfdf75e23b27 100644 --- a/test/parallel/test-fs-append-file-sync.js +++ b/test/parallel/test-fs-append-file-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var join = require('path').join; diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js index 450c8d3b9e82e9..ba2d34e5a1f0a6 100644 --- a/test/parallel/test-fs-append-file.js +++ b/test/parallel/test-fs-append-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js index 12fd820f3aa124..55056125da980d 100644 --- a/test/parallel/test-fs-chmod.js +++ b/test/parallel/test-fs-chmod.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-empty-readStream.js b/test/parallel/test-fs-empty-readStream.js index d181c219820aa8..bd6e1912977afc 100644 --- a/test/parallel/test-fs-empty-readStream.js +++ b/test/parallel/test-fs-empty-readStream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-error-messages.js b/test/parallel/test-fs-error-messages.js index 16b5dd92b3f9a9..4913ca255de7a8 100644 --- a/test/parallel/test-fs-error-messages.js +++ b/test/parallel/test-fs-error-messages.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-exists.js b/test/parallel/test-fs-exists.js index 377573056937a8..4eb14e1e3bc73f 100644 --- a/test/parallel/test-fs-exists.js +++ b/test/parallel/test-fs-exists.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js index e624ed7d65d382..50c010a49a5b1b 100644 --- a/test/parallel/test-fs-fsync.js +++ b/test/parallel/test-fs-fsync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-long-path.js b/test/parallel/test-fs-long-path.js index 67f042976e840a..ae8a5669f8193e 100644 --- a/test/parallel/test-fs-long-path.js +++ b/test/parallel/test-fs-long-path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var fs = require('fs'); var path = require('path'); diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 240bcd4bebc6be..b8a688adc4c736 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-null-bytes.js b/test/parallel/test-fs-null-bytes.js index 5dec223ba8758f..8499c03cfe8977 100644 --- a/test/parallel/test-fs-null-bytes.js +++ b/test/parallel/test-fs-null-bytes.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); @@ -28,6 +7,7 @@ function check(async, sync) { var argsSync = Array.prototype.slice.call(arguments, 2); var argsAsync = argsSync.concat(function(er) { assert(er && er.message.match(expected)); + assert.equal(er.code, 'ENOENT'); }); if (sync) diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index e1c6c3be99ee48..bf4619d19d4f33 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index e334de9895b9b4..ea099d2e14c89f 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var constants = require('constants'); var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-read-buffer.js b/test/parallel/test-fs-read-buffer.js index 96f700363a2741..0dc7a851da3c73 100644 --- a/test/parallel/test-fs-read-buffer.js +++ b/test/parallel/test-fs-read-buffer.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'), diff --git a/test/parallel/test-fs-read-file-sync-hostname.js b/test/parallel/test-fs-read-file-sync-hostname.js index 758e2aedd89759..a2c8ac5da7ce61 100644 --- a/test/parallel/test-fs-read-file-sync-hostname.js +++ b/test/parallel/test-fs-read-file-sync-hostname.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-read-file-sync.js b/test/parallel/test-fs-read-file-sync.js index 518d32cc18ffbf..cf6ab72dbf5b77 100644 --- a/test/parallel/test-fs-read-file-sync.js +++ b/test/parallel/test-fs-read-file-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-read-stream-err.js b/test/parallel/test-fs-read-stream-err.js index 54aa21799ea88f..a3d1457e610f7b 100644 --- a/test/parallel/test-fs-read-stream-err.js +++ b/test/parallel/test-fs-read-stream-err.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-read-stream-fd.js b/test/parallel/test-fs-read-stream-fd.js index 835ed97271dec4..f57499ca397660 100644 --- a/test/parallel/test-fs-read-stream-fd.js +++ b/test/parallel/test-fs-read-stream-fd.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var fs = require('fs'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-read-stream-resume.js b/test/parallel/test-fs-read-stream-resume.js index c3ace49e9ffcb6..c3c61c88cb1f64 100644 --- a/test/parallel/test-fs-read-stream-resume.js +++ b/test/parallel/test-fs-read-stream-resume.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 4d1eebb2c1785c..85032d49640cdd 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-read.js b/test/parallel/test-fs-read.js index 4a90f9091e7993..3182733d115251 100644 --- a/test/parallel/test-fs-read.js +++ b/test/parallel/test-fs-read.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'), diff --git a/test/parallel/test-fs-readfile-empty.js b/test/parallel/test-fs-readfile-empty.js index 31b83567ee444d..bf7da45fca93cc 100644 --- a/test/parallel/test-fs-readfile-empty.js +++ b/test/parallel/test-fs-readfile-empty.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-readfile-error.js b/test/parallel/test-fs-readfile-error.js index 72e1e2e7fb75e7..b8cf3e01757092 100644 --- a/test/parallel/test-fs-readfile-error.js +++ b/test/parallel/test-fs-readfile-error.js @@ -1,29 +1,15 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; var path = require('path'); +// `fs.readFile('/')` does not fail on FreeBSD, because you can open and read +// the directory there. +if (process.platform === 'freebsd') { + console.error('Skipping test, platform not supported.'); + process.exit(); +} + var callbacks = 0; function test(env, cb) { diff --git a/test/parallel/test-fs-readfile-pipe.js b/test/parallel/test-fs-readfile-pipe.js index 8ca165144ff601..da0cd2952fdb05 100644 --- a/test/parallel/test-fs-readfile-pipe.js +++ b/test/parallel/test-fs-readfile-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-readfile-unlink.js b/test/parallel/test-fs-readfile-unlink.js index 0bb4a67f781052..bdcf23380e4775 100644 --- a/test/parallel/test-fs-readfile-unlink.js +++ b/test/parallel/test-fs-readfile-unlink.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'), common = require('../common'), fs = require('fs'), diff --git a/test/parallel/test-fs-readfile-zero-byte-liar.js b/test/parallel/test-fs-readfile-zero-byte-liar.js index 60f41226f1bb17..c30ff9a1dd75e0 100644 --- a/test/parallel/test-fs-readfile-zero-byte-liar.js +++ b/test/parallel/test-fs-readfile-zero-byte-liar.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 9b02ae71737ff1..f8299d8d05662b 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-sir-writes-alot.js b/test/parallel/test-fs-sir-writes-alot.js index e16f56bdc82e52..9df95a77bdfedd 100644 --- a/test/parallel/test-fs-sir-writes-alot.js +++ b/test/parallel/test-fs-sir-writes-alot.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var fs = require('fs'); var assert = require('assert'); diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index 8c5a9c64c1534b..88a965974d05ce 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-stream-double-close.js b/test/parallel/test-fs-stream-double-close.js index 89386b6e6462b5..5d772da4aac887 100644 --- a/test/parallel/test-fs-stream-double-close.js +++ b/test/parallel/test-fs-stream-double-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-symlink-dir-junction-relative.js b/test/parallel/test-fs-symlink-dir-junction-relative.js index c598d2e9265a19..5e4ce38b916393 100644 --- a/test/parallel/test-fs-symlink-dir-junction-relative.js +++ b/test/parallel/test-fs-symlink-dir-junction-relative.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Test creating and resolving relative junction or symbolic link var common = require('../common'); diff --git a/test/parallel/test-fs-symlink-dir-junction.js b/test/parallel/test-fs-symlink-dir-junction.js index ed0bea49218076..27d3e5103d9124 100644 --- a/test/parallel/test-fs-symlink-dir-junction.js +++ b/test/parallel/test-fs-symlink-dir-junction.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-symlink.js b/test/parallel/test-fs-symlink.js index 6b23b1e1c1048c..533f22672da001 100644 --- a/test/parallel/test-fs-symlink.js +++ b/test/parallel/test-fs-symlink.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-sync-fd-leak.js b/test/parallel/test-fs-sync-fd-leak.js index fe932c7dfa0bda..ab851b1a16f333 100644 --- a/test/parallel/test-fs-sync-fd-leak.js +++ b/test/parallel/test-fs-sync-fd-leak.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-truncate-GH-6233.js b/test/parallel/test-fs-truncate-GH-6233.js index 472afdcab9c401..72dfa136916f87 100644 --- a/test/parallel/test-fs-truncate-GH-6233.js +++ b/test/parallel/test-fs-truncate-GH-6233.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-truncate.js b/test/parallel/test-fs-truncate.js index 09476b2ad8a1cd..7f1dcd0661e3f9 100644 --- a/test/parallel/test-fs-truncate.js +++ b/test/parallel/test-fs-truncate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index eae80238bc1469..e877b3dfdc56d5 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-fs-write-buffer.js b/test/parallel/test-fs-write-buffer.js index 46013bd87b6d08..7dfcc6cd355215 100644 --- a/test/parallel/test-fs-write-buffer.js +++ b/test/parallel/test-fs-write-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'), diff --git a/test/parallel/test-fs-write-file-buffer.js b/test/parallel/test-fs-write-file-buffer.js index dfe7cf5f3035c0..bdddba9524977e 100644 --- a/test/parallel/test-fs-write-file-buffer.js +++ b/test/parallel/test-fs-write-file-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var join = require('path').join; var util = require('util'); diff --git a/test/parallel/test-fs-write-file-sync.js b/test/parallel/test-fs-write-file-sync.js index 3e723425ac6aa7..343d179f2a6864 100644 --- a/test/parallel/test-fs-write-file-sync.js +++ b/test/parallel/test-fs-write-file-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-write-file.js b/test/parallel/test-fs-write-file.js index b70ea444cf4b31..4f43197fd6fb9f 100644 --- a/test/parallel/test-fs-write-file.js +++ b/test/parallel/test-fs-write-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-write-stream-change-open.js b/test/parallel/test-fs-write-stream-change-open.js index d025e8da35ae4d..ca02e3959cbbd0 100644 --- a/test/parallel/test-fs-write-stream-change-open.js +++ b/test/parallel/test-fs-write-stream-change-open.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-write-stream-end.js b/test/parallel/test-fs-write-stream-end.js index 7bbc5d68e0eebb..886df63660d15c 100644 --- a/test/parallel/test-fs-write-stream-end.js +++ b/test/parallel/test-fs-write-stream-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-write-stream-err.js b/test/parallel/test-fs-write-stream-err.js index 53ef4e34e8bee7..61d6df5d5fb57e 100644 --- a/test/parallel/test-fs-write-stream-err.js +++ b/test/parallel/test-fs-write-stream-err.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-fs-write-stream.js b/test/parallel/test-fs-write-stream.js index da75e26f8fd215..ef7822af48a365 100644 --- a/test/parallel/test-fs-write-stream.js +++ b/test/parallel/test-fs-write-stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-fs-write-sync.js b/test/parallel/test-fs-write-sync.js index c3dbfe3ba63587..59e2f90f92d6dc 100644 --- a/test/parallel/test-fs-write-sync.js +++ b/test/parallel/test-fs-write-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index 3d7a357a9a89fa..49b4ec53169137 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-global.js b/test/parallel/test-global.js index 4cc9799ba5d77d..a1ddc72f6290eb 100644 --- a/test/parallel/test-global.js +++ b/test/parallel/test-global.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-handle-wrap-close-abort.js b/test/parallel/test-handle-wrap-close-abort.js index 287c38b23a936c..c1179f72a13946 100644 --- a/test/parallel/test-handle-wrap-close-abort.js +++ b/test/parallel/test-handle-wrap-close-abort.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); process.on('uncaughtException', function() { }); diff --git a/test/parallel/test-http-1.0-keep-alive.js b/test/parallel/test-http-1.0-keep-alive.js index 851409d28bbffb..b67b48969c81e2 100644 --- a/test/parallel/test-http-1.0-keep-alive.js +++ b/test/parallel/test-http-1.0-keep-alive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-1.0.js b/test/parallel/test-http-1.0.js index f5f3aef0a6b05e..f1408d2f53412a 100644 --- a/test/parallel/test-http-1.0.js +++ b/test/parallel/test-http-1.0.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-304.js b/test/parallel/test-http-304.js index fcef21aee745f3..a2cc95e57db60d 100644 --- a/test/parallel/test-http-304.js +++ b/test/parallel/test-http-304.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-abort-before-end.js b/test/parallel/test-http-abort-before-end.js index 11e424fbe1a900..351ec86c2b8b95 100644 --- a/test/parallel/test-http-abort-before-end.js +++ b/test/parallel/test-http-abort-before-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'); var assert = require('assert'); diff --git a/test/parallel/test-http-abort-client.js b/test/parallel/test-http-abort-client.js index f15238af16013d..40cf64c2cb0559 100644 --- a/test/parallel/test-http-abort-client.js +++ b/test/parallel/test-http-abort-client.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'); var assert = require('assert'); diff --git a/test/parallel/test-http-abort-queued.js b/test/parallel/test-http-abort-queued.js index 6d83cd41cef5ad..1ef24acd509c1a 100644 --- a/test/parallel/test-http-abort-queued.js +++ b/test/parallel/test-http-abort-queued.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'), common = require('../common'), http = require('http'); diff --git a/test/parallel/test-http-after-connect.js b/test/parallel/test-http-after-connect.js index 08b2c14a60829a..bff9170a217b81 100644 --- a/test/parallel/test-http-after-connect.js +++ b/test/parallel/test-http-after-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index be90bc6771b509..a2fe54d1dc6848 100644 --- a/test/parallel/test-http-agent-destroyed-socket.js +++ b/test/parallel/test-http-agent-destroyed-socket.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent-false.js b/test/parallel/test-http-agent-false.js index d897ab603c0060..95c375ac37c7d3 100644 --- a/test/parallel/test-http-agent-false.js +++ b/test/parallel/test-http-agent-false.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index f56027a721ca51..7dfd6f789ed921 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent-no-protocol.js b/test/parallel/test-http-agent-no-protocol.js index fa224c5a7c12b4..1f910c33e53932 100644 --- a/test/parallel/test-http-agent-no-protocol.js +++ b/test/parallel/test-http-agent-no-protocol.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent-null.js b/test/parallel/test-http-agent-null.js index 3f49cec0c02381..397a5e0f4bbd72 100644 --- a/test/parallel/test-http-agent-null.js +++ b/test/parallel/test-http-agent-null.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-agent.js b/test/parallel/test-http-agent.js index fc66dc49f855e5..a485bc996ae2d8 100644 --- a/test/parallel/test-http-agent.js +++ b/test/parallel/test-http-agent.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-allow-req-after-204-res.js b/test/parallel/test-http-allow-req-after-204-res.js index 225ff299e9a299..e671bec029e159 100644 --- a/test/parallel/test-http-allow-req-after-204-res.js +++ b/test/parallel/test-http-allow-req-after-204-res.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'); var assert = require('assert'); diff --git a/test/parallel/test-http-bind-twice.js b/test/parallel/test-http-bind-twice.js index 59d69efaa21d9a..187f35ab879e4f 100644 --- a/test/parallel/test-http-bind-twice.js +++ b/test/parallel/test-http-bind-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-blank-header.js b/test/parallel/test-http-blank-header.js index bd9be86102c110..1fb1e0af96bec7 100644 --- a/test/parallel/test-http-blank-header.js +++ b/test/parallel/test-http-blank-header.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 2e650d9b2fa5b1..f55d36c770f277 100644 --- a/test/parallel/test-http-buffer-sanity.js +++ b/test/parallel/test-http-buffer-sanity.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-byteswritten.js b/test/parallel/test-http-byteswritten.js index dedc2399c22e77..00ba09143ec9c8 100644 --- a/test/parallel/test-http-byteswritten.js +++ b/test/parallel/test-http-byteswritten.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-http-chunked-304.js b/test/parallel/test-http-chunked-304.js index 24c5fa15109777..86e0b0d11d1dfd 100644 --- a/test/parallel/test-http-chunked-304.js +++ b/test/parallel/test-http-chunked-304.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-chunked.js b/test/parallel/test-http-chunked.js index c5def3de78db52..b666e051cc07b1 100644 --- a/test/parallel/test-http-chunked.js +++ b/test/parallel/test-http-chunked.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-abort.js b/test/parallel/test-http-client-abort.js index ae0ee2769cec7f..1359df5a6c4b3d 100644 --- a/test/parallel/test-http-client-abort.js +++ b/test/parallel/test-http-client-abort.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-abort2.js b/test/parallel/test-http-client-abort2.js index 17efb7e086f87e..c7c19acccf3ea5 100644 --- a/test/parallel/test-http-client-abort2.js +++ b/test/parallel/test-http-client-abort2.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-agent.js b/test/parallel/test-http-client-agent.js index 49ff77fc9e9cfd..e97a14720f4a0f 100644 --- a/test/parallel/test-http-client-agent.js +++ b/test/parallel/test-http-client-agent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js index 24470b95da1383..85ef2ac9f5758b 100644 --- a/test/parallel/test-http-client-default-headers-exist.js +++ b/test/parallel/test-http-client-default-headers-exist.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-encoding.js b/test/parallel/test-http-client-encoding.js index 104bf28e2e4575..a93b33620fe934 100644 --- a/test/parallel/test-http-client-encoding.js +++ b/test/parallel/test-http-client-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-client-get-url.js b/test/parallel/test-http-client-get-url.js index 451f5eeaa9b7a6..03fa3331e95160 100644 --- a/test/parallel/test-http-client-get-url.js +++ b/test/parallel/test-http-client-get-url.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-parse-error.js b/test/parallel/test-http-client-parse-error.js index 9896ca2251fbd4..38f2628741dd93 100644 --- a/test/parallel/test-http-client-parse-error.js +++ b/test/parallel/test-http-client-parse-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-client-pipe-end.js b/test/parallel/test-http-client-pipe-end.js index 51edebbe1a786a..6f05d3093123b5 100644 --- a/test/parallel/test-http-client-pipe-end.js +++ b/test/parallel/test-http-client-pipe-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // see https://github.com/joyent/node/issues/3257 var common = require('../common'); diff --git a/test/parallel/test-http-client-race-2.js b/test/parallel/test-http-client-race-2.js index 6b7c508c3d9c32..fabb2c50a86984 100644 --- a/test/parallel/test-http-client-race-2.js +++ b/test/parallel/test-http-client-race-2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-race.js b/test/parallel/test-http-client-race.js index 0f50c8e841044e..c284fbae773e68 100644 --- a/test/parallel/test-http-client-race.js +++ b/test/parallel/test-http-client-race.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-readable.js b/test/parallel/test-http-client-readable.js index 2b5f67562d9c9e..e690ba7ba5afc8 100644 --- a/test/parallel/test-http-client-readable.js +++ b/test/parallel/test-http-client-readable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-response-domain.js b/test/parallel/test-http-client-response-domain.js index e5a39913f410f1..1c38a1a254eaf4 100644 --- a/test/parallel/test-http-client-response-domain.js +++ b/test/parallel/test-http-client-response-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), http = require('http'), diff --git a/test/parallel/test-http-client-timeout-agent.js b/test/parallel/test-http-client-timeout-agent.js index 79d0a24242436a..a928b12090e704 100644 --- a/test/parallel/test-http-client-timeout-agent.js +++ b/test/parallel/test-http-client-timeout-agent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index e3e37f6993f95e..c975d69d399745 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-timeout-with-data.js b/test/parallel/test-http-client-timeout-with-data.js index 4e1aae6ff86a0c..accf8c1341b86c 100644 --- a/test/parallel/test-http-client-timeout-with-data.js +++ b/test/parallel/test-http-client-timeout-with-data.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js index 98eb5539ebf2a1..8ea36de41ec4c1 100644 --- a/test/parallel/test-http-client-timeout.js +++ b/test/parallel/test-http-client-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-unescaped-path.js b/test/parallel/test-http-client-unescaped-path.js index 376bca19c462b3..51e1fc7828be86 100644 --- a/test/parallel/test-http-client-unescaped-path.js +++ b/test/parallel/test-http-client-unescaped-path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-upload-buf.js b/test/parallel/test-http-client-upload-buf.js index d607ea88bb69a2..5e544ccf518123 100644 --- a/test/parallel/test-http-client-upload-buf.js +++ b/test/parallel/test-http-client-upload-buf.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-client-upload.js b/test/parallel/test-http-client-upload.js index 912ca96084c645..44fd5eabf23ab4 100644 --- a/test/parallel/test-http-client-upload.js +++ b/test/parallel/test-http-client-upload.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-conn-reset.js b/test/parallel/test-http-conn-reset.js index 9c293721cf9604..d340aa744c494a 100644 --- a/test/parallel/test-http-conn-reset.js +++ b/test/parallel/test-http-conn-reset.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-connect.js b/test/parallel/test-http-connect.js index 3643cec18e9861..5ba24df5c18a9a 100644 --- a/test/parallel/test-http-connect.js +++ b/test/parallel/test-http-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-contentLength0.js b/test/parallel/test-http-contentLength0.js index c7f7b6b669ea6d..9b565c5470a246 100644 --- a/test/parallel/test-http-contentLength0.js +++ b/test/parallel/test-http-contentLength0.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'); diff --git a/test/parallel/test-http-createConnection.js b/test/parallel/test-http-createConnection.js index bc29d9aee4861f..1da2d18f414bf8 100644 --- a/test/parallel/test-http-createConnection.js +++ b/test/parallel/test-http-createConnection.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-curl-chunk-problem.js b/test/parallel/test-http-curl-chunk-problem.js index 70162463359471..58908fa2d2f9f5 100644 --- a/test/parallel/test-http-curl-chunk-problem.js +++ b/test/parallel/test-http-curl-chunk-problem.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-http-date-header.js b/test/parallel/test-http-date-header.js index b11507c0174f90..293a9b99291255 100644 --- a/test/parallel/test-http-date-header.js +++ b/test/parallel/test-http-date-header.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-default-encoding.js b/test/parallel/test-http-default-encoding.js index b06f7c83a20472..6a2ac36ebd4b90 100644 --- a/test/parallel/test-http-default-encoding.js +++ b/test/parallel/test-http-default-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js index ec79de2aeb4e4e..29ade45bb4496a 100644 --- a/test/parallel/test-http-default-port.js +++ b/test/parallel/test-http-default-port.js @@ -1,26 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - var common = require('../common'); var http = require('http'), https = require('https'), diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 3347f3ccc9abd2..dc5b129dc89c1e 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index fc6d6b89e11717..a016c9883e0067 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-end-throw-socket-handling.js b/test/parallel/test-http-end-throw-socket-handling.js index 50aa97ff18e2f4..a8566beac8cbd7 100644 --- a/test/parallel/test-http-end-throw-socket-handling.js +++ b/test/parallel/test-http-end-throw-socket-handling.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-eof-on-connect.js b/test/parallel/test-http-eof-on-connect.js index 95d6fdc950dd78..a08ac9c7b0e6c9 100644 --- a/test/parallel/test-http-eof-on-connect.js +++ b/test/parallel/test-http-eof-on-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-exceptions.js b/test/parallel/test-http-exceptions.js index 1501d944ae48c3..6e0b5b9a6b8166 100644 --- a/test/parallel/test-http-exceptions.js +++ b/test/parallel/test-http-exceptions.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-exit-delay.js b/test/parallel/test-http-exit-delay.js index 900f4fabd5e656..fce01b5c51390c 100644 --- a/test/parallel/test-http-exit-delay.js +++ b/test/parallel/test-http-exit-delay.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); var http = require('http'); diff --git a/test/parallel/test-http-expect-continue.js b/test/parallel/test-http-expect-continue.js index 54c04cce0ee1ee..ed6de310955383 100644 --- a/test/parallel/test-http-expect-continue.js +++ b/test/parallel/test-http-expect-continue.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-extra-response.js b/test/parallel/test-http-extra-response.js index 1649a6a9292861..ac2d9b6157c967 100644 --- a/test/parallel/test-http-extra-response.js +++ b/test/parallel/test-http-extra-response.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-flush.js b/test/parallel/test-http-flush.js index 842cf8729e030b..8d5a593cd9d21d 100644 --- a/test/parallel/test-http-flush.js +++ b/test/parallel/test-http-flush.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-full-response.js b/test/parallel/test-http-full-response.js index d33df8b883c609..4f3ce63dd85bed 100644 --- a/test/parallel/test-http-full-response.js +++ b/test/parallel/test-http-full-response.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); // This test requires the program 'ab' diff --git a/test/parallel/test-http-get-pipeline-problem.js b/test/parallel/test-http-get-pipeline-problem.js index 720ce4b89c857b..4d36cd3f7ea6f2 100644 --- a/test/parallel/test-http-get-pipeline-problem.js +++ b/test/parallel/test-http-get-pipeline-problem.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // We are demonstrating a problem with http.get when queueing up many // transfers. The server simply introduces some delay and sends a file. // Note this is demonstrated with connection: close. diff --git a/test/parallel/test-http-head-request.js b/test/parallel/test-http-head-request.js index ca0f13a1a28830..2310a6f83162f3 100644 --- a/test/parallel/test-http-head-request.js +++ b/test/parallel/test-http-head-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-head-response-has-no-body-end.js b/test/parallel/test-http-head-response-has-no-body-end.js index cde777a58d910d..4f0fb5341ef10e 100644 --- a/test/parallel/test-http-head-response-has-no-body-end.js +++ b/test/parallel/test-http-head-response-has-no-body-end.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-head-response-has-no-body.js b/test/parallel/test-http-head-response-has-no-body.js index ab6bd5b51fc9b9..73fcf0b31f368d 100644 --- a/test/parallel/test-http-head-response-has-no-body.js +++ b/test/parallel/test-http-head-response-has-no-body.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-header-read.js b/test/parallel/test-http-header-read.js index 3383775922444a..0cba3d37415617 100644 --- a/test/parallel/test-http-header-read.js +++ b/test/parallel/test-http-header-read.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-header-response-splitting.js b/test/parallel/test-http-header-response-splitting.js index 1d3a85ce8b5624..148de1d245b040 100644 --- a/test/parallel/test-http-header-response-splitting.js +++ b/test/parallel/test-http-header-response-splitting.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), http = require('http'); diff --git a/test/parallel/test-http-hex-write.js b/test/parallel/test-http-hex-write.js index 21a93df53e2e44..acce151b20af79 100644 --- a/test/parallel/test-http-hex-write.js +++ b/test/parallel/test-http-hex-write.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-host-headers.js b/test/parallel/test-http-host-headers.js index ca7f70947f8cf6..288fc03354cf5e 100644 --- a/test/parallel/test-http-host-headers.js +++ b/test/parallel/test-http-host-headers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var http = require('http'), https = require('https'), fs = require('fs'), diff --git a/test/parallel/test-http-incoming-pipelined-socket-destroy.js b/test/parallel/test-http-incoming-pipelined-socket-destroy.js index 3a2f531a75c6e8..26b704e6d5b5ba 100644 --- a/test/parallel/test-http-incoming-pipelined-socket-destroy.js +++ b/test/parallel/test-http-incoming-pipelined-socket-destroy.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-keep-alive-close-on-header.js b/test/parallel/test-http-keep-alive-close-on-header.js index 4318bd9706b97f..200f017a802d57 100644 --- a/test/parallel/test-http-keep-alive-close-on-header.js +++ b/test/parallel/test-http-keep-alive-close-on-header.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-keep-alive.js b/test/parallel/test-http-keep-alive.js index 75049c9c6fed97..58c7061059a90c 100644 --- a/test/parallel/test-http-keep-alive.js +++ b/test/parallel/test-http-keep-alive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-keepalive-client.js b/test/parallel/test-http-keepalive-client.js index 177a8ed7a9e8f1..6bc459e3b96fd0 100644 --- a/test/parallel/test-http-keepalive-client.js +++ b/test/parallel/test-http-keepalive-client.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-keepalive-maxsockets.js b/test/parallel/test-http-keepalive-maxsockets.js index 8481eec357c916..e0e27f5e240cfe 100644 --- a/test/parallel/test-http-keepalive-maxsockets.js +++ b/test/parallel/test-http-keepalive-maxsockets.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-keepalive-request.js b/test/parallel/test-http-keepalive-request.js index 3b87375408d2f7..51e9d66b1f739c 100644 --- a/test/parallel/test-http-keepalive-request.js +++ b/test/parallel/test-http-keepalive-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-legacy.js b/test/parallel/test-http-legacy.js index c6605b0e4e2f16..7a3ae3572519f6 100644 --- a/test/parallel/test-http-legacy.js +++ b/test/parallel/test-http-legacy.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-localaddress-bind-error.js b/test/parallel/test-http-localaddress-bind-error.js index 719525cc612273..9ee8c1d74f950e 100644 --- a/test/parallel/test-http-localaddress-bind-error.js +++ b/test/parallel/test-http-localaddress-bind-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-localaddress.js b/test/parallel/test-http-localaddress.js index d5778e09b059bf..3cd821315253c9 100644 --- a/test/parallel/test-http-localaddress.js +++ b/test/parallel/test-http-localaddress.js @@ -1,29 +1,8 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'), assert = require('assert'); -if (['linux', 'win32'].indexOf(process.platform) == -1) { +if (!common.hasMultiLocalhost()) { console.log('Skipping platform-specific test.'); process.exit(); } diff --git a/test/parallel/test-http-malformed-request.js b/test/parallel/test-http-malformed-request.js index 52165a21d607c8..26a0f340794cfc 100644 --- a/test/parallel/test-http-malformed-request.js +++ b/test/parallel/test-http-malformed-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-many-ended-pipelines.js b/test/parallel/test-http-many-ended-pipelines.js index dffde722f2acf9..6824627151e741 100644 --- a/test/parallel/test-http-many-ended-pipelines.js +++ b/test/parallel/test-http-many-ended-pipelines.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-max-headers-count.js b/test/parallel/test-http-max-headers-count.js index 4595b11e7c80ac..ed9b34297b5f39 100644 --- a/test/parallel/test-http-max-headers-count.js +++ b/test/parallel/test-http-max-headers-count.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-methods.js b/test/parallel/test-http-methods.js index eec66d28045343..620db49434cdc2 100644 --- a/test/parallel/test-http-methods.js +++ b/test/parallel/test-http-methods.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-multi-line-headers.js b/test/parallel/test-http-multi-line-headers.js index 9415abadcb70cb..44d696a5a0c1d6 100644 --- a/test/parallel/test-http-multi-line-headers.js +++ b/test/parallel/test-http-multi-line-headers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js index 6106ac6ee00439..296b1622a03394 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-no-content-length.js b/test/parallel/test-http-no-content-length.js index 8c565aedc7ca82..527ffb7d37b4e4 100644 --- a/test/parallel/test-http-no-content-length.js +++ b/test/parallel/test-http-no-content-length.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-outgoing-finish.js b/test/parallel/test-http-outgoing-finish.js index 668040a812b2f9..e25f8ab743ff1e 100644 --- a/test/parallel/test-http-outgoing-finish.js +++ b/test/parallel/test-http-outgoing-finish.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-parser-free.js b/test/parallel/test-http-parser-free.js index 7b35781f4d3ed6..52df3836d790c0 100644 --- a/test/parallel/test-http-parser-free.js +++ b/test/parallel/test-http-parser-free.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-parser.js b/test/parallel/test-http-parser.js index c61dc991165319..d8c181bf60f7ce 100644 --- a/test/parallel/test-http-parser.js +++ b/test/parallel/test-http-parser.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); @@ -97,15 +76,17 @@ function expectBody(expected) { 'GET /hello HTTP/1.1' + CRLF + CRLF); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('GET')); - assert.equal(info.url || parser.url, '/hello'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + assert.equal(method, methods.indexOf('GET')); + assert.equal(url || parser.url, '/hello'); + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser.execute(request, 0, request.length); // @@ -136,21 +117,24 @@ function expectBody(expected) { CRLF + 'pong'); - var parser = newParser(RESPONSE); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, undefined); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - assert.equal(info.statusCode, 200); - assert.equal(info.statusMessage, "OK"); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, undefined); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + assert.equal(statusCode, 200); + assert.equal(statusMessage, 'OK'); + }; - parser[kOnBody] = mustCall(function(buf, start, len) { + var onBody = function(buf, start, len) { var body = '' + buf.slice(start, start + len); assert.equal(body, 'pong'); - }); + }; + var parser = newParser(RESPONSE); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); + parser[kOnBody] = mustCall(onBody); parser.execute(request, 0, request.length); })(); @@ -163,17 +147,19 @@ function expectBody(expected) { 'HTTP/1.0 200 Connection established' + CRLF + CRLF); - var parser = newParser(RESPONSE); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, undefined); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 0); - assert.equal(info.statusCode, 200); - assert.equal(info.statusMessage, "Connection established"); - assert.deepEqual(info.headers || parser.headers, []); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 0); + assert.equal(method, undefined); + assert.equal(statusCode, 200); + assert.equal(statusMessage, 'Connection established'); + assert.deepEqual(headers || parser.headers, []); + }; + var parser = newParser(RESPONSE); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser.execute(request, 0, request.length); })(); @@ -195,29 +181,31 @@ function expectBody(expected) { var seen_body = false; - function onHeaders(headers, url) { + var onHeaders = function(headers, url) { assert.ok(seen_body); // trailers should come after the body - assert.deepEqual(headers, - ['Vary', '*', 'Content-Type', 'text/plain']); - } - - var parser = newParser(REQUEST); + assert.deepEqual(headers, ['Vary', '*', 'Content-Type', 'text/plain']); + }; - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/it'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/it'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); // expect to see trailing headers now parser[kOnHeaders] = mustCall(onHeaders); - }); + }; - parser[kOnBody] = mustCall(function(buf, start, len) { + var onBody = function(buf, start, len) { var body = '' + buf.slice(start, start + len); assert.equal(body, 'ping'); seen_body = true; - }); + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); + parser[kOnBody] = mustCall(onBody); parser.execute(request, 0, request.length); })(); @@ -233,18 +221,19 @@ function expectBody(expected) { 'X-Filler2: 42' + CRLF + CRLF); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('GET')); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 0); - assert.deepEqual(info.headers || parser.headers, - ['X-Filler', '1337', - 'X-Filler', '42', - 'X-Filler2', '42']); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('GET')); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 0); + assert.deepEqual( + headers || parser.headers, + ['X-Filler', '1337', 'X-Filler', '42', 'X-Filler2', '42']); + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser.execute(request, 0, request.length); })(); @@ -262,23 +251,25 @@ function expectBody(expected) { lots_of_headers + CRLF); - var parser = newParser(REQUEST); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('GET')); + assert.equal(url || parser.url, '/foo/bar/baz?quux=42#1337'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 0); - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('GET')); - assert.equal(info.url || parser.url, '/foo/bar/baz?quux=42#1337'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 0); - - var headers = info.headers || parser.headers; + var headers = headers || parser.headers; assert.equal(headers.length, 2 * 256); // 256 key/value pairs for (var i = 0; i < headers.length; i += 2) { assert.equal(headers[i], 'X-Filler'); assert.equal(headers[i + 1], '42'); } - }); + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser.execute(request, 0, request.length); })(); @@ -294,20 +285,23 @@ function expectBody(expected) { CRLF + 'foo=42&bar=1337'); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/it'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/it'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + }; - parser[kOnBody] = mustCall(function(buf, start, len) { + var onBody = function(buf, start, len) { var body = '' + buf.slice(start, start + len); assert.equal(body, 'foo=42&bar=1337'); - }); + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); + parser[kOnBody] = mustCall(onBody); parser.execute(request, 0, request.length); })(); @@ -329,23 +323,25 @@ function expectBody(expected) { '1234567890' + CRLF + '0' + CRLF); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/it'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/it'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + }; var body_part = 0, body_parts = ['123', '123456', '1234567890']; - function onBody(buf, start, len) { + var onBody = function(buf, start, len) { var body = '' + buf.slice(start, start + len); assert.equal(body, body_parts[body_part++]); - } + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser[kOnBody] = mustCall(onBody, body_parts.length); parser.execute(request, 0, request.length); })(); @@ -365,25 +361,26 @@ function expectBody(expected) { '6' + CRLF + '123456' + CRLF); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/it'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/it'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + }; var body_part = 0, - body_parts = [ - '123', '123456', '123456789', - '123456789ABC', '123456789ABCDEF']; + body_parts = + ['123', '123456', '123456789', '123456789ABC', '123456789ABCDEF']; - function onBody(buf, start, len) { + var onBody = function(buf, start, len) { var body = '' + buf.slice(start, start + len); assert.equal(body, body_parts[body_part++]); - } + }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); parser[kOnBody] = mustCall(onBody, body_parts.length); parser.execute(request, 0, request.length); @@ -422,23 +419,26 @@ function expectBody(expected) { '0' + CRLF); function test(a, b) { - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/helpme'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, + method, url, statusCode, statusMessage, + upgrade, shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/helpme'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + }; var expected_body = '123123456123456789123456789ABC123456789ABCDEF'; - parser[kOnBody] = function(buf, start, len) { + var onBody = function(buf, start, len) { var chunk = '' + buf.slice(start, start + len); assert.equal(expected_body.indexOf(chunk), 0); expected_body = expected_body.slice(chunk.length); }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); + parser[kOnBody] = onBody; parser.execute(a, 0, a.length); parser.execute(b, 0, b.length); @@ -478,26 +478,30 @@ function expectBody(expected) { '123456789ABCDEF' + CRLF + '0' + CRLF); - var parser = newParser(REQUEST); - - parser[kOnHeadersComplete] = mustCall(function(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url || parser.url, '/it'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - assert.deepEqual(info.headers || parser.headers, - ['Content-Type', 'text/plain', - 'Transfer-Encoding', 'chunked']); - }); + var onHeadersComplete = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url || parser.url, '/it'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + assert.deepEqual( + headers || parser.headers, + ['Content-Type', 'text/plain', 'Transfer-Encoding', 'chunked']); + }; var expected_body = '123123456123456789123456789ABC123456789ABCDEF'; - parser[kOnBody] = function(buf, start, len) { + var onBody = function(buf, start, len) { var chunk = '' + buf.slice(start, start + len); assert.equal(expected_body.indexOf(chunk), 0); expected_body = expected_body.slice(chunk.length); }; + var parser = newParser(REQUEST); + parser[kOnHeadersComplete] = mustCall(onHeadersComplete); + parser[kOnBody] = onBody; + for (var i = 0; i < request.length; ++i) { parser.execute(request, i, 1); } @@ -526,24 +530,27 @@ function expectBody(expected) { CRLF + 'pong'); - function onHeadersComplete1(info) { - assert.equal(info.method, methods.indexOf('PUT')); - assert.equal(info.url, '/this'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 1); - assert.deepEqual(info.headers, - ['Content-Type', 'text/plain', - 'Transfer-Encoding', 'chunked']); + var onHeadersComplete1 = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('PUT')); + assert.equal(url, '/this'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 1); + assert.deepEqual( + headers, + ['Content-Type', 'text/plain', 'Transfer-Encoding', 'chunked']); }; - function onHeadersComplete2(info) { - assert.equal(info.method, methods.indexOf('POST')); - assert.equal(info.url, '/that'); - assert.equal(info.versionMajor, 1); - assert.equal(info.versionMinor, 0); - assert.deepEqual(info.headers, - ['Content-Type', 'text/plain', - 'Content-Length', '4']); + var onHeadersComplete2 = function(versionMajor, versionMinor, headers, method, + url, statusCode, statusMessage, upgrade, + shouldKeepAlive) { + assert.equal(method, methods.indexOf('POST')); + assert.equal(url, '/that'); + assert.equal(versionMajor, 1); + assert.equal(versionMinor, 0); + assert.deepEqual(headers, + ['Content-Type', 'text/plain', 'Content-Length', '4']); }; var parser = newParser(REQUEST); diff --git a/test/parallel/test-http-pause-resume-one-end.js b/test/parallel/test-http-pause-resume-one-end.js index f397452e98fb28..cc3e41f3e92c77 100644 --- a/test/parallel/test-http-pause-resume-one-end.js +++ b/test/parallel/test-http-pause-resume-one-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 0edf6d62215fcb..cf318d024f0656 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-pipe-fs.js b/test/parallel/test-http-pipe-fs.js index 57ebb11dca5b8d..76882d65650bfd 100644 --- a/test/parallel/test-http-pipe-fs.js +++ b/test/parallel/test-http-pipe-fs.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-proxy.js b/test/parallel/test-http-proxy.js index b531f1a8ab5a0c..8d27728a92ff34 100644 --- a/test/parallel/test-http-proxy.js +++ b/test/parallel/test-http-proxy.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-raw-headers.js b/test/parallel/test-http-raw-headers.js index 0d31d8f6131896..76447c65abca14 100644 --- a/test/parallel/test-http-raw-headers.js +++ b/test/parallel/test-http-raw-headers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-remove-header-stays-removed.js b/test/parallel/test-http-remove-header-stays-removed.js index a15c7750c50461..a9a5f04fc17790 100644 --- a/test/parallel/test-http-remove-header-stays-removed.js +++ b/test/parallel/test-http-remove-header-stays-removed.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-request-end-twice.js b/test/parallel/test-http-request-end-twice.js index aa587722264413..5518a8140cf463 100644 --- a/test/parallel/test-http-request-end-twice.js +++ b/test/parallel/test-http-request-end-twice.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-request-end.js b/test/parallel/test-http-request-end.js index f64dcc305adaa0..d06c96d8777f5d 100644 --- a/test/parallel/test-http-request-end.js +++ b/test/parallel/test-http-request-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-request-methods.js b/test/parallel/test-http-request-methods.js index 33575aed7e4ad7..d0b474d712e34d 100644 --- a/test/parallel/test-http-request-methods.js +++ b/test/parallel/test-http-request-methods.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 71a2564bfe46aa..295d38aacb0e79 100644 --- a/test/parallel/test-http-res-write-after-end.js +++ b/test/parallel/test-http-res-write-after-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-res-write-end-dont-take-array.js b/test/parallel/test-http-res-write-end-dont-take-array.js index d60b75552d05a5..a4dcfcac0f1e41 100644 --- a/test/parallel/test-http-res-write-end-dont-take-array.js +++ b/test/parallel/test-http-res-write-end-dont-take-array.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-response-close.js b/test/parallel/test-http-response-close.js index be89682a6893d0..1b3433d79ebe60 100644 --- a/test/parallel/test-http-response-close.js +++ b/test/parallel/test-http-response-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-response-no-headers.js b/test/parallel/test-http-response-no-headers.js index d16d8a4ce92f08..5d18b6182cd785 100644 --- a/test/parallel/test-http-response-no-headers.js +++ b/test/parallel/test-http-response-no-headers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-response-readable.js b/test/parallel/test-http-response-readable.js index b48c06fb4094b4..0774b8ed9c963f 100644 --- a/test/parallel/test-http-response-readable.js +++ b/test/parallel/test-http-response-readable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-response-status-message.js b/test/parallel/test-http-response-status-message.js index 3b3911010d352a..abbae8818bfecd 100644 --- a/test/parallel/test-http-response-status-message.js +++ b/test/parallel/test-http-response-status-message.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js index b287169bdab97d..ac5849d075ec40 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Verify that the HTTP server implementation handles multiple instances // of the same header as per RFC2616: joining the handful of fields by ', ' // that support it, and dropping duplicates for other fields. diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index 40674c0fc2e7eb..5a3b80c5cd8823 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Verify that the HTTP server implementation handles multiple instances // of the same header as per RFC2616: joining the handful of fields by ', ' // that support it, and dropping duplicates for other fields. diff --git a/test/parallel/test-http-server-stale-close.js b/test/parallel/test-http-server-stale-close.js index aa42a049bb8533..aa834b1fae3ef3 100644 --- a/test/parallel/test-http-server-stale-close.js +++ b/test/parallel/test-http-server-stale-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-server.js b/test/parallel/test-http-server.js index 7d97382d3e49c6..b96b57998a2cb6 100644 --- a/test/parallel/test-http-server.js +++ b/test/parallel/test-http-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-set-cookies.js b/test/parallel/test-http-set-cookies.js index bff34d82982c6f..1c03db01dba29e 100644 --- a/test/parallel/test-http-set-cookies.js +++ b/test/parallel/test-http-set-cookies.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-set-timeout-server.js b/test/parallel/test-http-set-timeout-server.js index ff4144963afcda..95a3124d14aa8b 100644 --- a/test/parallel/test-http-set-timeout-server.js +++ b/test/parallel/test-http-set-timeout-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-set-timeout.js b/test/parallel/test-http-set-timeout.js index 01d182b34c508b..1c547f06ee2200 100644 --- a/test/parallel/test-http-set-timeout.js +++ b/test/parallel/test-http-set-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js index 445a3eeaacc9ef..98001afb66448f 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js index 943c34bb439592..3c2d2530833305 100644 --- a/test/parallel/test-http-should-keep-alive.js +++ b/test/parallel/test-http-should-keep-alive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-status-code.js b/test/parallel/test-http-status-code.js index ca56230d264f18..e862ed6076b447 100644 --- a/test/parallel/test-http-status-code.js +++ b/test/parallel/test-http-status-code.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-status-message.js b/test/parallel/test-http-status-message.js index a8d7a351047e11..8d79d1a5affe4c 100644 --- a/test/parallel/test-http-status-message.js +++ b/test/parallel/test-http-status-message.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-timeout-overflow.js b/test/parallel/test-http-timeout-overflow.js index 3e62612b38ecfb..b4d64e459bfc12 100644 --- a/test/parallel/test-http-timeout-overflow.js +++ b/test/parallel/test-http-timeout-overflow.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-timeout.js b/test/parallel/test-http-timeout.js index ddd01c8a8f5857..80393837f3201d 100644 --- a/test/parallel/test-http-timeout.js +++ b/test/parallel/test-http-timeout.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-unix-socket.js b/test/parallel/test-http-unix-socket.js index 66d5403f677e7f..1c13dafd3b038b 100644 --- a/test/parallel/test-http-unix-socket.js +++ b/test/parallel/test-http-unix-socket.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-http-upgrade-agent.js b/test/parallel/test-http-upgrade-agent.js index 1077a983dcbcc4..b1655b7d0b41ae 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Verify that the 'upgrade' header causes an 'upgrade' event to be emitted to // the HTTP client. This test uses a raw TCP server to better control server // behavior. diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index 3bf5beccf5bdd9..14e0b9ca6a117d 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Verify that the 'upgrade' header causes an 'upgrade' event to be emitted to // the HTTP client. This test uses a raw TCP server to better control server // behavior. diff --git a/test/parallel/test-http-upgrade-client2.js b/test/parallel/test-http-upgrade-client2.js index fa39f2a572c452..d2b0f9c215b376 100644 --- a/test/parallel/test-http-upgrade-client2.js +++ b/test/parallel/test-http-upgrade-client2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-upgrade-server.js b/test/parallel/test-http-upgrade-server.js index b514eff3c9e530..84a8de9fed1b9a 100644 --- a/test/parallel/test-http-upgrade-server.js +++ b/test/parallel/test-http-upgrade-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-upgrade-server2.js b/test/parallel/test-http-upgrade-server2.js index e617d3b1c55fee..7af34c52719c4d 100644 --- a/test/parallel/test-http-upgrade-server2.js +++ b/test/parallel/test-http-upgrade-server2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-auth-with-header-in-request.js b/test/parallel/test-http-url.parse-auth-with-header-in-request.js index 5ac789068e68a2..9df0f5f6cda912 100644 --- a/test/parallel/test-http-url.parse-auth-with-header-in-request.js +++ b/test/parallel/test-http-url.parse-auth-with-header-in-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-auth.js b/test/parallel/test-http-url.parse-auth.js index 4c07d5ffccf5b7..7038efb552b031 100644 --- a/test/parallel/test-http-url.parse-auth.js +++ b/test/parallel/test-http-url.parse-auth.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-basic.js b/test/parallel/test-http-url.parse-basic.js index 8bf12b1c2dfae2..234082ad188b2a 100644 --- a/test/parallel/test-http-url.parse-basic.js +++ b/test/parallel/test-http-url.parse-basic.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index b83f0df9fcdf23..cda01be53a6aae 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var https = require('https'); diff --git a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js index 0f57126419d758..c8ae4ffeae97b2 100644 --- a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js +++ b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-path.js b/test/parallel/test-http-url.parse-path.js index 8ef09520c6e43a..2ff78755c1ed39 100644 --- a/test/parallel/test-http-url.parse-path.js +++ b/test/parallel/test-http-url.parse-path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-post.js b/test/parallel/test-http-url.parse-post.js index be93166d532c29..4cc3b3e04f83b0 100644 --- a/test/parallel/test-http-url.parse-post.js +++ b/test/parallel/test-http-url.parse-post.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-url.parse-search.js b/test/parallel/test-http-url.parse-search.js index 3b6727d0bf6320..96402e1cebfbcb 100644 --- a/test/parallel/test-http-url.parse-search.js +++ b/test/parallel/test-http-url.parse-search.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-wget.js b/test/parallel/test-http-wget.js index b6cf7d8be4f6da..b79cf84078e157 100644 --- a/test/parallel/test-http-wget.js +++ b/test/parallel/test-http-wget.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-http-write-callbacks.js b/test/parallel/test-http-write-callbacks.js index 3a740ae5ba04a2..a666e7ffe130a3 100644 --- a/test/parallel/test-http-write-callbacks.js +++ b/test/parallel/test-http-write-callbacks.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js index baf9c27f4b3352..e0ddbe3c22add4 100644 --- a/test/parallel/test-http-write-empty-string.js +++ b/test/parallel/test-http-write-empty-string.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http-write-head.js b/test/parallel/test-http-write-head.js index 88923ef27aca09..b0cab236780358 100644 --- a/test/parallel/test-http-write-head.js +++ b/test/parallel/test-http-write-head.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-http-zero-length-write.js b/test/parallel/test-http-zero-length-write.js index e68f947c32ccda..583b081a522873 100644 --- a/test/parallel/test-http-zero-length-write.js +++ b/test/parallel/test-http-zero-length-write.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js index fa388356d8395d..c1c55d2d525a34 100644 --- a/test/parallel/test-http.js +++ b/test/parallel/test-http.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js index 34fa15c737a1f7..92ceb4e23d0b25 100644 --- a/test/parallel/test-https-agent.js +++ b/test/parallel/test-https-agent.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-byteswritten.js b/test/parallel/test-https-byteswritten.js index 21c300efa7034b..02ccf2711344d8 100644 --- a/test/parallel/test-https-byteswritten.js +++ b/test/parallel/test-https-byteswritten.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js index a985d23e58efea..a379ab0784f037 100644 --- a/test/parallel/test-https-client-checkServerIdentity.js +++ b/test/parallel/test-https-client-checkServerIdentity.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index ae5613c1434b29..dc03ead2438d24 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index bf191da1d99997..bd086bc77fcdc7 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js index 0433afdd99b053..bb4e7369511639 100644 --- a/test/parallel/test-https-client-resume.js +++ b/test/parallel/test-https-client-resume.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Create an ssl server. First connection, validate that not resume. // Cache session and close connection. Use session on second connection. // ASSERT resumption. diff --git a/test/parallel/test-https-connecting-to-http.js b/test/parallel/test-https-connecting-to-http.js index 50bb2a8a3e25d6..584d8af2233661 100644 --- a/test/parallel/test-https-connecting-to-http.js +++ b/test/parallel/test-https-connecting-to-http.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // This tests the situation where you try to connect a https client // to an http server. You should get an error and exit. var common = require('../common'); diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index 5509a24744986f..60abd1441077be 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-eof-for-eom.js b/test/parallel/test-https-eof-for-eom.js index 7a465b865d4555..126fecc68514d3 100644 --- a/test/parallel/test-https-eof-for-eom.js +++ b/test/parallel/test-https-eof-for-eom.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // I hate HTTP. One way of terminating an HTTP response is to not send // a content-length header, not send a transfer-encoding: chunked header, // and simply terminate the TCP connection. That is identity diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index c9fc746e89e00f..f785b545203ebb 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-https-localaddress-bind-error.js b/test/parallel/test-https-localaddress-bind-error.js index 0c4f8da4c4da4a..6a8790b0775d3c 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var https = require('https'); diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js index f703d41aef1fcf..9eeebef95f4e3f 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -1,30 +1,9 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var https = require('https'), fs = require('fs'), assert = require('assert'); -if (['linux', 'win32'].indexOf(process.platform) == -1) { +if (!common.hasMultiLocalhost()) { console.log('Skipping platform-specific test.'); process.exit(); } diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 9da1ff8ee987ae..4f9b1da80d8967 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var https = require('https'); diff --git a/test/parallel/test-https-req-split.js b/test/parallel/test-https-req-split.js index db54d72377272b..2867b0b4d954f0 100644 --- a/test/parallel/test-https-req-split.js +++ b/test/parallel/test-https-req-split.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index e4dc1e3605560d..f33c85a2c2ebae 100644 --- a/test/parallel/test-https-set-timeout-server.js +++ b/test/parallel/test-https-set-timeout-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var https = require('https'); diff --git a/test/parallel/test-https-simple.js b/test/parallel/test-https-simple.js index 552450c3010e4b..d1f681ae46f0ad 100644 --- a/test/parallel/test-https-simple.js +++ b/test/parallel/test-https-simple.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 21b1118f7d4c55..3e30da0599f1f8 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index 9cd763f7ae3b40..e00cf90a0dc283 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js index 076a0ec26f311c..124395fa7ee7c3 100644 --- a/test/parallel/test-https-timeout-server-2.js +++ b/test/parallel/test-https-timeout-server-2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) process.exit(); var common = require('../common'); diff --git a/test/parallel/test-https-timeout-server.js b/test/parallel/test-https-timeout-server.js index 57d6c57b59c1d2..120075053402a4 100644 --- a/test/parallel/test-https-timeout-server.js +++ b/test/parallel/test-https-timeout-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) process.exit(); var common = require('../common'); diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js index 8b79204d461c8f..88b311f74a94ff 100644 --- a/test/parallel/test-https-timeout.js +++ b/test/parallel/test-https-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-https-truncate.js b/test/parallel/test-https-truncate.js index 889f9168248959..2dc69a260452a1 100644 --- a/test/parallel/test-https-truncate.js +++ b/test/parallel/test-https-truncate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js new file mode 100644 index 00000000000000..390155fc26e817 --- /dev/null +++ b/test/parallel/test-intl.js @@ -0,0 +1,82 @@ +var common = require('../common'); +var assert = require('assert'); + +// does node think that i18n was enabled? +var enablei18n = process.config.variables.v8_enable_i18n_support; +if (enablei18n === undefined) { + enablei18n = false; +} + +// is the Intl object present? +var haveIntl = (global.Intl != undefined); + +// Returns true if no specific locale ids were configured (i.e. "all") +// Else, returns true if loc is in the configured list +// Else, returns false +function haveLocale(loc) { + var locs = process.config.variables.icu_locales.split(','); + return locs.indexOf(loc) !== -1; +} + +if (!haveIntl) { + var erMsg = + '"Intl" object is NOT present but v8_enable_i18n_support is ' + + enablei18n; + assert.equal(enablei18n, false, erMsg); + console.log('Skipping Intl tests because Intl object not present.'); + +} else { + var erMsg = + '"Intl" object is present but v8_enable_i18n_support is ' + + enablei18n + + '. Is this test out of date?'; + assert.equal(enablei18n, true, erMsg); + + // Construct a new date at the beginning of Unix time + var date0 = new Date(0); + + // Use the GMT time zone + var GMT = 'Etc/GMT'; + + // Construct an English formatter. Should format to "Jan 70" + var dtf = + new Intl.DateTimeFormat(['en'], + {timeZone: GMT, month: 'short', year: '2-digit'}); + + // If list is specified and doesn't contain 'en' then return. + if (process.config.variables.icu_locales && !haveLocale('en')) { + console.log('Skipping detailed Intl tests because English is not listed ' + + 'as supported.'); + // Smoke test. Does it format anything, or fail? + console.log('Date(0) formatted to: ' + dtf.format(date0)); + return; + } + + // Check with toLocaleString + var localeString = dtf.format(date0); + assert.equal(localeString, 'Jan 70'); + + // Options to request GMT + var optsGMT = {timeZone: GMT}; + + // Test format + localeString = date0.toLocaleString(['en'], optsGMT); + assert.equal(localeString, '1/1/1970, 12:00:00 AM'); + + // number format + assert.equal(new Intl.NumberFormat(['en']).format(12345.67890), '12,345.679'); + + var collOpts = { sensitivity: 'base', ignorePunctuation: true }; + var coll = new Intl.Collator(['en'], collOpts); + + assert.equal(coll.compare('blackbird', 'black-bird'), 0, + 'ignore punctuation failed'); + assert.equal(coll.compare('blackbird', 'red-bird'), -1, + 'compare less failed'); + assert.equal(coll.compare('bluebird', 'blackbird'), 1, + 'compare greater failed'); + assert.equal(coll.compare('Bluebird', 'bluebird'), 0, + 'ignore case failed'); + assert.equal(coll.compare('\ufb03', 'ffi'), 0, + 'ffi ligature (contraction) failed'); +} diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index 0d6d7748aa1cf7..4b60a18161103c 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index dabc46cd313c7b..329eee5f818d48 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index 3d98abeacda629..a014fa1ee4a5a3 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js index 6c0f20ae436485..628ece68a32023 100644 --- a/test/parallel/test-listen-fd-ebadf.js +++ b/test/parallel/test-listen-fd-ebadf.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index 8f3454fbbd6334..39f15014a12851 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index 0df17420c97dd7..4c1b67c83a324f 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js index 2197bf9212e8ea..7e8b9a125038b4 100644 --- a/test/parallel/test-microtask-queue-integration-domain.js +++ b/test/parallel/test-microtask-queue-integration-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-microtask-queue-integration.js b/test/parallel/test-microtask-queue-integration.js index af01548477f682..3f68d736759f9e 100644 --- a/test/parallel/test-microtask-queue-integration.js +++ b/test/parallel/test-microtask-queue-integration.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-microtask-queue-run-domain.js b/test/parallel/test-microtask-queue-run-domain.js index 2b3b76315ef112..8627e90eff3518 100644 --- a/test/parallel/test-microtask-queue-run-domain.js +++ b/test/parallel/test-microtask-queue-run-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-microtask-queue-run-immediate-domain.js b/test/parallel/test-microtask-queue-run-immediate-domain.js index 8f95fadd586fb4..aa58b7fcb14710 100644 --- a/test/parallel/test-microtask-queue-run-immediate-domain.js +++ b/test/parallel/test-microtask-queue-run-immediate-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var domain = require('domain'); diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index b5423eb6b4f8e4..fbce91e5179406 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index c4138454f54c19..73ba76efc49e0c 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-module-globalpaths-nodepath.js b/test/parallel/test-module-globalpaths-nodepath.js index c99b6763b4eab0..d0261e81f7a802 100644 --- a/test/parallel/test-module-globalpaths-nodepath.js +++ b/test/parallel/test-module-globalpaths-nodepath.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index beddb5d37b9640..23eac7da6fbeeb 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-module-nodemodulepaths.js b/test/parallel/test-module-nodemodulepaths.js index 3d48d99ab94b72..e5e07dd40e3423 100644 --- a/test/parallel/test-module-nodemodulepaths.js +++ b/test/parallel/test-module-nodemodulepaths.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-after-close.js b/test/parallel/test-net-after-close.js index 2f3d4c37976a1a..99b213e0870238 100644 --- a/test/parallel/test-net-after-close.js +++ b/test/parallel/test-net-after-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-binary.js b/test/parallel/test-net-binary.js index 31004658464187..ae1a82ae8976bd 100644 --- a/test/parallel/test-net-binary.js +++ b/test/parallel/test-net-binary.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-bind-twice.js b/test/parallel/test-net-bind-twice.js index 58086cc9669f20..ca75fb16fed9e9 100644 --- a/test/parallel/test-net-bind-twice.js +++ b/test/parallel/test-net-bind-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-buffersize.js b/test/parallel/test-net-buffersize.js index 5759503a134e2d..e8618beb7ac627 100644 --- a/test/parallel/test-net-buffersize.js +++ b/test/parallel/test-net-buffersize.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-bytes-stats.js b/test/parallel/test-net-bytes-stats.js index 0cb08009ee4e7d..562e9b422c69c8 100644 --- a/test/parallel/test-net-bytes-stats.js +++ b/test/parallel/test-net-bytes-stats.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-can-reset-timeout.js b/test/parallel/test-net-can-reset-timeout.js index b9ea97efe80bb8..3febac8a3034f6 100644 --- a/test/parallel/test-net-can-reset-timeout.js +++ b/test/parallel/test-net-can-reset-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var net = require('net'); var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-connect-buffer.js b/test/parallel/test-net-connect-buffer.js index 679e18e9072030..74697932b0988b 100644 --- a/test/parallel/test-net-connect-buffer.js +++ b/test/parallel/test-net-connect-buffer.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-connect-handle-econnrefused.js b/test/parallel/test-net-connect-handle-econnrefused.js index e890b6a8d49e32..77849b9b577261 100644 --- a/test/parallel/test-net-connect-handle-econnrefused.js +++ b/test/parallel/test-net-connect-handle-econnrefused.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var net = require('net'); var assert = require('assert'); diff --git a/test/parallel/test-net-connect-immediate-finish.js b/test/parallel/test-net-connect-immediate-finish.js index ac2a61331d1914..1fc908be1fba21 100644 --- a/test/parallel/test-net-connect-immediate-finish.js +++ b/test/parallel/test-net-connect-immediate-finish.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-connect-options-ipv6.js b/test/parallel/test-net-connect-options-ipv6.js index 9dd60c1cbd0739..35af5124a46cd6 100644 --- a/test/parallel/test-net-connect-options-ipv6.js +++ b/test/parallel/test-net-connect-options-ipv6.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-connect-options.js b/test/parallel/test-net-connect-options.js index 6be3696dae721a..fba35eab1c7b68 100644 --- a/test/parallel/test-net-connect-options.js +++ b/test/parallel/test-net-connect-options.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-connect-paused-connection.js b/test/parallel/test-net-connect-paused-connection.js index 9d9db1040af0b5..06e51f843fefad 100644 --- a/test/parallel/test-net-connect-paused-connection.js +++ b/test/parallel/test-net-connect-paused-connection.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: - -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/parallel/test-net-create-connection.js b/test/parallel/test-net-create-connection.js index 12f7f0be6d7813..5b84e3513381d9 100644 --- a/test/parallel/test-net-create-connection.js +++ b/test/parallel/test-net-create-connection.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-dns-error.js b/test/parallel/test-net-dns-error.js index f7221389a24970..18f6fe259b75ec 100644 --- a/test/parallel/test-net-dns-error.js +++ b/test/parallel/test-net-dns-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-dns-lookup.js b/test/parallel/test-net-dns-lookup.js index 5628e4d8a3b19f..e7c058fe144a56 100644 --- a/test/parallel/test-net-dns-lookup.js +++ b/test/parallel/test-net-dns-lookup.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-during-close.js b/test/parallel/test-net-during-close.js index 489d77479dbe07..b2f139cfa0a1f8 100644 --- a/test/parallel/test-net-during-close.js +++ b/test/parallel/test-net-during-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-eaddrinuse.js b/test/parallel/test-net-eaddrinuse.js index 2192ea22420e34..209e4909c49728 100644 --- a/test/parallel/test-net-eaddrinuse.js +++ b/test/parallel/test-net-eaddrinuse.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-end-without-connect.js b/test/parallel/test-net-end-without-connect.js index 156071a0d124f6..6ccf2b028082d2 100644 --- a/test/parallel/test-net-end-without-connect.js +++ b/test/parallel/test-net-end-without-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'); diff --git a/test/parallel/test-net-error-twice.js b/test/parallel/test-net-error-twice.js index 955eea6c09e168..1620bb8ee55fa1 100644 --- a/test/parallel/test-net-error-twice.js +++ b/test/parallel/test-net-error-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index 0d324007f22138..1947810b82deb8 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-keepalive.js b/test/parallel/test-net-keepalive.js index b09d9d5d68f9e7..f5299c9eb34c0e 100644 --- a/test/parallel/test-net-keepalive.js +++ b/test/parallel/test-net-keepalive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-large-string.js b/test/parallel/test-net-large-string.js index 877dc7c780e3cb..318f25a1c9a1e2 100644 --- a/test/parallel/test-net-large-string.js +++ b/test/parallel/test-net-large-string.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-listen-close-server.js b/test/parallel/test-net-listen-close-server.js index 4a3233a8f76c0a..e3a73e6ae5cb60 100644 --- a/test/parallel/test-net-listen-close-server.js +++ b/test/parallel/test-net-listen-close-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-listen-error.js b/test/parallel/test-net-listen-error.js index 17ec762cafe14d..0ed2421fdfbca9 100644 --- a/test/parallel/test-net-listen-error.js +++ b/test/parallel/test-net-listen-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-listen-fd0.js b/test/parallel/test-net-listen-fd0.js index ac5896ee8f990f..7cfd49dbdd3d27 100644 --- a/test/parallel/test-net-listen-fd0.js +++ b/test/parallel/test-net-listen-fd0.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-listen-shared-ports.js b/test/parallel/test-net-listen-shared-ports.js index 7422e491fc6b8e..3139dc7ac29365 100644 --- a/test/parallel/test-net-listen-shared-ports.js +++ b/test/parallel/test-net-listen-shared-ports.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/parallel/test-net-local-address-port.js b/test/parallel/test-net-local-address-port.js index 0f59cec9b6fa97..2669e10df7cec1 100644 --- a/test/parallel/test-net-local-address-port.js +++ b/test/parallel/test-net-local-address-port.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-localerror.js b/test/parallel/test-net-localerror.js index c4d04aa921acc2..dbca6260519078 100644 --- a/test/parallel/test-net-localerror.js +++ b/test/parallel/test-net-localerror.js @@ -1,61 +1,31 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); -var server = net.createServer(function(socket) { - assert.ok(false, 'no clients should connect'); -}).listen(common.PORT).on('listening', function() { - server.unref(); + connect({ + host: 'localhost', + port: common.PORT, + localPort: 'foobar', + }, 'localPort should be a number: foobar'); - function test1(next) { - connect({ - host: '127.0.0.1', - port: common.PORT, - localPort: 'foobar', - }, - 'localPort should be a number: foobar', - next); - } + connect({ + host: 'localhost', + port: common.PORT, + localAddress: 'foobar', + }, 'localAddress should be a valid IP: foobar'); - function test2(next) { - connect({ - host: '127.0.0.1', - port: common.PORT, - localAddress: 'foobar', - }, - 'localAddress should be a valid IP: foobar', - next) - } + connect({ + host: 'localhost', + port: 65536 + }, 'port should be > 0 and < 65536: 65536'); - test1(test2); -}) + connect({ + host: 'localhost', + port: 0 + }, 'port should be > 0 and < 65536: 0'); -function connect(opts, msg, cb) { - var client = net.connect(opts).on('connect', function() { - assert.ok(false, 'we should never connect'); - }).on('error', function(err) { - assert.strictEqual(err.message, msg); - if (cb) cb(); - }); +function connect(opts, msg) { + assert.throws(function() { + var client = net.connect(opts); + }, msg); } diff --git a/test/parallel/test-net-pause-resume-connecting.js b/test/parallel/test-net-pause-resume-connecting.js index 264dc96801b619..b692f3508529e1 100644 --- a/test/parallel/test-net-pause-resume-connecting.js +++ b/test/parallel/test-net-pause-resume-connecting.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), net = require('net'); diff --git a/test/parallel/test-net-pingpong.js b/test/parallel/test-net-pingpong.js index ff7c97a03e5a03..7a05591caf969b 100644 --- a/test/parallel/test-net-pingpong.js +++ b/test/parallel/test-net-pingpong.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js index 07dd4fe4a2bb75..5150c6de819787 100644 --- a/test/parallel/test-net-pipe-connect-errors.js +++ b/test/parallel/test-net-pipe-connect-errors.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var fs = require('fs'); var net = require('net'); var path = require('path'); diff --git a/test/parallel/test-net-reconnect-error.js b/test/parallel/test-net-reconnect-error.js index 6094e943ca5fa9..541a481fe12705 100644 --- a/test/parallel/test-net-reconnect-error.js +++ b/test/parallel/test-net-reconnect-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'); var assert = require('assert'); diff --git a/test/parallel/test-net-reconnect.js b/test/parallel/test-net-reconnect.js index ffc2a73c6313b1..d65efac998102b 100644 --- a/test/parallel/test-net-reconnect.js +++ b/test/parallel/test-net-reconnect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index 0cfe47afe6cfc5..7be95ed15cc501 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-server-close.js b/test/parallel/test-net-server-close.js index afa83f10d6aaca..4101baf166b555 100644 --- a/test/parallel/test-net-server-close.js +++ b/test/parallel/test-net-server-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-server-connections.js b/test/parallel/test-net-server-connections.js index 423fcb8e382be9..76e9c2af1cc97f 100644 --- a/test/parallel/test-net-server-connections.js +++ b/test/parallel/test-net-server-connections.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-server-listen-remove-callback.js b/test/parallel/test-net-server-listen-remove-callback.js index e10231de8cde6c..d9a5a8bdec4934 100644 --- a/test/parallel/test-net-server-listen-remove-callback.js +++ b/test/parallel/test-net-server-listen-remove-callback.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-server-max-connections.js b/test/parallel/test-net-server-max-connections.js index 43bc2fee17ec4a..ea89bd9d9b04a9 100644 --- a/test/parallel/test-net-server-max-connections.js +++ b/test/parallel/test-net-server-max-connections.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-server-pause-on-connect.js b/test/parallel/test-net-server-pause-on-connect.js index 3a8255e8f77f4c..0f47565f0098d0 100644 --- a/test/parallel/test-net-server-pause-on-connect.js +++ b/test/parallel/test-net-server-pause-on-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-server-try-ports.js b/test/parallel/test-net-server-try-ports.js index 5eca9d0957d57b..698cbcfa23e7c6 100644 --- a/test/parallel/test-net-server-try-ports.js +++ b/test/parallel/test-net-server-try-ports.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This tests binds to one port, then attempts to start a server on that // port. It should be EADDRINUSE but be able to then bind to another port. var common = require('../common'); diff --git a/test/parallel/test-net-server-unref.js b/test/parallel/test-net-server-unref.js index f7f994babba40b..2365864d6b41f3 100644 --- a/test/parallel/test-net-server-unref.js +++ b/test/parallel/test-net-server-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-settimeout.js b/test/parallel/test-net-settimeout.js index da13385b94e314..3bf26974576f2b 100644 --- a/test/parallel/test-net-settimeout.js +++ b/test/parallel/test-net-settimeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This example sets a timeout then immediately attempts to disable the timeout // https://github.com/joyent/node/pull/2245 diff --git a/test/parallel/test-net-socket-destroy-twice.js b/test/parallel/test-net-socket-destroy-twice.js index 882e3a14ce9a33..2782048bd521c7 100644 --- a/test/parallel/test-net-socket-destroy-twice.js +++ b/test/parallel/test-net-socket-destroy-twice.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-socket-timeout-unref.js b/test/parallel/test-net-socket-timeout-unref.js index 32aef444a9b0cc..16bdcecaf17e78 100644 --- a/test/parallel/test-net-socket-timeout-unref.js +++ b/test/parallel/test-net-socket-timeout-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js index 2256d6813aab2f..c4d84fa177f51b 100644 --- a/test/parallel/test-net-socket-timeout.js +++ b/test/parallel/test-net-socket-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'); var assert = require('assert'); diff --git a/test/parallel/test-net-stream.js b/test/parallel/test-net-stream.js index 9f2db51be82b64..8f7efd45f6d18d 100644 --- a/test/parallel/test-net-stream.js +++ b/test/parallel/test-net-stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-net-write-after-close.js b/test/parallel/test-net-write-after-close.js index 3b98bbc42eac89..aaec89874674f3 100644 --- a/test/parallel/test-net-write-after-close.js +++ b/test/parallel/test-net-write-after-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-write-connect-write.js b/test/parallel/test-net-write-connect-write.js index cb65af8a808601..fbf6b51e6a1f5c 100644 --- a/test/parallel/test-net-write-connect-write.js +++ b/test/parallel/test-net-write-connect-write.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-write-slow.js b/test/parallel/test-net-write-slow.js index 468c311c5c844a..0b1cf4f5b2c9a5 100644 --- a/test/parallel/test-net-write-slow.js +++ b/test/parallel/test-net-write-slow.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-next-tick-doesnt-hang.js b/test/parallel/test-next-tick-doesnt-hang.js index 3d26bd3c6b0da1..7364b2f974d128 100644 --- a/test/parallel/test-next-tick-doesnt-hang.js +++ b/test/parallel/test-next-tick-doesnt-hang.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - /* * This test verifies that having a single nextTick statement and nothing else * does not hang the event loop. If this test times out it has failed. diff --git a/test/parallel/test-next-tick-domain.js b/test/parallel/test-next-tick-domain.js index 16f77ed94d5309..b07d741f65264f 100644 --- a/test/parallel/test-next-tick-domain.js +++ b/test/parallel/test-next-tick-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index bf3c2e3065fa6f..c2e635d5c5bd5c 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-next-tick-intentional-starvation.js b/test/parallel/test-next-tick-intentional-starvation.js index 1a76b27e44e4d9..5c8b414dcfead9 100644 --- a/test/parallel/test-next-tick-intentional-starvation.js +++ b/test/parallel/test-next-tick-intentional-starvation.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-next-tick-ordering.js b/test/parallel/test-next-tick-ordering.js index 5dc1dfbe1691f9..4340736aefec35 100644 --- a/test/parallel/test-next-tick-ordering.js +++ b/test/parallel/test-next-tick-ordering.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var i; diff --git a/test/parallel/test-next-tick-ordering2.js b/test/parallel/test-next-tick-ordering2.js index 94fd20fbb5a07b..69d4897fdbf9d2 100644 --- a/test/parallel/test-next-tick-ordering2.js +++ b/test/parallel/test-next-tick-ordering2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-next-tick.js b/test/parallel/test-next-tick.js index 2e40658c923c58..f8b5fed0ec62b6 100644 --- a/test/parallel/test-next-tick.js +++ b/test/parallel/test-next-tick.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index 5763e071bfd4f6..ae57353435333a 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/parallel/test-path-makelong.js b/test/parallel/test-path-makelong.js index d9d8efd4052abf..51d6404c4d4385 100644 --- a/test/parallel/test-path-makelong.js +++ b/test/parallel/test-path-makelong.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var path = require('path'); var common = require('../common'); diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index 4f6e5af45c06e8..a3120891fe7016 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var path = require('path'); diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 45fd282d089144..6227369e7532f7 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js index 1b3ba7089b48db..01c23cb418e426 100644 --- a/test/parallel/test-pipe-file-to-http.js +++ b/test/parallel/test-pipe-file-to-http.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-pipe-return-val.js b/test/parallel/test-pipe-return-val.js index 274e9f5bc61d07..6a333584f8f315 100644 --- a/test/parallel/test-pipe-return-val.js +++ b/test/parallel/test-pipe-return-val.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // This test ensures SourceStream.pipe(DestStream) returns DestStream var common = require('../common'); diff --git a/test/parallel/test-process-active-wraps.js b/test/parallel/test-process-active-wraps.js index 63fc218debc480..6b1313b41aec5f 100644 --- a/test/parallel/test-process-active-wraps.js +++ b/test/parallel/test-process-active-wraps.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; @@ -41,9 +20,16 @@ var handles = []; })(); (function() { + function onlookup() { + setImmediate(function() { + assert.equal(process._getActiveRequests().length, 0); + }); + }; + expect(1, 0); var conn = net.createConnection(common.PORT); - conn.on('error', function() { /* ignore */ }); + conn.on('lookup', onlookup); + conn.on('error', function() { assert(false); }); expect(2, 1); conn.destroy(); expect(2, 1); // client handle doesn't shut down until next tick @@ -52,10 +38,18 @@ var handles = []; (function() { var n = 0; + handles.forEach(function(handle) { handle.once('close', onclose); }); function onclose() { - if (++n === handles.length) setImmediate(expect, 0, 0); + if (++n === handles.length) { + // Allow the server handle a few loop iterations to wind down. + setImmediate(function() { + setImmediate(function() { + assert.equal(process._getActiveHandles().length, 0); + }); + }); + } } })(); diff --git a/test/parallel/test-process-argv-0.js b/test/parallel/test-process-argv-0.js index 0c38f6ac7bbf87..a5430509dabcd1 100644 --- a/test/parallel/test-process-argv-0.js +++ b/test/parallel/test-process-argv-0.js @@ -1,23 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. var util = require('util'); var path = require('path'); var assert = require('assert'); @@ -28,7 +8,7 @@ console.error('argv=%j', process.argv); console.error('exec=%j', process.execPath); if (process.argv[2] !== "child") { - var child = spawn('./node', [__filename, "child"], { + var child = spawn('./iojs', [__filename, "child"], { cwd: path.dirname(process.execPath) }); @@ -44,7 +24,7 @@ if (process.argv[2] !== "child") { console.error('CHILD: %s', childErr.trim().split('\n').join('\nCHILD: ')); if (process.platform === 'win32') { // On Windows argv[0] is not expanded into full path - assert.equal(childArgv0, './node'); + assert.equal(childArgv0, './iojs'); } else { assert.equal(childArgv0, process.execPath); } diff --git a/test/parallel/test-process-before-exit.js b/test/parallel/test-process-before-exit.js index 261ac253c5b198..48639c249ddec1 100644 --- a/test/parallel/test-process-before-exit.js +++ b/test/parallel/test-process-before-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/parallel/test-process-config.js b/test/parallel/test-process-config.js index b3236cd5ec315b..d9260ca94d6ff3 100644 --- a/test/parallel/test-process-config.js +++ b/test/parallel/test-process-config.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index 919d0d54ed47b2..f3e2957ba621a7 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // first things first, set the timezone; see tzset(3) process.env.TZ = 'Europe/Amsterdam'; diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index 395753b72a9bdc..7344000739576e 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js index 2488175d3d2d47..610cf662987850 100644 --- a/test/parallel/test-process-exit-code.js +++ b/test/parallel/test-process-exit-code.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-process-exit-from-before-exit.js b/test/parallel/test-process-exit-from-before-exit.js index 4818a6c196dfa3..e222f35245fb7d 100644 --- a/test/parallel/test-process-exit-from-before-exit.js +++ b/test/parallel/test-process-exit-from-before-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/parallel/test-process-exit-recursive.js b/test/parallel/test-process-exit-recursive.js index ba5b5dc5b035de..a326ec7f630e8c 100644 --- a/test/parallel/test-process-exit-recursive.js +++ b/test/parallel/test-process-exit-recursive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); // recursively calling .exit() should not overflow the call stack diff --git a/test/parallel/test-process-exit.js b/test/parallel/test-process-exit.js index 365d5f109366e9..58d7a276996c3c 100644 --- a/test/parallel/test-process-exit.js +++ b/test/parallel/test-process-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-process-getgroups.js b/test/parallel/test-process-getgroups.js index 16d017b3cc7e47..f7c80ca6e02003 100644 --- a/test/parallel/test-process-getgroups.js +++ b/test/parallel/test-process-getgroups.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index d8ffcafa9cc502..c845f919bb2efd 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-process-kill-null.js b/test/parallel/test-process-kill-null.js index 520210ef1f8c58..77e2a8bb5ee5cb 100644 --- a/test/parallel/test-process-kill-null.js +++ b/test/parallel/test-process-kill-null.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index 6e4e7d83a7da1f..22ec5a68145961 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-process-next-tick.js b/test/parallel/test-process-next-tick.js index 0322a033e39332..3b2d37ef68a3be 100644 --- a/test/parallel/test-process-next-tick.js +++ b/test/parallel/test-process-next-tick.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var N = 2; diff --git a/test/parallel/test-process-raw-debug.js b/test/parallel/test-process-raw-debug.js index 3c14c9eb51f942..2264e59937517b 100644 --- a/test/parallel/test-process-raw-debug.js +++ b/test/parallel/test-process-raw-debug.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/parallel/test-process-versions.js b/test/parallel/test-process-versions.js new file mode 100644 index 00000000000000..63bf6d1665cb55 --- /dev/null +++ b/test/parallel/test-process-versions.js @@ -0,0 +1,7 @@ +require('../common'); +var assert = require('assert'); + +var expected_keys = ['ares', 'http_parser', 'modules', 'node', + 'openssl', 'uv', 'v8', 'zlib']; + +assert.deepEqual(Object.keys(process.versions).sort(), expected_keys); diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index 892b028e3f1ec2..f3d903adb11448 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var Process = process.binding('process_wrap').Process; diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index fa6a9c0ec96b96..a601a4128db51a 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Copyright (C) 2011 by Ben Noordhuis // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 6bb3fe7c691329..e2591d709015f5 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-readdouble.js b/test/parallel/test-readdouble.js index 6749e5b2022746..6dfc4015492783 100644 --- a/test/parallel/test-readdouble.js +++ b/test/parallel/test-readdouble.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're reading in doubles correctly */ diff --git a/test/parallel/test-readfloat.js b/test/parallel/test-readfloat.js index 586b992c5b8213..9b2fc612c73324 100644 --- a/test/parallel/test-readfloat.js +++ b/test/parallel/test-readfloat.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're reading in floats correctly */ diff --git a/test/parallel/test-readint.js b/test/parallel/test-readint.js index f1b79e816a3ff8..208907d03ee153 100644 --- a/test/parallel/test-readint.js +++ b/test/parallel/test-readint.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're reading in signed integers correctly */ diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index b86dd5a8a9bd78..ae8a4188ab5ca4 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -1,26 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - var assert = require('assert'); var readline = require('readline'); var EventEmitter = require('events').EventEmitter; diff --git a/test/parallel/test-readline-set-raw-mode.js b/test/parallel/test-readline-set-raw-mode.js index f43443857b3d97..622d64181fbfe1 100644 --- a/test/parallel/test-readline-set-raw-mode.js +++ b/test/parallel/test-readline-set-raw-mode.js @@ -1,26 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - var assert = require('assert'); var readline = require('readline'); var Stream = require('stream'); diff --git a/test/parallel/test-readuint.js b/test/parallel/test-readuint.js index 2b11a61c929d22..293cb554ce343f 100644 --- a/test/parallel/test-readuint.js +++ b/test/parallel/test-readuint.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * A battery of tests to help us read a series of uints */ diff --git a/test/parallel/test-regress-GH-4256.js b/test/parallel/test-regress-GH-4256.js index 9f937cc099a611..ead32446b7b59b 100644 --- a/test/parallel/test-regress-GH-4256.js +++ b/test/parallel/test-regress-GH-4256.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - process.domain = null; timer = setTimeout(function() { console.log("this console.log statement should not make node crash"); diff --git a/test/parallel/test-regress-GH-5927.js b/test/parallel/test-regress-GH-5927.js index 5f8f276616c6a2..dee33d854abd9c 100644 --- a/test/parallel/test-regress-GH-5927.js +++ b/test/parallel/test-regress-GH-5927.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var readline = require('readline'); diff --git a/test/parallel/test-regress-GH-6235.js b/test/parallel/test-regress-GH-6235.js index e830f7bbee3aec..f929282b16ab75 100644 --- a/test/parallel/test-regress-GH-6235.js +++ b/test/parallel/test-regress-GH-6235.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-regress-GH-7511.js b/test/parallel/test-regress-GH-7511.js index 9694f0499e29f9..aa7a10c0474149 100644 --- a/test/parallel/test-regress-GH-7511.js +++ b/test/parallel/test-regress-GH-7511.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), vm = require('vm'); diff --git a/test/parallel/test-regress-GH-897.js b/test/parallel/test-regress-GH-897.js index dd4399f16f121a..fae1bd4b5d2a72 100644 --- a/test/parallel/test-regress-GH-897.js +++ b/test/parallel/test-regress-GH-897.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-regression-object-prototype.js b/test/parallel/test-regression-object-prototype.js index 158532ad873ac4..17fe1727d37070 100644 --- a/test/parallel/test-regression-object-prototype.js +++ b/test/parallel/test-regression-object-prototype.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - //console.log('puts before'); Object.prototype.xadsadsdasasdxx = function() { diff --git a/test/parallel/test-repl-.save.load.js b/test/parallel/test-repl-.save.load.js index fdbf18fa0b8b72..d1c0f13e92f851 100644 --- a/test/parallel/test-repl-.save.load.js +++ b/test/parallel/test-repl-.save.load.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var util = require('util'); var join = require('path').join; diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index b6f9294711da70..c7727f574a6ca5 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var util = require('util'); var repl = require('repl'); diff --git a/test/parallel/test-repl-console.js b/test/parallel/test-repl-console.js index 3dca14b7f3f5de..45dad0f390d00d 100644 --- a/test/parallel/test-repl-console.js +++ b/test/parallel/test-repl-console.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), Stream = require('stream'), diff --git a/test/parallel/test-repl-domain.js b/test/parallel/test-repl-domain.js index 55b7dc475efb09..6c3048e2682927 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); diff --git a/test/parallel/test-repl-end-emits-exit.js b/test/parallel/test-repl-end-emits-exit.js index 46eca2efbf6a25..bcb13a14afd021 100644 --- a/test/parallel/test-repl-end-emits-exit.js +++ b/test/parallel/test-repl-end-emits-exit.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), Stream = require('stream'), diff --git a/test/parallel/test-repl-harmony.js b/test/parallel/test-repl-harmony.js index 701dd5ed6729b0..420b3163cce252 100644 --- a/test/parallel/test-repl-harmony.js +++ b/test/parallel/test-repl-harmony.js @@ -1,33 +1,12 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; -var args = ['--harmony', '--use-strict', '-i']; +var args = ['--harmony', '--harmony_scoping', '--use-strict', '-i']; var child = spawn(process.execPath, args); -var input = 'function x(){const y=1;y=2}\n'; -var expectOut = /^> SyntaxError: Assignment to constant variable.\n/; +var input = '(function(){const y=1;y=2})()\n'; +var expectOut = /^> TypeError: Assignment to constant variable.\n/; child.stderr.setEncoding('utf8'); child.stderr.on('data', function(c) { diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index 94a622da260987..e58f459393ecba 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), Stream = require('stream'), diff --git a/test/parallel/test-repl-require-cache.js b/test/parallel/test-repl-require-cache.js index fe5753d2159d49..3ab3b7062c2603 100644 --- a/test/parallel/test-repl-require-cache.js +++ b/test/parallel/test-repl-require-cache.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), repl = require('repl'); diff --git a/test/parallel/test-repl-reset-event.js b/test/parallel/test-repl-reset-event.js index 3554d17b9e4c5d..eee31e24bee5a0 100644 --- a/test/parallel/test-repl-reset-event.js +++ b/test/parallel/test-repl-reset-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); common.globalCheck = false; diff --git a/test/parallel/test-repl-setprompt.js b/test/parallel/test-repl-setprompt.js index e5021c2356c1b0..56de10023f831f 100644 --- a/test/parallel/test-repl-setprompt.js +++ b/test/parallel/test-repl-setprompt.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'), assert = require('assert'), spawn = require('child_process').spawn, diff --git a/test/parallel/test-repl-syntax-error-handling.js b/test/parallel/test-repl-syntax-error-handling.js index 74328f44924ef0..79489628b588c7 100644 --- a/test/parallel/test-repl-syntax-error-handling.js +++ b/test/parallel/test-repl-syntax-error-handling.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 48df4033d0594c..c6a07f4017bef4 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-repl-timeout-throw.js b/test/parallel/test-repl-timeout-throw.js index 28f370909b283c..2febf2e3ce0565 100644 --- a/test/parallel/test-repl-timeout-throw.js +++ b/test/parallel/test-repl-timeout-throw.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 69b9b54d1e9e40..e1087a2e1daf8e 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); @@ -125,6 +104,17 @@ function error_test() { // But passing the same string to eval() should throw { client: client_unix, send: 'eval("function test_func() {")', expect: /^SyntaxError: Unexpected end of input/ }, + // Can handle multiline template literals + { client: client_unix, send: '`io.js', + expect: prompt_multiline }, + // Special REPL commands still available + { client: client_unix, send: '.break', + expect: prompt_unix }, + // Template expressions can cross lines + { client: client_unix, send: '`io.js ${"1.0"', + expect: prompt_multiline }, + { client: client_unix, send: '+ ".2"}`', + expect: `'io.js 1.0.2'\n${prompt_unix}` }, // Floating point numbers are not interpreted as REPL commands. { client: client_unix, send: '.1234', expect: '0.1234' }, @@ -166,7 +156,7 @@ function error_test() { expect: /^SyntaxError: Delete of an unqualified identifier in strict mode/ }, { client: client_unix, send: '(function() { "use strict"; eval = 17; })()', expect: /^SyntaxError: Unexpected eval or arguments in strict mode/ }, - { client: client_unix, send: '(function() { "use strict"; if (true){ function f() { } } })()', + { client: client_unix, send: '(function() { "use strict"; if (true) function f() { } })()', expect: /^SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function/ }, // Named functions can be used: { client: client_unix, send: 'function blah() { return 1; }', diff --git a/test/parallel/test-require-cache.js b/test/parallel/test-require-cache.js index 2f812044a7ff87..a069d0a799892a 100644 --- a/test/parallel/test-require-cache.js +++ b/test/parallel/test-require-cache.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-require-exceptions.js b/test/parallel/test-require-exceptions.js index 307e3e2f33823d..16c63a90aa41ed 100644 --- a/test/parallel/test-require-exceptions.js +++ b/test/parallel/test-require-exceptions.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js index 6469d14ffd4a84..cc2cd94ea6994c 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-require-extensions-same-filename-as-dir.js b/test/parallel/test-require-extensions-same-filename-as-dir.js index fbfba3b9bc3c0b..387620afa74cb2 100644 --- a/test/parallel/test-require-extensions-same-filename-as-dir.js +++ b/test/parallel/test-require-extensions-same-filename-as-dir.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-require-json.js b/test/parallel/test-require-json.js index 59b1e3d61f185f..dbf8c8f866d8c6 100644 --- a/test/parallel/test-require-json.js +++ b/test/parallel/test-require-json.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); try { diff --git a/test/parallel/test-require-process.js b/test/parallel/test-require-process.js new file mode 100644 index 00000000000000..2820c22eea92ec --- /dev/null +++ b/test/parallel/test-require-process.js @@ -0,0 +1,26 @@ +// Copyright io.js 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 assert = require('assert'); + +var nativeProcess = require('process'); +assert.strictEqual(nativeProcess, process, + 'require("process") should return a reference to global process'); diff --git a/test/parallel/test-require-resolve.js b/test/parallel/test-require-resolve.js index 490deae6871a40..c11ff65ac43307 100644 --- a/test/parallel/test-require-resolve.js +++ b/test/parallel/test-require-resolve.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var fixturesDir = common.fixturesDir; var assert = require('assert'); diff --git a/test/parallel/test-signal-handler.js b/test/parallel/test-signal-handler.js index 5531e2f556e847..30cad31eef5995 100644 --- a/test/parallel/test-signal-handler.js +++ b/test/parallel/test-signal-handler.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - // SIGUSR1 and SIGHUP are not supported on Windows if (process.platform === 'win32') { process.exit(0); diff --git a/test/parallel/test-smalloc.js b/test/parallel/test-smalloc.js index 198b5c7f5cc038..61ffe3b84da88c 100644 --- a/test/parallel/test-smalloc.js +++ b/test/parallel/test-smalloc.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/parallel/test-stdin-hang.js b/test/parallel/test-stdin-hang.js index 1edbf8c25b7c97..c22a097925b456 100644 --- a/test/parallel/test-stdin-hang.js +++ b/test/parallel/test-stdin-hang.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); // This test *only* verifies that invoking the stdin getter does not diff --git a/test/parallel/test-stdin-pause-resume-sync.js b/test/parallel/test-stdin-pause-resume-sync.js index 0e202a3063f2d1..fdb8e030b70edb 100644 --- a/test/parallel/test-stdin-pause-resume-sync.js +++ b/test/parallel/test-stdin-pause-resume-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error('before opening stdin'); process.stdin.resume(); console.error('stdin opened'); diff --git a/test/parallel/test-stdin-pause-resume.js b/test/parallel/test-stdin-pause-resume.js index fed5d665329cee..a9282d5aa030ed 100644 --- a/test/parallel/test-stdin-pause-resume.js +++ b/test/parallel/test-stdin-pause-resume.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - console.error('before opening stdin'); process.stdin.resume(); console.error('stdin opened'); diff --git a/test/parallel/test-stdin-resume-pause.js b/test/parallel/test-stdin-resume-pause.js index 2d2af2fc66d326..6290ff7999b250 100644 --- a/test/parallel/test-stdin-resume-pause.js +++ b/test/parallel/test-stdin-resume-pause.js @@ -1,23 +1,2 @@ -// 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. - process.stdin.resume(); process.stdin.pause(); diff --git a/test/parallel/test-stdio-readable-writable.js b/test/parallel/test-stdio-readable-writable.js index 5123f968872fdd..95ae679bca0389 100644 --- a/test/parallel/test-stdio-readable-writable.js +++ b/test/parallel/test-stdio-readable-writable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stdout-close-unref.js b/test/parallel/test-stdout-close-unref.js index f8cbc7e4b6300a..0b03e7142a8615 100644 --- a/test/parallel/test-stdout-close-unref.js +++ b/test/parallel/test-stdout-close-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/parallel/test-stream-big-packet.js b/test/parallel/test-stream-big-packet.js index 9ec29ca0dcc6e4..cfde7e47fb700a 100644 --- a/test/parallel/test-stream-big-packet.js +++ b/test/parallel/test-stream-big-packet.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js index e3787e4412f32a..b4ed8f8a527acd 100644 --- a/test/parallel/test-stream-big-push.js +++ b/test/parallel/test-stream-big-push.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream-duplex.js b/test/parallel/test-stream-duplex.js index 61f314939b0eed..8efc9d4b5f4160 100644 --- a/test/parallel/test-stream-duplex.js +++ b/test/parallel/test-stream-duplex.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-end-paused.js b/test/parallel/test-stream-end-paused.js index bb7377776bd75a..72825dc440df91 100644 --- a/test/parallel/test-stream-end-paused.js +++ b/test/parallel/test-stream-end-paused.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var gotEnd = false; diff --git a/test/parallel/test-stream-ispaused.js b/test/parallel/test-stream-ispaused.js index 91f4f512f04a3e..fe895ce7c39884 100644 --- a/test/parallel/test-stream-ispaused.js +++ b/test/parallel/test-stream-ispaused.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: - -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/parallel/test-stream-pipe-after-end.js b/test/parallel/test-stream-pipe-after-end.js index b46ee90ad73aac..a2fece3f7f6264 100644 --- a/test/parallel/test-stream-pipe-after-end.js +++ b/test/parallel/test-stream-pipe-after-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-pipe-cleanup.js b/test/parallel/test-stream-pipe-cleanup.js index f689358524fbeb..b2963c4f56c1a3 100644 --- a/test/parallel/test-stream-pipe-cleanup.js +++ b/test/parallel/test-stream-pipe-cleanup.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This test asserts that Stream.prototype.pipe does not leave listeners // hanging on the source or dest. diff --git a/test/parallel/test-stream-pipe-error-handling.js b/test/parallel/test-stream-pipe-error-handling.js index c5d724b782d388..18ce5a1edef021 100644 --- a/test/parallel/test-stream-pipe-error-handling.js +++ b/test/parallel/test-stream-pipe-error-handling.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var Stream = require('stream').Stream; diff --git a/test/parallel/test-stream-pipe-event.js b/test/parallel/test-stream-pipe-event.js index cb9d5fe8ca6b0b..bcae20c581ebbd 100644 --- a/test/parallel/test-stream-pipe-event.js +++ b/test/parallel/test-stream-pipe-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var stream = require('stream'); var assert = require('assert'); diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js index f2e6ec29ce34ef..1d7d09d8b1e30f 100644 --- a/test/parallel/test-stream-push-order.js +++ b/test/parallel/test-stream-push-order.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var Readable = require('stream').Readable; var assert = require('assert'); diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index 06f43dc1c86e93..f673173de5ea57 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index ba6a57724d23d0..2d7d1cc4f9020e 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-readable-flow-recursion.js b/test/parallel/test-stream-readable-flow-recursion.js index 2891ad6db8dbb9..c3dfbef53bd971 100644 --- a/test/parallel/test-stream-readable-flow-recursion.js +++ b/test/parallel/test-stream-readable-flow-recursion.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-transform-objectmode-falsey-value.js b/test/parallel/test-stream-transform-objectmode-falsey-value.js index 31b5bbaaf5b600..89feabef118e59 100644 --- a/test/parallel/test-stream-transform-objectmode-falsey-value.js +++ b/test/parallel/test-stream-transform-objectmode-falsey-value.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-transform-split-objectmode.js b/test/parallel/test-stream-transform-split-objectmode.js index 72a2f0acecbc47..df10ed1b6553e7 100644 --- a/test/parallel/test-stream-transform-split-objectmode.js +++ b/test/parallel/test-stream-transform-split-objectmode.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index 0c9647650f2b0f..c985d4bc37d279 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-unshift-read-race.js b/test/parallel/test-stream-unshift-read-race.js index 83fd9fa203e455..dd7c6dfb37e10c 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-writable-change-default-encoding.js b/test/parallel/test-stream-writable-change-default-encoding.js index eb71cf2b4a6917..3e2277ad980c3d 100644 --- a/test/parallel/test-stream-writable-change-default-encoding.js +++ b/test/parallel/test-stream-writable-change-default-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-writable-decoded-encoding.js b/test/parallel/test-stream-writable-decoded-encoding.js index 8e2624b259ffca..fb530d0830a5d9 100644 --- a/test/parallel/test-stream-writable-decoded-encoding.js +++ b/test/parallel/test-stream-writable-decoded-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream-writev.js b/test/parallel/test-stream-writev.js index 5b49e6e4163c69..2a2ed3cdae3c07 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-base64-single-char-read-end.js b/test/parallel/test-stream2-base64-single-char-read-end.js index 5a3834128c67b4..bf049e3b628e02 100644 --- a/test/parallel/test-stream2-base64-single-char-read-end.js +++ b/test/parallel/test-stream2-base64-single-char-read-end.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var R = require('_stream_readable'); var W = require('_stream_writable'); diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index 6cdd4e9948c715..ce6a5111a0c80a 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var R = require('_stream_readable'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-finish-pipe.js b/test/parallel/test-stream2-finish-pipe.js index 39b274f977cb0d..df7d7a14efd89a 100644 --- a/test/parallel/test-stream2-finish-pipe.js +++ b/test/parallel/test-stream2-finish-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var stream = require('stream'); var Buffer = require('buffer').Buffer; diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 2fbfbcab3f1f73..c76c300d50fc65 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index 3e6931dce0b7a5..e99ac09a3b2212 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var Readable = require('_stream_readable'); var Writable = require('_stream_writable'); diff --git a/test/parallel/test-stream2-pipe-error-handling.js b/test/parallel/test-stream2-pipe-error-handling.js index cf7531cbd3a63c..c7303accead89b 100644 --- a/test/parallel/test-stream2-pipe-error-handling.js +++ b/test/parallel/test-stream2-pipe-error-handling.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-pipe-error-once-listener.js b/test/parallel/test-stream2-pipe-error-once-listener.js old mode 100755 new mode 100644 index 5e8e3cb283117a..c8b9350a2ab2c2 --- a/test/parallel/test-stream2-pipe-error-once-listener.js +++ b/test/parallel/test-stream2-pipe-error-once-listener.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index b63edc308460f0..c42bb6d9b488d8 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var stream = require('stream'); var Readable = stream.Readable; diff --git a/test/parallel/test-stream2-read-sync-stack.js b/test/parallel/test-stream2-read-sync-stack.js index e8a73053c8c202..48b605e46a1865 100644 --- a/test/parallel/test-stream2-read-sync-stack.js +++ b/test/parallel/test-stream2-read-sync-stack.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var Readable = require('stream').Readable; diff --git a/test/parallel/test-stream2-readable-empty-buffer-no-eof.js b/test/parallel/test-stream2-readable-empty-buffer-no-eof.js index d52af5edb80df5..e71c37e36afcb0 100644 --- a/test/parallel/test-stream2-readable-empty-buffer-no-eof.js +++ b/test/parallel/test-stream2-readable-empty-buffer-no-eof.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 7c96ffe00c4e76..b0bedac5e7c44c 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); var fromList = require('_stream_readable')._fromList; diff --git a/test/parallel/test-stream2-readable-legacy-drain.js b/test/parallel/test-stream2-readable-legacy-drain.js index 117e253d268bba..7e8eb6b1ef3898 100644 --- a/test/parallel/test-stream2-readable-legacy-drain.js +++ b/test/parallel/test-stream2-readable-legacy-drain.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-readable-non-empty-end.js b/test/parallel/test-stream2-readable-non-empty-end.js index 65b7afda57b56c..72b952a95a290d 100644 --- a/test/parallel/test-stream2-readable-non-empty-end.js +++ b/test/parallel/test-stream2-readable-non-empty-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); var Readable = require('_stream_readable'); diff --git a/test/parallel/test-stream2-readable-wrap-empty.js b/test/parallel/test-stream2-readable-wrap-empty.js index 2e5cf25c4474d4..c1bc3361f23030 100644 --- a/test/parallel/test-stream2-readable-wrap-empty.js +++ b/test/parallel/test-stream2-readable-wrap-empty.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-readable-wrap.js b/test/parallel/test-stream2-readable-wrap.js index 293774ca5c86e7..71f8a28265bc76 100644 --- a/test/parallel/test-stream2-readable-wrap.js +++ b/test/parallel/test-stream2-readable-wrap.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index 9b28e559428fc9..e4e14952182348 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var assert = require('assert'); var R = require('_stream_readable'); diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 9c9ddd8efc3141..5c5d6333b79032 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common.js'); var PassThrough = require('_stream_passthrough'); @@ -81,7 +60,7 @@ test('writable side consumption', function(t) { t.equal(tx._readableState.length, 10); t.equal(transformed, 10); t.equal(tx._transformState.writechunk.length, 5); - t.same(tx._writableState.buffer.map(function(c) { + t.same(tx._writableState.getBuffer().map(function(c) { return c.chunk.length; }), [6, 7, 8, 9, 10]); diff --git a/test/parallel/test-stream2-unpipe-drain.js b/test/parallel/test-stream2-unpipe-drain.js index d66dc3cbece491..1c27cf8771216a 100644 --- a/test/parallel/test-stream2-unpipe-drain.js +++ b/test/parallel/test-stream2-unpipe-drain.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-unpipe-leak.js b/test/parallel/test-stream2-unpipe-leak.js index 99f8746c49e7bf..8bfc2a630e9cd9 100644 --- a/test/parallel/test-stream2-unpipe-leak.js +++ b/test/parallel/test-stream2-unpipe-leak.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 3767ce140e7725..5df3b18717f636 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var W = require('_stream_writable'); var D = require('_stream_duplex'); diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index b91bde3f0ae232..737a2f30a1d136 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index fea55d410b7538..0bac7a5f28f4d7 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // verify that the string decoder works getting 1 byte at a time, // the whole buffer at once, and that both match the .toString(enc) // result of the entire buffer. diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 9f47d131bbcb46..dd28ba748b389f 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var StringDecoder = require('string_decoder').StringDecoder; diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index c7c716c836b394..331897286ad165 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); // minimum string size to overflow into external string space diff --git a/test/parallel/test-sys.js b/test/parallel/test-sys.js index 6ea33161c55796..8b3ea082b6e135 100644 --- a/test/parallel/test-sys.js +++ b/test/parallel/test-sys.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-tcp-wrap.js b/test/parallel/test-tcp-wrap.js index bc1e14e68a493d..6ed8fb44ca806e 100644 --- a/test/parallel/test-tcp-wrap.js +++ b/test/parallel/test-tcp-wrap.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-first-fire.js b/test/parallel/test-timers-first-fire.js index e97b7ec8523588..357ac88cbca18c 100644 --- a/test/parallel/test-timers-first-fire.js +++ b/test/parallel/test-timers-first-fire.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-immediate-queue.js b/test/parallel/test-timers-immediate-queue.js index cce43a1aca19ee..1c0b095f18c3d6 100644 --- a/test/parallel/test-timers-immediate-queue.js +++ b/test/parallel/test-timers-immediate-queue.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-immediate.js b/test/parallel/test-timers-immediate.js index 0bd8ae9642eea8..00652d04060569 100644 --- a/test/parallel/test-timers-immediate.js +++ b/test/parallel/test-timers-immediate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-linked-list.js b/test/parallel/test-timers-linked-list.js index 0b6bf4bef8fd03..79a9839627c98c 100644 --- a/test/parallel/test-timers-linked-list.js +++ b/test/parallel/test-timers-linked-list.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var L = require('_linklist'); diff --git a/test/parallel/test-timers-non-integer-delay.js b/test/parallel/test-timers-non-integer-delay.js index db9bedafa80168..229db3892dba06 100644 --- a/test/parallel/test-timers-non-integer-delay.js +++ b/test/parallel/test-timers-non-integer-delay.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * This test makes sure that non-integer timer delays do not make the process * hang. See https://github.com/joyent/node/issues/8065 and diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js index 30cc44e53a6e1f..9f40288ec56068 100644 --- a/test/parallel/test-timers-ordering.js +++ b/test/parallel/test-timers-ordering.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var Timer = process.binding('timer_wrap').Timer; diff --git a/test/parallel/test-timers-this.js b/test/parallel/test-timers-this.js index 3d23e61dff14b4..cacb3f247cc4b8 100644 --- a/test/parallel/test-timers-this.js +++ b/test/parallel/test-timers-this.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var immediateThis, intervalThis, timeoutThis, diff --git a/test/parallel/test-timers-uncaught-exception.js b/test/parallel/test-timers-uncaught-exception.js index 6e07fe084e16f1..4e137427939654 100644 --- a/test/parallel/test-timers-uncaught-exception.js +++ b/test/parallel/test-timers-uncaught-exception.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-unref.js b/test/parallel/test-timers-unref.js index 1c362cb836f111..c4f9d820e5601f 100644 --- a/test/parallel/test-timers-unref.js +++ b/test/parallel/test-timers-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers-zero-timeout.js b/test/parallel/test-timers-zero-timeout.js index eb43f183f89d80..939b8db1bb30db 100644 --- a/test/parallel/test-timers-zero-timeout.js +++ b/test/parallel/test-timers-zero-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index 98e6bc3def1dbb..dad1bcc69389a0 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-tls-0-dns-altname.js b/test/parallel/test-tls-0-dns-altname.js index 002a5ca3c1bf17..fb4d250abbbac5 100644 --- a/test/parallel/test-tls-0-dns-altname.js +++ b/test/parallel/test-tls-0-dns-altname.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-alert.js b/test/parallel/test-tls-alert.js index f26b496f9dfdfd..4882ba09524114 100644 --- a/test/parallel/test-tls-alert.js +++ b/test/parallel/test-tls-alert.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index ec8369ba98ca67..9076c02771bc84 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js index 598dac0e00bb53..d78d4725ecf689 100644 --- a/test/parallel/test-tls-check-server-identity.js +++ b/test/parallel/test-tls-check-server-identity.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index 8958ceb158546e..d84363aa9c367a 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-client-abort2.js b/test/parallel/test-tls-client-abort2.js index f8119627687e0d..39a7d598125806 100644 --- a/test/parallel/test-tls-client-abort2.js +++ b/test/parallel/test-tls-client-abort2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-client-default-ciphers.js b/test/parallel/test-tls-client-default-ciphers.js index 0a3c470292ae0e..1eb74e6981fd69 100644 --- a/test/parallel/test-tls-client-default-ciphers.js +++ b/test/parallel/test-tls-client-default-ciphers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var tls = require('tls'); diff --git a/test/parallel/test-tls-client-destroy-soon.js b/test/parallel/test-tls-client-destroy-soon.js index 529b84a734328f..640b13919121e4 100644 --- a/test/parallel/test-tls-client-destroy-soon.js +++ b/test/parallel/test-tls-client-destroy-soon.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Create an ssl server. First connection, validate that not resume. // Cache session and close connection. Use session on second connection. // ASSERT resumption. diff --git a/test/parallel/test-tls-client-reject.js b/test/parallel/test-tls-client-reject.js index bae9614982f7d8..5fba3793e7d828 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-client-resume.js b/test/parallel/test-tls-client-resume.js index 7271134df1cf36..d5873fd9b2c02c 100644 --- a/test/parallel/test-tls-client-resume.js +++ b/test/parallel/test-tls-client-resume.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Create an ssl server. First connection, validate that not resume. // Cache session and close connection. Use session on second connection. // ASSERT resumption. diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js index 590dfc6e63c1a1..a11fc93cebe7c4 100644 --- a/test/parallel/test-tls-client-verify.js +++ b/test/parallel/test-tls-client-verify.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 3c6bf53f21281e..54f7314e2f7da0 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index ab571c7a811bc6..097dbdd3fee957 100644 --- a/test/parallel/test-tls-connect-given-socket.js +++ b/test/parallel/test-tls-connect-given-socket.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-connect-pipe.js b/test/parallel/test-tls-connect-pipe.js index 98031c0ad18d29..8d2e4a19131ee2 100644 --- a/test/parallel/test-tls-connect-pipe.js +++ b/test/parallel/test-tls-connect-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-connect-simple.js b/test/parallel/test-tls-connect-simple.js index 55e15221b1b0c9..a982781a2e5b28 100644 --- a/test/parallel/test-tls-connect-simple.js +++ b/test/parallel/test-tls-connect-simple.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-connect.js b/test/parallel/test-tls-connect.js index 616f76c05cf786..daec1b8a6f70fb 100644 --- a/test/parallel/test-tls-connect.js +++ b/test/parallel/test-tls-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-delayed-attach.js b/test/parallel/test-tls-delayed-attach.js index ceacedc7380269..d4ebc22d077b8f 100644 --- a/test/parallel/test-tls-delayed-attach.js +++ b/test/parallel/test-tls-delayed-attach.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 3975c5ed40a326..8c2892040f389e 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index 06b4e4ffd645c5..3b7c8539df39d1 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index 446d76c8379238..247ca497f0eed8 100644 --- a/test/parallel/test-tls-ecdh.js +++ b/test/parallel/test-tls-ecdh.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-econnreset.js b/test/parallel/test-tls-econnreset.js index fcadf13f0c3041..78548c415c17d2 100644 --- a/test/parallel/test-tls-econnreset.js +++ b/test/parallel/test-tls-econnreset.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 894ec346a5c11e..812593ac7767d8 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-tls-friendly-error-message.js b/test/parallel/test-tls-friendly-error-message.js index b589907659f530..586e693ac18a1f 100644 --- a/test/parallel/test-tls-friendly-error-message.js +++ b/test/parallel/test-tls-friendly-error-message.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-getcipher.js b/test/parallel/test-tls-getcipher.js index 22a280e5874332..7bf3fe88f70e70 100644 --- a/test/parallel/test-tls-getcipher.js +++ b/test/parallel/test-tls-getcipher.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index de36ebb500b438..781dc3e182f8a4 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index b6c0ac228393a4..57d0d80d724ee5 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var tls = require('tls'); var net = require('net'); diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index d15d1ebd43a7e8..76c747aadb8c24 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-interleave.js b/test/parallel/test-tls-interleave.js index 8bebb807e54848..0358c092b901fa 100644 --- a/test/parallel/test-tls-interleave.js +++ b/test/parallel/test-tls-interleave.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index 3e877b406ff9f0..15b4e150605e72 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-junk-closes-server.js b/test/parallel/test-tls-junk-closes-server.js index 57db7f5a39d246..4bd20ba9ebf497 100644 --- a/test/parallel/test-tls-junk-closes-server.js +++ b/test/parallel/test-tls-junk-closes-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index f99e9471fd3e05..b49b415ebfddcf 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index f6fdf25120506d..3054e8a4e6be73 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-multi-key.js b/test/parallel/test-tls-multi-key.js index e00c4040934475..cdf85008745e2e 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-no-cert-required.js b/test/parallel/test-tls-no-cert-required.js index 35121477ff7412..1be4e69922e86a 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-no-rsa-key.js b/test/parallel/test-tls-no-rsa-key.js index d50eab942eff0e..2daa80ed810a5b 100644 --- a/test/parallel/test-tls-no-rsa-key.js +++ b/test/parallel/test-tls-no-rsa-key.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-no-sslv23.js b/test/parallel/test-tls-no-sslv23.js new file mode 100644 index 00000000000000..64f5206720510d --- /dev/null +++ b/test/parallel/test-tls-no-sslv23.js @@ -0,0 +1,52 @@ +if (!process.versions.openssl) { + console.error('Skipping because node compiled without OpenSSL.'); + process.exit(0); +} + +var common = require('../common'); +var assert = require('assert'); +var tls = require('tls'); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'blargh' }); +}, /Unknown method/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv2_method' }); +}, /SSLv2 methods disabled/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv2_client_method' }); +}, /SSLv2 methods disabled/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv2_server_method' }); +}, /SSLv2 methods disabled/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv3_method' }); +}, /SSLv3 methods disabled/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv3_client_method' }); +}, /SSLv3 methods disabled/); + +assert.throws(function() { + tls.createSecureContext({ secureProtocol: 'SSLv3_server_method' }); +}, /SSLv3 methods disabled/); + +// Note that SSLv2 and SSLv3 are disallowed but SSLv2_method and friends are +// still accepted. They are OpenSSL's way of saying that all known protocols +// are supported unless explicitly disabled (which we do for SSLv2 and SSLv3.) +tls.createSecureContext({ secureProtocol: 'SSLv23_method' }); +tls.createSecureContext({ secureProtocol: 'SSLv23_client_method' }); +tls.createSecureContext({ secureProtocol: 'SSLv23_server_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_client_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_server_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_1_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_1_client_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_1_server_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_2_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_2_client_method' }); +tls.createSecureContext({ secureProtocol: 'TLSv1_2_server_method' }); diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js new file mode 100644 index 00000000000000..8bdc4c74232c9e --- /dev/null +++ b/test/parallel/test-tls-no-sslv3.js @@ -0,0 +1,34 @@ +if (!process.versions.openssl) { + console.error('Skipping because node compiled without OpenSSL.'); + process.exit(0); +} + +var common = require('../common'); +var assert = require('assert'); +var fs = require('fs'); +var spawn = require('child_process').spawn; +var tls = require('tls'); + +var cert = fs.readFileSync(common.fixturesDir + '/test_cert.pem'); +var key = fs.readFileSync(common.fixturesDir + '/test_key.pem'); +var server = tls.createServer({ cert: cert, key: key }, assert.fail); + +server.listen(common.PORT, '127.0.0.1', function() { + var address = this.address().address + ':' + this.address().port; + var args = ['s_client', + '-no_ssl2', + '-ssl3', + '-no_tls1', + '-no_tls1_1', + '-no_tls1_2', + '-connect', address]; + var client = spawn(common.opensslCli, args, { stdio: 'inherit' }); + client.once('exit', common.mustCall(function(exitCode) { + assert.equal(exitCode, 1); + server.close(); + })); +}); + +server.once('clientError', common.mustCall(function(err, conn) { + assert(/SSL3_GET_CLIENT_HELLO:wrong version number/.test(err.message)); +})); diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index 0849cc8d2e7503..a89d8bcb6c8a52 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.features.tls_npn) { console.error('Skipping because node compiled without OpenSSL or ' + 'with old OpenSSL version.'); diff --git a/test/parallel/test-tls-ocsp-callback.js b/test/parallel/test-tls-ocsp-callback.js index 4c7dd1d4423f1f..e0f3b5bc280e96 100644 --- a/test/parallel/test-tls-ocsp-callback.js +++ b/test/parallel/test-tls-ocsp-callback.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!process.features.tls_ocsp) { diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index 9fa82ae3ee2685..224e90a861fe6f 100644 --- a/test/parallel/test-tls-over-http-tunnel.js +++ b/test/parallel/test-tls-over-http-tunnel.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index e9a5c5a5df0ae5..ba12523253de3b 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index 5eaac8da1992d3..e858fbb8c88371 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index 288236a93c9def..12a8954ecf3f2f 100644 --- a/test/parallel/test-tls-peer-certificate-encoding.js +++ b/test/parallel/test-tls-peer-certificate-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index a321d2cbaa3aaa..0bf891d7b01aa3 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index f1d0a7f1971d97..cd0a12ff2a2c48 100644 --- a/test/parallel/test-tls-peer-certificate.js +++ b/test/parallel/test-tls-peer-certificate.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-request-timeout.js b/test/parallel/test-tls-request-timeout.js index 7f46bd2130325d..480f8fb5810ccc 100644 --- a/test/parallel/test-tls-request-timeout.js +++ b/test/parallel/test-tls-request-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-securepair-server.js b/test/parallel/test-tls-securepair-server.js index ece965c544ebb8..fee7a6ae76e93b 100644 --- a/test/parallel/test-tls-securepair-server.js +++ b/test/parallel/test-tls-securepair-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index 085749af4389bc..d5ec50d38abd54 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index d5db30ce110406..06df3b5f91bf52 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-set-ciphers.js b/test/parallel/test-tls-set-ciphers.js index 1571d5e83361b7..ef4c5c5fbe36ff 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/parallel/test-tls-set-encoding.js b/test/parallel/test-tls-set-encoding.js index 0f6beafd1dd578..6c3897fbe8589e 100644 --- a/test/parallel/test-tls-set-encoding.js +++ b/test/parallel/test-tls-set-encoding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index 57c17163a749c8..729a998755f852 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.features.tls_sni) { console.error('Skipping because node compiled without OpenSSL or ' + 'with old OpenSSL version.'); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index 31fc4194284d24..668f6228e5e1ab 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - if (!process.features.tls_sni) { console.error('Skipping because node compiled without OpenSSL or ' + 'with old OpenSSL version.'); diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index 22fe10c42b39df..2940a8e000c11e 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-ticket.js b/test/parallel/test-tls-ticket.js index 471d8c3ce805d0..12dfacf7ad9a11 100644 --- a/test/parallel/test-tls-ticket.js +++ b/test/parallel/test-tls-ticket.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tls-timeout-server-2.js b/test/parallel/test-tls-timeout-server-2.js index dfa9be3dee12b6..2e51b6845ed970 100644 --- a/test/parallel/test-tls-timeout-server-2.js +++ b/test/parallel/test-tls-timeout-server-2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) process.exit(); var common = require('../common'); diff --git a/test/parallel/test-tls-timeout-server.js b/test/parallel/test-tls-timeout-server.js index 2c9b973ab31858..174e981e6a4627 100644 --- a/test/parallel/test-tls-timeout-server.js +++ b/test/parallel/test-tls-timeout-server.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) process.exit(); var common = require('../common'); diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index 22f45b66348564..e6dd5b15efdb28 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/parallel/test-tty-stdout-end.js b/test/parallel/test-tty-stdout-end.js index 1fc27906834cad..a2f3ad12f4aca7 100644 --- a/test/parallel/test-tty-stdout-end.js +++ b/test/parallel/test-tty-stdout-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Can't test this when 'make test' doesn't assign a tty to the stdout. var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-tty-wrap.js b/test/parallel/test-tty-wrap.js index 610b92b43fd92a..1cd014992dcad6 100644 --- a/test/parallel/test-tty-wrap.js +++ b/test/parallel/test-tty-wrap.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-umask.js b/test/parallel/test-umask.js index a41c46b55f9440..84c34412189d25 100644 --- a/test/parallel/test-umask.js +++ b/test/parallel/test-umask.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index f12a00dbed0b72..d6732a91280ed5 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); @@ -857,6 +836,22 @@ var parseTests = { pathname: '%0D%0Ad/e', path: '%0D%0Ad/e?f', href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' + }, + + // git urls used by npm + 'git+ssh://git@github.com:npm/npm': { + protocol: 'git+ssh:', + slashes: true, + auth: 'git', + host: 'github.com', + port: null, + hostname: 'github.com', + hash: null, + search: null, + query: null, + pathname: '/:npm/npm', + path: '/:npm/npm', + href: 'git+ssh://git@github.com/:npm/npm' } }; @@ -1097,7 +1092,7 @@ var formatTests = { // `#`,`?` in path '/path/to/%%23%3F+=&.txt?foo=theA1#bar' : { - href: '/path/to/%%23%3F+=&.txt?foo=theA1#bar', + href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar', pathname: '/path/to/%#?+=&.txt', query: { foo: 'theA1' @@ -1107,7 +1102,7 @@ var formatTests = { // `#`,`?` in path + `#` in query '/path/to/%%23%3F+=&.txt?foo=the%231#bar' : { - href: '/path/to/%%23%3F+=&.txt?foo=the%231#bar', + href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar', pathname: '/path/to/%#?+=&.txt', query: { foo: 'the#1' @@ -1122,7 +1117,7 @@ var formatTests = { hostname: 'ex.com', hash: '#frag', search: '?abc=the#1?&foo=bar', - pathname: '/foo?100%m#r' + pathname: '/foo?100%m#r', }, // `?` and `#` in search only @@ -1132,77 +1127,8 @@ var formatTests = { hostname: 'ex.com', hash: '#frag', search: '?abc=the#1?&foo=bar', - pathname: '/fooA100%mBr' - }, - - // path - 'http://github.com/joyent/node#js1': { - href: 'http://github.com/joyent/node#js1', - protocol: 'http:', - hostname: 'github.com', - hash: '#js1', - path: '/joyent/node' - }, - - // pathname vs. path, path wins - 'http://github.com/joyent/node2#js1': { - href: 'http://github.com/joyent/node2#js1', - protocol: 'http:', - hostname: 'github.com', - hash: '#js1', - path: '/joyent/node2', - pathname: '/joyent/node' - }, - - // pathname with query/search - 'http://github.com/joyent/node?foo=bar#js2': { - href: 'http://github.com/joyent/node?foo=bar#js2', - protocol: 'http:', - hostname: 'github.com', - hash: '#js2', - path: '/joyent/node?foo=bar' - }, - - // path vs. query, path wins - 'http://github.com/joyent/node?foo=bar2#js3': { - href: 'http://github.com/joyent/node?foo=bar2#js3', - protocol: 'http:', - hostname: 'github.com', - hash: '#js3', - path: '/joyent/node?foo=bar2', - query: {foo: 'bar'} - }, - - // path vs. search, path wins - 'http://github.com/joyent/node?foo=bar3#js4': { - href: 'http://github.com/joyent/node?foo=bar3#js4', - protocol: 'http:', - hostname: 'github.com', - hash: '#js4', - path: '/joyent/node?foo=bar3', - search: '?foo=bar' - }, - - // path is present without ? vs. query given - 'http://github.com/joyent/node#js5': { - href: 'http://github.com/joyent/node#js5', - protocol: 'http:', - hostname: 'github.com', - hash: '#js5', - path: '/joyent/node', - query: {foo: 'bar'} - }, - - // path is present without ? vs. search given - 'http://github.com/joyent/node#js6': { - href: 'http://github.com/joyent/node#js6', - protocol: 'http:', - hostname: 'github.com', - hash: '#js6', - path: '/joyent/node', - search: '?foo=bar' + pathname: '/fooA100%mBr', } - }; for (var u in formatTests) { var expect = formatTests[u].href; diff --git a/test/parallel/test-utf8-scripts.js b/test/parallel/test-utf8-scripts.js index 4639304f8775f0..b9bef97a5eabfe 100644 --- a/test/parallel/test-utf8-scripts.js +++ b/test/parallel/test-utf8-scripts.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js index 1bea1bf211e08e..446e11e98db594 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 2a7c2c4fcb5b27..f4aeced4d98abc 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var util = require('util'); @@ -243,4 +219,19 @@ if (typeof Symbol !== 'undefined') { assert.equal(util.inspect(Symbol('hi')), 'Symbol(hi)'); assert.equal(util.inspect([Symbol()]), '[ Symbol() ]'); assert.equal(util.inspect({ foo: Symbol() }), '{ foo: Symbol() }'); + + var options = { showHidden: true }; + var subject = {}; + + subject[Symbol('symbol')] = 42; + + assert.equal(util.inspect(subject), '{}'); + assert.equal(util.inspect(subject, options), '{ [Symbol(symbol)]: 42 }'); + + subject = [1, 2, 3]; + subject[Symbol('symbol')] = 42; + + assert.equal(util.inspect(subject), '[ 1, 2, 3 ]'); + assert.equal(util.inspect(subject, options), '[ 1, 2, 3, [length]: 3, [Symbol(symbol)]: 42 ]'); + } diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 1912c69f87fa25..f157c80bec93dc 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 4e75d512c25f46..d8966ce66974dd 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-v8-features.js b/test/parallel/test-v8-features.js new file mode 100644 index 00000000000000..aac9de4a29c2fc --- /dev/null +++ b/test/parallel/test-v8-features.js @@ -0,0 +1,31 @@ +var common = require('../common'); +var assert = require('assert'); +var spawnSync = require('child_process').spawnSync; +var v8 = require('v8'); + +// --harmony_classes implies --harmony_scoping; ensure that scoping still works +// when classes are disabled. +assert.throws(function() { eval('"use strict"; class C {}'); }, SyntaxError); +eval('"use strict"; let x = 42'); // Should not throw. +eval('"use strict"; const y = 42'); // Should not throw. + +v8.setFlagsFromString('--harmony_classes'); +eval('"use strict"; class C {}'); // Should not throw. +eval('"use strict"; let x = 42'); // Should not throw. +eval('"use strict"; const y = 42'); // Should not throw. + +// Verify that the --harmony_classes flag unlocks classes again. +var args = ['--harmony_classes', '--use_strict', '-p', 'class C {}']; +var cp = spawnSync(process.execPath, args); +assert.equal(cp.status, 0); +assert.equal(cp.stdout.toString('utf8').trim(), '[Function: C]'); + +// Now do the same for --harmony_object_literals. +assert.throws(function() { eval('({ f() {} })'); }, SyntaxError); +v8.setFlagsFromString('--harmony_object_literals'); +eval('({ f() {} })'); + +var args = ['--harmony_object_literals', '-p', '({ f() {} })']; +var cp = spawnSync(process.execPath, args); +assert.equal(cp.status, 0); +assert.equal(cp.stdout.toString('utf8').trim(), '{ f: [Function: f] }'); diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index 680a81a4bc9ae6..092aa1a6363904 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-context-async-script.js b/test/parallel/test-vm-context-async-script.js index d201e98eb2394f..979fc24a1671b4 100644 --- a/test/parallel/test-vm-context-async-script.js +++ b/test/parallel/test-vm-context-async-script.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-context-property-forwarding.js b/test/parallel/test-vm-context-property-forwarding.js index 6d51463ad6e44e..b1012f5dee05a5 100644 --- a/test/parallel/test-vm-context-property-forwarding.js +++ b/test/parallel/test-vm-context-property-forwarding.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index c843addc695780..cdf76529efc08b 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-create-and-run-in-context.js b/test/parallel/test-vm-create-and-run-in-context.js index 863569ce788e79..cf6a4875d5aa64 100644 --- a/test/parallel/test-vm-create-and-run-in-context.js +++ b/test/parallel/test-vm-create-and-run-in-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-create-context-accessors.js b/test/parallel/test-vm-create-context-accessors.js index f0622245be16bf..23fc935389def8 100644 --- a/test/parallel/test-vm-create-context-accessors.js +++ b/test/parallel/test-vm-create-context-accessors.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-create-context-arg.js b/test/parallel/test-vm-create-context-arg.js index 8c49a373634527..65dcf05e2b2bf3 100644 --- a/test/parallel/test-vm-create-context-arg.js +++ b/test/parallel/test-vm-create-context-arg.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-create-context-circular-reference.js b/test/parallel/test-vm-create-context-circular-reference.js index ae5b48c81ce8fd..ae23eba167b9fb 100644 --- a/test/parallel/test-vm-create-context-circular-reference.js +++ b/test/parallel/test-vm-create-context-circular-reference.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-cross-context.js b/test/parallel/test-vm-cross-context.js index 6f5d501fe026a2..56c6040be7f5d6 100644 --- a/test/parallel/test-vm-cross-context.js +++ b/test/parallel/test-vm-cross-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-debug-context.js b/test/parallel/test-vm-debug-context.js index 5569b3853c4199..a648777fdcf974 100644 --- a/test/parallel/test-vm-debug-context.js +++ b/test/parallel/test-vm-debug-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-function-declaration.js b/test/parallel/test-vm-function-declaration.js index 58772ba2f5ad10..c9a4fbb03eb620 100644 --- a/test/parallel/test-vm-function-declaration.js +++ b/test/parallel/test-vm-function-declaration.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-global-define-property.js b/test/parallel/test-vm-global-define-property.js index fcfe489c1ad291..ea30a4f3156745 100644 --- a/test/parallel/test-vm-global-define-property.js +++ b/test/parallel/test-vm-global-define-property.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-vm-global-identity.js b/test/parallel/test-vm-global-identity.js index adfb3235846e9c..bc3d9653a7c437 100644 --- a/test/parallel/test-vm-global-identity.js +++ b/test/parallel/test-vm-global-identity.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-harmony-proxies.js b/test/parallel/test-vm-harmony-proxies.js index e1b4ec8ad2dd6a..859d77cd62d73b 100644 --- a/test/parallel/test-vm-harmony-proxies.js +++ b/test/parallel/test-vm-harmony-proxies.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --harmony_proxies var common = require('../common'); diff --git a/test/parallel/test-vm-harmony-symbols.js b/test/parallel/test-vm-harmony-symbols.js index 200084fdf42ad9..127e3c4a2b291e 100644 --- a/test/parallel/test-vm-harmony-symbols.js +++ b/test/parallel/test-vm-harmony-symbols.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-is-context.js b/test/parallel/test-vm-is-context.js index 9ef2037fe03a2b..7b3d6616ee4a1d 100644 --- a/test/parallel/test-vm-is-context.js +++ b/test/parallel/test-vm-is-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js index 139d8542915c24..742f247a11c19a 100644 --- a/test/parallel/test-vm-new-script-new-context.js +++ b/test/parallel/test-vm-new-script-new-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var Script = require('vm').Script; diff --git a/test/parallel/test-vm-new-script-this-context.js b/test/parallel/test-vm-new-script-this-context.js index ff0b5b36f741b7..99d40bea2e2237 100644 --- a/test/parallel/test-vm-new-script-this-context.js +++ b/test/parallel/test-vm-new-script-this-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var Script = require('vm').Script; diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js index ecb80bdbc05db2..4772c3b99d9eb5 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --expose-gc var common = require('../common'); diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index 860fbf04dd3711..b7b013396bef8a 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index 8ad2a234bb26e8..9925e03ad69d30 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-writedouble.js b/test/parallel/test-writedouble.js index a700a82b42c0ae..24ceb885f54318 100644 --- a/test/parallel/test-writedouble.js +++ b/test/parallel/test-writedouble.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're writing doubles correctly */ diff --git a/test/parallel/test-writefloat.js b/test/parallel/test-writefloat.js index 0b4d21532eae9b..5d5be20354377f 100644 --- a/test/parallel/test-writefloat.js +++ b/test/parallel/test-writefloat.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're writing floats correctly */ diff --git a/test/parallel/test-writeint.js b/test/parallel/test-writeint.js index 10540b6bd75312..064716ad0ccd16 100644 --- a/test/parallel/test-writeint.js +++ b/test/parallel/test-writeint.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * Tests to verify we're writing signed integers correctly */ diff --git a/test/parallel/test-writeuint.js b/test/parallel/test-writeuint.js index da0d7952812604..ec2efa12fb95ef 100644 --- a/test/parallel/test-writeuint.js +++ b/test/parallel/test-writeuint.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - /* * A battery of tests to help us read a series of uints */ diff --git a/test/parallel/test-zlib-close-after-write.js b/test/parallel/test-zlib-close-after-write.js index f0f176008f9e60..d159604417c7f8 100644 --- a/test/parallel/test-zlib-close-after-write.js +++ b/test/parallel/test-zlib-close-after-write.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js index 88cf82f04c8d67..eb9a2b23c458ca 100644 --- a/test/parallel/test-zlib-convenience-methods.js +++ b/test/parallel/test-zlib-convenience-methods.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test convenience methods with and without options supplied var common = require('../common.js'); diff --git a/test/parallel/test-zlib-dictionary-fail.js b/test/parallel/test-zlib-dictionary-fail.js index fd35a0192aecc3..ad8a95e0b492a5 100644 --- a/test/parallel/test-zlib-dictionary-fail.js +++ b/test/parallel/test-zlib-dictionary-fail.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-dictionary.js b/test/parallel/test-zlib-dictionary.js index 58da810ccdcc93..8af44823b1352e 100644 --- a/test/parallel/test-zlib-dictionary.js +++ b/test/parallel/test-zlib-dictionary.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test compression/decompression with dictionary var common = require('../common.js'); diff --git a/test/parallel/test-zlib-from-gzip.js b/test/parallel/test-zlib-from-gzip.js index 3993542099915d..51a275c9c7a68c 100644 --- a/test/parallel/test-zlib-from-gzip.js +++ b/test/parallel/test-zlib-from-gzip.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test unzipping a file that was created with a non-node gzip lib, // piped in as fast as possible. diff --git a/test/parallel/test-zlib-from-multiple-gzip-with-garbage.js b/test/parallel/test-zlib-from-multiple-gzip-with-garbage.js deleted file mode 100644 index f6a0185e0119d6..00000000000000 --- a/test/parallel/test-zlib-from-multiple-gzip-with-garbage.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// test unzipping a file that was created by concatenating multiple gzip -// streams. - -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); - -var util = require('util'); - -var gzipBuffer = new Buffer(128); -var gzipOffset = 0; - -var stream1 = '123\n'; -var stream2 = '456\n'; -var stream3 = '789\n'; - -function gzipAppend(data) { - data.copy(gzipBuffer, gzipOffset); - gzipOffset += data.length; -} - -function writeGzipStream(text, cb) { - var gzip = zlib.createGzip(); - gzip.on('data', gzipAppend); - gzip.write(text, function() { - gzip.flush(function() { - gzip.end(function() { - cb(); - }); - }); - }); -} - -function writeGarbageStream(text, cb) { - gzipAppend(new Buffer(text)); - cb(); -} - -writeGzipStream(stream1, function() { - writeGzipStream(stream2, function() { - writeGarbageStream(stream3, function() { - var gunzip = zlib.createGunzip(); - var gunzippedData = new Buffer(2 * 1024); - var gunzippedOffset = 0; - gunzip.on('data', function (data) { - data.copy(gunzippedData, gunzippedOffset); - gunzippedOffset += data.length; - }); - gunzip.on('error', function() { - assert.equal(gunzippedData.toString('utf8', 0, gunzippedOffset), - stream1 + stream2); - }); - gunzip.on('end', function() { - assert.fail('end event not expected'); - }); - - gunzip.write(gzipBuffer.slice(0, gzipOffset), 'binary', function() { - gunzip.end(); - }); - }); - }); -}); diff --git a/test/parallel/test-zlib-from-multiple-gzip.js b/test/parallel/test-zlib-from-multiple-gzip.js deleted file mode 100644 index 6f4127a4d304c5..00000000000000 --- a/test/parallel/test-zlib-from-multiple-gzip.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// test unzipping a file that was created by concatenating multiple gzip -// streams. - -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); - -var util = require('util'); - -var gzipBuffer = new Buffer(128); -var gzipOffset = 0; - -var stream1 = '123\n'; -var stream2 = '456\n'; -var stream3 = '789\n'; - -function gzipAppend(data) { - data.copy(gzipBuffer, gzipOffset); - gzipOffset += data.length; -} - -function writeGzipStream(text, cb) { - var gzip = zlib.createGzip(); - gzip.on('data', gzipAppend); - gzip.write(text, function() { - gzip.flush(function() { - gzip.end(function() { - cb(); - }); - }); - }); -} - -writeGzipStream(stream1, function() { - writeGzipStream(stream2, function() { - writeGzipStream(stream3, function() { - var gunzip = zlib.createGunzip(); - var gunzippedData = new Buffer(2 * 1024); - var gunzippedOffset = 0; - gunzip.on('data', function (data) { - data.copy(gunzippedData, gunzippedOffset); - gunzippedOffset += data.length; - }); - gunzip.on('end', function() { - assert.equal(gunzippedData.toString('utf8', 0, gunzippedOffset), stream1 + stream2 + stream3); - }); - - gunzip.write(gzipBuffer.slice(0, gzipOffset), 'binary', function() { - gunzip.end(); - }); - }); - }); -}); diff --git a/test/parallel/test-zlib-from-multiple-huge-gzip.js b/test/parallel/test-zlib-from-multiple-huge-gzip.js deleted file mode 100644 index 5533aafeb72f9a..00000000000000 --- a/test/parallel/test-zlib-from-multiple-huge-gzip.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// test unzipping a file that was created by concatenating multiple gzip -// streams. - -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); - -var util = require('util'); - -var HUGE = 64 * 1024; - -var originalBuffer = new Buffer(3 * HUGE); -var originalOffset = 0; - -var gzipBuffer = new Buffer(3 * HUGE); -var gzipOffset = 0; - -function getRandomLetter() { - return (Math.random() * (122 - 97)) + 97; -} - -function generateHugeStream() { - var buffer = new Buffer(HUGE); - for (var i = 0; i < HUGE; i++) - buffer.writeUInt8(getRandomLetter(), i); - - buffer.copy(originalBuffer, originalOffset); - originalOffset += HUGE; - - return buffer; -} - -function gzipAppend(data) { - data.copy(gzipBuffer, gzipOffset); - gzipOffset += data.length; -} - -function writeGzipStream(text, cb) { - var gzip = zlib.createGzip(); - gzip.on('data', gzipAppend); - gzip.write(text, function() { - gzip.flush(function() { - gzip.end(function() { - cb(); - }); - }); - }); -} - -writeGzipStream(generateHugeStream(), function() { - writeGzipStream(generateHugeStream(), function() { - writeGzipStream(generateHugeStream(), function() { - var gunzip = zlib.createGunzip(); - var gunzippedData = new Buffer(3 * HUGE); - var gunzippedOffset = 0; - gunzip.on('data', function (data) { - data.copy(gunzippedData, gunzippedOffset); - gunzippedOffset += data.length; - }); - gunzip.on('end', function() { - var gunzippedStr = gunzippedData.toString('utf8', 0, gunzippedOffset); - var originalStr = originalBuffer.toString('utf8', 0, 3 * HUGE); - - assert.equal(gunzippedStr, originalStr); - }); - - gunzip.write(gzipBuffer.slice(0, gzipOffset), 'binary', function() { - gunzip.end(); - }); - }); - }); -}); diff --git a/test/parallel/test-zlib-from-string.js b/test/parallel/test-zlib-from-string.js index 83bdeea83a9078..6382781f0ac936 100644 --- a/test/parallel/test-zlib-from-string.js +++ b/test/parallel/test-zlib-from-string.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test compressing and uncompressing a string with zlib var common = require('../common.js'); diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index c3d8b5b47a5fb0..ce5c2d6b0ff130 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // test uncompressing invalid input var common = require('../common.js'), diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index fc1db1cbba5e17..a5f4086e8399d1 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var crypto = require('crypto'); var stream = require('stream'); diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index d3f3d4e6b3c4df..5e798a2063859a 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-write-after-flush.js b/test/parallel/test-zlib-write-after-flush.js index e13871ecb62ec1..c0dbee7774b42d 100644 --- a/test/parallel/test-zlib-write-after-flush.js +++ b/test/parallel/test-zlib-write-after-flush.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-zero-byte.js b/test/parallel/test-zlib-zero-byte.js index 31ac86bd6ab13c..e7c8ddc954f77a 100644 --- a/test/parallel/test-zlib-zero-byte.js +++ b/test/parallel/test-zlib-zero-byte.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index b9267525ee44b0..869567c769243c 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/pummel/test-abort-fatal-error.js b/test/pummel/test-abort-fatal-error.js index 79e3d72e869f0d..045ff6da7f69e0 100644 --- a/test/pummel/test-abort-fatal-error.js +++ b/test/pummel/test-abort-fatal-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. - -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: - -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); diff --git a/test/pummel/test-buffer-big.js b/test/pummel/test-buffer-big.js index 8a26c4eb182332..9caa9287663a19 100644 --- a/test/pummel/test-buffer-big.js +++ b/test/pummel/test-buffer-big.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-child-process-spawn-loop.js b/test/pummel/test-child-process-spawn-loop.js index 631d9fc473f803..a6129dd0bb2081 100644 --- a/test/pummel/test-child-process-spawn-loop.js +++ b/test/pummel/test-child-process-spawn-loop.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index e4e883f6996477..0f3a5407dc7ed5 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index 2910dedc26e0a9..5f4534c36598b6 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-dtrace-jsstack.js b/test/pummel/test-dtrace-jsstack.js index 6779a766a70c8a..e86a497f6967ba 100644 --- a/test/pummel/test-dtrace-jsstack.js +++ b/test/pummel/test-dtrace-jsstack.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/pummel/test-exec.js b/test/pummel/test-exec.js index 6eacda783c5cd2..9665f6b81a0b22 100644 --- a/test/pummel/test-exec.js +++ b/test/pummel/test-exec.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/pummel/test-fs-readfile-large.js b/test/pummel/test-fs-readfile-large.js index 6021aac8952f99..d8c6634fb827ab 100644 --- a/test/pummel/test-fs-readfile-large.js +++ b/test/pummel/test-fs-readfile-large.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-fs-watch-file-slow.js b/test/pummel/test-fs-watch-file-slow.js index 9240ad01f03031..df8763a4e2839d 100644 --- a/test/pummel/test-fs-watch-file-slow.js +++ b/test/pummel/test-fs-watch-file-slow.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/pummel/test-fs-watch-file.js b/test/pummel/test-fs-watch-file.js index 3e8a17a4b8b231..199bf5242e251b 100644 --- a/test/pummel/test-fs-watch-file.js +++ b/test/pummel/test-fs-watch-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/pummel/test-fs-watch-non-recursive.js b/test/pummel/test-fs-watch-non-recursive.js index 374a15e271cd23..60d2c6b6a84900 100644 --- a/test/pummel/test-fs-watch-non-recursive.js +++ b/test/pummel/test-fs-watch-non-recursive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/pummel/test-http-client-reconnect-bug.js b/test/pummel/test-http-client-reconnect-bug.js index a85cc13bc448ce..00a38608125dbd 100644 --- a/test/pummel/test-http-client-reconnect-bug.js +++ b/test/pummel/test-http-client-reconnect-bug.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-http-many-keep-alive-connections.js b/test/pummel/test-http-many-keep-alive-connections.js index adbebbdcc433f6..fdd7a068102c3d 100644 --- a/test/pummel/test-http-many-keep-alive-connections.js +++ b/test/pummel/test-http-many-keep-alive-connections.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/pummel/test-http-upload-timeout.js b/test/pummel/test-http-upload-timeout.js index 8a37de4ac2e468..f889c60f177b5f 100644 --- a/test/pummel/test-http-upload-timeout.js +++ b/test/pummel/test-http-upload-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This tests setTimeout() by having multiple clients connecting and sending // data in random intervals. Clients are also randomly disconnecting until there // are no more clients left. If no false timeout occurs, this test has passed. diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 2dacfc065bb833..cbdb2328cb314f 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index 370415dcb78faa..3ba36b496ad8f3 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index d046482be0f9e4..1da46548c14156 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index 8611f4dbec6c99..df5e1230873071 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - if (process.platform === 'win32') { console.log('skipping this test because there is no wrk on windows'); process.exit(0); diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index 5dff1248d9cf66..be3db49aa4fe7a 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/test/pummel/test-net-connect-econnrefused.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // verify that connect reqs are properly cleaned up var common = require('../common'); diff --git a/test/pummel/test-net-connect-memleak.js b/test/pummel/test-net-connect-memleak.js index 3e7503864a429c..66b7e926d8cadc 100644 --- a/test/pummel/test-net-connect-memleak.js +++ b/test/pummel/test-net-connect-memleak.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --expose-gc var common = require('../common'); diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js index 83ff181990376f..fce7f33e669ccb 100644 --- a/test/pummel/test-net-many-clients.js +++ b/test/pummel/test-net-many-clients.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-pause.js b/test/pummel/test-net-pause.js index 740869d2196a77..26eec2cfd092d6 100644 --- a/test/pummel/test-net-pause.js +++ b/test/pummel/test-net-pause.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-pingpong-delay.js b/test/pummel/test-net-pingpong-delay.js index 7b1d59036a596f..8a30e7bae7f5fd 100644 --- a/test/pummel/test-net-pingpong-delay.js +++ b/test/pummel/test-net-pingpong-delay.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js index aab03c2872ee07..d38064e64a4067 100644 --- a/test/pummel/test-net-pingpong.js +++ b/test/pummel/test-net-pingpong.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js index 228b5518183145..45c0a6fb6d9cc5 100644 --- a/test/pummel/test-net-throttle.js +++ b/test/pummel/test-net-throttle.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js index 4fc43c859fead3..47214fc98f528a 100644 --- a/test/pummel/test-net-timeout.js +++ b/test/pummel/test-net-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/pummel/test-net-timeout2.js b/test/pummel/test-net-timeout2.js index cc0516cc249f8e..2eb97a6e7e2f1c 100644 --- a/test/pummel/test-net-timeout2.js +++ b/test/pummel/test-net-timeout2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // socket.write was not resetting the timeout timer. See // https://github.com/joyent/node/issues/2002 diff --git a/test/pummel/test-net-write-callbacks.js b/test/pummel/test-net-write-callbacks.js index aca418257aa2c4..b43729d0c1ed46 100644 --- a/test/pummel/test-net-write-callbacks.js +++ b/test/pummel/test-net-write-callbacks.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'); var assert = require('assert'); diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js index 6912fee76e1532..5177135a34a6e2 100644 --- a/test/pummel/test-next-tick-infinite-calls.js +++ b/test/pummel/test-next-tick-infinite-calls.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-postmortem-findjsobjects.js b/test/pummel/test-postmortem-findjsobjects.js index 65214a0e068cda..555d42aacded82 100644 --- a/test/pummel/test-postmortem-findjsobjects.js +++ b/test/pummel/test-postmortem-findjsobjects.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/pummel/test-postmortem-jsstack.js b/test/pummel/test-postmortem-jsstack.js index 04b3352a530f51..784f3df041222a 100644 --- a/test/pummel/test-postmortem-jsstack.js +++ b/test/pummel/test-postmortem-jsstack.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/pummel/test-process-hrtime.js b/test/pummel/test-process-hrtime.js index 74608d1a558e91..faf97d8a8daed1 100644 --- a/test/pummel/test-process-hrtime.js +++ b/test/pummel/test-process-hrtime.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-process-uptime.js b/test/pummel/test-process-uptime.js index 602f7775dbdf10..b105edebbd8689 100644 --- a/test/pummel/test-process-uptime.js +++ b/test/pummel/test-process-uptime.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-regress-GH-814.js b/test/pummel/test-regress-GH-814.js index e4c9c92ce62da0..20183960e04af8 100644 --- a/test/pummel/test-regress-GH-814.js +++ b/test/pummel/test-regress-GH-814.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --expose_gc function newBuffer(size, value) { diff --git a/test/pummel/test-regress-GH-814_2.js b/test/pummel/test-regress-GH-814_2.js index 8015f4ed2402b0..7443e4f57eaf98 100644 --- a/test/pummel/test-regress-GH-814_2.js +++ b/test/pummel/test-regress-GH-814_2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --expose_gc var common = require('../common'); diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js index 0c411849463330..188e552987eacc 100644 --- a/test/pummel/test-regress-GH-892.js +++ b/test/pummel/test-regress-GH-892.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // Uploading a big file via HTTPS causes node to drop out of the event loop. // https://github.com/joyent/node/issues/892 // In this test we set up an HTTPS in this process and launch a subprocess diff --git a/test/pummel/test-smalloc-alloc-segfault.js b/test/pummel/test-smalloc-alloc-segfault.js index 6d484857fa89ae..3e89f726ce7f70 100644 --- a/test/pummel/test-smalloc-alloc-segfault.js +++ b/test/pummel/test-smalloc-alloc-segfault.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-smalloc-dispose-segfault.js b/test/pummel/test-smalloc-dispose-segfault.js index 22c8587535d63a..e94d9d5ba17c76 100644 --- a/test/pummel/test-smalloc-dispose-segfault.js +++ b/test/pummel/test-smalloc-dispose-segfault.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-smalloc-sliceonto-segfault.js b/test/pummel/test-smalloc-sliceonto-segfault.js index 62a438c6e3a3b6..ed43828a530ee6 100644 --- a/test/pummel/test-smalloc-sliceonto-segfault.js +++ b/test/pummel/test-smalloc-sliceonto-segfault.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-stream-pipe-multi.js b/test/pummel/test-stream-pipe-multi.js index 9a8535ffe7d26e..00d17f17425c0b 100644 --- a/test/pummel/test-stream-pipe-multi.js +++ b/test/pummel/test-stream-pipe-multi.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Test that having a bunch of streams piping in parallel // doesn't break anything. diff --git a/test/pummel/test-stream2-basic.js b/test/pummel/test-stream2-basic.js index f210c9f0309cbe..fc0cac04e37812 100644 --- a/test/pummel/test-stream2-basic.js +++ b/test/pummel/test-stream2-basic.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var R = require('_stream_readable'); var assert = require('assert'); diff --git a/test/pummel/test-timer-wrap.js b/test/pummel/test-timer-wrap.js index 1ddea727eb62b9..fdfb855a75830d 100644 --- a/test/pummel/test-timer-wrap.js +++ b/test/pummel/test-timer-wrap.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-timer-wrap2.js b/test/pummel/test-timer-wrap2.js index 4fb424a54c0497..8a7502888b5557 100644 --- a/test/pummel/test-timer-wrap2.js +++ b/test/pummel/test-timer-wrap2.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 2c45bf05ef75e0..f676b98438852e 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index 13c3fe10952715..22f5b7baaef02c 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/pummel/test-tls-connect-memleak.js b/test/pummel/test-tls-connect-memleak.js index ceee4372d09322..9f8fb9e7103d89 100644 --- a/test/pummel/test-tls-connect-memleak.js +++ b/test/pummel/test-tls-connect-memleak.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --expose-gc var common = require('../common'); diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js index 711fae3642bd7b..8a2950c8cc8e17 100644 --- a/test/pummel/test-tls-securepair-client.js +++ b/test/pummel/test-tls-securepair-client.js @@ -1,23 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. // var common = require('../common'); diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index 9928e8547ed5ca..eac41df22f51c3 100644 --- a/test/pummel/test-tls-server-large-request.js +++ b/test/pummel/test-tls-server-large-request.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js index 87534f314fc6b1..13e6a957f10198 100644 --- a/test/pummel/test-tls-session-timeout.js +++ b/test/pummel/test-tls-session-timeout.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); if (!common.opensslCli) { diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index a7119944ad32c6..a0cca24e214c67 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Server sends a large string. Client counts bytes and pauses every few // seconds. Makes sure that pause and resume work properly. diff --git a/test/pummel/test-vm-memleak.js b/test/pummel/test-vm-memleak.js index 2abedc297b72d6..916b65d6da49a9 100644 --- a/test/pummel/test-vm-memleak.js +++ b/test/pummel/test-vm-memleak.js @@ -1,23 +1,4 @@ -// 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. +// Flags: --max_old_space_size=32 var assert = require('assert'); var common = require('../common'); @@ -25,6 +6,11 @@ var common = require('../common'); var start = Date.now(); var maxMem = 0; +var ok = process.execArgv.some(function(arg) { + return arg === '--max_old_space_size=32'; +}); +assert(ok, 'Run this test with --max_old_space_size=32.'); + var interval = setInterval(function() { try { require('vm').runInNewContext('throw 1;'); @@ -34,7 +20,6 @@ var interval = setInterval(function() { var rss = process.memoryUsage().rss; maxMem = Math.max(rss, maxMem); - if (Date.now() - start > 5 * 1000) { // wait 10 seconds. clearInterval(interval); @@ -50,6 +35,5 @@ function testContextLeak() { process.on('exit', function() { console.error('max mem: %dmb', Math.round(maxMem / (1024 * 1024))); - // make sure we stay below 100mb - assert.ok(maxMem < 50 * 1024 * 1024); + assert.ok(maxMem < 64 * 1024 * 1024); }); diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js index 1a3d854101c971..3e92efc26c9edb 100644 --- a/test/pummel/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-chdir.js b/test/sequential/test-chdir.js index 7454bee2d3387b..a24753de2d28e0 100644 --- a/test/sequential/test-chdir.js +++ b/test/sequential/test-chdir.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var fs = require('fs'); @@ -38,3 +17,7 @@ assert(process.cwd() == dir); process.chdir('..'); assert(process.cwd() == path.resolve(common.fixturesDir)); fs.rmdirSync(dir); + +assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); +assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); +assert.throws(function() { process.chdir("x", "y"); }, TypeError, 'Bad argument.'); diff --git a/test/sequential/test-child-process-emfile.js b/test/sequential/test-child-process-emfile.js index 323bbb0a38333d..66be12749c9f03 100644 --- a/test/sequential/test-child-process-emfile.js +++ b/test/sequential/test-child-process-emfile.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index e97de721f6d9b0..91105e4620eaf3 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var util = require('util'); diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index f8fed6884f5a53..6848b2ffa0b9c6 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var common = require('../common'); var fork = require('child_process').fork; diff --git a/test/sequential/test-cluster-listening-port.js b/test/sequential/test-cluster-listening-port.js index 352c4d757eba72..5d68b066cfd9e2 100644 --- a/test/sequential/test-cluster-listening-port.js +++ b/test/sequential/test-cluster-listening-port.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var cluster = require('cluster'); var net = require('net'); diff --git a/test/sequential/test-debug-args.js b/test/sequential/test-debug-args.js index 51eaa801d88e24..7aaef76a641fd6 100644 --- a/test/sequential/test-debug-args.js +++ b/test/sequential/test-debug-args.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Flags: --debugger var common = require('../common'); diff --git a/test/sequential/test-debug-cluster.js b/test/sequential/test-debug-cluster.js deleted file mode 100644 index c0963c35a97661..00000000000000 --- a/test/sequential/test-debug-cluster.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; - -var args = ['--debug', common.fixturesDir + '/clustered-server/app.js' ]; -var child = spawn(process.execPath, args); -var outputLines = []; - -child.stderr.on('data', function(data) { - var lines = data.toString().replace(/\r/g, '').trim().split('\n'); - var line = lines[0]; - - lines.forEach(function(ln) { console.log('> ' + ln) } ); - - if (line === 'all workers are running') { - assertOutputLines(); - process.exit(); - } else { - outputLines = outputLines.concat(lines); - } -}); - -process.on('exit', function onExit() { - child.kill(); -}); - -var assertOutputLines = common.mustCall(function() { - var expectedLines = [ - 'Debugger listening on port ' + 5858, - 'Debugger listening on port ' + 5859, - 'Debugger listening on port ' + 5860, - ]; - - // Do not assume any particular order of output messages, - // since workers can take different amout of time to - // start up - outputLines.sort(); - - assert.equal(outputLines.length, expectedLines.length) - for (var i = 0; i < expectedLines.length; i++) - assert.equal(outputLines[i], expectedLines[i]); -}); diff --git a/test/sequential/test-debug-signal-cluster.js b/test/sequential/test-debug-signal-cluster.js deleted file mode 100644 index cd57e548a93601..00000000000000 --- a/test/sequential/test-debug-signal-cluster.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; - -var args = [ common.fixturesDir + '/clustered-server/app.js' ]; -var child = spawn(process.execPath, args, { - stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ] -}); -var outputLines = []; -var outputTimerId; -var waitingForDebuggers = false; - -var pids = null; - -child.stderr.on('data', function(data) { - var lines = data.toString().replace(/\r/g, '').trim().split('\n'); - var line = lines[0]; - - lines.forEach(function(ln) { console.log('> ' + ln) } ); - - if (outputTimerId !== undefined) - clearTimeout(outputTimerId); - - if (waitingForDebuggers) { - outputLines = outputLines.concat(lines); - outputTimerId = setTimeout(onNoMoreLines, 800); - } else if (line === 'all workers are running') { - child.on('message', function(msg) { - if (msg.type !== 'pids') - return; - - pids = msg.pids; - console.error('got pids %j', pids); - - waitingForDebuggers = true; - process._debugProcess(child.pid); - }); - - child.send({ - type: 'getpids' - }); - } -}); - -function onNoMoreLines() { - assertOutputLines(); - process.exit(); -} - -setTimeout(function testTimedOut() { - assert(false, 'test timed out.'); -}, 6000); - -process.on('exit', function onExit() { - // Kill processes in reverse order to avoid timing problems on Windows where - // the parent process is killed before the children. - pids.reverse().forEach(function(pid) { - process.kill(pid); - }); -}); - -function assertOutputLines() { - var expectedLines = [ - 'Starting debugger agent.', - 'Debugger listening on port ' + 5858, - 'Starting debugger agent.', - 'Debugger listening on port ' + 5859, - 'Starting debugger agent.', - 'Debugger listening on port ' + 5860, - ]; - - // Do not assume any particular order of output messages, - // since workers can take different amout of time to - // start up - outputLines.sort(); - expectedLines.sort(); - - assert.equal(outputLines.length, expectedLines.length); - for (var i = 0; i < expectedLines.length; i++) - assert.equal(outputLines[i], expectedLines[i]); -} diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index 3d50c097f687ce..2af60a17364999 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var execFile = require('child_process').execFile; diff --git a/test/sequential/test-force-repl.js b/test/sequential/test-force-repl.js index 60ba3485bb2069..fa17297ad257b2 100644 --- a/test/sequential/test-force-repl.js +++ b/test/sequential/test-force-repl.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/sequential/test-fs-watch-recursive.js b/test/sequential/test-fs-watch-recursive.js index e421ab02227621..a789dcb3061b3d 100644 --- a/test/sequential/test-fs-watch-recursive.js +++ b/test/sequential/test-fs-watch-recursive.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 470736d594ffb8..7c86e211620006 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-http-pipeline-flood.js b/test/sequential/test-http-pipeline-flood.js index 64c56dbf34c45a..6eeb785f9cbc2a 100644 --- a/test/sequential/test-http-pipeline-flood.js +++ b/test/sequential/test-http-pipeline-flood.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-init.js b/test/sequential/test-init.js index 139df7f58b3e89..b2f25899c2c128 100644 --- a/test/sequential/test-init.js +++ b/test/sequential/test-init.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - (function() { var assert = require('assert'), child = require('child_process'), diff --git a/test/sequential/test-memory-usage-emfile.js b/test/sequential/test-memory-usage-emfile.js index aaed8995309f54..e95fe429c37645 100644 --- a/test/sequential/test-memory-usage-emfile.js +++ b/test/sequential/test-memory-usage-emfile.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-mkdir-rmdir.js b/test/sequential/test-mkdir-rmdir.js index 73534555c8c1e0..63dc78df381e78 100644 --- a/test/sequential/test-mkdir-rmdir.js +++ b/test/sequential/test-mkdir-rmdir.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index c923d56fd4a6d8..c1d8df4553370c 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index 0e87c8210eff8a..ef2e1ceb29bebf 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-net-listen-exclusive-random-ports.js b/test/sequential/test-net-listen-exclusive-random-ports.js index 2c0aa49044e324..2922a2b06e140f 100644 --- a/test/sequential/test-net-listen-exclusive-random-ports.js +++ b/test/sequential/test-net-listen-exclusive-random-ports.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); diff --git a/test/sequential/test-net-localport.js b/test/sequential/test-net-localport.js index 34fa377dc8e01e..239196813ad8a3 100644 --- a/test/sequential/test-net-localport.js +++ b/test/sequential/test-net-localport.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-net-server-address.js b/test/sequential/test-net-server-address.js index cc8fbd211aa5af..936a7760b14be4 100644 --- a/test/sequential/test-net-server-address.js +++ b/test/sequential/test-net-server-address.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-net-server-bind.js b/test/sequential/test-net-server-bind.js index 0951aa246209a1..c07261c7e8db96 100644 --- a/test/sequential/test-net-server-bind.js +++ b/test/sequential/test-net-server-bind.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index e0d47a2147b2da..c8011115c04f0e 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-pipe-address.js b/test/sequential/test-pipe-address.js index 6b29d2a2c48422..6497eb7f1246c1 100644 --- a/test/sequential/test-pipe-address.js +++ b/test/sequential/test-pipe-address.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-pipe-head.js b/test/sequential/test-pipe-head.js index a049be6c295ed2..4fa3eaa4daa59c 100644 --- a/test/sequential/test-pipe-head.js +++ b/test/sequential/test-pipe-head.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-pipe-stream.js b/test/sequential/test-pipe-stream.js index b2b2a551847a20..5e5837b29843b6 100644 --- a/test/sequential/test-pipe-stream.js +++ b/test/sequential/test-pipe-stream.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-pipe-unref.js b/test/sequential/test-pipe-unref.js index 9f715a9d172d02..53853b9bdcba66 100644 --- a/test/sequential/test-pipe-unref.js +++ b/test/sequential/test-pipe-unref.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-pipe.js b/test/sequential/test-pipe.js index 9f1dae885b03d4..11ea83b88422ba 100644 --- a/test/sequential/test-pipe.js +++ b/test/sequential/test-pipe.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var http = require('http'); diff --git a/test/sequential/test-pump-file2tcp-noexist.js b/test/sequential/test-pump-file2tcp-noexist.js index 8017db73f189c4..8b2057e533c60e 100644 --- a/test/sequential/test-pump-file2tcp-noexist.js +++ b/test/sequential/test-pump-file2tcp-noexist.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-pump-file2tcp.js b/test/sequential/test-pump-file2tcp.js index 60c0fdd7f04836..50b576771f9074 100644 --- a/test/sequential/test-pump-file2tcp.js +++ b/test/sequential/test-pump-file2tcp.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-readdir.js b/test/sequential/test-readdir.js index 24997241f9b9bb..bba28d0d7a8bfc 100644 --- a/test/sequential/test-readdir.js +++ b/test/sequential/test-readdir.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-regress-GH-1531.js b/test/sequential/test-regress-GH-1531.js index 53bc2a3ca1ef8a..120618dcad156e 100644 --- a/test/sequential/test-regress-GH-1531.js +++ b/test/sequential/test-regress-GH-1531.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - if (!process.versions.openssl) { console.error('Skipping because node compiled without OpenSSL.'); process.exit(0); diff --git a/test/sequential/test-regress-GH-1697.js b/test/sequential/test-regress-GH-1697.js index fdf2c42e9e2da4..18d1829174dd8b 100644 --- a/test/sequential/test-regress-GH-1697.js +++ b/test/sequential/test-regress-GH-1697.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'), cp = require('child_process'), diff --git a/test/sequential/test-regress-GH-1726.js b/test/sequential/test-regress-GH-1726.js index f65e63d10ba932..74578ab4e0fe55 100644 --- a/test/sequential/test-regress-GH-1726.js +++ b/test/sequential/test-regress-GH-1726.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// 'Software'), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Open a chain of five Node processes each a child of the next. The final // process exits immediately. Each process in the chain is instructed to // exit when its child exits. diff --git a/test/sequential/test-regress-GH-1899.js b/test/sequential/test-regress-GH-1899.js index 7fc8007a24c2c0..8663eb5a4dd1ea 100644 --- a/test/sequential/test-regress-GH-1899.js +++ b/test/sequential/test-regress-GH-1899.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var path = require('path'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/sequential/test-regress-GH-3542.js b/test/sequential/test-regress-GH-3542.js index 90e0b78501a688..5411e1ca71db25 100644 --- a/test/sequential/test-regress-GH-3542.js +++ b/test/sequential/test-regress-GH-3542.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This test is only relevant on Windows. if (process.platform !== 'win32') { return process.exit(0); diff --git a/test/sequential/test-regress-GH-3739.js b/test/sequential/test-regress-GH-3739.js index 4a7e8e15217546..709f71220d1ead 100644 --- a/test/sequential/test-regress-GH-3739.js +++ b/test/sequential/test-regress-GH-3739.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'), assert = require('assert'), fs = require('fs'), diff --git a/test/sequential/test-regress-GH-4015.js b/test/sequential/test-regress-GH-4015.js index b66584f8048847..9fce060ad223c5 100644 --- a/test/sequential/test-regress-GH-4015.js +++ b/test/sequential/test-regress-GH-4015.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/sequential/test-regress-GH-4027.js b/test/sequential/test-regress-GH-4027.js index 3dff1684d7badb..de2dff180db5c0 100644 --- a/test/sequential/test-regress-GH-4027.js +++ b/test/sequential/test-regress-GH-4027.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-regress-GH-4948.js b/test/sequential/test-regress-GH-4948.js index 5e717fad56fdf3..e78870b704c917 100644 --- a/test/sequential/test-regress-GH-4948.js +++ b/test/sequential/test-regress-GH-4948.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // https://github.com/joyent/node/issues/4948 var common = require('../common'); diff --git a/test/sequential/test-regress-GH-746.js b/test/sequential/test-regress-GH-746.js index 29f1456522ac86..93346c43f1d9e2 100644 --- a/test/sequential/test-regress-GH-746.js +++ b/test/sequential/test-regress-GH-746.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Just test that destroying stdin doesn't mess up listening on a server. // This is a regression test for GH-746. diff --git a/test/sequential/test-regress-GH-784.js b/test/sequential/test-regress-GH-784.js index c2039a9c6ae65f..a33b6f23c479bf 100644 --- a/test/sequential/test-regress-GH-784.js +++ b/test/sequential/test-regress-GH-784.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Regression test for GH-784 // https://github.com/joyent/node/issues/784 // diff --git a/test/sequential/test-regress-GH-819.js b/test/sequential/test-regress-GH-819.js index 874d99e285f00a..16d0f3bc54e4f3 100644 --- a/test/sequential/test-regress-GH-819.js +++ b/test/sequential/test-regress-GH-819.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var net = require('net'); var assert = require('assert'); diff --git a/test/sequential/test-regress-GH-877.js b/test/sequential/test-regress-GH-877.js index 30e1f8009e3628..80c8456742d5af 100644 --- a/test/sequential/test-regress-GH-877.js +++ b/test/sequential/test-regress-GH-877.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var http = require('http'); var assert = require('assert'); diff --git a/test/sequential/test-require-cache-without-stat.js b/test/sequential/test-require-cache-without-stat.js index c2c6c0655248f8..701d47bfc91800 100644 --- a/test/sequential/test-require-cache-without-stat.js +++ b/test/sequential/test-require-cache-without-stat.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // We've experienced a regression where the module loader stats a bunch of // directories on require() even if it's been called before. The require() // should caching the request. diff --git a/test/sequential/test-setproctitle.js b/test/sequential/test-setproctitle.js index 6373af4cd18494..b7e6dd8b552a5d 100644 --- a/test/sequential/test-setproctitle.js +++ b/test/sequential/test-setproctitle.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Original test written by Jakub Lekstan // FIXME add sunos support @@ -45,7 +24,7 @@ exec('ps -p ' + process.pid + ' -o args=', function(error, stdout, stderr) { assert.equal(stderr, ''); // freebsd always add ' (procname)' to the process title - if (process.platform === 'freebsd') title += ' (node)'; + if (process.platform === 'freebsd') title += ' (iojs)'; // omitting trailing whitespace and \n assert.equal(stdout.replace(/\s+$/, ''), title); diff --git a/test/sequential/test-sigint-infinite-loop.js b/test/sequential/test-sigint-infinite-loop.js index 4ff2745845a45f..c444caf419188e 100644 --- a/test/sequential/test-sigint-infinite-loop.js +++ b/test/sequential/test-sigint-infinite-loop.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - // This test is to assert that we can SIGINT a script which loops forever. // Ref(http): // groups.google.com/group/nodejs-dev/browse_thread/thread/e20f2f8df0296d3f diff --git a/test/sequential/test-signal-unregister.js b/test/sequential/test-signal-unregister.js index d65e0a0d98a782..3190ac3dce4248 100644 --- a/test/sequential/test-signal-unregister.js +++ b/test/sequential/test-signal-unregister.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-socket-write-after-fin-error.js b/test/sequential/test-socket-write-after-fin-error.js index 123557417ccc94..5274d6e3dabe43 100644 --- a/test/sequential/test-socket-write-after-fin-error.js +++ b/test/sequential/test-socket-write-after-fin-error.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-socket-write-after-fin.js b/test/sequential/test-socket-write-after-fin.js index 88d780b81e87d6..44d98ba512e1ca 100644 --- a/test/sequential/test-socket-write-after-fin.js +++ b/test/sequential/test-socket-write-after-fin.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/sequential/test-stdin-child-proc.js b/test/sequential/test-stdin-child-proc.js index 6a4ea947394822..4d3ead73ceac6c 100644 --- a/test/sequential/test-stdin-child-proc.js +++ b/test/sequential/test-stdin-child-proc.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This tests that pausing and resuming stdin does not hang and timeout // when done in a child process. See test/simple/test-stdin-pause-resume.js var common = require('../common'); diff --git a/test/sequential/test-stdin-from-file.js b/test/sequential/test-stdin-from-file.js index 617b9037d23374..bde2a8559c3db3 100644 --- a/test/sequential/test-stdin-from-file.js +++ b/test/sequential/test-stdin-from-file.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var join = require('path').join; diff --git a/test/sequential/test-stdin-pipe-resume.js b/test/sequential/test-stdin-pipe-resume.js index 163d8369c9e956..a326e380a73654 100644 --- a/test/sequential/test-stdin-pipe-resume.js +++ b/test/sequential/test-stdin-pipe-resume.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // This tests that piping stdin will cause it to resume() as well. var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-stdin-script-child.js b/test/sequential/test-stdin-script-child.js index e940c3c3f3b425..dcccff1ff5d47c 100644 --- a/test/sequential/test-stdin-script-child.js +++ b/test/sequential/test-stdin-script-child.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js b/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js index 2e79c5af101a2b..519dce059b2f25 100644 --- a/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js +++ b/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-stdout-close-catch.js b/test/sequential/test-stdout-close-catch.js index f517a6cbe439a1..c1165350aec0ba 100644 --- a/test/sequential/test-stdout-close-catch.js +++ b/test/sequential/test-stdout-close-catch.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-stdout-stderr-reading.js b/test/sequential/test-stdout-stderr-reading.js index 5b67a0d0618502..3fe0db0ce3abbd 100644 --- a/test/sequential/test-stdout-stderr-reading.js +++ b/test/sequential/test-stdout-stderr-reading.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-stdout-to-file.js b/test/sequential/test-stdout-to-file.js index 94181ef8174e4f..8a9d0476911c76 100644 --- a/test/sequential/test-stdout-to-file.js +++ b/test/sequential/test-stdout-to-file.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-stream2-fs.js b/test/sequential/test-stream2-fs.js index e1624062877175..cf9453ed274372 100644 --- a/test/sequential/test-stream2-fs.js +++ b/test/sequential/test-stream2-fs.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); var R = require('_stream_readable'); var assert = require('assert'); diff --git a/test/sequential/test-stream2-httpclient-response-end.js b/test/sequential/test-stream2-httpclient-response-end.js index 15cffc2ac9a774..bea0df38737a26 100644 --- a/test/sequential/test-stream2-httpclient-response-end.js +++ b/test/sequential/test-stream2-httpclient-response-end.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common.js'); var assert = require('assert'); var http = require('http'); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index 9e2d3ec223b09d..105eff846caa4b 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Make sure that sync writes to stderr get processed before exiting. var common = require('../common.js'); diff --git a/test/sequential/test-sync-fileread.js b/test/sequential/test-sync-fileread.js index 428838a8cddc32..3f5f6debd55fea 100644 --- a/test/sequential/test-sync-fileread.js +++ b/test/sequential/test-sync-fileread.js @@ -1,27 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-tcp-wrap-connect.js b/test/sequential/test-tcp-wrap-connect.js index 9e915d243bae35..2dc9f0cb93a185 100644 --- a/test/sequential/test-tcp-wrap-connect.js +++ b/test/sequential/test-tcp-wrap-connect.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var TCP = process.binding('tcp_wrap').TCP; diff --git a/test/sequential/test-tcp-wrap-listen.js b/test/sequential/test-tcp-wrap-listen.js index 5801368ba1e889..2c0856bd951788 100644 --- a/test/sequential/test-tcp-wrap-listen.js +++ b/test/sequential/test-tcp-wrap-listen.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-tls-honorcipherorder.js b/test/sequential/test-tls-honorcipherorder.js index 6b24d75146e20a..0cb85a3c19ae07 100644 --- a/test/sequential/test-tls-honorcipherorder.js +++ b/test/sequential/test-tls-honorcipherorder.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index 6d9c28a95a6eb0..e6e4cbb5a5f806 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); diff --git a/test/sequential/test-vm-syntax-error-stderr.js b/test/sequential/test-vm-syntax-error-stderr.js index 3e88e1ff10571f..b3f76e5e30c5e2 100644 --- a/test/sequential/test-vm-syntax-error-stderr.js +++ b/test/sequential/test-vm-syntax-error-stderr.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var common = require('../common'); var assert = require('assert'); var path = require('path'); diff --git a/test/sequential/test-vm-timeout-rethrow.js b/test/sequential/test-vm-timeout-rethrow.js index c2158a13509141..547ed2f8d6205b 100644 --- a/test/sequential/test-vm-timeout-rethrow.js +++ b/test/sequential/test-vm-timeout-rethrow.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var assert = require('assert'); var vm = require('vm'); var spawn = require('child_process').spawn; diff --git a/test/sequential/test-zerolengthbufferbug.js b/test/sequential/test-zerolengthbufferbug.js index 395e35baf5513a..dde08c63914b38 100644 --- a/test/sequential/test-zerolengthbufferbug.js +++ b/test/sequential/test-zerolengthbufferbug.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // Serving up a zero-length buffer should work. var common = require('../common'); diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index a46e964a475a68..a1b89898fe1e27 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -173,5 +173,6 @@ def ListTests(self, current_path, path, arch, mode): for test in all_tests: if self.Contains(path, test): file_path = join(self.root, reduce(join, test[1:], "") + ".js") - result.append(SimpleTestCase(test, file_path, mode, self.context, self)) + result.append( + SimpleTestCase(test, file_path, arch, mode, self.context, self)) return result diff --git a/tools/build-changelog.sh b/tools/build-changelog.sh index c6c219dae8213a..b7fe976a907de3 100644 --- a/tools/build-changelog.sh +++ b/tools/build-changelog.sh @@ -1,5 +1,5 @@ #!/bin/bash -cat ChangeLog \ +cat CHANGELOG.md \ | sed -E 's|([^/ ]+/[^#]+)#([0-9]+)|[\1#\2](https://github.com/\1/issues/\2)|g' \ | sed -E 's| #([0-9]+)| [#\1](https://github.com/joyent/node/issues/\1)|g' \ | sed -E 's|([0-9]+\.[0-9]+\.[0-9]+),? Version ([0-9]+\.[0-9]+\.[0-9]+)|\ diff --git a/tools/changelog-head.sh b/tools/changelog-head.sh index 94821e107f2737..f91b7c7cc81758 100644 --- a/tools/changelog-head.sh +++ b/tools/changelog-head.sh @@ -1,5 +1,5 @@ #!/bin/bash -cat ChangeLog | { +cat CHANGELOG.md | { s=-1 while read line; do if [ "${line:0:1}" == "-" ]; then diff --git a/tools/closure_linter/AUTHORS b/tools/closure_linter/AUTHORS new file mode 100644 index 00000000000000..2f72bd6b2fce9a --- /dev/null +++ b/tools/closure_linter/AUTHORS @@ -0,0 +1,6 @@ +# This is a list of contributors to the Closure Linter. + +# Names should be added to this file like so: +# Name or Organization + +Google Inc. diff --git a/tools/closure_linter/LICENSE b/tools/closure_linter/LICENSE new file mode 100644 index 00000000000000..d9a10c0d8e868e --- /dev/null +++ b/tools/closure_linter/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/tools/closure_linter/PKG-INFO b/tools/closure_linter/PKG-INFO deleted file mode 100644 index b6e71c8f110855..00000000000000 --- a/tools/closure_linter/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: closure_linter -Version: 2.2.6 -Summary: Closure Linter -Home-page: http://code.google.com/p/closure-linter -Author: The Closure Linter Authors -Author-email: opensource@google.com -License: Apache -Description: UNKNOWN -Platform: UNKNOWN diff --git a/tools/closure_linter/build/lib/closure_linter/__init__.py b/tools/closure_linter/build/lib/closure_linter/__init__.py new file mode 100644 index 00000000000000..1798c8cfff57fa --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/__init__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package indicator for gjslint.""" diff --git a/tools/closure_linter/build/lib/closure_linter/aliaspass.py b/tools/closure_linter/build/lib/closure_linter/aliaspass.py new file mode 100644 index 00000000000000..bb37bfa07b2d90 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/aliaspass.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Pass that scans for goog.scope aliases and lint/usage errors.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +from closure_linter import ecmametadatapass +from closure_linter import errors +from closure_linter import javascripttokens +from closure_linter import scopeutil +from closure_linter import tokenutil +from closure_linter.common import error + + +# TODO(nnaze): Create a Pass interface and move this class, EcmaMetaDataPass, +# and related classes onto it. + + +def _GetAliasForIdentifier(identifier, alias_map): + """Returns the aliased_symbol name for an identifier. + + Example usage: + >>> alias_map = {'MyClass': 'goog.foo.MyClass'} + >>> _GetAliasForIdentifier('MyClass.prototype.action', alias_map) + 'goog.foo.MyClass.prototype.action' + + >>> _GetAliasForIdentifier('MyClass.prototype.action', {}) + None + + Args: + identifier: The identifier. + alias_map: A dictionary mapping a symbol to an alias. + + Returns: + The aliased symbol name or None if not found. + """ + ns = identifier.split('.', 1)[0] + aliased_symbol = alias_map.get(ns) + if aliased_symbol: + return aliased_symbol + identifier[len(ns):] + + +def _SetTypeAlias(js_type, alias_map): + """Updates the alias for identifiers in a type. + + Args: + js_type: A typeannotation.TypeAnnotation instance. + alias_map: A dictionary mapping a symbol to an alias. + """ + aliased_symbol = _GetAliasForIdentifier(js_type.identifier, alias_map) + if aliased_symbol: + js_type.alias = aliased_symbol + for sub_type in js_type.IterTypes(): + _SetTypeAlias(sub_type, alias_map) + + +class AliasPass(object): + """Pass to identify goog.scope() usages. + + Identifies goog.scope() usages and finds lint/usage errors. Notes any + aliases of symbols in Closurized namespaces (that is, reassignments + such as "var MyClass = goog.foo.MyClass;") and annotates identifiers + when they're using an alias (so they may be expanded to the full symbol + later -- that "MyClass.prototype.action" refers to + "goog.foo.MyClass.prototype.action" when expanded.). + """ + + def __init__(self, closurized_namespaces=None, error_handler=None): + """Creates a new pass. + + Args: + closurized_namespaces: A set of Closurized namespaces (e.g. 'goog'). + error_handler: An error handler to report lint errors to. + """ + + self._error_handler = error_handler + + # If we have namespaces, freeze the set. + if closurized_namespaces: + closurized_namespaces = frozenset(closurized_namespaces) + + self._closurized_namespaces = closurized_namespaces + + def Process(self, start_token): + """Runs the pass on a token stream. + + Args: + start_token: The first token in the stream. + """ + + if start_token is None: + return + + # TODO(nnaze): Add more goog.scope usage checks. + self._CheckGoogScopeCalls(start_token) + + # If we have closurized namespaces, identify aliased identifiers. + if self._closurized_namespaces: + context = start_token.metadata.context + root_context = context.GetRoot() + self._ProcessRootContext(root_context) + + def _CheckGoogScopeCalls(self, start_token): + """Check goog.scope calls for lint/usage errors.""" + + def IsScopeToken(token): + return (token.type is javascripttokens.JavaScriptTokenType.IDENTIFIER and + token.string == 'goog.scope') + + # Find all the goog.scope tokens in the file + scope_tokens = [t for t in start_token if IsScopeToken(t)] + + for token in scope_tokens: + scope_context = token.metadata.context + + if not (scope_context.type == ecmametadatapass.EcmaContext.STATEMENT and + scope_context.parent.type == ecmametadatapass.EcmaContext.ROOT): + self._MaybeReportError( + error.Error(errors.INVALID_USE_OF_GOOG_SCOPE, + 'goog.scope call not in global scope', token)) + + # There should be only one goog.scope reference. Register errors for + # every instance after the first. + for token in scope_tokens[1:]: + self._MaybeReportError( + error.Error(errors.EXTRA_GOOG_SCOPE_USAGE, + 'More than one goog.scope call in file.', token)) + + def _MaybeReportError(self, err): + """Report an error to the handler (if registered).""" + if self._error_handler: + self._error_handler.HandleError(err) + + @classmethod + def _YieldAllContexts(cls, context): + """Yields all contexts that are contained by the given context.""" + yield context + for child_context in context.children: + for descendent_child in cls._YieldAllContexts(child_context): + yield descendent_child + + @staticmethod + def _IsTokenInParentBlock(token, parent_block): + """Determines whether the given token is contained by the given block. + + Args: + token: A token + parent_block: An EcmaContext. + + Returns: + Whether the token is in a context that is or is a child of the given + parent_block context. + """ + context = token.metadata.context + + while context: + if context is parent_block: + return True + context = context.parent + + return False + + def _ProcessRootContext(self, root_context): + """Processes all goog.scope blocks under the root context.""" + + assert root_context.type is ecmametadatapass.EcmaContext.ROOT + + # Process aliases in statements in the root scope for goog.module-style + # aliases. + global_alias_map = {} + for context in root_context.children: + if context.type == ecmametadatapass.EcmaContext.STATEMENT: + for statement_child in context.children: + if statement_child.type == ecmametadatapass.EcmaContext.VAR: + match = scopeutil.MatchModuleAlias(statement_child) + if match: + # goog.require aliases cannot use further aliases, the symbol is + # the second part of match, directly. + symbol = match[1] + if scopeutil.IsInClosurizedNamespace(symbol, + self._closurized_namespaces): + global_alias_map[match[0]] = symbol + + # Process each block to find aliases. + for context in root_context.children: + self._ProcessBlock(context, global_alias_map) + + def _ProcessBlock(self, context, global_alias_map): + """Scans a goog.scope block to find aliases and mark alias tokens.""" + alias_map = global_alias_map.copy() + + # Iterate over every token in the context. Each token points to one + # context, but multiple tokens may point to the same context. We only want + # to check each context once, so keep track of those we've seen. + seen_contexts = set() + token = context.start_token + while token and self._IsTokenInParentBlock(token, context): + token_context = token.metadata.context if token.metadata else None + + # Check to see if this token is an alias. + if token_context and token_context not in seen_contexts: + seen_contexts.add(token_context) + + # If this is a alias statement in the goog.scope block. + if (token_context.type == ecmametadatapass.EcmaContext.VAR and + scopeutil.IsGoogScopeBlock(token_context.parent.parent)): + match = scopeutil.MatchAlias(token_context) + + # If this is an alias, remember it in the map. + if match: + alias, symbol = match + symbol = _GetAliasForIdentifier(symbol, alias_map) or symbol + if scopeutil.IsInClosurizedNamespace(symbol, + self._closurized_namespaces): + alias_map[alias] = symbol + + # If this token is an identifier that matches an alias, + # mark the token as an alias to the original symbol. + if (token.type is javascripttokens.JavaScriptTokenType.SIMPLE_LVALUE or + token.type is javascripttokens.JavaScriptTokenType.IDENTIFIER): + identifier = tokenutil.GetIdentifierForToken(token) + if identifier: + aliased_symbol = _GetAliasForIdentifier(identifier, alias_map) + if aliased_symbol: + token.metadata.aliased_symbol = aliased_symbol + + elif token.type == javascripttokens.JavaScriptTokenType.DOC_FLAG: + flag = token.attached_object + if flag and flag.HasType() and flag.jstype: + _SetTypeAlias(flag.jstype, alias_map) + + token = token.next # Get next token diff --git a/tools/closure_linter/build/lib/closure_linter/aliaspass_test.py b/tools/closure_linter/build/lib/closure_linter/aliaspass_test.py new file mode 100644 index 00000000000000..7042e5348763cb --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/aliaspass_test.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the aliaspass module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import unittest as googletest + +from closure_linter import aliaspass +from closure_linter import errors +from closure_linter import javascriptstatetracker +from closure_linter import testutil +from closure_linter.common import erroraccumulator + + +def _GetTokenByLineAndString(start_token, string, line_number): + for token in start_token: + if token.line_number == line_number and token.string == string: + return token + + +class AliasPassTest(googletest.TestCase): + + def testInvalidGoogScopeCall(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCOPE_SCRIPT) + + error_accumulator = erroraccumulator.ErrorAccumulator() + alias_pass = aliaspass.AliasPass( + error_handler=error_accumulator) + alias_pass.Process(start_token) + + alias_errors = error_accumulator.GetErrors() + self.assertEquals(1, len(alias_errors)) + + alias_error = alias_errors[0] + + self.assertEquals(errors.INVALID_USE_OF_GOOG_SCOPE, alias_error.code) + self.assertEquals('goog.scope', alias_error.token.string) + + def testAliasedIdentifiers(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_ALIAS_SCRIPT) + alias_pass = aliaspass.AliasPass(set(['goog', 'myproject'])) + alias_pass.Process(start_token) + + alias_token = _GetTokenByLineAndString(start_token, 'Event', 4) + self.assertTrue(alias_token.metadata.is_alias_definition) + + my_class_token = _GetTokenByLineAndString(start_token, 'myClass', 9) + self.assertIsNone(my_class_token.metadata.aliased_symbol) + + component_token = _GetTokenByLineAndString(start_token, 'Component', 17) + self.assertEquals('goog.ui.Component', + component_token.metadata.aliased_symbol) + + event_token = _GetTokenByLineAndString(start_token, 'Event.Something', 17) + self.assertEquals('goog.events.Event.Something', + event_token.metadata.aliased_symbol) + + non_closurized_token = _GetTokenByLineAndString( + start_token, 'NonClosurizedClass', 18) + self.assertIsNone(non_closurized_token.metadata.aliased_symbol) + + long_start_token = _GetTokenByLineAndString(start_token, 'Event', 24) + self.assertEquals('goog.events.Event.MultilineIdentifier.someMethod', + long_start_token.metadata.aliased_symbol) + + def testAliasedDoctypes(self): + """Tests that aliases are correctly expanded within type annotations.""" + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_ALIAS_SCRIPT) + tracker = javascriptstatetracker.JavaScriptStateTracker() + tracker.DocFlagPass(start_token, error_handler=None) + + alias_pass = aliaspass.AliasPass(set(['goog', 'myproject'])) + alias_pass.Process(start_token) + + flag_token = _GetTokenByLineAndString(start_token, '@type', 22) + self.assertEquals( + 'goog.events.Event.>', + repr(flag_token.attached_object.jstype)) + + def testModuleAlias(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(""" +goog.module('goog.test'); +var Alias = goog.require('goog.Alias'); +Alias.use(); +""") + alias_pass = aliaspass.AliasPass(set(['goog'])) + alias_pass.Process(start_token) + alias_token = _GetTokenByLineAndString(start_token, 'Alias', 3) + self.assertTrue(alias_token.metadata.is_alias_definition) + + def testMultipleGoogScopeCalls(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass( + _TEST_MULTIPLE_SCOPE_SCRIPT) + + error_accumulator = erroraccumulator.ErrorAccumulator() + + alias_pass = aliaspass.AliasPass( + set(['goog', 'myproject']), + error_handler=error_accumulator) + alias_pass.Process(start_token) + + alias_errors = error_accumulator.GetErrors() + + self.assertEquals(3, len(alias_errors)) + + error = alias_errors[0] + self.assertEquals(errors.INVALID_USE_OF_GOOG_SCOPE, error.code) + self.assertEquals(7, error.token.line_number) + + error = alias_errors[1] + self.assertEquals(errors.EXTRA_GOOG_SCOPE_USAGE, error.code) + self.assertEquals(7, error.token.line_number) + + error = alias_errors[2] + self.assertEquals(errors.EXTRA_GOOG_SCOPE_USAGE, error.code) + self.assertEquals(11, error.token.line_number) + + +_TEST_ALIAS_SCRIPT = """ +goog.scope(function() { +var events = goog.events; // scope alias +var Event = events. + Event; // nested multiline scope alias + +// This should not be registered as an aliased identifier because +// it appears before the alias. +var myClass = new MyClass(); + +var Component = goog.ui.Component; // scope alias +var MyClass = myproject.foo.MyClass; // scope alias + +// Scope alias of non-Closurized namespace. +var NonClosurizedClass = aaa.bbb.NonClosurizedClass; + +var component = new Component(Event.Something); +var nonClosurized = NonClosurizedClass(); + +/** + * A created namespace with a really long identifier. + * @type {events.Event.} + */ +Event. + MultilineIdentifier. + someMethod = function() {}; +}); +""" + +_TEST_SCOPE_SCRIPT = """ +function foo () { + // This goog.scope call is invalid. + goog.scope(function() { + + }); +} +""" + +_TEST_MULTIPLE_SCOPE_SCRIPT = """ +goog.scope(function() { + // do nothing +}); + +function foo() { + var test = goog.scope; // We should not see goog.scope mentioned. +} + +// This goog.scope invalid. There can be only one. +goog.scope(function() { + +}); +""" + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/checker.py b/tools/closure_linter/build/lib/closure_linter/checker.py new file mode 100644 index 00000000000000..1c984173b06639 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/checker.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Core methods for checking JS files for common style guide violations.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import gflags as flags + +from closure_linter import aliaspass +from closure_linter import checkerbase +from closure_linter import closurizednamespacesinfo +from closure_linter import javascriptlintrules + + +flags.DEFINE_list('closurized_namespaces', '', + 'Namespace prefixes, used for testing of' + 'goog.provide/require') +flags.DEFINE_list('ignored_extra_namespaces', '', + 'Fully qualified namespaces that should be not be reported ' + 'as extra by the linter.') + + +class JavaScriptStyleChecker(checkerbase.CheckerBase): + """Checker that applies JavaScriptLintRules.""" + + def __init__(self, state_tracker, error_handler): + """Initialize an JavaScriptStyleChecker object. + + Args: + state_tracker: State tracker. + error_handler: Error handler to pass all errors to. + """ + self._namespaces_info = None + self._alias_pass = None + if flags.FLAGS.closurized_namespaces: + self._namespaces_info = ( + closurizednamespacesinfo.ClosurizedNamespacesInfo( + flags.FLAGS.closurized_namespaces, + flags.FLAGS.ignored_extra_namespaces)) + + self._alias_pass = aliaspass.AliasPass( + flags.FLAGS.closurized_namespaces, error_handler) + + checkerbase.CheckerBase.__init__( + self, + error_handler=error_handler, + lint_rules=javascriptlintrules.JavaScriptLintRules( + self._namespaces_info), + state_tracker=state_tracker) + + def Check(self, start_token, limited_doc_checks=False, is_html=False, + stop_token=None): + """Checks a token stream for lint warnings/errors. + + Adds a separate pass for computing dependency information based on + goog.require and goog.provide statements prior to the main linting pass. + + Args: + start_token: The first token in the token stream. + limited_doc_checks: Whether to perform limited checks. + is_html: Whether this token stream is HTML. + stop_token: If given, checks should stop at this token. + """ + self._lint_rules.Initialize(self, limited_doc_checks, is_html) + + self._state_tracker.DocFlagPass(start_token, self._error_handler) + + if self._alias_pass: + self._alias_pass.Process(start_token) + + # To maximize the amount of errors that get reported before a parse error + # is displayed, don't run the dependency pass if a parse error exists. + if self._namespaces_info: + self._namespaces_info.Reset() + self._ExecutePass(start_token, self._DependencyPass, stop_token) + + self._ExecutePass(start_token, self._LintPass, stop_token) + + # If we have a stop_token, we didn't end up reading the whole file and, + # thus, don't call Finalize to do end-of-file checks. + if not stop_token: + self._lint_rules.Finalize(self._state_tracker) + + def _DependencyPass(self, token): + """Processes an individual token for dependency information. + + Used to encapsulate the logic needed to process an individual token so that + it can be passed to _ExecutePass. + + Args: + token: The token to process. + """ + self._namespaces_info.ProcessToken(token, self._state_tracker) diff --git a/tools/closure_linter/build/lib/closure_linter/checkerbase.py b/tools/closure_linter/build/lib/closure_linter/checkerbase.py new file mode 100644 index 00000000000000..6679ded05be1e1 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/checkerbase.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Base classes for writing checkers that operate on tokens.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'jacobr@google.com (Jacob Richman)') + +from closure_linter import errorrules +from closure_linter.common import error + + +class LintRulesBase(object): + """Base class for all classes defining the lint rules for a language.""" + + def __init__(self): + self.__checker = None + + def Initialize(self, checker, limited_doc_checks, is_html): + """Initializes to prepare to check a file. + + Args: + checker: Class to report errors to. + limited_doc_checks: Whether doc checking is relaxed for this file. + is_html: Whether the file is an HTML file with extracted contents. + """ + self.__checker = checker + self._limited_doc_checks = limited_doc_checks + self._is_html = is_html + + def _HandleError(self, code, message, token, position=None, + fix_data=None): + """Call the HandleError function for the checker we are associated with.""" + if errorrules.ShouldReportError(code): + self.__checker.HandleError(code, message, token, position, fix_data) + + def _SetLimitedDocChecks(self, limited_doc_checks): + """Sets whether doc checking is relaxed for this file. + + Args: + limited_doc_checks: Whether doc checking is relaxed for this file. + """ + self._limited_doc_checks = limited_doc_checks + + def CheckToken(self, token, parser_state): + """Checks a token, given the current parser_state, for warnings and errors. + + Args: + token: The current token under consideration. + parser_state: Object that indicates the parser state in the page. + + Raises: + TypeError: If not overridden. + """ + raise TypeError('Abstract method CheckToken not implemented') + + def Finalize(self, parser_state): + """Perform all checks that need to occur after all lines are processed. + + Args: + parser_state: State of the parser after parsing all tokens + + Raises: + TypeError: If not overridden. + """ + raise TypeError('Abstract method Finalize not implemented') + + +class CheckerBase(object): + """This class handles checking a LintRules object against a file.""" + + def __init__(self, error_handler, lint_rules, state_tracker): + """Initialize a checker object. + + Args: + error_handler: Object that handles errors. + lint_rules: LintRules object defining lint errors given a token + and state_tracker object. + state_tracker: Object that tracks the current state in the token stream. + + """ + self._error_handler = error_handler + self._lint_rules = lint_rules + self._state_tracker = state_tracker + + self._has_errors = False + + def HandleError(self, code, message, token, position=None, + fix_data=None): + """Prints out the given error message including a line number. + + Args: + code: The error code. + message: The error to print. + token: The token where the error occurred, or None if it was a file-wide + issue. + position: The position of the error, defaults to None. + fix_data: Metadata used for fixing the error. + """ + self._has_errors = True + self._error_handler.HandleError( + error.Error(code, message, token, position, fix_data)) + + def HasErrors(self): + """Returns true if the style checker has found any errors. + + Returns: + True if the style checker has found any errors. + """ + return self._has_errors + + def Check(self, start_token, limited_doc_checks=False, is_html=False, + stop_token=None): + """Checks a token stream, reporting errors to the error reporter. + + Args: + start_token: First token in token stream. + limited_doc_checks: Whether doc checking is relaxed for this file. + is_html: Whether the file being checked is an HTML file with extracted + contents. + stop_token: If given, check should stop at this token. + """ + + self._lint_rules.Initialize(self, limited_doc_checks, is_html) + self._ExecutePass(start_token, self._LintPass, stop_token=stop_token) + self._lint_rules.Finalize(self._state_tracker) + + def _LintPass(self, token): + """Checks an individual token for lint warnings/errors. + + Used to encapsulate the logic needed to check an individual token so that it + can be passed to _ExecutePass. + + Args: + token: The token to check. + """ + self._lint_rules.CheckToken(token, self._state_tracker) + + def _ExecutePass(self, token, pass_function, stop_token=None): + """Calls the given function for every token in the given token stream. + + As each token is passed to the given function, state is kept up to date and, + depending on the error_trace flag, errors are either caught and reported, or + allowed to bubble up so developers can see the full stack trace. If a parse + error is specified, the pass will proceed as normal until the token causing + the parse error is reached. + + Args: + token: The first token in the token stream. + pass_function: The function to call for each token in the token stream. + stop_token: The last token to check (if given). + + Raises: + Exception: If any error occurred while calling the given function. + """ + + self._state_tracker.Reset() + while token: + # When we are looking at a token and decided to delete the whole line, we + # will delete all of them in the "HandleToken()" below. So the current + # token and subsequent ones may already be deleted here. The way we + # delete a token does not wipe out the previous and next pointers of the + # deleted token. So we need to check the token itself to make sure it is + # not deleted. + if not token.is_deleted: + # End the pass at the stop token + if stop_token and token is stop_token: + return + + self._state_tracker.HandleToken( + token, self._state_tracker.GetLastNonSpaceToken()) + pass_function(token) + self._state_tracker.HandleAfterToken(token) + + token = token.next diff --git a/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo.py b/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo.py new file mode 100644 index 00000000000000..e7cbfd3318974b --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo.py @@ -0,0 +1,578 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Logic for computing dependency information for closurized JavaScript files. + +Closurized JavaScript files express dependencies using goog.require and +goog.provide statements. In order for the linter to detect when a statement is +missing or unnecessary, all identifiers in the JavaScript file must first be +processed to determine if they constitute the creation or usage of a dependency. +""" + + + +import re + +from closure_linter import javascripttokens +from closure_linter import tokenutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + +DEFAULT_EXTRA_NAMESPACES = [ + 'goog.testing.asserts', + 'goog.testing.jsunit', +] + + +class UsedNamespace(object): + """A type for information about a used namespace.""" + + def __init__(self, namespace, identifier, token, alias_definition): + """Initializes the instance. + + Args: + namespace: the namespace of an identifier used in the file + identifier: the complete identifier + token: the token that uses the namespace + alias_definition: a boolean stating whether the namespace is only to used + for an alias definition and should not be required. + """ + self.namespace = namespace + self.identifier = identifier + self.token = token + self.alias_definition = alias_definition + + def GetLine(self): + return self.token.line_number + + def __repr__(self): + return 'UsedNamespace(%s)' % ', '.join( + ['%s=%s' % (k, repr(v)) for k, v in self.__dict__.iteritems()]) + + +class ClosurizedNamespacesInfo(object): + """Dependency information for closurized JavaScript files. + + Processes token streams for dependency creation or usage and provides logic + for determining if a given require or provide statement is unnecessary or if + there are missing require or provide statements. + """ + + def __init__(self, closurized_namespaces, ignored_extra_namespaces): + """Initializes an instance the ClosurizedNamespacesInfo class. + + Args: + closurized_namespaces: A list of namespace prefixes that should be + processed for dependency information. Non-matching namespaces are + ignored. + ignored_extra_namespaces: A list of namespaces that should not be reported + as extra regardless of whether they are actually used. + """ + self._closurized_namespaces = closurized_namespaces + self._ignored_extra_namespaces = (ignored_extra_namespaces + + DEFAULT_EXTRA_NAMESPACES) + self.Reset() + + def Reset(self): + """Resets the internal state to prepare for processing a new file.""" + + # A list of goog.provide tokens in the order they appeared in the file. + self._provide_tokens = [] + + # A list of goog.require tokens in the order they appeared in the file. + self._require_tokens = [] + + # Namespaces that are already goog.provided. + self._provided_namespaces = [] + + # Namespaces that are already goog.required. + self._required_namespaces = [] + + # Note that created_namespaces and used_namespaces contain both namespaces + # and identifiers because there are many existing cases where a method or + # constant is provided directly instead of its namespace. Ideally, these + # two lists would only have to contain namespaces. + + # A list of tuples where the first element is the namespace of an identifier + # created in the file, the second is the identifier itself and the third is + # the line number where it's created. + self._created_namespaces = [] + + # A list of UsedNamespace instances. + self._used_namespaces = [] + + # A list of seemingly-unnecessary namespaces that are goog.required() and + # annotated with @suppress {extraRequire}. + self._suppressed_requires = [] + + # A list of goog.provide tokens which are duplicates. + self._duplicate_provide_tokens = [] + + # A list of goog.require tokens which are duplicates. + self._duplicate_require_tokens = [] + + # Whether this file is in a goog.scope. Someday, we may add support + # for checking scopified namespaces, but for now let's just fail + # in a more reasonable way. + self._scopified_file = False + + # TODO(user): Handle the case where there are 2 different requires + # that can satisfy the same dependency, but only one is necessary. + + def GetProvidedNamespaces(self): + """Returns the namespaces which are already provided by this file. + + Returns: + A list of strings where each string is a 'namespace' corresponding to an + existing goog.provide statement in the file being checked. + """ + return set(self._provided_namespaces) + + def GetRequiredNamespaces(self): + """Returns the namespaces which are already required by this file. + + Returns: + A list of strings where each string is a 'namespace' corresponding to an + existing goog.require statement in the file being checked. + """ + return set(self._required_namespaces) + + def IsExtraProvide(self, token): + """Returns whether the given goog.provide token is unnecessary. + + Args: + token: A goog.provide token. + + Returns: + True if the given token corresponds to an unnecessary goog.provide + statement, otherwise False. + """ + namespace = tokenutil.GetStringAfterToken(token) + + if self.GetClosurizedNamespace(namespace) is None: + return False + + if token in self._duplicate_provide_tokens: + return True + + # TODO(user): There's probably a faster way to compute this. + for created_namespace, created_identifier, _ in self._created_namespaces: + if namespace == created_namespace or namespace == created_identifier: + return False + + return True + + def IsExtraRequire(self, token): + """Returns whether the given goog.require token is unnecessary. + + Args: + token: A goog.require token. + + Returns: + True if the given token corresponds to an unnecessary goog.require + statement, otherwise False. + """ + namespace = tokenutil.GetStringAfterToken(token) + + if self.GetClosurizedNamespace(namespace) is None: + return False + + if namespace in self._ignored_extra_namespaces: + return False + + if token in self._duplicate_require_tokens: + return True + + if namespace in self._suppressed_requires: + return False + + # If the namespace contains a component that is initial caps, then that + # must be the last component of the namespace. + parts = namespace.split('.') + if len(parts) > 1 and parts[-2][0].isupper(): + return True + + # TODO(user): There's probably a faster way to compute this. + for ns in self._used_namespaces: + if (not ns.alias_definition and ( + namespace == ns.namespace or namespace == ns.identifier)): + return False + + return True + + def GetMissingProvides(self): + """Returns the dict of missing provided namespaces for the current file. + + Returns: + Returns a dictionary of key as string and value as integer where each + string(key) is a namespace that should be provided by this file, but is + not and integer(value) is first line number where it's defined. + """ + missing_provides = dict() + for namespace, identifier, line_number in self._created_namespaces: + if (not self._IsPrivateIdentifier(identifier) and + namespace not in self._provided_namespaces and + identifier not in self._provided_namespaces and + namespace not in self._required_namespaces and + namespace not in missing_provides): + missing_provides[namespace] = line_number + + return missing_provides + + def GetMissingRequires(self): + """Returns the dict of missing required namespaces for the current file. + + For each non-private identifier used in the file, find either a + goog.require, goog.provide or a created identifier that satisfies it. + goog.require statements can satisfy the identifier by requiring either the + namespace of the identifier or the identifier itself. goog.provide + statements can satisfy the identifier by providing the namespace of the + identifier. A created identifier can only satisfy the used identifier if + it matches it exactly (necessary since things can be defined on a + namespace in more than one file). Note that provided namespaces should be + a subset of created namespaces, but we check both because in some cases we + can't always detect the creation of the namespace. + + Returns: + Returns a dictionary of key as string and value integer where each + string(key) is a namespace that should be required by this file, but is + not and integer(value) is first line number where it's used. + """ + external_dependencies = set(self._required_namespaces) + + # Assume goog namespace is always available. + external_dependencies.add('goog') + # goog.module is treated as a builtin, too (for goog.module.get). + external_dependencies.add('goog.module') + + created_identifiers = set() + for unused_namespace, identifier, unused_line_number in ( + self._created_namespaces): + created_identifiers.add(identifier) + + missing_requires = dict() + illegal_alias_statements = dict() + + def ShouldRequireNamespace(namespace, identifier): + """Checks if a namespace would normally be required.""" + return ( + not self._IsPrivateIdentifier(identifier) and + namespace not in external_dependencies and + namespace not in self._provided_namespaces and + identifier not in external_dependencies and + identifier not in created_identifiers and + namespace not in missing_requires) + + # First check all the used identifiers where we know that their namespace + # needs to be provided (unless they are optional). + for ns in self._used_namespaces: + namespace = ns.namespace + identifier = ns.identifier + if (not ns.alias_definition and + ShouldRequireNamespace(namespace, identifier)): + missing_requires[namespace] = ns.GetLine() + + # Now that all required namespaces are known, we can check if the alias + # definitions (that are likely being used for typeannotations that don't + # need explicit goog.require statements) are already covered. If not + # the user shouldn't use the alias. + for ns in self._used_namespaces: + if (not ns.alias_definition or + not ShouldRequireNamespace(ns.namespace, ns.identifier)): + continue + if self._FindNamespace(ns.identifier, self._provided_namespaces, + created_identifiers, external_dependencies, + missing_requires): + continue + namespace = ns.identifier.rsplit('.', 1)[0] + illegal_alias_statements[namespace] = ns.token + + return missing_requires, illegal_alias_statements + + def _FindNamespace(self, identifier, *namespaces_list): + """Finds the namespace of an identifier given a list of other namespaces. + + Args: + identifier: An identifier whose parent needs to be defined. + e.g. for goog.bar.foo we search something that provides + goog.bar. + *namespaces_list: var args of iterables of namespace identifiers + Returns: + The namespace that the given identifier is part of or None. + """ + identifier = identifier.rsplit('.', 1)[0] + identifier_prefix = identifier + '.' + for namespaces in namespaces_list: + for namespace in namespaces: + if namespace == identifier or namespace.startswith(identifier_prefix): + return namespace + return None + + def _IsPrivateIdentifier(self, identifier): + """Returns whether the given identifier is private.""" + pieces = identifier.split('.') + for piece in pieces: + if piece.endswith('_'): + return True + return False + + def IsFirstProvide(self, token): + """Returns whether token is the first provide token.""" + return self._provide_tokens and token == self._provide_tokens[0] + + def IsFirstRequire(self, token): + """Returns whether token is the first require token.""" + return self._require_tokens and token == self._require_tokens[0] + + def IsLastProvide(self, token): + """Returns whether token is the last provide token.""" + return self._provide_tokens and token == self._provide_tokens[-1] + + def IsLastRequire(self, token): + """Returns whether token is the last require token.""" + return self._require_tokens and token == self._require_tokens[-1] + + def ProcessToken(self, token, state_tracker): + """Processes the given token for dependency information. + + Args: + token: The token to process. + state_tracker: The JavaScript state tracker. + """ + + # Note that this method is in the critical path for the linter and has been + # optimized for performance in the following ways: + # - Tokens are checked by type first to minimize the number of function + # calls necessary to determine if action needs to be taken for the token. + # - The most common tokens types are checked for first. + # - The number of function calls has been minimized (thus the length of this + # function. + + if token.type == TokenType.IDENTIFIER: + # TODO(user): Consider saving the whole identifier in metadata. + whole_identifier_string = tokenutil.GetIdentifierForToken(token) + if whole_identifier_string is None: + # We only want to process the identifier one time. If the whole string + # identifier is None, that means this token was part of a multi-token + # identifier, but it was not the first token of the identifier. + return + + # In the odd case that a goog.require is encountered inside a function, + # just ignore it (e.g. dynamic loading in test runners). + if token.string == 'goog.require' and not state_tracker.InFunction(): + self._require_tokens.append(token) + namespace = tokenutil.GetStringAfterToken(token) + if namespace in self._required_namespaces: + self._duplicate_require_tokens.append(token) + else: + self._required_namespaces.append(namespace) + + # If there is a suppression for the require, add a usage for it so it + # gets treated as a regular goog.require (i.e. still gets sorted). + if self._HasSuppression(state_tracker, 'extraRequire'): + self._suppressed_requires.append(namespace) + self._AddUsedNamespace(state_tracker, namespace, token) + + elif token.string == 'goog.provide': + self._provide_tokens.append(token) + namespace = tokenutil.GetStringAfterToken(token) + if namespace in self._provided_namespaces: + self._duplicate_provide_tokens.append(token) + else: + self._provided_namespaces.append(namespace) + + # If there is a suppression for the provide, add a creation for it so it + # gets treated as a regular goog.provide (i.e. still gets sorted). + if self._HasSuppression(state_tracker, 'extraProvide'): + self._AddCreatedNamespace(state_tracker, namespace, token.line_number) + + elif token.string == 'goog.scope': + self._scopified_file = True + + elif token.string == 'goog.setTestOnly': + + # Since the message is optional, we don't want to scan to later lines. + for t in tokenutil.GetAllTokensInSameLine(token): + if t.type == TokenType.STRING_TEXT: + message = t.string + + if re.match(r'^\w+(\.\w+)+$', message): + # This looks like a namespace. If it's a Closurized namespace, + # consider it created. + base_namespace = message.split('.', 1)[0] + if base_namespace in self._closurized_namespaces: + self._AddCreatedNamespace(state_tracker, message, + token.line_number) + + break + else: + jsdoc = state_tracker.GetDocComment() + if token.metadata and token.metadata.aliased_symbol: + whole_identifier_string = token.metadata.aliased_symbol + elif (token.string == 'goog.module.get' and + not self._HasSuppression(state_tracker, 'extraRequire')): + # Cannot use _AddUsedNamespace as this is not an identifier, but + # already the entire namespace that's required. + namespace = tokenutil.GetStringAfterToken(token) + namespace = UsedNamespace(namespace, namespace, token, + alias_definition=False) + self._used_namespaces.append(namespace) + if jsdoc and jsdoc.HasFlag('typedef'): + self._AddCreatedNamespace(state_tracker, whole_identifier_string, + token.line_number, + namespace=self.GetClosurizedNamespace( + whole_identifier_string)) + else: + is_alias_definition = (token.metadata and + token.metadata.is_alias_definition) + self._AddUsedNamespace(state_tracker, whole_identifier_string, + token, is_alias_definition) + + elif token.type == TokenType.SIMPLE_LVALUE: + identifier = token.values['identifier'] + start_token = tokenutil.GetIdentifierStart(token) + if start_token and start_token != token: + # Multi-line identifier being assigned. Get the whole identifier. + identifier = tokenutil.GetIdentifierForToken(start_token) + else: + start_token = token + # If an alias is defined on the start_token, use it instead. + if (start_token and + start_token.metadata and + start_token.metadata.aliased_symbol and + not start_token.metadata.is_alias_definition): + identifier = start_token.metadata.aliased_symbol + + if identifier: + namespace = self.GetClosurizedNamespace(identifier) + if state_tracker.InFunction(): + self._AddUsedNamespace(state_tracker, identifier, token) + elif namespace and namespace != 'goog': + self._AddCreatedNamespace(state_tracker, identifier, + token.line_number, namespace=namespace) + + elif token.type == TokenType.DOC_FLAG: + flag = token.attached_object + flag_type = flag.flag_type + if flag and flag.HasType() and flag.jstype: + is_interface = state_tracker.GetDocComment().HasFlag('interface') + if flag_type == 'implements' or (flag_type == 'extends' + and is_interface): + identifier = flag.jstype.alias or flag.jstype.identifier + self._AddUsedNamespace(state_tracker, identifier, token) + # Since we process doctypes only for implements and extends, the + # type is a simple one and we don't need any iteration for subtypes. + + def _AddCreatedNamespace(self, state_tracker, identifier, line_number, + namespace=None): + """Adds the namespace of an identifier to the list of created namespaces. + + If the identifier is annotated with a 'missingProvide' suppression, it is + not added. + + Args: + state_tracker: The JavaScriptStateTracker instance. + identifier: The identifier to add. + line_number: Line number where namespace is created. + namespace: The namespace of the identifier or None if the identifier is + also the namespace. + """ + if not namespace: + namespace = identifier + + if self._HasSuppression(state_tracker, 'missingProvide'): + return + + self._created_namespaces.append([namespace, identifier, line_number]) + + def _AddUsedNamespace(self, state_tracker, identifier, token, + is_alias_definition=False): + """Adds the namespace of an identifier to the list of used namespaces. + + If the identifier is annotated with a 'missingRequire' suppression, it is + not added. + + Args: + state_tracker: The JavaScriptStateTracker instance. + identifier: An identifier which has been used. + token: The token in which the namespace is used. + is_alias_definition: If the used namespace is part of an alias_definition. + Aliased symbols need their parent namespace to be available, if it is + not yet required through another symbol, an error will be thrown. + """ + if self._HasSuppression(state_tracker, 'missingRequire'): + return + + namespace = self.GetClosurizedNamespace(identifier) + # b/5362203 If its a variable in scope then its not a required namespace. + if namespace and not state_tracker.IsVariableInScope(namespace): + namespace = UsedNamespace(namespace, identifier, token, + is_alias_definition) + self._used_namespaces.append(namespace) + + def _HasSuppression(self, state_tracker, suppression): + jsdoc = state_tracker.GetDocComment() + return jsdoc and suppression in jsdoc.suppressions + + def GetClosurizedNamespace(self, identifier): + """Given an identifier, returns the namespace that identifier is from. + + Args: + identifier: The identifier to extract a namespace from. + + Returns: + The namespace the given identifier resides in, or None if one could not + be found. + """ + if identifier.startswith('goog.global'): + # Ignore goog.global, since it is, by definition, global. + return None + + parts = identifier.split('.') + for namespace in self._closurized_namespaces: + if not identifier.startswith(namespace + '.'): + continue + + # The namespace for a class is the shortest prefix ending in a class + # name, which starts with a capital letter but is not a capitalized word. + # + # We ultimately do not want to allow requiring or providing of inner + # classes/enums. Instead, a file should provide only the top-level class + # and users should require only that. + namespace = [] + for part in parts: + if part == 'prototype' or part.isupper(): + return '.'.join(namespace) + namespace.append(part) + if part[0].isupper(): + return '.'.join(namespace) + + # At this point, we know there's no class or enum, so the namespace is + # just the identifier with the last part removed. With the exception of + # apply, inherits, and call, which should also be stripped. + if parts[-1] in ('apply', 'inherits', 'call'): + parts.pop() + parts.pop() + + # If the last part ends with an underscore, it is a private variable, + # method, or enum. The namespace is whatever is before it. + if parts and parts[-1].endswith('_'): + parts.pop() + + return '.'.join(parts) + + return None diff --git a/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo_test.py b/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo_test.py new file mode 100644 index 00000000000000..7aeae21956af8d --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/closurizednamespacesinfo_test.py @@ -0,0 +1,873 @@ +#!/usr/bin/env python +# +# Copyright 2010 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for ClosurizedNamespacesInfo.""" + + + +import unittest as googletest +from closure_linter import aliaspass +from closure_linter import closurizednamespacesinfo +from closure_linter import ecmametadatapass +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + + +def _ToLineDict(illegal_alias_stmts): + """Replaces tokens with the respective line number.""" + return {k: v.line_number for k, v in illegal_alias_stmts.iteritems()} + + +class ClosurizedNamespacesInfoTest(googletest.TestCase): + """Tests for ClosurizedNamespacesInfo.""" + + _test_cases = { + 'goog.global.anything': None, + 'package.CONSTANT': 'package', + 'package.methodName': 'package', + 'package.subpackage.methodName': 'package.subpackage', + 'package.subpackage.methodName.apply': 'package.subpackage', + 'package.ClassName.something': 'package.ClassName', + 'package.ClassName.Enum.VALUE.methodName': 'package.ClassName', + 'package.ClassName.CONSTANT': 'package.ClassName', + 'package.namespace.CONSTANT.methodName': 'package.namespace', + 'package.ClassName.inherits': 'package.ClassName', + 'package.ClassName.apply': 'package.ClassName', + 'package.ClassName.methodName.apply': 'package.ClassName', + 'package.ClassName.methodName.call': 'package.ClassName', + 'package.ClassName.prototype.methodName': 'package.ClassName', + 'package.ClassName.privateMethod_': 'package.ClassName', + 'package.className.privateProperty_': 'package.className', + 'package.className.privateProperty_.methodName': 'package.className', + 'package.ClassName.PrivateEnum_': 'package.ClassName', + 'package.ClassName.prototype.methodName.apply': 'package.ClassName', + 'package.ClassName.property.subProperty': 'package.ClassName', + 'package.className.prototype.something.somethingElse': 'package.className' + } + + def testGetClosurizedNamespace(self): + """Tests that the correct namespace is returned for various identifiers.""" + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=['package'], ignored_extra_namespaces=[]) + for identifier, expected_namespace in self._test_cases.items(): + actual_namespace = namespaces_info.GetClosurizedNamespace(identifier) + self.assertEqual( + expected_namespace, + actual_namespace, + 'expected namespace "' + str(expected_namespace) + + '" for identifier "' + str(identifier) + '" but was "' + + str(actual_namespace) + '"') + + def testIgnoredExtraNamespaces(self): + """Tests that ignored_extra_namespaces are ignored.""" + token = self._GetRequireTokens('package.Something') + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=['package'], + ignored_extra_namespaces=['package.Something']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should be valid since it is in ignored namespaces.') + + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + ['package'], []) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be invalid since it is not in ignored namespaces.') + + def testIsExtraProvide_created(self): + """Tests that provides for created namespaces are not extra.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is created.') + + def testIsExtraProvide_createdIdentifier(self): + """Tests that provides for created identifiers are not extra.""" + input_lines = [ + 'goog.provide(\'package.Foo.methodName\');', + 'package.Foo.methodName = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is created.') + + def testIsExtraProvide_notCreated(self): + """Tests that provides for non-created namespaces are extra.""" + input_lines = ['goog.provide(\'package.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is not created.') + + def testIsExtraProvide_notCreatedMultipartClosurizedNamespace(self): + """Tests that provides for non-created namespaces are extra.""" + input_lines = ['goog.provide(\'multi.part.namespace.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['multi.part']) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is not created.') + + def testIsExtraProvide_duplicate(self): + """Tests that providing a namespace twice makes the second one extra.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + # Advance to the second goog.provide token. + token = tokenutil.Search(token.next, TokenType.IDENTIFIER) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is already provided.') + + def testIsExtraProvide_notClosurized(self): + """Tests that provides of non-closurized namespaces are not extra.""" + input_lines = ['goog.provide(\'notclosurized.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is not closurized.') + + def testIsExtraRequire_used(self): + """Tests that requires for used namespaces are not extra.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'var x = package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is used.') + + def testIsExtraRequire_usedIdentifier(self): + """Tests that requires for used methods on classes are extra.""" + input_lines = [ + 'goog.require(\'package.Foo.methodName\');', + 'var x = package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should require the package, not the method specifically.') + + def testIsExtraRequire_notUsed(self): + """Tests that requires for unused namespaces are extra.""" + input_lines = ['goog.require(\'package.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be extra since it is not used.') + + def testIsExtraRequire_notUsedMultiPartClosurizedNamespace(self): + """Tests unused require with multi-part closurized namespaces.""" + + input_lines = ['goog.require(\'multi.part.namespace.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['multi.part']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be extra since it is not used.') + + def testIsExtraRequire_notClosurized(self): + """Tests that requires of non-closurized namespaces are not extra.""" + input_lines = ['goog.require(\'notclosurized.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is not closurized.') + + def testIsExtraRequire_objectOnClass(self): + """Tests that requiring an object on a class is extra.""" + input_lines = [ + 'goog.require(\'package.Foo.Enum\');', + 'var x = package.Foo.Enum.VALUE1;', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'The whole class, not the object, should be required.'); + + def testIsExtraRequire_constantOnClass(self): + """Tests that requiring a constant on a class is extra.""" + input_lines = [ + 'goog.require(\'package.Foo.CONSTANT\');', + 'var x = package.Foo.CONSTANT', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'The class, not the constant, should be required.'); + + def testIsExtraRequire_constantNotOnClass(self): + """Tests that requiring a constant not on a class is OK.""" + input_lines = [ + 'goog.require(\'package.subpackage.CONSTANT\');', + 'var x = package.subpackage.CONSTANT', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Constants can be required except on classes.'); + + def testIsExtraRequire_methodNotOnClass(self): + """Tests that requiring a method not on a class is OK.""" + input_lines = [ + 'goog.require(\'package.subpackage.method\');', + 'var x = package.subpackage.method()', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Methods can be required except on classes.'); + + def testIsExtraRequire_defaults(self): + """Tests that there are no warnings about extra requires for test utils""" + input_lines = ['goog.require(\'goog.testing.jsunit\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['goog']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is for testing.') + + def testGetMissingProvides_provided(self): + """Tests that provided functions don't cause a missing provide.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript( + input_lines, ['package']) + + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_providedIdentifier(self): + """Tests that provided identifiers don't cause a missing provide.""" + input_lines = [ + 'goog.provide(\'package.Foo.methodName\');', + 'package.Foo.methodName = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_providedParentIdentifier(self): + """Tests that provided identifiers on a class don't cause a missing provide + on objects attached to that class.""" + input_lines = [ + 'goog.provide(\'package.foo.ClassName\');', + 'package.foo.ClassName.methodName = function() {};', + 'package.foo.ClassName.ObjectName = 1;', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_unprovided(self): + """Tests that unprovided functions cause a missing provide.""" + input_lines = ['package.Foo = function() {};'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_provides = namespaces_info.GetMissingProvides() + self.assertEquals(1, len(missing_provides)) + missing_provide = missing_provides.popitem() + self.assertEquals('package.Foo', missing_provide[0]) + self.assertEquals(1, missing_provide[1]) + + def testGetMissingProvides_privatefunction(self): + """Tests that unprovided private functions don't cause a missing provide.""" + input_lines = ['package.Foo_ = function() {};'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_required(self): + """Tests that required namespaces don't cause a missing provide.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingRequires_required(self): + """Tests that required namespaces don't cause a missing require.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredIdentifier(self): + """Tests that required namespaces satisfy identifiers on that namespace.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredNamespace(self): + """Tests that required namespaces satisfy the namespace.""" + input_lines = [ + 'goog.require(\'package.soy.fooTemplate\');', + 'render(package.soy.fooTemplate);' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredParentClass(self): + """Tests that requiring a parent class of an object is sufficient to prevent + a missing require on that object.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName();', + 'package.Foo.methodName(package.Foo.ObjectName);' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_unrequired(self): + """Tests that unrequired namespaces cause a missing require.""" + input_lines = ['package.Foo();'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires)) + missing_req = missing_requires.popitem() + self.assertEquals('package.Foo', missing_req[0]) + self.assertEquals(1, missing_req[1]) + + def testGetMissingRequires_provided(self): + """Tests that provided namespaces satisfy identifiers on that namespace.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_created(self): + """Tests that created namespaces do not satisfy usage of an identifier.""" + input_lines = [ + 'package.Foo = function();', + 'package.Foo.methodName();', + 'package.Foo.anotherMethodName1();', + 'package.Foo.anotherMethodName2();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires)) + missing_require = missing_requires.popitem() + self.assertEquals('package.Foo', missing_require[0]) + # Make sure line number of first occurrence is reported + self.assertEquals(2, missing_require[1]) + + def testGetMissingRequires_createdIdentifier(self): + """Tests that created identifiers satisfy usage of the identifier.""" + input_lines = [ + 'package.Foo.methodName = function();', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_implements(self): + """Tests that a parametrized type requires the correct identifier.""" + input_lines = [ + '/** @constructor @implements {package.Bar} */', + 'package.Foo = function();', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertItemsEqual({'package.Bar': 1}, missing_requires) + + def testGetMissingRequires_objectOnClass(self): + """Tests that we should require a class, not the object on the class.""" + input_lines = [ + 'goog.require(\'package.Foo.Enum\');', + 'var x = package.Foo.Enum.VALUE1;', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires), + 'The whole class, not the object, should be required.') + + def testGetMissingRequires_variableWithSameName(self): + """Tests that we should not goog.require variables and parameters. + + b/5362203 Variables in scope are not missing namespaces. + """ + input_lines = [ + 'goog.provide(\'Foo\');', + 'Foo.A = function();', + 'Foo.A.prototype.method = function(ab) {', + ' if (ab) {', + ' var docs;', + ' var lvalue = new Obj();', + ' // Variable in scope hence not goog.require here.', + ' docs.foo.abc = 1;', + ' lvalue.next();', + ' }', + ' // Since js is function scope this should also not goog.require.', + ' docs.foo.func();', + ' // Its not a variable in scope hence goog.require.', + ' dummy.xyz.reset();', + ' return this.method2();', + '};', + 'Foo.A.prototype.method1 = function(docs, abcd, xyz) {', + ' // Parameter hence not goog.require.', + ' docs.nodes.length = 2;', + ' lvalue.abc.reset();', + '};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['Foo', + 'docs', + 'lvalue', + 'dummy']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(2, len(missing_requires)) + self.assertItemsEqual( + {'dummy.xyz': 14, + 'lvalue.abc': 20}, missing_requires) + + def testIsFirstProvide(self): + """Tests operation of the isFirstProvide method.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + self.assertTrue(namespaces_info.IsFirstProvide(token)) + + def testGetWholeIdentifierString(self): + """Tests that created identifiers satisfy usage of the identifier.""" + input_lines = [ + 'package.Foo.', + ' veryLong.', + ' identifier;' + ] + + token = testutil.TokenizeSource(input_lines) + + self.assertEquals('package.Foo.veryLong.identifier', + tokenutil.GetIdentifierForToken(token)) + + self.assertEquals(None, + tokenutil.GetIdentifierForToken(token.next)) + + def testScopified(self): + """Tests that a goog.scope call is noticed.""" + input_lines = [ + 'goog.scope(function() {', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertTrue(namespaces_info._scopified_file) + + def testScope_unusedAlias(self): + """Tests that an unused alias symbol is illegal.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_usedMultilevelAlias(self): + """Tests that an used alias symbol in a deep namespace is ok.""" + input_lines = [ + 'goog.require(\'goog.Events\');', + 'goog.scope(function() {', + 'var Event = goog.Events.DeepNamespace.Event;', + 'Event();', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_usedAlias(self): + """Tests that aliased symbols result in correct requires.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + 'var dom = goog.dom;', + 'Event(dom.classes.get);', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, illegal_alias_stmts) + self.assertEquals({'goog.dom.classes': 4, 'goog.events.Event': 4}, + missing_requires) + + def testModule_alias(self): + """Tests that goog.module style aliases are supported.""" + input_lines = [ + 'goog.module(\'test.module\');', + 'var Unused = goog.require(\'goog.Unused\');', + 'var AliasedClass = goog.require(\'goog.AliasedClass\');', + 'var x = new AliasedClass();', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + namespaceToken = self._GetRequireTokens('goog.AliasedClass') + self.assertFalse(namespaces_info.IsExtraRequire(namespaceToken), + 'AliasedClass should be marked as used') + unusedToken = self._GetRequireTokens('goog.Unused') + self.assertTrue(namespaces_info.IsExtraRequire(unusedToken), + 'Unused should be marked as not used') + + def testModule_aliasInScope(self): + """Tests that goog.module style aliases are supported.""" + input_lines = [ + 'goog.module(\'test.module\');', + 'var AliasedClass = goog.require(\'goog.AliasedClass\');', + 'goog.scope(function() {', + 'var x = new AliasedClass();', + '});', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + namespaceToken = self._GetRequireTokens('goog.AliasedClass') + self.assertFalse(namespaces_info.IsExtraRequire(namespaceToken), + 'AliasedClass should be marked as used') + + def testModule_getAlwaysProvided(self): + """Tests that goog.module.get is recognized as a built-in.""" + input_lines = [ + 'goog.provide(\'test.MyClass\');', + 'goog.require(\'goog.someModule\');', + 'goog.scope(function() {', + 'var someModule = goog.module.get(\'goog.someModule\');', + 'test.MyClass = function() {};', + '});', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertEquals({}, namespaces_info.GetMissingRequires()[0]) + + def testModule_requireForGet(self): + """Tests that goog.module.get needs a goog.require call.""" + input_lines = [ + 'goog.provide(\'test.MyClass\');', + 'function foo() {', + ' var someModule = goog.module.get(\'goog.someModule\');', + ' someModule.doSth();', + '}', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertEquals({'goog.someModule': 3}, + namespaces_info.GetMissingRequires()[0]) + + def testScope_usedTypeAlias(self): + """Tests aliased symbols in type annotations.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + '/** @type {Event} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_partialAlias_typeOnly(self): + """Tests a partial alias only used in type annotations. + + In this example, some goog.events namespace would need to be required + so that evaluating goog.events.bar doesn't throw an error. + """ + input_lines = [ + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Foo} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_partialAlias(self): + """Tests a partial alias in conjunction with a type annotation. + + In this example, the partial alias is already defined by another type, + therefore the doc-only type doesn't need to be required. + """ + input_lines = [ + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({'goog.events.bar.EventType': 4}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_partialAliasRequires(self): + """Tests partial aliases with correct requires.""" + input_lines = [ + 'goog.require(\'goog.events.bar.EventType\');', + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_partialAliasRequiresBoth(self): + """Tests partial aliases with correct requires.""" + input_lines = [ + 'goog.require(\'goog.events.bar.Event\');', + 'goog.require(\'goog.events.bar.EventType\');', + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + event_token = self._GetRequireTokens('goog.events.bar.Event') + self.assertTrue(namespaces_info.IsExtraRequire(event_token)) + + def testScope_partialAliasNoSubtypeRequires(self): + """Tests that partial aliases don't yield subtype requires (regression).""" + input_lines = [ + 'goog.provide(\'goog.events.Foo\');', + 'goog.scope(function() {', + 'goog.events.Foo = {};', + 'var Foo = goog.events.Foo;' + 'Foo.CssName_ = {};' + 'var CssName_ = Foo.CssName_;' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + + def testScope_aliasNamespace(self): + """Tests that an unused alias namespace is not required when available. + + In the example goog.events.Bar is not required, because the namespace + goog.events is already defined because goog.events.Foo is required. + """ + input_lines = [ + 'goog.require(\'goog.events.Foo\');', + 'goog.scope(function() {', + 'var Bar = goog.events.Bar;', + '/** @type {Bar} */;', + 'goog.events.Foo;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_aliasNamespaceIllegal(self): + """Tests that an unused alias namespace is not required when available.""" + input_lines = [ + 'goog.scope(function() {', + 'var Bar = goog.events.Bar;', + '/** @type {Bar} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_provides(self): + """Tests that aliased symbols result in correct provides.""" + input_lines = [ + 'goog.scope(function() {', + 'goog.bar = {};', + 'var bar = goog.bar;', + 'bar.Foo = {};', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_provides = namespaces_info.GetMissingProvides() + self.assertEquals({'goog.bar.Foo': 4}, missing_provides) + _, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, illegal_alias_stmts) + + def testSetTestOnlyNamespaces(self): + """Tests that a namespace in setTestOnly makes it a valid provide.""" + namespaces_info = self._GetNamespacesInfoForScript([ + 'goog.setTestOnly(\'goog.foo.barTest\');' + ], ['goog']) + + token = self._GetProvideTokens('goog.foo.barTest') + self.assertFalse(namespaces_info.IsExtraProvide(token)) + + token = self._GetProvideTokens('goog.foo.bazTest') + self.assertTrue(namespaces_info.IsExtraProvide(token)) + + def testSetTestOnlyComment(self): + """Ensure a comment in setTestOnly does not cause a created namespace.""" + namespaces_info = self._GetNamespacesInfoForScript([ + 'goog.setTestOnly(\'this is a comment\');' + ], ['goog']) + + self.assertEquals( + [], namespaces_info._created_namespaces, + 'A comment in setTestOnly should not modify created namespaces.') + + def _GetNamespacesInfoForScript(self, script, closurized_namespaces=None): + _, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + script, closurized_namespaces) + + return namespaces_info + + def _GetStartTokenAndNamespacesInfoForScript( + self, script, closurized_namespaces): + + token = testutil.TokenizeSource(script) + return token, self._GetInitializedNamespacesInfo( + token, closurized_namespaces, []) + + def _GetInitializedNamespacesInfo(self, token, closurized_namespaces, + ignored_extra_namespaces): + """Returns a namespaces info initialized with the given token stream.""" + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=closurized_namespaces, + ignored_extra_namespaces=ignored_extra_namespaces) + state_tracker = javascriptstatetracker.JavaScriptStateTracker() + + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + ecma_pass.Process(token) + + state_tracker.DocFlagPass(token, error_handler=None) + + alias_pass = aliaspass.AliasPass(closurized_namespaces) + alias_pass.Process(token) + + while token: + state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken()) + namespaces_info.ProcessToken(token, state_tracker) + state_tracker.HandleAfterToken(token) + token = token.next + + return namespaces_info + + def _GetProvideTokens(self, namespace): + """Returns a list of tokens for a goog.require of the given namespace.""" + line_text = 'goog.require(\'' + namespace + '\');\n' + return testutil.TokenizeSource([line_text]) + + def _GetRequireTokens(self, namespace): + """Returns a list of tokens for a goog.require of the given namespace.""" + line_text = 'goog.require(\'' + namespace + '\');\n' + return testutil.TokenizeSource([line_text]) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/common/__init__.py b/tools/closure_linter/build/lib/closure_linter/common/__init__.py new file mode 100644 index 00000000000000..57930436ce4323 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/__init__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package indicator for gjslint.common.""" diff --git a/tools/closure_linter/build/lib/closure_linter/common/error.py b/tools/closure_linter/build/lib/closure_linter/common/error.py new file mode 100644 index 00000000000000..4209c235b85425 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/error.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Error object commonly used in linters.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +class Error(object): + """Object representing a style error.""" + + def __init__(self, code, message, token=None, position=None, fix_data=None): + """Initialize the error object. + + Args: + code: The numeric error code. + message: The error message string. + token: The tokens.Token where the error occurred. + position: The position of the error within the token. + fix_data: Data to be used in autofixing. Codes with fix_data are: + GOOG_REQUIRES_NOT_ALPHABETIZED - List of string value tokens that are + class names in goog.requires calls. + """ + self.code = code + self.message = message + self.token = token + self.position = position + if token: + self.start_index = token.start_index + else: + self.start_index = 0 + self.fix_data = fix_data + if self.position: + self.start_index += self.position.start + + def Compare(a, b): + """Compare two error objects, by source code order. + + Args: + a: First error object. + b: Second error object. + + Returns: + A Negative/0/Positive number when a is before/the same as/after b. + """ + line_diff = a.token.line_number - b.token.line_number + if line_diff: + return line_diff + + return a.start_index - b.start_index + Compare = staticmethod(Compare) diff --git a/tools/closure_linter/build/lib/closure_linter/common/erroraccumulator.py b/tools/closure_linter/build/lib/closure_linter/common/erroraccumulator.py new file mode 100644 index 00000000000000..55844ba60356fa --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/erroraccumulator.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Linter error handler class that accumulates an array of errors.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +from closure_linter.common import errorhandler + + +class ErrorAccumulator(errorhandler.ErrorHandler): + """Error handler object that accumulates errors in a list.""" + + def __init__(self): + self._errors = [] + + def HandleError(self, error): + """Append the error to the list. + + Args: + error: The error object + """ + self._errors.append(error) + + def GetErrors(self): + """Returns the accumulated errors. + + Returns: + A sequence of errors. + """ + return self._errors diff --git a/tools/closure_linter/build/lib/closure_linter/common/errorhandler.py b/tools/closure_linter/build/lib/closure_linter/common/errorhandler.py new file mode 100644 index 00000000000000..764d54d84cb3c1 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/errorhandler.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Interface for a linter error handler. + +Error handlers aggregate a set of errors from multiple files and can optionally +perform some action based on the reported errors, for example, logging the error +or automatically fixing it. +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +class ErrorHandler(object): + """Error handler interface.""" + + def __init__(self): + if self.__class__ == ErrorHandler: + raise NotImplementedError('class ErrorHandler is abstract') + + def HandleFile(self, filename, first_token): + """Notifies this ErrorHandler that subsequent errors are in filename. + + Args: + filename: The file being linted. + first_token: The first token of the file. + """ + + def HandleError(self, error): + """Append the error to the list. + + Args: + error: The error object + """ + + def FinishFile(self): + """Finishes handling the current file. + + Should be called after all errors in a file have been handled. + """ + + def GetErrors(self): + """Returns the accumulated errors. + + Returns: + A sequence of errors. + """ diff --git a/tools/closure_linter/build/lib/closure_linter/common/erroroutput.py b/tools/closure_linter/build/lib/closure_linter/common/erroroutput.py new file mode 100644 index 00000000000000..149738b5d4f173 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/erroroutput.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility functions to format errors.""" + + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'nnaze@google.com (Nathan Naze)') + + +def GetUnixErrorOutput(filename, error, new_error=False): + """Get a output line for an error in UNIX format.""" + + line = '' + + if error.token: + line = '%d' % error.token.line_number + + error_code = '%04d' % error.code + if new_error: + error_code = 'New Error ' + error_code + return '%s:%s:(%s) %s' % (filename, line, error_code, error.message) + + +def GetErrorOutput(error, new_error=False): + """Get a output line for an error in regular format.""" + + line = '' + if error.token: + line = 'Line %d, ' % error.token.line_number + + code = 'E:%04d' % error.code + + error_message = error.message + if new_error: + error_message = 'New Error ' + error_message + + return '%s%s: %s' % (line, code, error.message) diff --git a/tools/closure_linter/build/lib/closure_linter/common/filetestcase.py b/tools/closure_linter/build/lib/closure_linter/common/filetestcase.py new file mode 100644 index 00000000000000..7cd83cd1dcf58c --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/filetestcase.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Test case that runs a checker on a file, matching errors against annotations. + +Runs the given checker on the given file, accumulating all errors. The list +of errors is then matched against those annotated in the file. Based heavily +on devtools/javascript/gpylint/full_test.py. +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import re + +import gflags as flags +import unittest as googletest +from closure_linter.common import erroraccumulator + + +class AnnotatedFileTestCase(googletest.TestCase): + """Test case to run a linter against a single file.""" + + # Matches an all caps letters + underscores error identifer + _MESSAGE = {'msg': '[A-Z][A-Z_]+'} + # Matches a //, followed by an optional line number with a +/-, followed by a + # list of message IDs. Used to extract expected messages from testdata files. + # TODO(robbyw): Generalize to use different commenting patterns. + _EXPECTED_RE = re.compile(r'\s*//\s*(?:(?P[+-]?[0-9]+):)?' + r'\s*(?P%(msg)s(?:,\s*%(msg)s)*)' % _MESSAGE) + + def __init__(self, filename, lint_callable, converter): + """Create a single file lint test case. + + Args: + filename: Filename to test. + lint_callable: Callable that lints a file. This is usually runner.Run(). + converter: Function taking an error string and returning an error code. + """ + + googletest.TestCase.__init__(self, 'runTest') + self._filename = filename + self._messages = [] + self._lint_callable = lint_callable + self._converter = converter + + def setUp(self): + flags.FLAGS.dot_on_next_line = True + + def tearDown(self): + flags.FLAGS.dot_on_next_line = False + + def shortDescription(self): + """Provides a description for the test.""" + return 'Run linter on %s' % self._filename + + def runTest(self): + """Runs the test.""" + try: + filename = self._filename + stream = open(filename) + except IOError as ex: + raise IOError('Could not find testdata resource for %s: %s' % + (self._filename, ex)) + + expected = self._GetExpectedMessages(stream) + got = self._ProcessFileAndGetMessages(filename) + self.assertEqual(expected, got) + + def _GetExpectedMessages(self, stream): + """Parse a file and get a sorted list of expected messages.""" + messages = [] + for i, line in enumerate(stream): + match = self._EXPECTED_RE.search(line) + if match: + line = match.group('line') + msg_ids = match.group('msgs') + if line is None: + line = i + 1 + elif line.startswith('+') or line.startswith('-'): + line = i + 1 + int(line) + else: + line = int(line) + for msg_id in msg_ids.split(','): + # Ignore a spurious message from the license preamble. + if msg_id != 'WITHOUT': + messages.append((line, self._converter(msg_id.strip()))) + stream.seek(0) + messages.sort() + return messages + + def _ProcessFileAndGetMessages(self, filename): + """Trap gjslint's output parse it to get messages added.""" + error_accumulator = erroraccumulator.ErrorAccumulator() + self._lint_callable(filename, error_accumulator) + + errors = error_accumulator.GetErrors() + + # Convert to expected tuple format. + + error_msgs = [(error.token.line_number, error.code) for error in errors] + error_msgs.sort() + return error_msgs diff --git a/tools/closure_linter/build/lib/closure_linter/common/htmlutil.py b/tools/closure_linter/build/lib/closure_linter/common/htmlutil.py new file mode 100644 index 00000000000000..26d44c5908353d --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/htmlutil.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utilities for dealing with HTML.""" + +__author__ = ('robbyw@google.com (Robert Walker)') + +import cStringIO +import formatter +import htmllib +import HTMLParser +import re + + +class ScriptExtractor(htmllib.HTMLParser): + """Subclass of HTMLParser that extracts script contents from an HTML file. + + Also inserts appropriate blank lines so that line numbers in the extracted + code match the line numbers in the original HTML. + """ + + def __init__(self): + """Initialize a ScriptExtractor.""" + htmllib.HTMLParser.__init__(self, formatter.NullFormatter()) + self._in_script = False + self._text = '' + + def start_script(self, attrs): + """Internal handler for the start of a script tag. + + Args: + attrs: The attributes of the script tag, as a list of tuples. + """ + for attribute in attrs: + if attribute[0].lower() == 'src': + # Skip script tags with a src specified. + return + self._in_script = True + + def end_script(self): + """Internal handler for the end of a script tag.""" + self._in_script = False + + def handle_data(self, data): + """Internal handler for character data. + + Args: + data: The character data from the HTML file. + """ + if self._in_script: + # If the last line contains whitespace only, i.e. is just there to + # properly align a tag, strip the whitespace. + if data.rstrip(' \t') != data.rstrip(' \t\n\r\f'): + data = data.rstrip(' \t') + self._text += data + else: + self._AppendNewlines(data) + + def handle_comment(self, data): + """Internal handler for HTML comments. + + Args: + data: The text of the comment. + """ + self._AppendNewlines(data) + + def _AppendNewlines(self, data): + """Count the number of newlines in the given string and append them. + + This ensures line numbers are correct for reported errors. + + Args: + data: The data to count newlines in. + """ + # We append 'x' to both sides of the string to ensure that splitlines + # gives us an accurate count. + for i in xrange(len(('x' + data + 'x').splitlines()) - 1): + self._text += '\n' + + def GetScriptLines(self): + """Return the extracted script lines. + + Returns: + The extracted script lines as a list of strings. + """ + return self._text.splitlines() + + +def GetScriptLines(f): + """Extract script tag contents from the given HTML file. + + Args: + f: The HTML file. + + Returns: + Lines in the HTML file that are from script tags. + """ + extractor = ScriptExtractor() + + # The HTML parser chokes on text like Array., so we patch + # that bug by replacing the < with < - escaping all text inside script + # tags would be better but it's a bit of a catch 22. + contents = f.read() + contents = re.sub(r'<([^\s\w/])', + lambda x: '<%s' % x.group(1), + contents) + + extractor.feed(contents) + extractor.close() + return extractor.GetScriptLines() + + +def StripTags(str): + """Returns the string with HTML tags stripped. + + Args: + str: An html string. + + Returns: + The html string with all tags stripped. If there was a parse error, returns + the text successfully parsed so far. + """ + # Brute force approach to stripping as much HTML as possible. If there is a + # parsing error, don't strip text before parse error position, and continue + # trying from there. + final_text = '' + finished = False + while not finished: + try: + strip = _HtmlStripper() + strip.feed(str) + strip.close() + str = strip.get_output() + final_text += str + finished = True + except HTMLParser.HTMLParseError, e: + final_text += str[:e.offset] + str = str[e.offset + 1:] + + return final_text + + +class _HtmlStripper(HTMLParser.HTMLParser): + """Simple class to strip tags from HTML. + + Does so by doing nothing when encountering tags, and appending character data + to a buffer when that is encountered. + """ + def __init__(self): + self.reset() + self.__output = cStringIO.StringIO() + + def handle_data(self, d): + self.__output.write(d) + + def get_output(self): + return self.__output.getvalue() diff --git a/tools/closure_linter/build/lib/closure_linter/common/lintrunner.py b/tools/closure_linter/build/lib/closure_linter/common/lintrunner.py new file mode 100644 index 00000000000000..07842c7bfeb36f --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/lintrunner.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Interface for a lint running wrapper.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +class LintRunner(object): + """Interface for a lint running wrapper.""" + + def __init__(self): + if self.__class__ == LintRunner: + raise NotImplementedError('class LintRunner is abstract') + + def Run(self, filenames, error_handler): + """Run a linter on the given filenames. + + Args: + filenames: The filenames to check + error_handler: An ErrorHandler object + + Returns: + The error handler, which may have been used to collect error info. + """ diff --git a/tools/closure_linter/build/lib/closure_linter/common/matcher.py b/tools/closure_linter/build/lib/closure_linter/common/matcher.py new file mode 100644 index 00000000000000..9b4402c6718bc7 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/matcher.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Regular expression based JavaScript matcher classes.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +from closure_linter.common import position +from closure_linter.common import tokens + +# Shorthand +Token = tokens.Token +Position = position.Position + + +class Matcher(object): + """A token matcher. + + Specifies a pattern to match, the type of token it represents, what mode the + token changes to, and what mode the token applies to. + + Modes allow more advanced grammars to be incorporated, and are also necessary + to tokenize line by line. We can have different patterns apply to different + modes - i.e. looking for documentation while in comment mode. + + Attributes: + regex: The regular expression representing this matcher. + type: The type of token indicated by a successful match. + result_mode: The mode to move to after a successful match. + """ + + def __init__(self, regex, token_type, result_mode=None, line_start=False): + """Create a new matcher template. + + Args: + regex: The regular expression to match. + token_type: The type of token a successful match indicates. + result_mode: What mode to change to after a successful match. Defaults to + None, which means to not change the current mode. + line_start: Whether this matcher should only match string at the start + of a line. + """ + self.regex = regex + self.type = token_type + self.result_mode = result_mode + self.line_start = line_start diff --git a/tools/closure_linter/build/lib/closure_linter/common/position.py b/tools/closure_linter/build/lib/closure_linter/common/position.py new file mode 100644 index 00000000000000..cebf17ef36277e --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/position.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Classes to represent positions within strings.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +class Position(object): + """Object representing a segment of a string. + + Attributes: + start: The index in to the string where the segment starts. + length: The length of the string segment. + """ + + def __init__(self, start, length): + """Initialize the position object. + + Args: + start: The start index. + length: The number of characters to include. + """ + self.start = start + self.length = length + + def Get(self, string): + """Returns this range of the given string. + + Args: + string: The string to slice. + + Returns: + The string within the range specified by this object. + """ + return string[self.start:self.start + self.length] + + def Set(self, target, source): + """Sets this range within the target string to the source string. + + Args: + target: The target string. + source: The source string. + + Returns: + The resulting string + """ + return target[:self.start] + source + target[self.start + self.length:] + + def AtEnd(string): + """Create a Position representing the end of the given string. + + Args: + string: The string to represent the end of. + + Returns: + The created Position object. + """ + return Position(len(string), 0) + AtEnd = staticmethod(AtEnd) + + def IsAtEnd(self, string): + """Returns whether this position is at the end of the given string. + + Args: + string: The string to test for the end of. + + Returns: + Whether this position is at the end of the given string. + """ + return self.start == len(string) and self.length == 0 + + def AtBeginning(): + """Create a Position representing the beginning of any string. + + Returns: + The created Position object. + """ + return Position(0, 0) + AtBeginning = staticmethod(AtBeginning) + + def IsAtBeginning(self): + """Returns whether this position is at the beginning of any string. + + Returns: + Whether this position is at the beginning of any string. + """ + return self.start == 0 and self.length == 0 + + def All(string): + """Create a Position representing the entire string. + + Args: + string: The string to represent the entirety of. + + Returns: + The created Position object. + """ + return Position(0, len(string)) + All = staticmethod(All) + + def Index(index): + """Returns a Position object for the specified index. + + Args: + index: The index to select, inclusively. + + Returns: + The created Position object. + """ + return Position(index, 1) + Index = staticmethod(Index) diff --git a/tools/closure_linter/build/lib/closure_linter/common/simplefileflags.py b/tools/closure_linter/build/lib/closure_linter/common/simplefileflags.py new file mode 100644 index 00000000000000..3402bef3a1d36e --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/simplefileflags.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Determines the list of files to be checked from command line arguments.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import glob +import os +import re + +import gflags as flags + + +FLAGS = flags.FLAGS + +flags.DEFINE_multistring( + 'recurse', + None, + 'Recurse in to the subdirectories of the given path', + short_name='r') +flags.DEFINE_list( + 'exclude_directories', + ('_demos'), + 'Exclude the specified directories (only applicable along with -r or ' + '--presubmit)', + short_name='e') +flags.DEFINE_list( + 'exclude_files', + ('deps.js'), + 'Exclude the specified files', + short_name='x') + + +def MatchesSuffixes(filename, suffixes): + """Returns whether the given filename matches one of the given suffixes. + + Args: + filename: Filename to check. + suffixes: Sequence of suffixes to check. + + Returns: + Whether the given filename matches one of the given suffixes. + """ + suffix = filename[filename.rfind('.'):] + return suffix in suffixes + + +def _GetUserSpecifiedFiles(argv, suffixes): + """Returns files to be linted, specified directly on the command line. + + Can handle the '*' wildcard in filenames, but no other wildcards. + + Args: + argv: Sequence of command line arguments. The second and following arguments + are assumed to be files that should be linted. + suffixes: Expected suffixes for the file type being checked. + + Returns: + A sequence of files to be linted. + """ + files = argv[1:] or [] + all_files = [] + lint_files = [] + + # Perform any necessary globs. + for f in files: + if f.find('*') != -1: + for result in glob.glob(f): + all_files.append(result) + else: + all_files.append(f) + + for f in all_files: + if MatchesSuffixes(f, suffixes): + lint_files.append(f) + return lint_files + + +def _GetRecursiveFiles(suffixes): + """Returns files to be checked specified by the --recurse flag. + + Args: + suffixes: Expected suffixes for the file type being checked. + + Returns: + A list of files to be checked. + """ + lint_files = [] + # Perform any request recursion + if FLAGS.recurse: + for start in FLAGS.recurse: + for root, subdirs, files in os.walk(start): + for f in files: + if MatchesSuffixes(f, suffixes): + lint_files.append(os.path.join(root, f)) + return lint_files + + +def GetAllSpecifiedFiles(argv, suffixes): + """Returns all files specified by the user on the commandline. + + Args: + argv: Sequence of command line arguments. The second and following arguments + are assumed to be files that should be linted. + suffixes: Expected suffixes for the file type + + Returns: + A list of all files specified directly or indirectly (via flags) on the + command line by the user. + """ + files = _GetUserSpecifiedFiles(argv, suffixes) + + if FLAGS.recurse: + files += _GetRecursiveFiles(suffixes) + + return FilterFiles(files) + + +def FilterFiles(files): + """Filters the list of files to be linted be removing any excluded files. + + Filters out files excluded using --exclude_files and --exclude_directories. + + Args: + files: Sequence of files that needs filtering. + + Returns: + Filtered list of files to be linted. + """ + num_files = len(files) + + ignore_dirs_regexs = [] + for ignore in FLAGS.exclude_directories: + ignore_dirs_regexs.append(re.compile(r'(^|[\\/])%s[\\/]' % ignore)) + + result_files = [] + for f in files: + add_file = True + for exclude in FLAGS.exclude_files: + if f.endswith('/' + exclude) or f == exclude: + add_file = False + break + for ignore in ignore_dirs_regexs: + if ignore.search(f): + # Break out of ignore loop so we don't add to + # filtered files. + add_file = False + break + if add_file: + # Convert everything to absolute paths so we can easily remove duplicates + # using a set. + result_files.append(os.path.abspath(f)) + + skipped = num_files - len(result_files) + if skipped: + print 'Skipping %d file(s).' % skipped + + return set(result_files) + + +def GetFileList(argv, file_type, suffixes): + """Parse the flags and return the list of files to check. + + Args: + argv: Sequence of command line arguments. + suffixes: Sequence of acceptable suffixes for the file type. + + Returns: + The list of files to check. + """ + return sorted(GetAllSpecifiedFiles(argv, suffixes)) + + +def IsEmptyArgumentList(argv): + return not (len(argv[1:]) or FLAGS.recurse) diff --git a/tools/closure_linter/build/lib/closure_linter/common/tokenizer.py b/tools/closure_linter/build/lib/closure_linter/common/tokenizer.py new file mode 100644 index 00000000000000..9420ea3267a5a2 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/tokenizer.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Regular expression based lexer.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +from closure_linter.common import tokens + +# Shorthand +Type = tokens.TokenType + + +class Tokenizer(object): + """General purpose tokenizer. + + Attributes: + mode: The latest mode of the tokenizer. This allows patterns to distinguish + if they are mid-comment, mid-parameter list, etc. + matchers: Dictionary of modes to sequences of matchers that define the + patterns to check at any given time. + default_types: Dictionary of modes to types, defining what type to give + non-matched text when in the given mode. Defaults to Type.NORMAL. + """ + + def __init__(self, starting_mode, matchers, default_types): + """Initialize the tokenizer. + + Args: + starting_mode: Mode to start in. + matchers: Dictionary of modes to sequences of matchers that defines the + patterns to check at any given time. + default_types: Dictionary of modes to types, defining what type to give + non-matched text when in the given mode. Defaults to Type.NORMAL. + """ + self.__starting_mode = starting_mode + self.matchers = matchers + self.default_types = default_types + + def TokenizeFile(self, file): + """Tokenizes the given file. + + Args: + file: An iterable that yields one line of the file at a time. + + Returns: + The first token in the file + """ + # The current mode. + self.mode = self.__starting_mode + # The first token in the stream. + self.__first_token = None + # The last token added to the token stream. + self.__last_token = None + # The current line number. + self.__line_number = 0 + + for line in file: + self.__line_number += 1 + self.__TokenizeLine(line) + + return self.__first_token + + def _CreateToken(self, string, token_type, line, line_number, values=None): + """Creates a new Token object (or subclass). + + Args: + string: The string of input the token represents. + token_type: The type of token. + line: The text of the line this token is in. + line_number: The line number of the token. + values: A dict of named values within the token. For instance, a + function declaration may have a value called 'name' which captures the + name of the function. + + Returns: + The newly created Token object. + """ + return tokens.Token(string, token_type, line, line_number, values, + line_number) + + def __TokenizeLine(self, line): + """Tokenizes the given line. + + Args: + line: The contents of the line. + """ + string = line.rstrip('\n\r\f') + line_number = self.__line_number + self.__start_index = 0 + + if not string: + self.__AddToken(self._CreateToken('', Type.BLANK_LINE, line, line_number)) + return + + normal_token = '' + index = 0 + while index < len(string): + for matcher in self.matchers[self.mode]: + if matcher.line_start and index > 0: + continue + + match = matcher.regex.match(string, index) + + if match: + if normal_token: + self.__AddToken( + self.__CreateNormalToken(self.mode, normal_token, line, + line_number)) + normal_token = '' + + # Add the match. + self.__AddToken(self._CreateToken(match.group(), matcher.type, line, + line_number, match.groupdict())) + + # Change the mode to the correct one for after this match. + self.mode = matcher.result_mode or self.mode + + # Shorten the string to be matched. + index = match.end() + + break + + else: + # If the for loop finishes naturally (i.e. no matches) we just add the + # first character to the string of consecutive non match characters. + # These will constitute a NORMAL token. + if string: + normal_token += string[index:index + 1] + index += 1 + + if normal_token: + self.__AddToken( + self.__CreateNormalToken(self.mode, normal_token, line, line_number)) + + def __CreateNormalToken(self, mode, string, line, line_number): + """Creates a normal token. + + Args: + mode: The current mode. + string: The string to tokenize. + line: The line of text. + line_number: The line number within the file. + + Returns: + A Token object, of the default type for the current mode. + """ + type = Type.NORMAL + if mode in self.default_types: + type = self.default_types[mode] + return self._CreateToken(string, type, line, line_number) + + def __AddToken(self, token): + """Add the given token to the token stream. + + Args: + token: The token to add. + """ + # Store the first token, or point the previous token to this one. + if not self.__first_token: + self.__first_token = token + else: + self.__last_token.next = token + + # Establish the doubly linked list + token.previous = self.__last_token + self.__last_token = token + + # Compute the character indices + token.start_index = self.__start_index + self.__start_index += token.length diff --git a/tools/closure_linter/build/lib/closure_linter/common/tokens.py b/tools/closure_linter/build/lib/closure_linter/common/tokens.py new file mode 100644 index 00000000000000..4703998752b036 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/tokens.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Classes to represent tokens and positions within them.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +class TokenType(object): + """Token types common to all languages.""" + NORMAL = 'normal' + WHITESPACE = 'whitespace' + BLANK_LINE = 'blank line' + + +class Token(object): + """Token class for intelligent text splitting. + + The token class represents a string of characters and an identifying type. + + Attributes: + type: The type of token. + string: The characters the token comprises. + length: The length of the token. + line: The text of the line the token is found in. + line_number: The number of the line the token is found in. + values: Dictionary of values returned from the tokens regex match. + previous: The token before this one. + next: The token after this one. + start_index: The character index in the line where this token starts. + attached_object: Object containing more information about this token. + metadata: Object containing metadata about this token. Must be added by + a separate metadata pass. + """ + + def __init__(self, string, token_type, line, line_number, values=None, + orig_line_number=None): + """Creates a new Token object. + + Args: + string: The string of input the token contains. + token_type: The type of token. + line: The text of the line this token is in. + line_number: The line number of the token. + values: A dict of named values within the token. For instance, a + function declaration may have a value called 'name' which captures the + name of the function. + orig_line_number: The line number of the original file this token comes + from. This should be only set during the tokenization process. For newly + created error fix tokens after that, it should be None. + """ + self.type = token_type + self.string = string + self.length = len(string) + self.line = line + self.line_number = line_number + self.orig_line_number = orig_line_number + self.values = values + self.is_deleted = False + + # These parts can only be computed when the file is fully tokenized + self.previous = None + self.next = None + self.start_index = None + + # This part is set in statetracker.py + # TODO(robbyw): Wrap this in to metadata + self.attached_object = None + + # This part is set in *metadatapass.py + self.metadata = None + + def IsFirstInLine(self): + """Tests if this token is the first token in its line. + + Returns: + Whether the token is the first token in its line. + """ + return not self.previous or self.previous.line_number != self.line_number + + def IsLastInLine(self): + """Tests if this token is the last token in its line. + + Returns: + Whether the token is the last token in its line. + """ + return not self.next or self.next.line_number != self.line_number + + def IsType(self, token_type): + """Tests if this token is of the given type. + + Args: + token_type: The type to test for. + + Returns: + True if the type of this token matches the type passed in. + """ + return self.type == token_type + + def IsAnyType(self, *token_types): + """Tests if this token is any of the given types. + + Args: + token_types: The types to check. Also accepts a single array. + + Returns: + True if the type of this token is any of the types passed in. + """ + if not isinstance(token_types[0], basestring): + return self.type in token_types[0] + else: + return self.type in token_types + + def __repr__(self): + return '' % (self.type, self.string, + self.values, self.line_number, + self.metadata) + + def __iter__(self): + """Returns a token iterator.""" + node = self + while node: + yield node + node = node.next + + def __reversed__(self): + """Returns a reverse-direction token iterator.""" + node = self + while node: + yield node + node = node.previous diff --git a/tools/closure_linter/build/lib/closure_linter/common/tokens_test.py b/tools/closure_linter/build/lib/closure_linter/common/tokens_test.py new file mode 100644 index 00000000000000..01ec89d01bc357 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/common/tokens_test.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import unittest as googletest +from closure_linter.common import tokens + + +def _CreateDummyToken(): + return tokens.Token('foo', None, 1, 1) + + +def _CreateDummyTokens(count): + dummy_tokens = [] + for _ in xrange(count): + dummy_tokens.append(_CreateDummyToken()) + return dummy_tokens + + +def _SetTokensAsNeighbors(neighbor_tokens): + for i in xrange(len(neighbor_tokens)): + prev_index = i - 1 + next_index = i + 1 + + if prev_index >= 0: + neighbor_tokens[i].previous = neighbor_tokens[prev_index] + + if next_index < len(neighbor_tokens): + neighbor_tokens[i].next = neighbor_tokens[next_index] + + +class TokensTest(googletest.TestCase): + + def testIsFirstInLine(self): + + # First token in file (has no previous). + self.assertTrue(_CreateDummyToken().IsFirstInLine()) + + a, b = _CreateDummyTokens(2) + _SetTokensAsNeighbors([a, b]) + + # Tokens on same line + a.line_number = 30 + b.line_number = 30 + + self.assertFalse(b.IsFirstInLine()) + + # Tokens on different lines + b.line_number = 31 + self.assertTrue(b.IsFirstInLine()) + + def testIsLastInLine(self): + # Last token in file (has no next). + self.assertTrue(_CreateDummyToken().IsLastInLine()) + + a, b = _CreateDummyTokens(2) + _SetTokensAsNeighbors([a, b]) + + # Tokens on same line + a.line_number = 30 + b.line_number = 30 + self.assertFalse(a.IsLastInLine()) + + b.line_number = 31 + self.assertTrue(a.IsLastInLine()) + + def testIsType(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertTrue(a.IsType('fakeType1')) + self.assertFalse(a.IsType('fakeType2')) + + def testIsAnyType(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertTrue(a.IsAnyType(['fakeType1', 'fakeType2'])) + self.assertFalse(a.IsAnyType(['fakeType3', 'fakeType4'])) + + def testRepr(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertEquals('', str(a)) + + def testIter(self): + dummy_tokens = _CreateDummyTokens(5) + _SetTokensAsNeighbors(dummy_tokens) + a, b, c, d, e = dummy_tokens + + i = iter(a) + self.assertListEqual([a, b, c, d, e], list(i)) + + def testReverseIter(self): + dummy_tokens = _CreateDummyTokens(5) + _SetTokensAsNeighbors(dummy_tokens) + a, b, c, d, e = dummy_tokens + + ri = reversed(e) + self.assertListEqual([e, d, c, b, a], list(ri)) + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/ecmalintrules.py b/tools/closure_linter/build/lib/closure_linter/ecmalintrules.py new file mode 100644 index 00000000000000..c07dffc86eeae3 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/ecmalintrules.py @@ -0,0 +1,844 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Core methods for checking EcmaScript files for common style guide violations. +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'jacobr@google.com (Jacob Richman)') + +import re + +import gflags as flags + +from closure_linter import checkerbase +from closure_linter import ecmametadatapass +from closure_linter import error_check +from closure_linter import errorrules +from closure_linter import errors +from closure_linter import indentation +from closure_linter import javascripttokenizer +from closure_linter import javascripttokens +from closure_linter import statetracker +from closure_linter import tokenutil +from closure_linter.common import error +from closure_linter.common import position + + +FLAGS = flags.FLAGS +flags.DEFINE_list('custom_jsdoc_tags', '', 'Extra jsdoc tags to allow') +# TODO(user): When flipping this to True, remove logic from unit tests +# that overrides this flag. +flags.DEFINE_boolean('dot_on_next_line', False, 'Require dots to be' + 'placed on the next line for wrapped expressions') + +# TODO(robbyw): Check for extra parens on return statements +# TODO(robbyw): Check for 0px in strings +# TODO(robbyw): Ensure inline jsDoc is in {} +# TODO(robbyw): Check for valid JS types in parameter docs + +# Shorthand +Context = ecmametadatapass.EcmaContext +Error = error.Error +Modes = javascripttokenizer.JavaScriptModes +Position = position.Position +Rule = error_check.Rule +Type = javascripttokens.JavaScriptTokenType + + +class EcmaScriptLintRules(checkerbase.LintRulesBase): + """EmcaScript lint style checking rules. + + Can be used to find common style errors in JavaScript, ActionScript and other + Ecma like scripting languages. Style checkers for Ecma scripting languages + should inherit from this style checker. + Please do not add any state to EcmaScriptLintRules or to any subclasses. + + All state should be added to the StateTracker subclass used for a particular + language. + """ + + # It will be initialized in constructor so the flags are initialized. + max_line_length = -1 + + # Static constants. + MISSING_PARAMETER_SPACE = re.compile(r',\S') + + EXTRA_SPACE = re.compile(r'(\(\s|\s\))') + + ENDS_WITH_SPACE = re.compile(r'\s$') + + ILLEGAL_TAB = re.compile(r'\t') + + # Regex used to split up complex types to check for invalid use of ? and |. + TYPE_SPLIT = re.compile(r'[,<>()]') + + # Regex for form of author lines after the @author tag. + AUTHOR_SPEC = re.compile(r'(\s*)[^\s]+@[^(\s]+(\s*)\(.+\)') + + # Acceptable tokens to remove for line too long testing. + LONG_LINE_IGNORE = frozenset( + ['*', '//', '@see'] + + ['@%s' % tag for tag in statetracker.DocFlag.HAS_TYPE]) + + JSDOC_FLAGS_DESCRIPTION_NOT_REQUIRED = frozenset([ + '@fileoverview', '@param', '@return', '@returns']) + + def __init__(self): + """Initialize this lint rule object.""" + checkerbase.LintRulesBase.__init__(self) + if EcmaScriptLintRules.max_line_length == -1: + EcmaScriptLintRules.max_line_length = errorrules.GetMaxLineLength() + + def Initialize(self, checker, limited_doc_checks, is_html): + """Initialize this lint rule object before parsing a new file.""" + checkerbase.LintRulesBase.Initialize(self, checker, limited_doc_checks, + is_html) + self._indentation = indentation.IndentationRules() + + def HandleMissingParameterDoc(self, token, param_name): + """Handle errors associated with a parameter missing a @param tag.""" + raise TypeError('Abstract method HandleMissingParameterDoc not implemented') + + def _CheckLineLength(self, last_token, state): + """Checks whether the line is too long. + + Args: + last_token: The last token in the line. + state: parser_state object that indicates the current state in the page + """ + # Start from the last token so that we have the flag object attached to + # and DOC_FLAG tokens. + line_number = last_token.line_number + token = last_token + + # Build a representation of the string where spaces indicate potential + # line-break locations. + line = [] + while token and token.line_number == line_number: + if state.IsTypeToken(token): + line.insert(0, 'x' * len(token.string)) + elif token.type in (Type.IDENTIFIER, Type.OPERATOR): + # Dots are acceptable places to wrap (may be tokenized as identifiers). + line.insert(0, token.string.replace('.', ' ')) + else: + line.insert(0, token.string) + token = token.previous + + line = ''.join(line) + line = line.rstrip('\n\r\f') + try: + length = len(unicode(line, 'utf-8')) + except (LookupError, UnicodeDecodeError): + # Unknown encoding. The line length may be wrong, as was originally the + # case for utf-8 (see bug 1735846). For now just accept the default + # length, but as we find problems we can either add test for other + # possible encodings or return without an error to protect against + # false positives at the cost of more false negatives. + length = len(line) + + if length > EcmaScriptLintRules.max_line_length: + + # If the line matches one of the exceptions, then it's ok. + for long_line_regexp in self.GetLongLineExceptions(): + if long_line_regexp.match(last_token.line): + return + + # If the line consists of only one "word", or multiple words but all + # except one are ignoreable, then it's ok. + parts = set(line.split()) + + # We allow two "words" (type and name) when the line contains @param + max_parts = 1 + if '@param' in parts: + max_parts = 2 + + # Custom tags like @requires may have url like descriptions, so ignore + # the tag, similar to how we handle @see. + custom_tags = set(['@%s' % f for f in FLAGS.custom_jsdoc_tags]) + if (len(parts.difference(self.LONG_LINE_IGNORE | custom_tags)) + > max_parts): + self._HandleError( + errors.LINE_TOO_LONG, + 'Line too long (%d characters).' % len(line), last_token) + + def _CheckJsDocType(self, token, js_type): + """Checks the given type for style errors. + + Args: + token: The DOC_FLAG token for the flag whose type to check. + js_type: The flag's typeannotation.TypeAnnotation instance. + """ + if not js_type: return + + if js_type.type_group and len(js_type.sub_types) == 2: + identifiers = [t.identifier for t in js_type.sub_types] + if 'null' in identifiers: + # Don't warn if the identifier is a template type (e.g. {TYPE|null}. + if not identifiers[0].isupper() and not identifiers[1].isupper(): + self._HandleError( + errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL, + 'Prefer "?Type" to "Type|null": "%s"' % js_type, token) + + # TODO(user): We should report an error for wrong usage of '?' and '|' + # e.g. {?number|string|null} etc. + + for sub_type in js_type.IterTypes(): + self._CheckJsDocType(token, sub_type) + + def _CheckForMissingSpaceBeforeToken(self, token): + """Checks for a missing space at the beginning of a token. + + Reports a MISSING_SPACE error if the token does not begin with a space or + the previous token doesn't end with a space and the previous token is on the + same line as the token. + + Args: + token: The token being checked + """ + # TODO(user): Check if too many spaces? + if (len(token.string) == len(token.string.lstrip()) and + token.previous and token.line_number == token.previous.line_number and + len(token.previous.string) - len(token.previous.string.rstrip()) == 0): + self._HandleError( + errors.MISSING_SPACE, + 'Missing space before "%s"' % token.string, + token, + position=Position.AtBeginning()) + + def _CheckOperator(self, token): + """Checks an operator for spacing and line style. + + Args: + token: The operator token. + """ + last_code = token.metadata.last_code + + if not self._ExpectSpaceBeforeOperator(token): + if (token.previous and token.previous.type == Type.WHITESPACE and + last_code and last_code.type in (Type.NORMAL, Type.IDENTIFIER) and + last_code.line_number == token.line_number): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "%s"' % token.string, + token.previous, position=Position.All(token.previous.string)) + + elif (token.previous and + not token.previous.IsComment() and + not tokenutil.IsDot(token) and + token.previous.type in Type.EXPRESSION_ENDER_TYPES): + self._HandleError(errors.MISSING_SPACE, + 'Missing space before "%s"' % token.string, token, + position=Position.AtBeginning()) + + # Check wrapping of operators. + next_code = tokenutil.GetNextCodeToken(token) + + is_dot = tokenutil.IsDot(token) + wrapped_before = last_code and last_code.line_number != token.line_number + wrapped_after = next_code and next_code.line_number != token.line_number + + if FLAGS.dot_on_next_line and is_dot and wrapped_after: + self._HandleError( + errors.LINE_ENDS_WITH_DOT, + '"." must go on the following line', + token) + if (not is_dot and wrapped_before and + not token.metadata.IsUnaryOperator()): + self._HandleError( + errors.LINE_STARTS_WITH_OPERATOR, + 'Binary operator must go on previous line "%s"' % token.string, + token) + + def _IsLabel(self, token): + # A ':' token is considered part of a label if it occurs in a case + # statement, a plain label, or an object literal, i.e. is not part of a + # ternary. + + return (token.string == ':' and + token.metadata.context.type in (Context.LITERAL_ELEMENT, + Context.CASE_BLOCK, + Context.STATEMENT)) + + def _ExpectSpaceBeforeOperator(self, token): + """Returns whether a space should appear before the given operator token. + + Args: + token: The operator token. + + Returns: + Whether there should be a space before the token. + """ + if token.string == ',' or token.metadata.IsUnaryPostOperator(): + return False + + if tokenutil.IsDot(token): + return False + + # Colons should appear in labels, object literals, the case of a switch + # statement, and ternary operator. Only want a space in the case of the + # ternary operator. + if self._IsLabel(token): + return False + + if token.metadata.IsUnaryOperator() and token.IsFirstInLine(): + return False + + return True + + def CheckToken(self, token, state): + """Checks a token, given the current parser_state, for warnings and errors. + + Args: + token: The current token under consideration + state: parser_state object that indicates the current state in the page + """ + # Store some convenience variables + first_in_line = token.IsFirstInLine() + last_in_line = token.IsLastInLine() + last_non_space_token = state.GetLastNonSpaceToken() + + token_type = token.type + + # Process the line change. + if not self._is_html and error_check.ShouldCheck(Rule.INDENTATION): + # TODO(robbyw): Support checking indentation in HTML files. + indentation_errors = self._indentation.CheckToken(token, state) + for indentation_error in indentation_errors: + self._HandleError(*indentation_error) + + if last_in_line: + self._CheckLineLength(token, state) + + if token_type == Type.PARAMETERS: + # Find missing spaces in parameter lists. + if self.MISSING_PARAMETER_SPACE.search(token.string): + fix_data = ', '.join([s.strip() for s in token.string.split(',')]) + self._HandleError(errors.MISSING_SPACE, 'Missing space after ","', + token, position=None, fix_data=fix_data.strip()) + + # Find extra spaces at the beginning of parameter lists. Make sure + # we aren't at the beginning of a continuing multi-line list. + if not first_in_line: + space_count = len(token.string) - len(token.string.lstrip()) + if space_count: + self._HandleError(errors.EXTRA_SPACE, 'Extra space after "("', + token, position=Position(0, space_count)) + + elif (token_type == Type.START_BLOCK and + token.metadata.context.type == Context.BLOCK): + self._CheckForMissingSpaceBeforeToken(token) + + elif token_type == Type.END_BLOCK: + last_code = token.metadata.last_code + if state.InFunction() and state.IsFunctionClose(): + if state.InTopLevelFunction(): + # A semicolons should not be included at the end of a function + # declaration. + if not state.InAssignedFunction(): + if not last_in_line and token.next.type == Type.SEMICOLON: + self._HandleError( + errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION, + 'Illegal semicolon after function declaration', + token.next, position=Position.All(token.next.string)) + + # A semicolon should be included at the end of a function expression + # that is not immediately called or used by a dot operator. + if (state.InAssignedFunction() and token.next + and token.next.type != Type.SEMICOLON): + next_token = tokenutil.GetNextCodeToken(token) + is_immediately_used = (next_token.type == Type.START_PAREN or + tokenutil.IsDot(next_token)) + if not is_immediately_used: + self._HandleError( + errors.MISSING_SEMICOLON_AFTER_FUNCTION, + 'Missing semicolon after function assigned to a variable', + token, position=Position.AtEnd(token.string)) + + if state.InInterfaceMethod() and last_code.type != Type.START_BLOCK: + self._HandleError(errors.INTERFACE_METHOD_CANNOT_HAVE_CODE, + 'Interface methods cannot contain code', last_code) + + elif (state.IsBlockClose() and + token.next and token.next.type == Type.SEMICOLON): + if (last_code.metadata.context.parent.type != Context.OBJECT_LITERAL + and last_code.metadata.context.type != Context.OBJECT_LITERAL): + self._HandleError( + errors.REDUNDANT_SEMICOLON, + 'No semicolon is required to end a code block', + token.next, position=Position.All(token.next.string)) + + elif token_type == Type.SEMICOLON: + if token.previous and token.previous.type == Type.WHITESPACE: + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before ";"', + token.previous, position=Position.All(token.previous.string)) + + if token.next and token.next.line_number == token.line_number: + if token.metadata.context.type != Context.FOR_GROUP_BLOCK: + # TODO(robbyw): Error about no multi-statement lines. + pass + + elif token.next.type not in ( + Type.WHITESPACE, Type.SEMICOLON, Type.END_PAREN): + self._HandleError( + errors.MISSING_SPACE, + 'Missing space after ";" in for statement', + token.next, + position=Position.AtBeginning()) + + last_code = token.metadata.last_code + if last_code and last_code.type == Type.SEMICOLON: + # Allow a single double semi colon in for loops for cases like: + # for (;;) { }. + # NOTE(user): This is not a perfect check, and will not throw an error + # for cases like: for (var i = 0;; i < n; i++) {}, but then your code + # probably won't work either. + for_token = tokenutil.CustomSearch( + last_code, + lambda token: token.type == Type.KEYWORD and token.string == 'for', + end_func=lambda token: token.type == Type.SEMICOLON, + distance=None, + reverse=True) + + if not for_token: + self._HandleError(errors.REDUNDANT_SEMICOLON, 'Redundant semicolon', + token, position=Position.All(token.string)) + + elif token_type == Type.START_PAREN: + # Ensure that opening parentheses have a space before any keyword + # that is not being invoked like a member function. + if (token.previous and token.previous.type == Type.KEYWORD and + (not token.previous.metadata or + not token.previous.metadata.last_code or + not token.previous.metadata.last_code.string or + token.previous.metadata.last_code.string[-1:] != '.')): + self._HandleError(errors.MISSING_SPACE, 'Missing space before "("', + token, position=Position.AtBeginning()) + elif token.previous and token.previous.type == Type.WHITESPACE: + before_space = token.previous.previous + # Ensure that there is no extra space before a function invocation, + # even if the function being invoked happens to be a keyword. + if (before_space and before_space.line_number == token.line_number and + before_space.type == Type.IDENTIFIER or + (before_space.type == Type.KEYWORD and before_space.metadata and + before_space.metadata.last_code and + before_space.metadata.last_code.string and + before_space.metadata.last_code.string[-1:] == '.')): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "("', + token.previous, position=Position.All(token.previous.string)) + + elif token_type == Type.START_BRACKET: + self._HandleStartBracket(token, last_non_space_token) + elif token_type in (Type.END_PAREN, Type.END_BRACKET): + # Ensure there is no space before closing parentheses, except when + # it's in a for statement with an omitted section, or when it's at the + # beginning of a line. + if (token.previous and token.previous.type == Type.WHITESPACE and + not token.previous.IsFirstInLine() and + not (last_non_space_token and last_non_space_token.line_number == + token.line_number and + last_non_space_token.type == Type.SEMICOLON)): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "%s"' % + token.string, token.previous, + position=Position.All(token.previous.string)) + + elif token_type == Type.WHITESPACE: + if self.ILLEGAL_TAB.search(token.string): + if token.IsFirstInLine(): + if token.next: + self._HandleError( + errors.ILLEGAL_TAB, + 'Illegal tab in whitespace before "%s"' % token.next.string, + token, position=Position.All(token.string)) + else: + self._HandleError( + errors.ILLEGAL_TAB, + 'Illegal tab in whitespace', + token, position=Position.All(token.string)) + else: + self._HandleError( + errors.ILLEGAL_TAB, + 'Illegal tab in whitespace after "%s"' % token.previous.string, + token, position=Position.All(token.string)) + + # Check whitespace length if it's not the first token of the line and + # if it's not immediately before a comment. + if last_in_line: + # Check for extra whitespace at the end of a line. + self._HandleError(errors.EXTRA_SPACE, 'Extra space at end of line', + token, position=Position.All(token.string)) + elif not first_in_line and not token.next.IsComment(): + if token.length > 1: + self._HandleError( + errors.EXTRA_SPACE, 'Extra space after "%s"' % + token.previous.string, token, + position=Position(1, len(token.string) - 1)) + + elif token_type == Type.OPERATOR: + self._CheckOperator(token) + elif token_type == Type.DOC_FLAG: + flag = token.attached_object + + if flag.flag_type == 'bug': + # TODO(robbyw): Check for exactly 1 space on the left. + string = token.next.string.lstrip() + string = string.split(' ', 1)[0] + + if not string.isdigit(): + self._HandleError(errors.NO_BUG_NUMBER_AFTER_BUG_TAG, + '@bug should be followed by a bug number', token) + + elif flag.flag_type == 'suppress': + if flag.type is None: + # A syntactically invalid suppress tag will get tokenized as a normal + # flag, indicating an error. + self._HandleError( + errors.INCORRECT_SUPPRESS_SYNTAX, + 'Invalid suppress syntax: should be @suppress {errortype}. ' + 'Spaces matter.', token) + else: + for suppress_type in flag.jstype.IterIdentifiers(): + if suppress_type not in state.GetDocFlag().SUPPRESS_TYPES: + self._HandleError( + errors.INVALID_SUPPRESS_TYPE, + 'Invalid suppression type: %s' % suppress_type, token) + + elif (error_check.ShouldCheck(Rule.WELL_FORMED_AUTHOR) and + flag.flag_type == 'author'): + # TODO(user): In non strict mode check the author tag for as much as + # it exists, though the full form checked below isn't required. + string = token.next.string + result = self.AUTHOR_SPEC.match(string) + if not result: + self._HandleError(errors.INVALID_AUTHOR_TAG_DESCRIPTION, + 'Author tag line should be of the form: ' + '@author foo@somewhere.com (Your Name)', + token.next) + else: + # Check spacing between email address and name. Do this before + # checking earlier spacing so positions are easier to calculate for + # autofixing. + num_spaces = len(result.group(2)) + if num_spaces < 1: + self._HandleError(errors.MISSING_SPACE, + 'Missing space after email address', + token.next, position=Position(result.start(2), 0)) + elif num_spaces > 1: + self._HandleError( + errors.EXTRA_SPACE, 'Extra space after email address', + token.next, + position=Position(result.start(2) + 1, num_spaces - 1)) + + # Check for extra spaces before email address. Can't be too few, if + # not at least one we wouldn't match @author tag. + num_spaces = len(result.group(1)) + if num_spaces > 1: + self._HandleError(errors.EXTRA_SPACE, + 'Extra space before email address', + token.next, position=Position(1, num_spaces - 1)) + + elif (flag.flag_type in state.GetDocFlag().HAS_DESCRIPTION and + not self._limited_doc_checks): + if flag.flag_type == 'param': + if flag.name is None: + self._HandleError(errors.MISSING_JSDOC_PARAM_NAME, + 'Missing name in @param tag', token) + + if not flag.description or flag.description is None: + flag_name = token.type + if 'name' in token.values: + flag_name = '@' + token.values['name'] + + if flag_name not in self.JSDOC_FLAGS_DESCRIPTION_NOT_REQUIRED: + self._HandleError( + errors.MISSING_JSDOC_TAG_DESCRIPTION, + 'Missing description in %s tag' % flag_name, token) + else: + self._CheckForMissingSpaceBeforeToken(flag.description_start_token) + + if flag.HasType(): + if flag.type_start_token is not None: + self._CheckForMissingSpaceBeforeToken( + token.attached_object.type_start_token) + + if flag.jstype and not flag.jstype.IsEmpty(): + self._CheckJsDocType(token, flag.jstype) + + if error_check.ShouldCheck(Rule.BRACES_AROUND_TYPE) and ( + flag.type_start_token.type != Type.DOC_START_BRACE or + flag.type_end_token.type != Type.DOC_END_BRACE): + self._HandleError( + errors.MISSING_BRACES_AROUND_TYPE, + 'Type must always be surrounded by curly braces.', token) + + if token_type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG): + if (token.values['name'] not in state.GetDocFlag().LEGAL_DOC and + token.values['name'] not in FLAGS.custom_jsdoc_tags): + self._HandleError( + errors.INVALID_JSDOC_TAG, + 'Invalid JsDoc tag: %s' % token.values['name'], token) + + if (error_check.ShouldCheck(Rule.NO_BRACES_AROUND_INHERIT_DOC) and + token.values['name'] == 'inheritDoc' and + token_type == Type.DOC_INLINE_FLAG): + self._HandleError(errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC, + 'Unnecessary braces around @inheritDoc', + token) + + elif token_type == Type.SIMPLE_LVALUE: + identifier = token.values['identifier'] + + if ((not state.InFunction() or state.InConstructor()) and + state.InTopLevel() and not state.InObjectLiteralDescendant()): + jsdoc = state.GetDocComment() + if not state.HasDocComment(identifier): + # Only test for documentation on identifiers with .s in them to + # avoid checking things like simple variables. We don't require + # documenting assignments to .prototype itself (bug 1880803). + if (not state.InConstructor() and + identifier.find('.') != -1 and not + identifier.endswith('.prototype') and not + self._limited_doc_checks): + comment = state.GetLastComment() + if not (comment and comment.lower().count('jsdoc inherited')): + self._HandleError( + errors.MISSING_MEMBER_DOCUMENTATION, + "No docs found for member '%s'" % identifier, + token) + elif jsdoc and (not state.InConstructor() or + identifier.startswith('this.')): + # We are at the top level and the function/member is documented. + if identifier.endswith('_') and not identifier.endswith('__'): + # Can have a private class which inherits documentation from a + # public superclass. + # + # @inheritDoc is deprecated in favor of using @override, and they + if (jsdoc.HasFlag('override') and not jsdoc.HasFlag('constructor') + and ('accessControls' not in jsdoc.suppressions)): + self._HandleError( + errors.INVALID_OVERRIDE_PRIVATE, + '%s should not override a private member.' % identifier, + jsdoc.GetFlag('override').flag_token) + if (jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor') + and ('accessControls' not in jsdoc.suppressions)): + self._HandleError( + errors.INVALID_INHERIT_DOC_PRIVATE, + '%s should not inherit from a private member.' % identifier, + jsdoc.GetFlag('inheritDoc').flag_token) + if (not jsdoc.HasFlag('private') and + ('underscore' not in jsdoc.suppressions) and not + ((jsdoc.HasFlag('inheritDoc') or jsdoc.HasFlag('override')) and + ('accessControls' in jsdoc.suppressions))): + self._HandleError( + errors.MISSING_PRIVATE, + 'Member "%s" must have @private JsDoc.' % + identifier, token) + if jsdoc.HasFlag('private') and 'underscore' in jsdoc.suppressions: + self._HandleError( + errors.UNNECESSARY_SUPPRESS, + '@suppress {underscore} is not necessary with @private', + jsdoc.suppressions['underscore']) + elif (jsdoc.HasFlag('private') and + not self.InExplicitlyTypedLanguage()): + # It is convention to hide public fields in some ECMA + # implementations from documentation using the @private tag. + self._HandleError( + errors.EXTRA_PRIVATE, + 'Member "%s" must not have @private JsDoc' % + identifier, token) + + # These flags are only legal on localizable message definitions; + # such variables always begin with the prefix MSG_. + for f in ('desc', 'hidden', 'meaning'): + if (jsdoc.HasFlag(f) + and not identifier.startswith('MSG_') + and identifier.find('.MSG_') == -1): + self._HandleError( + errors.INVALID_USE_OF_DESC_TAG, + 'Member "%s" should not have @%s JsDoc' % (identifier, f), + token) + + # Check for illegaly assigning live objects as prototype property values. + index = identifier.find('.prototype.') + # Ignore anything with additional .s after the prototype. + if index != -1 and identifier.find('.', index + 11) == -1: + equal_operator = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) + next_code = tokenutil.SearchExcept(equal_operator, Type.NON_CODE_TYPES) + if next_code and ( + next_code.type in (Type.START_BRACKET, Type.START_BLOCK) or + next_code.IsOperator('new')): + self._HandleError( + errors.ILLEGAL_PROTOTYPE_MEMBER_VALUE, + 'Member %s cannot have a non-primitive value' % identifier, + token) + + elif token_type == Type.END_PARAMETERS: + # Find extra space at the end of parameter lists. We check the token + # prior to the current one when it is a closing paren. + if (token.previous and token.previous.type == Type.PARAMETERS + and self.ENDS_WITH_SPACE.search(token.previous.string)): + self._HandleError(errors.EXTRA_SPACE, 'Extra space before ")"', + token.previous) + + jsdoc = state.GetDocComment() + if state.GetFunction().is_interface: + if token.previous and token.previous.type == Type.PARAMETERS: + self._HandleError( + errors.INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS, + 'Interface constructor cannot have parameters', + token.previous) + elif (state.InTopLevel() and jsdoc and not jsdoc.HasFlag('see') + and not jsdoc.InheritsDocumentation() + and not state.InObjectLiteralDescendant() and not + jsdoc.IsInvalidated()): + distance, edit = jsdoc.CompareParameters(state.GetParams()) + if distance: + params_iter = iter(state.GetParams()) + docs_iter = iter(jsdoc.ordered_params) + + for op in edit: + if op == 'I': + # Insertion. + # Parsing doc comments is the same for all languages + # but some languages care about parameters that don't have + # doc comments and some languages don't care. + # Languages that don't allow variables to by typed such as + # JavaScript care but languages such as ActionScript or Java + # that allow variables to be typed don't care. + if not self._limited_doc_checks: + self.HandleMissingParameterDoc(token, params_iter.next()) + + elif op == 'D': + # Deletion + self._HandleError(errors.EXTRA_PARAMETER_DOCUMENTATION, + 'Found docs for non-existing parameter: "%s"' % + docs_iter.next(), token) + elif op == 'S': + # Substitution + if not self._limited_doc_checks: + self._HandleError( + errors.WRONG_PARAMETER_DOCUMENTATION, + 'Parameter mismatch: got "%s", expected "%s"' % + (params_iter.next(), docs_iter.next()), token) + + else: + # Equality - just advance the iterators + params_iter.next() + docs_iter.next() + + elif token_type == Type.STRING_TEXT: + # If this is the first token after the start of the string, but it's at + # the end of a line, we know we have a multi-line string. + if token.previous.type in ( + Type.SINGLE_QUOTE_STRING_START, + Type.DOUBLE_QUOTE_STRING_START) and last_in_line: + self._HandleError(errors.MULTI_LINE_STRING, + 'Multi-line strings are not allowed', token) + + # This check is orthogonal to the ones above, and repeats some types, so + # it is a plain if and not an elif. + if token.type in Type.COMMENT_TYPES: + if self.ILLEGAL_TAB.search(token.string): + self._HandleError(errors.ILLEGAL_TAB, + 'Illegal tab in comment "%s"' % token.string, token) + + trimmed = token.string.rstrip() + if last_in_line and token.string != trimmed: + # Check for extra whitespace at the end of a line. + self._HandleError( + errors.EXTRA_SPACE, 'Extra space at end of line', token, + position=Position(len(trimmed), len(token.string) - len(trimmed))) + + # This check is also orthogonal since it is based on metadata. + if token.metadata.is_implied_semicolon: + self._HandleError(errors.MISSING_SEMICOLON, + 'Missing semicolon at end of line', token) + + def _HandleStartBracket(self, token, last_non_space_token): + """Handles a token that is an open bracket. + + Args: + token: The token to handle. + last_non_space_token: The last token that was not a space. + """ + if (not token.IsFirstInLine() and token.previous.type == Type.WHITESPACE and + last_non_space_token and + last_non_space_token.type in Type.EXPRESSION_ENDER_TYPES): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "["', + token.previous, position=Position.All(token.previous.string)) + # If the [ token is the first token in a line we shouldn't complain + # about a missing space before [. This is because some Ecma script + # languages allow syntax like: + # [Annotation] + # class MyClass {...} + # So we don't want to blindly warn about missing spaces before [. + # In the the future, when rules for computing exactly how many spaces + # lines should be indented are added, then we can return errors for + # [ tokens that are improperly indented. + # For example: + # var someVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariableName = + # [a,b,c]; + # should trigger a proper indentation warning message as [ is not indented + # by four spaces. + elif (not token.IsFirstInLine() and token.previous and + token.previous.type not in ( + [Type.WHITESPACE, Type.START_PAREN, Type.START_BRACKET] + + Type.EXPRESSION_ENDER_TYPES)): + self._HandleError(errors.MISSING_SPACE, 'Missing space before "["', + token, position=Position.AtBeginning()) + + def Finalize(self, state): + """Perform all checks that need to occur after all lines are processed. + + Args: + state: State of the parser after parsing all tokens + + Raises: + TypeError: If not overridden. + """ + last_non_space_token = state.GetLastNonSpaceToken() + # Check last line for ending with newline. + if state.GetLastLine() and not ( + state.GetLastLine().isspace() or + state.GetLastLine().rstrip('\n\r\f') != state.GetLastLine()): + self._HandleError( + errors.FILE_MISSING_NEWLINE, + 'File does not end with new line. (%s)' % state.GetLastLine(), + last_non_space_token) + + try: + self._indentation.Finalize() + except Exception, e: + self._HandleError( + errors.FILE_DOES_NOT_PARSE, + str(e), + last_non_space_token) + + def GetLongLineExceptions(self): + """Gets a list of regexps for lines which can be longer than the limit. + + Returns: + A list of regexps, used as matches (rather than searches). + """ + return [] + + def InExplicitlyTypedLanguage(self): + """Returns whether this ecma implementation is explicitly typed.""" + return False diff --git a/tools/closure_linter/build/lib/closure_linter/ecmametadatapass.py b/tools/closure_linter/build/lib/closure_linter/ecmametadatapass.py new file mode 100644 index 00000000000000..50621610efe08d --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/ecmametadatapass.py @@ -0,0 +1,574 @@ +#!/usr/bin/env python +# +# Copyright 2010 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Metadata pass for annotating tokens in EcmaScript files.""" + +__author__ = ('robbyw@google.com (Robert Walker)') + +from closure_linter import javascripttokens +from closure_linter import tokenutil + + +TokenType = javascripttokens.JavaScriptTokenType + + +class ParseError(Exception): + """Exception indicating a parse error at the given token. + + Attributes: + token: The token where the parse error occurred. + """ + + def __init__(self, token, message=None): + """Initialize a parse error at the given token with an optional message. + + Args: + token: The token where the parse error occurred. + message: A message describing the parse error. + """ + Exception.__init__(self, message) + self.token = token + + +class EcmaContext(object): + """Context object for EcmaScript languages. + + Attributes: + type: The context type. + start_token: The token where this context starts. + end_token: The token where this context ends. + parent: The parent context. + """ + + # The root context. + ROOT = 'root' + + # A block of code. + BLOCK = 'block' + + # A pseudo-block of code for a given case or default section. + CASE_BLOCK = 'case_block' + + # Block of statements in a for loop's parentheses. + FOR_GROUP_BLOCK = 'for_block' + + # An implied block of code for 1 line if, while, and for statements + IMPLIED_BLOCK = 'implied_block' + + # An index in to an array or object. + INDEX = 'index' + + # An array literal in []. + ARRAY_LITERAL = 'array_literal' + + # An object literal in {}. + OBJECT_LITERAL = 'object_literal' + + # An individual element in an array or object literal. + LITERAL_ELEMENT = 'literal_element' + + # The portion of a ternary statement between ? and : + TERNARY_TRUE = 'ternary_true' + + # The portion of a ternary statment after : + TERNARY_FALSE = 'ternary_false' + + # The entire switch statment. This will contain a GROUP with the variable + # and a BLOCK with the code. + + # Since that BLOCK is not a normal block, it can not contain statements except + # for case and default. + SWITCH = 'switch' + + # A normal comment. + COMMENT = 'comment' + + # A JsDoc comment. + DOC = 'doc' + + # An individual statement. + STATEMENT = 'statement' + + # Code within parentheses. + GROUP = 'group' + + # Parameter names in a function declaration. + PARAMETERS = 'parameters' + + # A set of variable declarations appearing after the 'var' keyword. + VAR = 'var' + + # Context types that are blocks. + BLOCK_TYPES = frozenset([ + ROOT, BLOCK, CASE_BLOCK, FOR_GROUP_BLOCK, IMPLIED_BLOCK]) + + def __init__(self, context_type, start_token, parent=None): + """Initializes the context object. + + Args: + context_type: The context type. + start_token: The token where this context starts. + parent: The parent context. + + Attributes: + type: The context type. + start_token: The token where this context starts. + end_token: The token where this context ends. + parent: The parent context. + children: The child contexts of this context, in order. + """ + self.type = context_type + self.start_token = start_token + self.end_token = None + + self.parent = None + self.children = [] + + if parent: + parent.AddChild(self) + + def __repr__(self): + """Returns a string representation of the context object.""" + stack = [] + context = self + while context: + stack.append(context.type) + context = context.parent + return 'Context(%s)' % ' > '.join(stack) + + def AddChild(self, child): + """Adds a child to this context and sets child's parent to this context. + + Args: + child: A child EcmaContext. The child's parent will be set to this + context. + """ + + child.parent = self + + self.children.append(child) + self.children.sort(EcmaContext._CompareContexts) + + def GetRoot(self): + """Get the root context that contains this context, if any.""" + context = self + while context: + if context.type is EcmaContext.ROOT: + return context + context = context.parent + + @staticmethod + def _CompareContexts(context1, context2): + """Sorts contexts 1 and 2 by start token document position.""" + return tokenutil.Compare(context1.start_token, context2.start_token) + + +class EcmaMetaData(object): + """Token metadata for EcmaScript languages. + + Attributes: + last_code: The last code token to appear before this one. + context: The context this token appears in. + operator_type: The operator type, will be one of the *_OPERATOR constants + defined below. + aliased_symbol: The full symbol being identified, as a string (e.g. an + 'XhrIo' alias for 'goog.net.XhrIo'). Only applicable to identifier + tokens. This is set in aliaspass.py and is a best guess. + is_alias_definition: True if the symbol is part of an alias definition. + If so, these symbols won't be counted towards goog.requires/provides. + """ + + UNARY_OPERATOR = 'unary' + + UNARY_POST_OPERATOR = 'unary_post' + + BINARY_OPERATOR = 'binary' + + TERNARY_OPERATOR = 'ternary' + + def __init__(self): + """Initializes a token metadata object.""" + self.last_code = None + self.context = None + self.operator_type = None + self.is_implied_semicolon = False + self.is_implied_block = False + self.is_implied_block_close = False + self.aliased_symbol = None + self.is_alias_definition = False + + def __repr__(self): + """Returns a string representation of the context object.""" + parts = ['%r' % self.context] + if self.operator_type: + parts.append('optype: %r' % self.operator_type) + if self.is_implied_semicolon: + parts.append('implied;') + if self.aliased_symbol: + parts.append('alias for: %s' % self.aliased_symbol) + return 'MetaData(%s)' % ', '.join(parts) + + def IsUnaryOperator(self): + return self.operator_type in (EcmaMetaData.UNARY_OPERATOR, + EcmaMetaData.UNARY_POST_OPERATOR) + + def IsUnaryPostOperator(self): + return self.operator_type == EcmaMetaData.UNARY_POST_OPERATOR + + +class EcmaMetaDataPass(object): + """A pass that iterates over all tokens and builds metadata about them.""" + + def __init__(self): + """Initialize the meta data pass object.""" + self.Reset() + + def Reset(self): + """Resets the metadata pass to prepare for the next file.""" + self._token = None + self._context = None + self._AddContext(EcmaContext.ROOT) + self._last_code = None + + def _CreateContext(self, context_type): + """Overridable by subclasses to create the appropriate context type.""" + return EcmaContext(context_type, self._token, self._context) + + def _CreateMetaData(self): + """Overridable by subclasses to create the appropriate metadata type.""" + return EcmaMetaData() + + def _AddContext(self, context_type): + """Adds a context of the given type to the context stack. + + Args: + context_type: The type of context to create + """ + self._context = self._CreateContext(context_type) + + def _PopContext(self): + """Moves up one level in the context stack. + + Returns: + The former context. + + Raises: + ParseError: If the root context is popped. + """ + top_context = self._context + top_context.end_token = self._token + self._context = top_context.parent + if self._context: + return top_context + else: + raise ParseError(self._token) + + def _PopContextType(self, *stop_types): + """Pops the context stack until a context of the given type is popped. + + Args: + *stop_types: The types of context to pop to - stops at the first match. + + Returns: + The context object of the given type that was popped. + """ + last = None + while not last or last.type not in stop_types: + last = self._PopContext() + return last + + def _EndStatement(self): + """Process the end of a statement.""" + self._PopContextType(EcmaContext.STATEMENT) + if self._context.type == EcmaContext.IMPLIED_BLOCK: + self._token.metadata.is_implied_block_close = True + self._PopContext() + + def _ProcessContext(self): + """Process the context at the current token. + + Returns: + The context that should be assigned to the current token, or None if + the current context after this method should be used. + + Raises: + ParseError: When the token appears in an invalid context. + """ + token = self._token + token_type = token.type + + if self._context.type in EcmaContext.BLOCK_TYPES: + # Whenever we're in a block, we add a statement context. We make an + # exception for switch statements since they can only contain case: and + # default: and therefore don't directly contain statements. + # The block we add here may be immediately removed in some cases, but + # that causes no harm. + parent = self._context.parent + if not parent or parent.type != EcmaContext.SWITCH: + self._AddContext(EcmaContext.STATEMENT) + + elif self._context.type == EcmaContext.ARRAY_LITERAL: + self._AddContext(EcmaContext.LITERAL_ELEMENT) + + if token_type == TokenType.START_PAREN: + if self._last_code and self._last_code.IsKeyword('for'): + # for loops contain multiple statements in the group unlike while, + # switch, if, etc. + self._AddContext(EcmaContext.FOR_GROUP_BLOCK) + else: + self._AddContext(EcmaContext.GROUP) + + elif token_type == TokenType.END_PAREN: + result = self._PopContextType(EcmaContext.GROUP, + EcmaContext.FOR_GROUP_BLOCK) + keyword_token = result.start_token.metadata.last_code + # keyword_token will not exist if the open paren is the first line of the + # file, for example if all code is wrapped in an immediately executed + # annonymous function. + if keyword_token and keyword_token.string in ('if', 'for', 'while'): + next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES) + if next_code.type != TokenType.START_BLOCK: + # Check for do-while. + is_do_while = False + pre_keyword_token = keyword_token.metadata.last_code + if (pre_keyword_token and + pre_keyword_token.type == TokenType.END_BLOCK): + start_block_token = pre_keyword_token.metadata.context.start_token + is_do_while = start_block_token.metadata.last_code.string == 'do' + + # If it's not do-while, it's an implied block. + if not is_do_while: + self._AddContext(EcmaContext.IMPLIED_BLOCK) + token.metadata.is_implied_block = True + + return result + + # else (not else if) with no open brace after it should be considered the + # start of an implied block, similar to the case with if, for, and while + # above. + elif (token_type == TokenType.KEYWORD and + token.string == 'else'): + next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES) + if (next_code.type != TokenType.START_BLOCK and + (next_code.type != TokenType.KEYWORD or next_code.string != 'if')): + self._AddContext(EcmaContext.IMPLIED_BLOCK) + token.metadata.is_implied_block = True + + elif token_type == TokenType.START_PARAMETERS: + self._AddContext(EcmaContext.PARAMETERS) + + elif token_type == TokenType.END_PARAMETERS: + return self._PopContextType(EcmaContext.PARAMETERS) + + elif token_type == TokenType.START_BRACKET: + if (self._last_code and + self._last_code.type in TokenType.EXPRESSION_ENDER_TYPES): + self._AddContext(EcmaContext.INDEX) + else: + self._AddContext(EcmaContext.ARRAY_LITERAL) + + elif token_type == TokenType.END_BRACKET: + return self._PopContextType(EcmaContext.INDEX, EcmaContext.ARRAY_LITERAL) + + elif token_type == TokenType.START_BLOCK: + if (self._last_code.type in (TokenType.END_PAREN, + TokenType.END_PARAMETERS) or + self._last_code.IsKeyword('else') or + self._last_code.IsKeyword('do') or + self._last_code.IsKeyword('try') or + self._last_code.IsKeyword('finally') or + (self._last_code.IsOperator(':') and + self._last_code.metadata.context.type == EcmaContext.CASE_BLOCK)): + # else, do, try, and finally all might have no () before {. + # Also, handle the bizzare syntax case 10: {...}. + self._AddContext(EcmaContext.BLOCK) + else: + self._AddContext(EcmaContext.OBJECT_LITERAL) + + elif token_type == TokenType.END_BLOCK: + context = self._PopContextType(EcmaContext.BLOCK, + EcmaContext.OBJECT_LITERAL) + if self._context.type == EcmaContext.SWITCH: + # The end of the block also means the end of the switch statement it + # applies to. + return self._PopContext() + return context + + elif token.IsKeyword('switch'): + self._AddContext(EcmaContext.SWITCH) + + elif (token_type == TokenType.KEYWORD and + token.string in ('case', 'default') and + self._context.type != EcmaContext.OBJECT_LITERAL): + # Pop up to but not including the switch block. + while self._context.parent.type != EcmaContext.SWITCH: + self._PopContext() + if self._context.parent is None: + raise ParseError(token, 'Encountered case/default statement ' + 'without switch statement') + + elif token.IsOperator('?'): + self._AddContext(EcmaContext.TERNARY_TRUE) + + elif token.IsOperator(':'): + if self._context.type == EcmaContext.OBJECT_LITERAL: + self._AddContext(EcmaContext.LITERAL_ELEMENT) + + elif self._context.type == EcmaContext.TERNARY_TRUE: + self._PopContext() + self._AddContext(EcmaContext.TERNARY_FALSE) + + # Handle nested ternary statements like: + # foo = bar ? baz ? 1 : 2 : 3 + # When we encounter the second ":" the context is + # ternary_false > ternary_true > statement > root + elif (self._context.type == EcmaContext.TERNARY_FALSE and + self._context.parent.type == EcmaContext.TERNARY_TRUE): + self._PopContext() # Leave current ternary false context. + self._PopContext() # Leave current parent ternary true + self._AddContext(EcmaContext.TERNARY_FALSE) + + elif self._context.parent.type == EcmaContext.SWITCH: + self._AddContext(EcmaContext.CASE_BLOCK) + + elif token.IsKeyword('var'): + self._AddContext(EcmaContext.VAR) + + elif token.IsOperator(','): + while self._context.type not in (EcmaContext.VAR, + EcmaContext.ARRAY_LITERAL, + EcmaContext.OBJECT_LITERAL, + EcmaContext.STATEMENT, + EcmaContext.PARAMETERS, + EcmaContext.GROUP): + self._PopContext() + + elif token_type == TokenType.SEMICOLON: + self._EndStatement() + + def Process(self, first_token): + """Processes the token stream starting with the given token.""" + self._token = first_token + while self._token: + self._ProcessToken() + + if self._token.IsCode(): + self._last_code = self._token + + self._token = self._token.next + + try: + self._PopContextType(self, EcmaContext.ROOT) + except ParseError: + # Ignore the "popped to root" error. + pass + + def _ProcessToken(self): + """Process the given token.""" + token = self._token + token.metadata = self._CreateMetaData() + context = (self._ProcessContext() or self._context) + token.metadata.context = context + token.metadata.last_code = self._last_code + + # Determine the operator type of the token, if applicable. + if token.type == TokenType.OPERATOR: + token.metadata.operator_type = self._GetOperatorType(token) + + # Determine if there is an implied semicolon after the token. + if token.type != TokenType.SEMICOLON: + next_code = tokenutil.SearchExcept(token, TokenType.NON_CODE_TYPES) + # A statement like if (x) does not need a semicolon after it + is_implied_block = self._context == EcmaContext.IMPLIED_BLOCK + is_last_code_in_line = token.IsCode() and ( + not next_code or next_code.line_number != token.line_number) + is_continued_operator = (token.type == TokenType.OPERATOR and + not token.metadata.IsUnaryPostOperator()) + is_continued_dot = token.string == '.' + next_code_is_operator = next_code and next_code.type == TokenType.OPERATOR + is_end_of_block = ( + token.type == TokenType.END_BLOCK and + token.metadata.context.type != EcmaContext.OBJECT_LITERAL) + is_multiline_string = token.type == TokenType.STRING_TEXT + is_continued_var_decl = (token.IsKeyword('var') and + next_code and + (next_code.type in [TokenType.IDENTIFIER, + TokenType.SIMPLE_LVALUE]) and + token.line_number < next_code.line_number) + next_code_is_block = next_code and next_code.type == TokenType.START_BLOCK + if (is_last_code_in_line and + self._StatementCouldEndInContext() and + not is_multiline_string and + not is_end_of_block and + not is_continued_var_decl and + not is_continued_operator and + not is_continued_dot and + not next_code_is_operator and + not is_implied_block and + not next_code_is_block): + token.metadata.is_implied_semicolon = True + self._EndStatement() + + def _StatementCouldEndInContext(self): + """Returns if the current statement (if any) may end in this context.""" + # In the basic statement or variable declaration context, statement can + # always end in this context. + if self._context.type in (EcmaContext.STATEMENT, EcmaContext.VAR): + return True + + # End of a ternary false branch inside a statement can also be the + # end of the statement, for example: + # var x = foo ? foo.bar() : null + # In this case the statement ends after the null, when the context stack + # looks like ternary_false > var > statement > root. + if (self._context.type == EcmaContext.TERNARY_FALSE and + self._context.parent.type in (EcmaContext.STATEMENT, EcmaContext.VAR)): + return True + + # In all other contexts like object and array literals, ternary true, etc. + # the statement can't yet end. + return False + + def _GetOperatorType(self, token): + """Returns the operator type of the given operator token. + + Args: + token: The token to get arity for. + + Returns: + The type of the operator. One of the *_OPERATOR constants defined in + EcmaMetaData. + """ + if token.string == '?': + return EcmaMetaData.TERNARY_OPERATOR + + if token.string in TokenType.UNARY_OPERATORS: + return EcmaMetaData.UNARY_OPERATOR + + last_code = token.metadata.last_code + if not last_code or last_code.type == TokenType.END_BLOCK: + return EcmaMetaData.UNARY_OPERATOR + + if (token.string in TokenType.UNARY_POST_OPERATORS and + last_code.type in TokenType.EXPRESSION_ENDER_TYPES): + return EcmaMetaData.UNARY_POST_OPERATOR + + if (token.string in TokenType.UNARY_OK_OPERATORS and + last_code.type not in TokenType.EXPRESSION_ENDER_TYPES and + last_code.string not in TokenType.UNARY_POST_OPERATORS): + return EcmaMetaData.UNARY_OPERATOR + + return EcmaMetaData.BINARY_OPERATOR diff --git a/tools/closure_linter/build/lib/closure_linter/error_check.py b/tools/closure_linter/build/lib/closure_linter/error_check.py new file mode 100644 index 00000000000000..8d657fe9174fff --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/error_check.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Specific JSLint errors checker.""" + + + +import gflags as flags + +FLAGS = flags.FLAGS + + +class Rule(object): + """Different rules to check.""" + + # Documentations for specific rules goes in flag definition. + BLANK_LINES_AT_TOP_LEVEL = 'blank_lines_at_top_level' + INDENTATION = 'indentation' + WELL_FORMED_AUTHOR = 'well_formed_author' + NO_BRACES_AROUND_INHERIT_DOC = 'no_braces_around_inherit_doc' + BRACES_AROUND_TYPE = 'braces_around_type' + OPTIONAL_TYPE_MARKER = 'optional_type_marker' + VARIABLE_ARG_MARKER = 'variable_arg_marker' + UNUSED_PRIVATE_MEMBERS = 'unused_private_members' + UNUSED_LOCAL_VARIABLES = 'unused_local_variables' + + # Rule to raise all known errors. + ALL = 'all' + + # All rules that are to be checked when using the strict flag. E.g. the rules + # that are specific to the stricter Closure style. + CLOSURE_RULES = frozenset([BLANK_LINES_AT_TOP_LEVEL, + INDENTATION, + WELL_FORMED_AUTHOR, + NO_BRACES_AROUND_INHERIT_DOC, + BRACES_AROUND_TYPE, + OPTIONAL_TYPE_MARKER, + VARIABLE_ARG_MARKER]) + + +flags.DEFINE_boolean('strict', False, + 'Whether to validate against the stricter Closure style. ' + 'This includes ' + (', '.join(Rule.CLOSURE_RULES)) + '.') +flags.DEFINE_multistring('jslint_error', [], + 'List of specific lint errors to check. Here is a list' + ' of accepted values:\n' + ' - ' + Rule.ALL + ': enables all following errors.\n' + ' - ' + Rule.BLANK_LINES_AT_TOP_LEVEL + ': validates' + 'number of blank lines between blocks at top level.\n' + ' - ' + Rule.INDENTATION + ': checks correct ' + 'indentation of code.\n' + ' - ' + Rule.WELL_FORMED_AUTHOR + ': validates the ' + '@author JsDoc tags.\n' + ' - ' + Rule.NO_BRACES_AROUND_INHERIT_DOC + ': ' + 'forbids braces around @inheritdoc JsDoc tags.\n' + ' - ' + Rule.BRACES_AROUND_TYPE + ': enforces braces ' + 'around types in JsDoc tags.\n' + ' - ' + Rule.OPTIONAL_TYPE_MARKER + ': checks correct ' + 'use of optional marker = in param types.\n' + ' - ' + Rule.UNUSED_PRIVATE_MEMBERS + ': checks for ' + 'unused private variables.\n' + ' - ' + Rule.UNUSED_LOCAL_VARIABLES + ': checks for ' + 'unused local variables.\n') + + +def ShouldCheck(rule): + """Returns whether the optional rule should be checked. + + Computes different flags (strict, jslint_error, jslint_noerror) to find out if + this specific rule should be checked. + + Args: + rule: Name of the rule (see Rule). + + Returns: + True if the rule should be checked according to the flags, otherwise False. + """ + if rule in FLAGS.jslint_error or Rule.ALL in FLAGS.jslint_error: + return True + # Checks strict rules. + return FLAGS.strict and rule in Rule.CLOSURE_RULES diff --git a/tools/closure_linter/build/lib/closure_linter/error_fixer.py b/tools/closure_linter/build/lib/closure_linter/error_fixer.py new file mode 100644 index 00000000000000..88f9c720ab3517 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/error_fixer.py @@ -0,0 +1,618 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Main class responsible for automatically fixing simple style violations.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = 'robbyw@google.com (Robert Walker)' + +import re + +import gflags as flags +from closure_linter import errors +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokens +from closure_linter import requireprovidesorter +from closure_linter import tokenutil +from closure_linter.common import errorhandler + +# Shorthand +Token = javascripttokens.JavaScriptToken +Type = javascripttokens.JavaScriptTokenType + +END_OF_FLAG_TYPE = re.compile(r'(}?\s*)$') + +# Regex to represent common mistake inverting author name and email as +# @author User Name (user@company) +INVERTED_AUTHOR_SPEC = re.compile(r'(?P\s*)' + r'(?P[^(]+)' + r'(?P\s+)' + r'\(' + r'(?P[^\s]+@[^)\s]+)' + r'\)' + r'(?P.*)') + +FLAGS = flags.FLAGS +flags.DEFINE_boolean('disable_indentation_fixing', False, + 'Whether to disable automatic fixing of indentation.') +flags.DEFINE_list('fix_error_codes', [], 'A list of specific error codes to ' + 'fix. Defaults to all supported error codes when empty. ' + 'See errors.py for a list of error codes.') + + +class ErrorFixer(errorhandler.ErrorHandler): + """Object that fixes simple style errors.""" + + def __init__(self, external_file=None): + """Initialize the error fixer. + + Args: + external_file: If included, all output will be directed to this file + instead of overwriting the files the errors are found in. + """ + errorhandler.ErrorHandler.__init__(self) + + self._file_name = None + self._file_token = None + self._external_file = external_file + + try: + self._fix_error_codes = set([errors.ByName(error.upper()) for error in + FLAGS.fix_error_codes]) + except KeyError as ke: + raise ValueError('Unknown error code ' + ke.args[0]) + + def HandleFile(self, filename, first_token): + """Notifies this ErrorPrinter that subsequent errors are in filename. + + Args: + filename: The name of the file about to be checked. + first_token: The first token in the file. + """ + self._file_name = filename + self._file_is_html = filename.endswith('.html') or filename.endswith('.htm') + self._file_token = first_token + self._file_fix_count = 0 + self._file_changed_lines = set() + + def _AddFix(self, tokens): + """Adds the fix to the internal count. + + Args: + tokens: The token or sequence of tokens changed to fix an error. + """ + self._file_fix_count += 1 + if hasattr(tokens, 'line_number'): + self._file_changed_lines.add(tokens.line_number) + else: + for token in tokens: + self._file_changed_lines.add(token.line_number) + + def _FixJsDocPipeNull(self, js_type): + """Change number|null or null|number to ?number. + + Args: + js_type: The typeannotation.TypeAnnotation instance to fix. + """ + + # Recurse into all sub_types if the error was at a deeper level. + map(self._FixJsDocPipeNull, js_type.IterTypes()) + + if js_type.type_group and len(js_type.sub_types) == 2: + # Find and remove the null sub_type: + sub_type = None + for sub_type in js_type.sub_types: + if sub_type.identifier == 'null': + map(tokenutil.DeleteToken, sub_type.tokens) + self._AddFix(sub_type.tokens) + break + else: + return + + first_token = js_type.FirstToken() + question_mark = Token('?', Type.DOC_TYPE_MODIFIER, first_token.line, + first_token.line_number) + tokenutil.InsertTokenBefore(question_mark, first_token) + js_type.tokens.insert(0, question_mark) + js_type.tokens.remove(sub_type) + js_type.or_null = True + + # Now also remove the separator, which is in the parent's token list, + # either before or after the sub_type, there is exactly one. Scan for it. + for token in js_type.tokens: + if (token and isinstance(token, Token) and + token.type == Type.DOC_TYPE_MODIFIER and token.string == '|'): + tokenutil.DeleteToken(token) + self._AddFix(token) + break + + def HandleError(self, error): + """Attempts to fix the error. + + Args: + error: The error object + """ + code = error.code + token = error.token + + if self._fix_error_codes and code not in self._fix_error_codes: + return + + if code == errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL: + self._FixJsDocPipeNull(token.attached_object.jstype) + + elif code == errors.JSDOC_MISSING_OPTIONAL_TYPE: + iterator = token.attached_object.type_end_token + if iterator.type == Type.DOC_END_BRACE or iterator.string.isspace(): + iterator = iterator.previous + + ending_space = len(iterator.string) - len(iterator.string.rstrip()) + iterator.string = '%s=%s' % (iterator.string.rstrip(), + ' ' * ending_space) + + # Create a new flag object with updated type info. + token.attached_object = javascriptstatetracker.JsDocFlag(token) + self._AddFix(token) + + elif code == errors.JSDOC_MISSING_VAR_ARGS_TYPE: + iterator = token.attached_object.type_start_token + if iterator.type == Type.DOC_START_BRACE or iterator.string.isspace(): + iterator = iterator.next + + starting_space = len(iterator.string) - len(iterator.string.lstrip()) + iterator.string = '%s...%s' % (' ' * starting_space, + iterator.string.lstrip()) + + # Create a new flag object with updated type info. + token.attached_object = javascriptstatetracker.JsDocFlag(token) + self._AddFix(token) + + elif code in (errors.MISSING_SEMICOLON_AFTER_FUNCTION, + errors.MISSING_SEMICOLON): + semicolon_token = Token(';', Type.SEMICOLON, token.line, + token.line_number) + tokenutil.InsertTokenAfter(semicolon_token, token) + token.metadata.is_implied_semicolon = False + semicolon_token.metadata.is_implied_semicolon = False + self._AddFix(token) + + elif code in (errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION, + errors.REDUNDANT_SEMICOLON, + errors.COMMA_AT_END_OF_LITERAL): + self._DeleteToken(token) + self._AddFix(token) + + elif code == errors.INVALID_JSDOC_TAG: + if token.string == '@returns': + token.string = '@return' + self._AddFix(token) + + elif code == errors.FILE_MISSING_NEWLINE: + # This error is fixed implicitly by the way we restore the file + self._AddFix(token) + + elif code == errors.MISSING_SPACE: + if error.fix_data: + token.string = error.fix_data + self._AddFix(token) + elif error.position: + if error.position.IsAtBeginning(): + tokenutil.InsertSpaceTokenAfter(token.previous) + elif error.position.IsAtEnd(token.string): + tokenutil.InsertSpaceTokenAfter(token) + else: + token.string = error.position.Set(token.string, ' ') + self._AddFix(token) + + elif code == errors.EXTRA_SPACE: + if error.position: + token.string = error.position.Set(token.string, '') + self._AddFix(token) + + elif code == errors.MISSING_LINE: + if error.position.IsAtBeginning(): + tokenutil.InsertBlankLineAfter(token.previous) + else: + tokenutil.InsertBlankLineAfter(token) + self._AddFix(token) + + elif code == errors.EXTRA_LINE: + self._DeleteToken(token) + self._AddFix(token) + + elif code == errors.WRONG_BLANK_LINE_COUNT: + if not token.previous: + # TODO(user): Add an insertBefore method to tokenutil. + return + + num_lines = error.fix_data + should_delete = False + + if num_lines < 0: + num_lines *= -1 + should_delete = True + + for unused_i in xrange(1, num_lines + 1): + if should_delete: + # TODO(user): DeleteToken should update line numbers. + self._DeleteToken(token.previous) + else: + tokenutil.InsertBlankLineAfter(token.previous) + self._AddFix(token) + + elif code == errors.UNNECESSARY_DOUBLE_QUOTED_STRING: + end_quote = tokenutil.Search(token, Type.DOUBLE_QUOTE_STRING_END) + if end_quote: + single_quote_start = Token( + "'", Type.SINGLE_QUOTE_STRING_START, token.line, token.line_number) + single_quote_end = Token( + "'", Type.SINGLE_QUOTE_STRING_START, end_quote.line, + token.line_number) + + tokenutil.InsertTokenAfter(single_quote_start, token) + tokenutil.InsertTokenAfter(single_quote_end, end_quote) + self._DeleteToken(token) + self._DeleteToken(end_quote) + self._AddFix([token, end_quote]) + + elif code == errors.MISSING_BRACES_AROUND_TYPE: + fixed_tokens = [] + start_token = token.attached_object.type_start_token + + if start_token.type != Type.DOC_START_BRACE: + leading_space = ( + len(start_token.string) - len(start_token.string.lstrip())) + if leading_space: + start_token = tokenutil.SplitToken(start_token, leading_space) + # Fix case where start and end token were the same. + if token.attached_object.type_end_token == start_token.previous: + token.attached_object.type_end_token = start_token + + new_token = Token('{', Type.DOC_START_BRACE, start_token.line, + start_token.line_number) + tokenutil.InsertTokenAfter(new_token, start_token.previous) + token.attached_object.type_start_token = new_token + fixed_tokens.append(new_token) + + end_token = token.attached_object.type_end_token + if end_token.type != Type.DOC_END_BRACE: + # If the start token was a brace, the end token will be a + # FLAG_ENDING_TYPE token, if there wasn't a starting brace then + # the end token is the last token of the actual type. + last_type = end_token + if not fixed_tokens: + last_type = end_token.previous + + while last_type.string.isspace(): + last_type = last_type.previous + + # If there was no starting brace then a lone end brace wouldn't have + # been type end token. Now that we've added any missing start brace, + # see if the last effective type token was an end brace. + if last_type.type != Type.DOC_END_BRACE: + trailing_space = (len(last_type.string) - + len(last_type.string.rstrip())) + if trailing_space: + tokenutil.SplitToken(last_type, + len(last_type.string) - trailing_space) + + new_token = Token('}', Type.DOC_END_BRACE, last_type.line, + last_type.line_number) + tokenutil.InsertTokenAfter(new_token, last_type) + token.attached_object.type_end_token = new_token + fixed_tokens.append(new_token) + + self._AddFix(fixed_tokens) + + elif code == errors.LINE_STARTS_WITH_OPERATOR: + # Remove whitespace following the operator so the line starts clean. + self._StripSpace(token, before=False) + + # Remove the operator. + tokenutil.DeleteToken(token) + self._AddFix(token) + + insertion_point = tokenutil.GetPreviousCodeToken(token) + + # Insert a space between the previous token and the new operator. + space = Token(' ', Type.WHITESPACE, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenAfter(space, insertion_point) + + # Insert the operator on the end of the previous line. + new_token = Token(token.string, token.type, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenAfter(new_token, space) + self._AddFix(new_token) + + elif code == errors.LINE_ENDS_WITH_DOT: + # Remove whitespace preceding the operator to remove trailing whitespace. + self._StripSpace(token, before=True) + + # Remove the dot. + tokenutil.DeleteToken(token) + self._AddFix(token) + + insertion_point = tokenutil.GetNextCodeToken(token) + + # Insert the dot at the beginning of the next line of code. + new_token = Token(token.string, token.type, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenBefore(new_token, insertion_point) + self._AddFix(new_token) + + elif code == errors.GOOG_REQUIRES_NOT_ALPHABETIZED: + require_start_token = error.fix_data + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(require_start_token) + + self._AddFix(require_start_token) + + elif code == errors.GOOG_PROVIDES_NOT_ALPHABETIZED: + provide_start_token = error.fix_data + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixProvides(provide_start_token) + + self._AddFix(provide_start_token) + + elif code == errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC: + if token.previous.string == '{' and token.next.string == '}': + self._DeleteToken(token.previous) + self._DeleteToken(token.next) + self._AddFix([token]) + + elif code == errors.INVALID_AUTHOR_TAG_DESCRIPTION: + match = INVERTED_AUTHOR_SPEC.match(token.string) + if match: + token.string = '%s%s%s(%s)%s' % (match.group('leading_whitespace'), + match.group('email'), + match.group('whitespace_after_name'), + match.group('name'), + match.group('trailing_characters')) + self._AddFix(token) + + elif (code == errors.WRONG_INDENTATION and + not FLAGS.disable_indentation_fixing): + token = tokenutil.GetFirstTokenInSameLine(token) + actual = error.position.start + expected = error.position.length + + # Cases where first token is param but with leading spaces. + if (len(token.string.lstrip()) == len(token.string) - actual and + token.string.lstrip()): + token.string = token.string.lstrip() + actual = 0 + + if token.type in (Type.WHITESPACE, Type.PARAMETERS) and actual != 0: + token.string = token.string.lstrip() + (' ' * expected) + self._AddFix([token]) + else: + # We need to add indentation. + new_token = Token(' ' * expected, Type.WHITESPACE, + token.line, token.line_number) + # Note that we'll never need to add indentation at the first line, + # since it will always not be indented. Therefore it's safe to assume + # token.previous exists. + tokenutil.InsertTokenAfter(new_token, token.previous) + self._AddFix([token]) + + elif code in [errors.MALFORMED_END_OF_SCOPE_COMMENT, + errors.MISSING_END_OF_SCOPE_COMMENT]: + # Only fix cases where }); is found with no trailing content on the line + # other than a comment. Value of 'token' is set to } for this error. + if (token.type == Type.END_BLOCK and + token.next.type == Type.END_PAREN and + token.next.next.type == Type.SEMICOLON): + current_token = token.next.next.next + removed_tokens = [] + while current_token and current_token.line_number == token.line_number: + if current_token.IsAnyType(Type.WHITESPACE, + Type.START_SINGLE_LINE_COMMENT, + Type.COMMENT): + removed_tokens.append(current_token) + current_token = current_token.next + else: + return + + if removed_tokens: + self._DeleteTokens(removed_tokens[0], len(removed_tokens)) + + whitespace_token = Token(' ', Type.WHITESPACE, token.line, + token.line_number) + start_comment_token = Token('//', Type.START_SINGLE_LINE_COMMENT, + token.line, token.line_number) + comment_token = Token(' goog.scope', Type.COMMENT, token.line, + token.line_number) + insertion_tokens = [whitespace_token, start_comment_token, + comment_token] + + tokenutil.InsertTokensAfter(insertion_tokens, token.next.next) + self._AddFix(removed_tokens + insertion_tokens) + + elif code in [errors.EXTRA_GOOG_PROVIDE, errors.EXTRA_GOOG_REQUIRE]: + tokens_in_line = tokenutil.GetAllTokensInSameLine(token) + num_delete_tokens = len(tokens_in_line) + # If line being deleted is preceded and succeed with blank lines then + # delete one blank line also. + if (tokens_in_line[0].previous and tokens_in_line[-1].next + and tokens_in_line[0].previous.type == Type.BLANK_LINE + and tokens_in_line[-1].next.type == Type.BLANK_LINE): + num_delete_tokens += 1 + self._DeleteTokens(tokens_in_line[0], num_delete_tokens) + self._AddFix(tokens_in_line) + + elif code in [errors.MISSING_GOOG_PROVIDE, errors.MISSING_GOOG_REQUIRE]: + missing_namespaces = error.fix_data[0] + need_blank_line = error.fix_data[1] or (not token.previous) + + insert_location = Token('', Type.NORMAL, '', token.line_number - 1) + dummy_first_token = insert_location + tokenutil.InsertTokenBefore(insert_location, token) + + # If inserting a blank line check blank line does not exist before + # token to avoid extra blank lines. + if (need_blank_line and insert_location.previous + and insert_location.previous.type != Type.BLANK_LINE): + tokenutil.InsertBlankLineAfter(insert_location) + insert_location = insert_location.next + + for missing_namespace in missing_namespaces: + new_tokens = self._GetNewRequireOrProvideTokens( + code == errors.MISSING_GOOG_PROVIDE, + missing_namespace, insert_location.line_number + 1) + tokenutil.InsertLineAfter(insert_location, new_tokens) + insert_location = new_tokens[-1] + self._AddFix(new_tokens) + + # If inserting a blank line check blank line does not exist after + # token to avoid extra blank lines. + if (need_blank_line and insert_location.next + and insert_location.next.type != Type.BLANK_LINE): + tokenutil.InsertBlankLineAfter(insert_location) + + tokenutil.DeleteToken(dummy_first_token) + + def _StripSpace(self, token, before): + """Strip whitespace tokens either preceding or following the given token. + + Args: + token: The token. + before: If true, strip space before the token, if false, after it. + """ + token = token.previous if before else token.next + while token and token.type == Type.WHITESPACE: + tokenutil.DeleteToken(token) + token = token.previous if before else token.next + + def _GetNewRequireOrProvideTokens(self, is_provide, namespace, line_number): + """Returns a list of tokens to create a goog.require/provide statement. + + Args: + is_provide: True if getting tokens for a provide, False for require. + namespace: The required or provided namespaces to get tokens for. + line_number: The line number the new require or provide statement will be + on. + + Returns: + Tokens to create a new goog.require or goog.provide statement. + """ + string = 'goog.require' + if is_provide: + string = 'goog.provide' + line_text = string + '(\'' + namespace + '\');\n' + return [ + Token(string, Type.IDENTIFIER, line_text, line_number), + Token('(', Type.START_PAREN, line_text, line_number), + Token('\'', Type.SINGLE_QUOTE_STRING_START, line_text, line_number), + Token(namespace, Type.STRING_TEXT, line_text, line_number), + Token('\'', Type.SINGLE_QUOTE_STRING_END, line_text, line_number), + Token(')', Type.END_PAREN, line_text, line_number), + Token(';', Type.SEMICOLON, line_text, line_number) + ] + + def _DeleteToken(self, token): + """Deletes the specified token from the linked list of tokens. + + Updates instance variables pointing to tokens such as _file_token if + they reference the deleted token. + + Args: + token: The token to delete. + """ + if token == self._file_token: + self._file_token = token.next + + tokenutil.DeleteToken(token) + + def _DeleteTokens(self, token, token_count): + """Deletes the given number of tokens starting with the given token. + + Updates instance variables pointing to tokens such as _file_token if + they reference the deleted token. + + Args: + token: The first token to delete. + token_count: The total number of tokens to delete. + """ + if token == self._file_token: + for unused_i in xrange(token_count): + self._file_token = self._file_token.next + + tokenutil.DeleteTokens(token, token_count) + + def FinishFile(self): + """Called when the current file has finished style checking. + + Used to go back and fix any errors in the file. It currently supports both + js and html files. For js files it does a simple dump of all tokens, but in + order to support html file, we need to merge the original file with the new + token set back together. This works because the tokenized html file is the + original html file with all non js lines kept but blanked out with one blank + line token per line of html. + """ + if self._file_fix_count: + # Get the original file content for html. + if self._file_is_html: + f = open(self._file_name, 'r') + original_lines = f.readlines() + f.close() + + f = self._external_file + if not f: + error_noun = 'error' if self._file_fix_count == 1 else 'errors' + print 'Fixed %d %s in %s' % ( + self._file_fix_count, error_noun, self._file_name) + f = open(self._file_name, 'w') + + token = self._file_token + # Finding the first not deleted token. + while token.is_deleted: + token = token.next + # If something got inserted before first token (e.g. due to sorting) + # then move to start. Bug 8398202. + while token.previous: + token = token.previous + char_count = 0 + line = '' + while token: + line += token.string + char_count += len(token.string) + + if token.IsLastInLine(): + # We distinguish if a blank line in html was from stripped original + # file or newly added error fix by looking at the "org_line_number" + # field on the token. It is only set in the tokenizer, so for all + # error fixes, the value should be None. + if (line or not self._file_is_html or + token.orig_line_number is None): + f.write(line) + f.write('\n') + else: + f.write(original_lines[token.orig_line_number - 1]) + line = '' + if char_count > 80 and token.line_number in self._file_changed_lines: + print 'WARNING: Line %d of %s is now longer than 80 characters.' % ( + token.line_number, self._file_name) + + char_count = 0 + + token = token.next + + if not self._external_file: + # Close the file if we created it + f.close() diff --git a/tools/closure_linter/build/lib/closure_linter/error_fixer_test.py b/tools/closure_linter/build/lib/closure_linter/error_fixer_test.py new file mode 100644 index 00000000000000..49f449de42f36f --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/error_fixer_test.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the error_fixer module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + + + +import unittest as googletest +from closure_linter import error_fixer +from closure_linter import testutil + + +class ErrorFixerTest(googletest.TestCase): + """Unit tests for error_fixer.""" + + def setUp(self): + self.error_fixer = error_fixer.ErrorFixer() + + def testDeleteToken(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + second_token = start_token.next + self.error_fixer.HandleFile('test_file', start_token) + + self.error_fixer._DeleteToken(start_token) + + self.assertEqual(second_token, self.error_fixer._file_token) + + def testDeleteTokens(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + fourth_token = start_token.next.next.next + self.error_fixer.HandleFile('test_file', start_token) + + self.error_fixer._DeleteTokens(start_token, 3) + + self.assertEqual(fourth_token, self.error_fixer._file_token) + +_TEST_SCRIPT = """\ +var x = 3; +""" + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/errorrecord.py b/tools/closure_linter/build/lib/closure_linter/errorrecord.py new file mode 100644 index 00000000000000..ce9fb908c75e71 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/errorrecord.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""A simple, pickle-serializable class to represent a lint error.""" + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import gflags as flags + +from closure_linter import errors +from closure_linter.common import erroroutput + +FLAGS = flags.FLAGS + + +class ErrorRecord(object): + """Record-keeping struct that can be serialized back from a process. + + Attributes: + path: Path to the file. + error_string: Error string for the user. + new_error: Whether this is a "new error" (see errors.NEW_ERRORS). + """ + + def __init__(self, path, error_string, new_error): + self.path = path + self.error_string = error_string + self.new_error = new_error + + +def MakeErrorRecord(path, error): + """Make an error record with correctly formatted error string. + + Errors are not able to be serialized (pickled) over processes because of + their pointers to the complex token/context graph. We use an intermediary + serializable class to pass back just the relevant information. + + Args: + path: Path of file the error was found in. + error: An error.Error instance. + + Returns: + _ErrorRecord instance. + """ + new_error = error.code in errors.NEW_ERRORS + + if FLAGS.unix_mode: + error_string = erroroutput.GetUnixErrorOutput( + path, error, new_error=new_error) + else: + error_string = erroroutput.GetErrorOutput(error, new_error=new_error) + + return ErrorRecord(path, error_string, new_error) diff --git a/tools/closure_linter/build/lib/closure_linter/errorrules.py b/tools/closure_linter/build/lib/closure_linter/errorrules.py new file mode 100644 index 00000000000000..b1b72aab6dabdc --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/errorrules.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# +# Copyright 2010 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Linter error rules class for Closure Linter.""" + +__author__ = 'robbyw@google.com (Robert Walker)' + +import gflags as flags +from closure_linter import errors + + +FLAGS = flags.FLAGS +flags.DEFINE_boolean('jsdoc', True, + 'Whether to report errors for missing JsDoc.') +flags.DEFINE_list('disable', None, + 'Disable specific error. Usage Ex.: gjslint --disable 1,' + '0011 foo.js.') +flags.DEFINE_integer('max_line_length', 80, 'Maximum line length allowed ' + 'without warning.', lower_bound=1) + +disabled_error_nums = None + + +def GetMaxLineLength(): + """Returns allowed maximum length of line. + + Returns: + Length of line allowed without any warning. + """ + return FLAGS.max_line_length + + +def ShouldReportError(error): + """Whether the given error should be reported. + + Returns: + True for all errors except missing documentation errors and disabled + errors. For missing documentation, it returns the value of the + jsdoc flag. + """ + global disabled_error_nums + if disabled_error_nums is None: + disabled_error_nums = [] + if FLAGS.disable: + for error_str in FLAGS.disable: + error_num = 0 + try: + error_num = int(error_str) + except ValueError: + pass + disabled_error_nums.append(error_num) + + return ((FLAGS.jsdoc or error not in ( + errors.MISSING_PARAMETER_DOCUMENTATION, + errors.MISSING_RETURN_DOCUMENTATION, + errors.MISSING_MEMBER_DOCUMENTATION, + errors.MISSING_PRIVATE, + errors.MISSING_JSDOC_TAG_THIS)) and + (not FLAGS.disable or error not in disabled_error_nums)) diff --git a/tools/closure_linter/build/lib/closure_linter/errorrules_test.py b/tools/closure_linter/build/lib/closure_linter/errorrules_test.py new file mode 100644 index 00000000000000..cb903785e60fec --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/errorrules_test.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# Copyright 2013 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Medium tests for the gjslint errorrules. + +Currently its just verifying that warnings can't be disabled. +""" + + + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import erroraccumulator + +flags.FLAGS.strict = True +flags.FLAGS.limited_doc_files = ('dummy.js', 'externs.js') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') + + +class ErrorRulesTest(googletest.TestCase): + """Test case to for gjslint errorrules.""" + + def testNoMaxLineLengthFlagExists(self): + """Tests that --max_line_length flag does not exists.""" + self.assertTrue('max_line_length' not in flags.FLAGS.FlagDict()) + + def testGetMaxLineLength(self): + """Tests warning are reported for line greater than 80. + """ + + # One line > 100 and one line > 80 and < 100. So should produce two + # line too long error. + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'function a() {', + ' dummy.aa.i = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13' + ' + 14 + 15 + 16 + 17 + 18 + 19 + 20;', + ' dummy.aa.j = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13' + ' + 14 + 15 + 16 + 17 + 18;', + '}', + '' + ] + + # Expect line too long. + expected = [errors.LINE_TOO_LONG, errors.LINE_TOO_LONG] + + self._AssertErrors(original, expected) + + def testNoDisableFlagExists(self): + """Tests that --disable flag does not exists.""" + self.assertTrue('disable' not in flags.FLAGS.FlagDict()) + + def testWarningsNotDisabled(self): + """Tests warnings are reported when nothing is disabled. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] + + expected = [errors.GOOG_REQUIRES_NOT_ALPHABETIZED, + errors.FILE_MISSING_NEWLINE] + + self._AssertErrors(original, expected) + + def _AssertErrors(self, original, expected_errors, include_header=True): + """Asserts that the error fixer corrects original to expected.""" + if include_header: + original = self._GetHeader() + original + + # Trap gjslint's output parse it to get messages added. + error_accumulator = erroraccumulator.ErrorAccumulator() + runner.Run('testing.js', error_accumulator, source=original) + error_nums = [e.code for e in error_accumulator.GetErrors()] + + error_nums.sort() + expected_errors.sort() + self.assertListEqual(error_nums, expected_errors) + + def _GetHeader(self): + """Returns a fake header for a JavaScript file.""" + return [ + '// Copyright 2011 Google Inc. All Rights Reserved.', + '', + '/**', + ' * @fileoverview Fake file overview.', + ' * @author fake@google.com (Fake Person)', + ' */', + '' + ] + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/errors.py b/tools/closure_linter/build/lib/closure_linter/errors.py new file mode 100644 index 00000000000000..356ee0c5a6441d --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/errors.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Error codes for JavaScript style checker.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + + +def ByName(name): + """Get the error code for the given error name. + + Args: + name: The name of the error + + Returns: + The error code + """ + return globals()[name] + + +# "File-fatal" errors - these errors stop further parsing of a single file +FILE_NOT_FOUND = -1 +FILE_DOES_NOT_PARSE = -2 + +# Spacing +EXTRA_SPACE = 1 +MISSING_SPACE = 2 +EXTRA_LINE = 3 +MISSING_LINE = 4 +ILLEGAL_TAB = 5 +WRONG_INDENTATION = 6 +WRONG_BLANK_LINE_COUNT = 7 + +# Semicolons +MISSING_SEMICOLON = 10 +MISSING_SEMICOLON_AFTER_FUNCTION = 11 +ILLEGAL_SEMICOLON_AFTER_FUNCTION = 12 +REDUNDANT_SEMICOLON = 13 + +# Miscellaneous +ILLEGAL_PROTOTYPE_MEMBER_VALUE = 100 +LINE_TOO_LONG = 110 +LINE_STARTS_WITH_OPERATOR = 120 +COMMA_AT_END_OF_LITERAL = 121 +LINE_ENDS_WITH_DOT = 122 +MULTI_LINE_STRING = 130 +UNNECESSARY_DOUBLE_QUOTED_STRING = 131 +UNUSED_PRIVATE_MEMBER = 132 +UNUSED_LOCAL_VARIABLE = 133 + +# Requires, provides +GOOG_REQUIRES_NOT_ALPHABETIZED = 140 +GOOG_PROVIDES_NOT_ALPHABETIZED = 141 +MISSING_GOOG_REQUIRE = 142 +MISSING_GOOG_PROVIDE = 143 +EXTRA_GOOG_REQUIRE = 144 +EXTRA_GOOG_PROVIDE = 145 +ALIAS_STMT_NEEDS_GOOG_REQUIRE = 146 + +# JsDoc +INVALID_JSDOC_TAG = 200 +INVALID_USE_OF_DESC_TAG = 201 +NO_BUG_NUMBER_AFTER_BUG_TAG = 202 +MISSING_PARAMETER_DOCUMENTATION = 210 +EXTRA_PARAMETER_DOCUMENTATION = 211 +WRONG_PARAMETER_DOCUMENTATION = 212 +MISSING_JSDOC_TAG_TYPE = 213 +MISSING_JSDOC_TAG_DESCRIPTION = 214 +MISSING_JSDOC_PARAM_NAME = 215 +OUT_OF_ORDER_JSDOC_TAG_TYPE = 216 +MISSING_RETURN_DOCUMENTATION = 217 +UNNECESSARY_RETURN_DOCUMENTATION = 218 +MISSING_BRACES_AROUND_TYPE = 219 +MISSING_MEMBER_DOCUMENTATION = 220 +MISSING_PRIVATE = 221 +EXTRA_PRIVATE = 222 +INVALID_OVERRIDE_PRIVATE = 223 +INVALID_INHERIT_DOC_PRIVATE = 224 +MISSING_JSDOC_TAG_THIS = 225 +UNNECESSARY_BRACES_AROUND_INHERIT_DOC = 226 +INVALID_AUTHOR_TAG_DESCRIPTION = 227 +JSDOC_PREFER_QUESTION_TO_PIPE_NULL = 230 +JSDOC_ILLEGAL_QUESTION_WITH_PIPE = 231 +JSDOC_MISSING_OPTIONAL_TYPE = 232 +JSDOC_MISSING_OPTIONAL_PREFIX = 233 +JSDOC_MISSING_VAR_ARGS_TYPE = 234 +JSDOC_MISSING_VAR_ARGS_NAME = 235 +JSDOC_DOES_NOT_PARSE = 236 +# TODO(robbyw): Split this in to more specific syntax problems. +INCORRECT_SUPPRESS_SYNTAX = 250 +INVALID_SUPPRESS_TYPE = 251 +UNNECESSARY_SUPPRESS = 252 + +# File ending +FILE_MISSING_NEWLINE = 300 +FILE_IN_BLOCK = 301 + +# Interfaces +INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS = 400 +INTERFACE_METHOD_CANNOT_HAVE_CODE = 401 + +# Comments +MISSING_END_OF_SCOPE_COMMENT = 500 +MALFORMED_END_OF_SCOPE_COMMENT = 501 + +# goog.scope - Namespace aliasing +# TODO(nnaze) Add additional errors here and in aliaspass.py +INVALID_USE_OF_GOOG_SCOPE = 600 +EXTRA_GOOG_SCOPE_USAGE = 601 + +# ActionScript specific errors: +# TODO(user): move these errors to their own file and move all JavaScript +# specific errors to their own file as well. +# All ActionScript specific errors should have error number at least 1000. +FUNCTION_MISSING_RETURN_TYPE = 1132 +PARAMETER_MISSING_TYPE = 1133 +VAR_MISSING_TYPE = 1134 +PARAMETER_MISSING_DEFAULT_VALUE = 1135 +IMPORTS_NOT_ALPHABETIZED = 1140 +IMPORT_CONTAINS_WILDCARD = 1141 +UNUSED_IMPORT = 1142 +INVALID_TRACE_SEVERITY_LEVEL = 1250 +MISSING_TRACE_SEVERITY_LEVEL = 1251 +MISSING_TRACE_MESSAGE = 1252 +REMOVE_TRACE_BEFORE_SUBMIT = 1253 +REMOVE_COMMENT_BEFORE_SUBMIT = 1254 +# End of list of ActionScript specific errors. + +NEW_ERRORS = frozenset([ + # Errors added after 2.0.2: + WRONG_INDENTATION, + MISSING_SEMICOLON, + # Errors added after 2.3.9: + JSDOC_MISSING_VAR_ARGS_TYPE, + JSDOC_MISSING_VAR_ARGS_NAME, + # Errors added after 2.3.15: + ALIAS_STMT_NEEDS_GOOG_REQUIRE, + JSDOC_DOES_NOT_PARSE, + LINE_ENDS_WITH_DOT, + # Errors added after 2.3.17: + ]) diff --git a/tools/closure_linter/build/lib/closure_linter/fixjsstyle.py b/tools/closure_linter/build/lib/closure_linter/fixjsstyle.py new file mode 100644 index 00000000000000..2d65e0398fdcc6 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/fixjsstyle.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Automatically fix simple style guide violations.""" + +__author__ = 'robbyw@google.com (Robert Walker)' + +import StringIO +import sys + +import gflags as flags + +from closure_linter import error_fixer +from closure_linter import runner +from closure_linter.common import simplefileflags as fileflags + +FLAGS = flags.FLAGS +flags.DEFINE_list('additional_extensions', None, 'List of additional file ' + 'extensions (not js) that should be treated as ' + 'JavaScript files.') +flags.DEFINE_boolean('dry_run', False, 'Do not modify the file, only print it.') + + +def main(argv=None): + """Main function. + + Args: + argv: Sequence of command line arguments. + """ + if argv is None: + argv = flags.FLAGS(sys.argv) + + suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] + + files = fileflags.GetFileList(argv, 'JavaScript', suffixes) + + output_buffer = None + if FLAGS.dry_run: + output_buffer = StringIO.StringIO() + + fixer = error_fixer.ErrorFixer(output_buffer) + + # Check the list of files. + for filename in files: + runner.Run(filename, fixer) + if FLAGS.dry_run: + print output_buffer.getvalue() + + +if __name__ == '__main__': + main() diff --git a/tools/closure_linter/build/lib/closure_linter/fixjsstyle_test.py b/tools/closure_linter/build/lib/closure_linter/fixjsstyle_test.py new file mode 100644 index 00000000000000..34de3f8488d351 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/fixjsstyle_test.py @@ -0,0 +1,615 @@ +#!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Medium tests for the gpylint auto-fixer.""" + +__author__ = 'robbyw@google.com (Robby Walker)' + +import StringIO + +import gflags as flags +import unittest as googletest +from closure_linter import error_fixer +from closure_linter import runner + + +_RESOURCE_PREFIX = 'closure_linter/testdata' + +flags.FLAGS.strict = True +flags.FLAGS.limited_doc_files = ('dummy.js', 'externs.js') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') + + +class FixJsStyleTest(googletest.TestCase): + """Test case to for gjslint auto-fixing.""" + + def setUp(self): + flags.FLAGS.dot_on_next_line = True + + def tearDown(self): + flags.FLAGS.dot_on_next_line = False + + def testFixJsStyle(self): + test_cases = [ + ['fixjsstyle.in.js', 'fixjsstyle.out.js'], + ['indentation.js', 'fixjsstyle.indentation.out.js'], + ['fixjsstyle.html.in.html', 'fixjsstyle.html.out.html'], + ['fixjsstyle.oplineend.in.js', 'fixjsstyle.oplineend.out.js']] + for [running_input_file, running_output_file] in test_cases: + print 'Checking %s vs %s' % (running_input_file, running_output_file) + input_filename = None + golden_filename = None + current_filename = None + try: + input_filename = '%s/%s' % (_RESOURCE_PREFIX, running_input_file) + current_filename = input_filename + + golden_filename = '%s/%s' % (_RESOURCE_PREFIX, running_output_file) + current_filename = golden_filename + except IOError as ex: + raise IOError('Could not find testdata resource for %s: %s' % + (current_filename, ex)) + + if running_input_file == 'fixjsstyle.in.js': + with open(input_filename) as f: + for line in f: + # Go to last line. + pass + self.assertTrue(line == line.rstrip(), '%s file should not end ' + 'with a new line.' % (input_filename)) + + # Autofix the file, sending output to a fake file. + actual = StringIO.StringIO() + runner.Run(input_filename, error_fixer.ErrorFixer(actual)) + + # Now compare the files. + actual.seek(0) + expected = open(golden_filename, 'r') + + # Uncomment to generate new golden files and run + # open('/'.join(golden_filename.split('/')[4:]), 'w').write(actual.read()) + # actual.seek(0) + + self.assertEqual(actual.readlines(), expected.readlines()) + + def testAddProvideFirstLine(self): + """Tests handling of case where goog.provide is added.""" + original = [ + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testAddRequireFirstLine(self): + """Tests handling of case where goog.require is added.""" + original = [ + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteProvideAndAddProvideFirstLine(self): + """Tests handling of case where goog.provide is deleted and added. + + Bug 14832597. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.provide(\'dummy.aa\');', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteProvideAndAddRequireFirstLine(self): + """Tests handling where goog.provide is deleted and goog.require added. + + Bug 14832597. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + '', + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.provide(\'dummy.aa\');', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteRequireAndAddRequireFirstLine(self): + """Tests handling of case where goog.require is deleted and added. + + Bug 14832597. + """ + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.require(\'dummy.aa\');', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteRequireAndAddProvideFirstLine(self): + """Tests handling where goog.require is deleted and goog.provide added. + + Bug 14832597. + """ + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.require(\'dummy.aa\');', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMultipleProvideInsert(self): + original = [ + 'goog.provide(\'dummy.bb\');', + 'goog.provide(\'dummy.dd\');', + '', + 'dummy.aa.ff = 1;', + 'dummy.bb.ff = 1;', + 'dummy.cc.ff = 1;', + 'dummy.dd.ff = 1;', + 'dummy.ee.ff = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.bb\');', + 'goog.provide(\'dummy.cc\');', + 'goog.provide(\'dummy.dd\');', + 'goog.provide(\'dummy.ee\');', + '', + 'dummy.aa.ff = 1;', + 'dummy.bb.ff = 1;', + 'dummy.cc.ff = 1;', + 'dummy.dd.ff = 1;', + 'dummy.ee.ff = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMultipleRequireInsert(self): + original = [ + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.dd\');', + '', + 'a = dummy.aa.ff;', + 'b = dummy.bb.ff;', + 'c = dummy.cc.ff;', + 'd = dummy.dd.ff;', + 'e = dummy.ee.ff;', + ] + + expected = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.cc\');', + 'goog.require(\'dummy.dd\');', + 'goog.require(\'dummy.ee\');', + '', + 'a = dummy.aa.ff;', + 'b = dummy.bb.ff;', + 'c = dummy.cc.ff;', + 'd = dummy.dd.ff;', + 'e = dummy.ee.ff;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testUnsortedRequires(self): + """Tests handling of unsorted goog.require statements without header. + + Bug 8398202. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] + + expected = [ + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + 'goog.require(\'dummy.aa\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMissingExtraAndUnsortedRequires(self): + """Tests handling of missing extra and unsorted goog.require statements.""" + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'var x = new dummy.Bb();', + 'dummy.Cc.someMethod();', + 'dummy.aa.someMethod();', + ] + + expected = [ + 'goog.require(\'dummy.Bb\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.aa\');', + '', + 'var x = new dummy.Bb();', + 'dummy.Cc.someMethod();', + 'dummy.aa.someMethod();', + ] + + self._AssertFixes(original, expected) + + def testExtraRequireOnFirstLine(self): + """Tests handling of extra goog.require statement on the first line. + + There was a bug when fixjsstyle quits with an exception. It happened if + - the first line of the file is an extra goog.require() statement, + - goog.require() statements are not sorted. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.cc\');', + 'goog.require(\'dummy.bb\');', + '', + 'var x = new dummy.bb();', + 'var y = new dummy.cc();', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.cc\');', + '', + 'var x = new dummy.bb();', + 'var y = new dummy.cc();', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testUnsortedProvides(self): + """Tests handling of unsorted goog.provide statements without header. + + Bug 8398202. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + '', + 'dummy.aa = function() {};' + 'dummy.Cc = function() {};' + 'dummy.Dd = function() {};' + ] + + expected = [ + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.aa = function() {};' + 'dummy.Cc = function() {};' + 'dummy.Dd = function() {};' + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMissingExtraAndUnsortedProvides(self): + """Tests handling of missing extra and unsorted goog.provide statements.""" + original = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + '', + 'dummy.Cc = function() {};', + 'dummy.Bb = function() {};', + 'dummy.aa.someMethod = function();', + ] + + expected = [ + 'goog.provide(\'dummy.Bb\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.Cc = function() {};', + 'dummy.Bb = function() {};', + 'dummy.aa.someMethod = function();', + ] + + self._AssertFixes(original, expected) + + def testNoRequires(self): + """Tests positioning of missing requires without existing requires.""" + original = [ + 'goog.provide(\'dummy.Something\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + expected = [ + 'goog.provide(\'dummy.Something\');', + '', + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + self._AssertFixes(original, expected) + + def testNoProvides(self): + """Tests positioning of missing provides without existing provides.""" + original = [ + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + expected = [ + 'goog.provide(\'dummy.Something\');', + '', + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + self._AssertFixes(original, expected) + + def testOutputOkayWhenFirstTokenIsDeleted(self): + """Tests that autofix output is is correct when first token is deleted. + + Regression test for bug 4581567 + """ + original = ['"use strict";'] + expected = ["'use strict';"] + + self._AssertFixes(original, expected, include_header=False) + + def testGoogScopeIndentation(self): + """Tests Handling a typical end-of-scope indentation fix.""" + original = [ + 'goog.scope(function() {', + ' // TODO(brain): Take over the world.', + '}); // goog.scope', + ] + + expected = [ + 'goog.scope(function() {', + '// TODO(brain): Take over the world.', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMissingEndOfScopeComment(self): + """Tests Handling a missing comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + '});', + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMissingEndOfScopeCommentWithOtherComment(self): + """Tests handling an irrelevant comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + "}); // I don't belong here!", + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMalformedEndOfScopeComment(self): + """Tests Handling a malformed comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + '}); // goog.scope FTW', + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testEndsWithIdentifier(self): + """Tests Handling case where script ends with identifier. Bug 7643404.""" + original = [ + 'goog.provide(\'xyz\');', + '', + 'abc' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected) + + def testFileStartsWithSemicolon(self): + """Tests handling files starting with semicolon. + + b/10062516 + """ + original = [ + ';goog.provide(\'xyz\');', + '', + 'abc;' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected, include_header=False) + + def testCodeStartsWithSemicolon(self): + """Tests handling code in starting with semicolon after comments. + + b/10062516 + """ + original = [ + ';goog.provide(\'xyz\');', + '', + 'abc;' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected) + + def _AssertFixes(self, original, expected, include_header=True): + """Asserts that the error fixer corrects original to expected.""" + if include_header: + original = self._GetHeader() + original + expected = self._GetHeader() + expected + + actual = StringIO.StringIO() + runner.Run('testing.js', error_fixer.ErrorFixer(actual), original) + actual.seek(0) + + expected = [x + '\n' for x in expected] + + self.assertListEqual(actual.readlines(), expected) + + def _GetHeader(self): + """Returns a fake header for a JavaScript file.""" + return [ + '// Copyright 2011 Google Inc. All Rights Reserved.', + '', + '/**', + ' * @fileoverview Fake file overview.', + ' * @author fake@google.com (Fake Person)', + ' */', + '' + ] + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/full_test.py b/tools/closure_linter/build/lib/closure_linter/full_test.py new file mode 100644 index 00000000000000..d0a1557dc23dbe --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/full_test.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Full regression-type (Medium) tests for gjslint. + +Tests every error that can be thrown by gjslint. Based heavily on +devtools/javascript/gpylint/full_test.py +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import os +import sys +import unittest + +import gflags as flags +import unittest as googletest + +from closure_linter import error_check +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import filetestcase + +_RESOURCE_PREFIX = 'closure_linter/testdata' + +flags.FLAGS.strict = True +flags.FLAGS.custom_jsdoc_tags = ('customtag', 'requires') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') +flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js', + 'limited_doc_checks.js') +flags.FLAGS.jslint_error = error_check.Rule.ALL + +# List of files under testdata to test. +# We need to list files explicitly since pyglib can't list directories. +# TODO(user): Figure out how to list the directory. +_TEST_FILES = [ + 'all_js_wrapped.js', + 'blank_lines.js', + 'ends_with_block.js', + 'empty_file.js', + 'externs.js', + 'externs_jsdoc.js', + 'goog_scope.js', + 'html_parse_error.html', + 'indentation.js', + 'interface.js', + 'jsdoc.js', + 'limited_doc_checks.js', + 'minimal.js', + 'other.js', + 'provide_blank.js', + 'provide_extra.js', + 'provide_missing.js', + 'require_alias.js', + 'require_all_caps.js', + 'require_blank.js', + 'require_extra.js', + 'require_function.js', + 'require_function_missing.js', + 'require_function_through_both.js', + 'require_function_through_namespace.js', + 'require_interface.js', + 'require_interface_alias.js', + 'require_interface_base.js', + 'require_lower_case.js', + 'require_missing.js', + 'require_numeric.js', + 'require_provide_blank.js', + 'require_provide_missing.js', + 'require_provide_ok.js', + 'semicolon_missing.js', + 'simple.html', + 'spaces.js', + 'tokenizer.js', + 'unparseable.js', + 'unused_local_variables.js', + 'unused_private_members.js', + 'utf8.html', +] + + +class GJsLintTestSuite(unittest.TestSuite): + """Test suite to run a GJsLintTest for each of several files. + + If sys.argv[1:] is non-empty, it is interpreted as a list of filenames in + testdata to test. Otherwise, _TEST_FILES is used. + """ + + def __init__(self, tests=()): + unittest.TestSuite.__init__(self, tests) + + argv = sys.argv and sys.argv[1:] or [] + if argv: + test_files = argv + else: + test_files = _TEST_FILES + for test_file in test_files: + resource_path = os.path.join(_RESOURCE_PREFIX, test_file) + self.addTest( + filetestcase.AnnotatedFileTestCase( + resource_path, + runner.Run, + errors.ByName)) + +if __name__ == '__main__': + # Don't let main parse args; it happens in the TestSuite. + googletest.main(argv=sys.argv[0:1], defaultTest='GJsLintTestSuite') diff --git a/tools/closure_linter/build/lib/closure_linter/gjslint.py b/tools/closure_linter/build/lib/closure_linter/gjslint.py new file mode 100644 index 00000000000000..824e025dcb00de --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/gjslint.py @@ -0,0 +1,319 @@ +#!/usr/bin/env python +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Checks JavaScript files for common style guide violations. + +gjslint.py is designed to be used as a PRESUBMIT script to check for javascript +style guide violations. As of now, it checks for the following violations: + + * Missing and extra spaces + * Lines longer than 80 characters + * Missing newline at end of file + * Missing semicolon after function declaration + * Valid JsDoc including parameter matching + +Someday it will validate to the best of its ability against the entirety of the +JavaScript style guide. + +This file is a front end that parses arguments and flags. The core of the code +is in tokenizer.py and checker.py. +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'nnaze@google.com (Nathan Naze)',) + +import errno +import itertools +import os +import platform +import re +import sys +import time + +import gflags as flags + +from closure_linter import errorrecord +from closure_linter import runner +from closure_linter.common import erroraccumulator +from closure_linter.common import simplefileflags as fileflags + +# Attempt import of multiprocessing (should be available in Python 2.6 and up). +try: + # pylint: disable=g-import-not-at-top + import multiprocessing +except ImportError: + multiprocessing = None + +FLAGS = flags.FLAGS +flags.DEFINE_boolean('unix_mode', False, + 'Whether to emit warnings in standard unix format.') +flags.DEFINE_boolean('beep', True, 'Whether to beep when errors are found.') +flags.DEFINE_boolean('time', False, 'Whether to emit timing statistics.') +flags.DEFINE_boolean('quiet', False, 'Whether to minimize logged messages. ' + 'Most useful for per-file linting, such as that performed ' + 'by the presubmit linter service.') +flags.DEFINE_boolean('check_html', False, + 'Whether to check javascript in html files.') +flags.DEFINE_boolean('summary', False, + 'Whether to show an error count summary.') +flags.DEFINE_list('additional_extensions', None, 'List of additional file ' + 'extensions (not js) that should be treated as ' + 'JavaScript files.') +flags.DEFINE_boolean('multiprocess', + platform.system() is 'Linux' and bool(multiprocessing), + 'Whether to attempt parallelized linting using the ' + 'multiprocessing module. Enabled by default on Linux ' + 'if the multiprocessing module is present (Python 2.6+). ' + 'Otherwise disabled by default. ' + 'Disabling may make debugging easier.') +flags.ADOPT_module_key_flags(fileflags) +flags.ADOPT_module_key_flags(runner) + + +GJSLINT_ONLY_FLAGS = ['--unix_mode', '--beep', '--nobeep', '--time', + '--check_html', '--summary', '--quiet'] + + + +def _MultiprocessCheckPaths(paths): + """Run _CheckPath over mutltiple processes. + + Tokenization, passes, and checks are expensive operations. Running in a + single process, they can only run on one CPU/core. Instead, + shard out linting over all CPUs with multiprocessing to parallelize. + + Args: + paths: paths to check. + + Yields: + errorrecord.ErrorRecords for any found errors. + """ + + pool = multiprocessing.Pool() + + path_results = pool.imap(_CheckPath, paths) + for results in path_results: + for result in results: + yield result + + # Force destruct before returning, as this can sometimes raise spurious + # "interrupted system call" (EINTR), which we can ignore. + try: + pool.close() + pool.join() + del pool + except OSError as err: + if err.errno is not errno.EINTR: + raise err + + +def _CheckPaths(paths): + """Run _CheckPath on all paths in one thread. + + Args: + paths: paths to check. + + Yields: + errorrecord.ErrorRecords for any found errors. + """ + + for path in paths: + results = _CheckPath(path) + for record in results: + yield record + + +def _CheckPath(path): + """Check a path and return any errors. + + Args: + path: paths to check. + + Returns: + A list of errorrecord.ErrorRecords for any found errors. + """ + + error_handler = erroraccumulator.ErrorAccumulator() + runner.Run(path, error_handler) + + make_error_record = lambda err: errorrecord.MakeErrorRecord(path, err) + return map(make_error_record, error_handler.GetErrors()) + + +def _GetFilePaths(argv): + suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] + if FLAGS.check_html: + suffixes += ['.html', '.htm'] + return fileflags.GetFileList(argv, 'JavaScript', suffixes) + + +# Error printing functions + + +def _PrintFileSummary(paths, records): + """Print a detailed summary of the number of errors in each file.""" + + paths = list(paths) + paths.sort() + + for path in paths: + path_errors = [e for e in records if e.path == path] + print '%s: %d' % (path, len(path_errors)) + + +def _PrintFileSeparator(path): + print '----- FILE : %s -----' % path + + +def _PrintSummary(paths, error_records): + """Print a summary of the number of errors and files.""" + + error_count = len(error_records) + all_paths = set(paths) + all_paths_count = len(all_paths) + + if error_count is 0: + print '%d files checked, no errors found.' % all_paths_count + + new_error_count = len([e for e in error_records if e.new_error]) + + error_paths = set([e.path for e in error_records]) + error_paths_count = len(error_paths) + no_error_paths_count = all_paths_count - error_paths_count + + if (error_count or new_error_count) and not FLAGS.quiet: + error_noun = 'error' if error_count == 1 else 'errors' + new_error_noun = 'error' if new_error_count == 1 else 'errors' + error_file_noun = 'file' if error_paths_count == 1 else 'files' + ok_file_noun = 'file' if no_error_paths_count == 1 else 'files' + print ('Found %d %s, including %d new %s, in %d %s (%d %s OK).' % + (error_count, + error_noun, + new_error_count, + new_error_noun, + error_paths_count, + error_file_noun, + no_error_paths_count, + ok_file_noun)) + + +def _PrintErrorRecords(error_records): + """Print error records strings in the expected format.""" + + current_path = None + for record in error_records: + + if current_path != record.path: + current_path = record.path + if not FLAGS.unix_mode: + _PrintFileSeparator(current_path) + + print record.error_string + + +def _FormatTime(t): + """Formats a duration as a human-readable string. + + Args: + t: A duration in seconds. + + Returns: + A formatted duration string. + """ + if t < 1: + return '%dms' % round(t * 1000) + else: + return '%.2fs' % t + + + + +def main(argv=None): + """Main function. + + Args: + argv: Sequence of command line arguments. + """ + if argv is None: + argv = flags.FLAGS(sys.argv) + + if FLAGS.time: + start_time = time.time() + + suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] + if FLAGS.check_html: + suffixes += ['.html', '.htm'] + paths = fileflags.GetFileList(argv, 'JavaScript', suffixes) + + if FLAGS.multiprocess: + records_iter = _MultiprocessCheckPaths(paths) + else: + records_iter = _CheckPaths(paths) + + records_iter, records_iter_copy = itertools.tee(records_iter, 2) + _PrintErrorRecords(records_iter_copy) + + error_records = list(records_iter) + _PrintSummary(paths, error_records) + + exit_code = 0 + + # If there are any errors + if error_records: + exit_code += 1 + + # If there are any new errors + if [r for r in error_records if r.new_error]: + exit_code += 2 + + if exit_code: + if FLAGS.summary: + _PrintFileSummary(paths, error_records) + + if FLAGS.beep: + # Make a beep noise. + sys.stdout.write(chr(7)) + + # Write out instructions for using fixjsstyle script to fix some of the + # reported errors. + fix_args = [] + for flag in sys.argv[1:]: + for f in GJSLINT_ONLY_FLAGS: + if flag.startswith(f): + break + else: + fix_args.append(flag) + + if not FLAGS.quiet: + print """ +Some of the errors reported by GJsLint may be auto-fixable using the script +fixjsstyle. Please double check any changes it makes and report any bugs. The +script can be run by executing: + +fixjsstyle %s """ % ' '.join(fix_args) + + if FLAGS.time: + print 'Done in %s.' % _FormatTime(time.time() - start_time) + + sys.exit(exit_code) + + +if __name__ == '__main__': + main() diff --git a/tools/closure_linter/build/lib/closure_linter/indentation.py b/tools/closure_linter/build/lib/closure_linter/indentation.py new file mode 100644 index 00000000000000..d48ad2b862c43a --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/indentation.py @@ -0,0 +1,617 @@ +#!/usr/bin/env python +# Copyright 2010 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Methods for checking EcmaScript files for indentation issues.""" + +__author__ = ('robbyw@google.com (Robert Walker)') + +import gflags as flags + +from closure_linter import ecmametadatapass +from closure_linter import errors +from closure_linter import javascripttokens +from closure_linter import tokenutil +from closure_linter.common import error +from closure_linter.common import position + + +flags.DEFINE_boolean('debug_indentation', False, + 'Whether to print debugging information for indentation.') + + +# Shorthand +Context = ecmametadatapass.EcmaContext +Error = error.Error +Position = position.Position +Type = javascripttokens.JavaScriptTokenType + + +# The general approach: +# +# 1. Build a stack of tokens that can affect indentation. +# For each token, we determine if it is a block or continuation token. +# Some tokens need to be temporarily overwritten in case they are removed +# before the end of the line. +# Much of the work here is determining which tokens to keep on the stack +# at each point. Operators, for example, should be removed once their +# expression or line is gone, while parentheses must stay until the matching +# end parentheses is found. +# +# 2. Given that stack, determine the allowable indentations. +# Due to flexible indentation rules in JavaScript, there may be many +# allowable indentations for each stack. We follows the general +# "no false positives" approach of GJsLint and build the most permissive +# set possible. + + +class TokenInfo(object): + """Stores information about a token. + + Attributes: + token: The token + is_block: Whether the token represents a block indentation. + is_transient: Whether the token should be automatically removed without + finding a matching end token. + overridden_by: TokenInfo for a token that overrides the indentation that + this token would require. + is_permanent_override: Whether the override on this token should persist + even after the overriding token is removed from the stack. For example: + x([ + 1], + 2); + needs this to be set so the last line is not required to be a continuation + indent. + line_number: The effective line number of this token. Will either be the + actual line number or the one before it in the case of a mis-wrapped + operator. + """ + + def __init__(self, token, is_block=False): + """Initializes a TokenInfo object. + + Args: + token: The token + is_block: Whether the token represents a block indentation. + """ + self.token = token + self.overridden_by = None + self.is_permanent_override = False + self.is_block = is_block + self.is_transient = not is_block and token.type not in ( + Type.START_PAREN, Type.START_PARAMETERS) + self.line_number = token.line_number + + def __repr__(self): + result = '\n %s' % self.token + if self.overridden_by: + result = '%s OVERRIDDEN [by "%s"]' % ( + result, self.overridden_by.token.string) + result += ' {is_block: %s, is_transient: %s}' % ( + self.is_block, self.is_transient) + return result + + +class IndentationRules(object): + """EmcaScript indentation rules. + + Can be used to find common indentation errors in JavaScript, ActionScript and + other Ecma like scripting languages. + """ + + def __init__(self): + """Initializes the IndentationRules checker.""" + self._stack = [] + + # Map from line number to number of characters it is off in indentation. + self._start_index_offset = {} + + def Finalize(self): + if self._stack: + old_stack = self._stack + self._stack = [] + raise Exception('INTERNAL ERROR: indentation stack is not empty: %r' % + old_stack) + + def CheckToken(self, token, state): + """Checks a token for indentation errors. + + Args: + token: The current token under consideration + state: Additional information about the current tree state + + Returns: + An error array [error code, error string, error token] if the token is + improperly indented, or None if indentation is correct. + """ + + token_type = token.type + indentation_errors = [] + stack = self._stack + is_first = self._IsFirstNonWhitespaceTokenInLine(token) + + # Add tokens that could decrease indentation before checking. + if token_type == Type.END_PAREN: + self._PopTo(Type.START_PAREN) + + elif token_type == Type.END_PARAMETERS: + self._PopTo(Type.START_PARAMETERS) + + elif token_type == Type.END_BRACKET: + self._PopTo(Type.START_BRACKET) + + elif token_type == Type.END_BLOCK: + start_token = self._PopTo(Type.START_BLOCK) + # Check for required goog.scope comment. + if start_token: + goog_scope = tokenutil.GoogScopeOrNoneFromStartBlock(start_token.token) + if goog_scope is not None: + if not token.line.endswith('; // goog.scope\n'): + if (token.line.find('//') > -1 and + token.line.find('goog.scope') > + token.line.find('//')): + indentation_errors.append([ + errors.MALFORMED_END_OF_SCOPE_COMMENT, + ('Malformed end of goog.scope comment. Please use the ' + 'exact following syntax to close the scope:\n' + '}); // goog.scope'), + token, + Position(token.start_index, token.length)]) + else: + indentation_errors.append([ + errors.MISSING_END_OF_SCOPE_COMMENT, + ('Missing comment for end of goog.scope which opened at line ' + '%d. End the scope with:\n' + '}); // goog.scope' % + (start_token.line_number)), + token, + Position(token.start_index, token.length)]) + + elif token_type == Type.KEYWORD and token.string in ('case', 'default'): + self._Add(self._PopTo(Type.START_BLOCK)) + + elif token_type == Type.SEMICOLON: + self._PopTransient() + + if (is_first and + token_type not in (Type.COMMENT, Type.DOC_PREFIX, Type.STRING_TEXT)): + if flags.FLAGS.debug_indentation: + print 'Line #%d: stack %r' % (token.line_number, stack) + + # Ignore lines that start in JsDoc since we don't check them properly yet. + # TODO(robbyw): Support checking JsDoc indentation. + # Ignore lines that start as multi-line strings since indentation is N/A. + # Ignore lines that start with operators since we report that already. + # Ignore lines with tabs since we report that already. + expected = self._GetAllowableIndentations() + actual = self._GetActualIndentation(token) + + # Special case comments describing else, case, and default. Allow them + # to outdent to the parent block. + if token_type in Type.COMMENT_TYPES: + next_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) + if next_code and next_code.type == Type.END_BLOCK: + next_code = tokenutil.SearchExcept(next_code, Type.NON_CODE_TYPES) + if next_code and next_code.string in ('else', 'case', 'default'): + # TODO(robbyw): This almost certainly introduces false negatives. + expected |= self._AddToEach(expected, -2) + + if actual >= 0 and actual not in expected: + expected = sorted(expected) + indentation_errors.append([ + errors.WRONG_INDENTATION, + 'Wrong indentation: expected any of {%s} but got %d' % ( + ', '.join('%d' % x for x in expected if x < 80), actual), + token, + Position(actual, expected[0])]) + self._start_index_offset[token.line_number] = expected[0] - actual + + # Add tokens that could increase indentation. + if token_type == Type.START_BRACKET: + self._Add(TokenInfo( + token=token, + is_block=token.metadata.context.type == Context.ARRAY_LITERAL)) + + elif token_type == Type.START_BLOCK or token.metadata.is_implied_block: + self._Add(TokenInfo(token=token, is_block=True)) + + elif token_type in (Type.START_PAREN, Type.START_PARAMETERS): + self._Add(TokenInfo(token=token, is_block=False)) + + elif token_type == Type.KEYWORD and token.string == 'return': + self._Add(TokenInfo(token)) + + elif not token.IsLastInLine() and ( + token.IsAssignment() or token.IsOperator('?')): + self._Add(TokenInfo(token=token)) + + # Handle implied block closes. + if token.metadata.is_implied_block_close: + self._PopToImpliedBlock() + + # Add some tokens only if they appear at the end of the line. + is_last = self._IsLastCodeInLine(token) + if is_last: + next_code_token = tokenutil.GetNextCodeToken(token) + # Increase required indentation if this is an overlong wrapped statement + # ending in an operator. + if token_type == Type.OPERATOR: + if token.string == ':': + if stack and stack[-1].token.string == '?': + # When a ternary : is on a different line than its '?', it doesn't + # add indentation. + if token.line_number == stack[-1].token.line_number: + self._Add(TokenInfo(token)) + elif token.metadata.context.type == Context.CASE_BLOCK: + # Pop transient tokens from say, line continuations, e.g., + # case x. + # y: + # Want to pop the transient 4 space continuation indent. + self._PopTransient() + # Starting the body of the case statement, which is a type of + # block. + self._Add(TokenInfo(token=token, is_block=True)) + elif token.metadata.context.type == Context.LITERAL_ELEMENT: + # When in an object literal, acts as operator indicating line + # continuations. + self._Add(TokenInfo(token)) + else: + # ':' might also be a statement label, no effect on indentation in + # this case. + pass + + elif token.string != ',': + self._Add(TokenInfo(token)) + else: + # The token is a comma. + if token.metadata.context.type == Context.VAR: + self._Add(TokenInfo(token)) + elif token.metadata.context.type != Context.PARAMETERS: + self._PopTransient() + # Increase required indentation if this is the end of a statement that's + # continued with an operator on the next line (e.g. the '.'). + elif (next_code_token and next_code_token.type == Type.OPERATOR and + not next_code_token.metadata.IsUnaryOperator()): + self._Add(TokenInfo(token)) + elif token_type == Type.PARAMETERS and token.string.endswith(','): + # Parameter lists. + self._Add(TokenInfo(token)) + elif token.IsKeyword('var'): + self._Add(TokenInfo(token)) + elif token.metadata.is_implied_semicolon: + self._PopTransient() + elif token.IsAssignment(): + self._Add(TokenInfo(token)) + + return indentation_errors + + def _AddToEach(self, original, amount): + """Returns a new set with the given amount added to each element. + + Args: + original: The original set of numbers + amount: The amount to add to each element + + Returns: + A new set containing each element of the original set added to the amount. + """ + return set([x + amount for x in original]) + + _HARD_STOP_TYPES = (Type.START_PAREN, Type.START_PARAMETERS, + Type.START_BRACKET) + + _HARD_STOP_STRINGS = ('return', '?') + + def _IsHardStop(self, token): + """Determines if the given token can have a hard stop after it. + + Args: + token: token to examine + + Returns: + Whether the token can have a hard stop after it. + + Hard stops are indentations defined by the position of another token as in + indentation lined up with return, (, [, and ?. + """ + return (token.type in self._HARD_STOP_TYPES or + token.string in self._HARD_STOP_STRINGS or + token.IsAssignment()) + + def _GetAllowableIndentations(self): + """Computes the set of allowable indentations. + + Returns: + The set of allowable indentations, given the current stack. + """ + expected = set([0]) + hard_stops = set([]) + + # Whether the tokens are still in the same continuation, meaning additional + # indentation is optional. As an example: + # x = 5 + + # 6 + + # 7; + # The second '+' does not add any required indentation. + in_same_continuation = False + + for token_info in self._stack: + token = token_info.token + + # Handle normal additive indentation tokens. + if not token_info.overridden_by and token.string != 'return': + if token_info.is_block: + expected = self._AddToEach(expected, 2) + hard_stops = self._AddToEach(hard_stops, 2) + in_same_continuation = False + elif in_same_continuation: + expected |= self._AddToEach(expected, 4) + hard_stops |= self._AddToEach(hard_stops, 4) + else: + expected = self._AddToEach(expected, 4) + hard_stops |= self._AddToEach(hard_stops, 4) + in_same_continuation = True + + # Handle hard stops after (, [, return, =, and ? + if self._IsHardStop(token): + override_is_hard_stop = (token_info.overridden_by and + self._IsHardStop( + token_info.overridden_by.token)) + if token.type == Type.START_PAREN and token.previous: + # For someFunction(...) we allow to indent at the beginning of the + # identifier +4 + prev = token.previous + if (prev.type == Type.IDENTIFIER and + prev.line_number == token.line_number): + hard_stops.add(prev.start_index + 4) + if not override_is_hard_stop: + start_index = token.start_index + if token.line_number in self._start_index_offset: + start_index += self._start_index_offset[token.line_number] + if (token.type in (Type.START_PAREN, Type.START_PARAMETERS) and + not token_info.overridden_by): + hard_stops.add(start_index + 1) + + elif token.string == 'return' and not token_info.overridden_by: + hard_stops.add(start_index + 7) + + elif token.type == Type.START_BRACKET: + hard_stops.add(start_index + 1) + + elif token.IsAssignment(): + hard_stops.add(start_index + len(token.string) + 1) + + elif token.IsOperator('?') and not token_info.overridden_by: + hard_stops.add(start_index + 2) + + return (expected | hard_stops) or set([0]) + + def _GetActualIndentation(self, token): + """Gets the actual indentation of the line containing the given token. + + Args: + token: Any token on the line. + + Returns: + The actual indentation of the line containing the given token. Returns + -1 if this line should be ignored due to the presence of tabs. + """ + # Move to the first token in the line + token = tokenutil.GetFirstTokenInSameLine(token) + + # If it is whitespace, it is the indentation. + if token.type == Type.WHITESPACE: + if token.string.find('\t') >= 0: + return -1 + else: + return len(token.string) + elif token.type == Type.PARAMETERS: + return len(token.string) - len(token.string.lstrip()) + else: + return 0 + + def _IsFirstNonWhitespaceTokenInLine(self, token): + """Determines if the given token is the first non-space token on its line. + + Args: + token: The token. + + Returns: + True if the token is the first non-whitespace token on its line. + """ + if token.type in (Type.WHITESPACE, Type.BLANK_LINE): + return False + if token.IsFirstInLine(): + return True + return (token.previous and token.previous.IsFirstInLine() and + token.previous.type == Type.WHITESPACE) + + def _IsLastCodeInLine(self, token): + """Determines if the given token is the last code token on its line. + + Args: + token: The token. + + Returns: + True if the token is the last code token on its line. + """ + if token.type in Type.NON_CODE_TYPES: + return False + start_token = token + while True: + token = token.next + if not token or token.line_number != start_token.line_number: + return True + if token.type not in Type.NON_CODE_TYPES: + return False + + def _AllFunctionPropertyAssignTokens(self, start_token, end_token): + """Checks if tokens are (likely) a valid function property assignment. + + Args: + start_token: Start of the token range. + end_token: End of the token range. + + Returns: + True if all tokens between start_token and end_token are legal tokens + within a function declaration and assignment into a property. + """ + for token in tokenutil.GetTokenRange(start_token, end_token): + fn_decl_tokens = (Type.FUNCTION_DECLARATION, + Type.PARAMETERS, + Type.START_PARAMETERS, + Type.END_PARAMETERS, + Type.END_PAREN) + if (token.type not in fn_decl_tokens and + token.IsCode() and + not tokenutil.IsIdentifierOrDot(token) and + not token.IsAssignment() and + not (token.type == Type.OPERATOR and token.string == ',')): + return False + return True + + def _Add(self, token_info): + """Adds the given token info to the stack. + + Args: + token_info: The token information to add. + """ + if self._stack and self._stack[-1].token == token_info.token: + # Don't add the same token twice. + return + + if token_info.is_block or token_info.token.type == Type.START_PAREN: + scope_token = tokenutil.GoogScopeOrNoneFromStartBlock(token_info.token) + token_info.overridden_by = TokenInfo(scope_token) if scope_token else None + + if (token_info.token.type == Type.START_BLOCK and + token_info.token.metadata.context.type == Context.BLOCK): + # Handle function() {} assignments: their block contents get special + # treatment and are allowed to just indent by two whitespace. + # For example + # long.long.name = function( + # a) { + # In this case the { and the = are on different lines. But the + # override should still apply for all previous stack tokens that are + # part of an assignment of a block. + + has_assignment = any(x for x in self._stack if x.token.IsAssignment()) + if has_assignment: + last_token = token_info.token.previous + for stack_info in reversed(self._stack): + if (last_token and + not self._AllFunctionPropertyAssignTokens(stack_info.token, + last_token)): + break + stack_info.overridden_by = token_info + stack_info.is_permanent_override = True + last_token = stack_info.token + + index = len(self._stack) - 1 + while index >= 0: + stack_info = self._stack[index] + stack_token = stack_info.token + + if stack_info.line_number == token_info.line_number: + # In general, tokens only override each other when they are on + # the same line. + stack_info.overridden_by = token_info + if (token_info.token.type == Type.START_BLOCK and + (stack_token.IsAssignment() or + stack_token.type in (Type.IDENTIFIER, Type.START_PAREN))): + # Multi-line blocks have lasting overrides, as in: + # callFn({ + # a: 10 + # }, + # 30); + # b/11450054. If a string is not closed properly then close_block + # could be null. + close_block = token_info.token.metadata.context.end_token + stack_info.is_permanent_override = close_block and ( + close_block.line_number != token_info.token.line_number) + else: + break + index -= 1 + + self._stack.append(token_info) + + def _Pop(self): + """Pops the top token from the stack. + + Returns: + The popped token info. + """ + token_info = self._stack.pop() + if token_info.token.type not in (Type.START_BLOCK, Type.START_BRACKET): + # Remove any temporary overrides. + self._RemoveOverrides(token_info) + else: + # For braces and brackets, which can be object and array literals, remove + # overrides when the literal is closed on the same line. + token_check = token_info.token + same_type = token_check.type + goal_type = None + if token_info.token.type == Type.START_BRACKET: + goal_type = Type.END_BRACKET + else: + goal_type = Type.END_BLOCK + line_number = token_info.token.line_number + count = 0 + while token_check and token_check.line_number == line_number: + if token_check.type == goal_type: + count -= 1 + if not count: + self._RemoveOverrides(token_info) + break + if token_check.type == same_type: + count += 1 + token_check = token_check.next + return token_info + + def _PopToImpliedBlock(self): + """Pops the stack until an implied block token is found.""" + while not self._Pop().token.metadata.is_implied_block: + pass + + def _PopTo(self, stop_type): + """Pops the stack until a token of the given type is popped. + + Args: + stop_type: The type of token to pop to. + + Returns: + The token info of the given type that was popped. + """ + last = None + while True: + last = self._Pop() + if last.token.type == stop_type: + break + return last + + def _RemoveOverrides(self, token_info): + """Marks any token that was overridden by this token as active again. + + Args: + token_info: The token that is being removed from the stack. + """ + for stack_token in self._stack: + if (stack_token.overridden_by == token_info and + not stack_token.is_permanent_override): + stack_token.overridden_by = None + + def _PopTransient(self): + """Pops all transient tokens - i.e. not blocks, literals, or parens.""" + while self._stack and self._stack[-1].is_transient: + self._Pop() diff --git a/tools/closure_linter/build/lib/closure_linter/javascriptlintrules.py b/tools/closure_linter/build/lib/closure_linter/javascriptlintrules.py new file mode 100644 index 00000000000000..9578009daacb5a --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/javascriptlintrules.py @@ -0,0 +1,754 @@ +#!/usr/bin/env python +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Methods for checking JS files for common style guide violations. + +These style guide violations should only apply to JavaScript and not an Ecma +scripting languages. +""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'jacobr@google.com (Jacob Richman)') + +import re + +from closure_linter import ecmalintrules +from closure_linter import error_check +from closure_linter import errors +from closure_linter import javascripttokenizer +from closure_linter import javascripttokens +from closure_linter import requireprovidesorter +from closure_linter import tokenutil +from closure_linter.common import error +from closure_linter.common import position + +# Shorthand +Error = error.Error +Position = position.Position +Rule = error_check.Rule +Type = javascripttokens.JavaScriptTokenType + + +class JavaScriptLintRules(ecmalintrules.EcmaScriptLintRules): + """JavaScript lint rules that catch JavaScript specific style errors.""" + + def __init__(self, namespaces_info): + """Initializes a JavaScriptLintRules instance.""" + ecmalintrules.EcmaScriptLintRules.__init__(self) + self._namespaces_info = namespaces_info + self._declared_private_member_tokens = {} + self._declared_private_members = set() + self._used_private_members = set() + # A stack of dictionaries, one for each function scope entered. Each + # dictionary is keyed by an identifier that defines a local variable and has + # a token as its value. + self._unused_local_variables_by_scope = [] + + def HandleMissingParameterDoc(self, token, param_name): + """Handle errors associated with a parameter missing a param tag.""" + self._HandleError(errors.MISSING_PARAMETER_DOCUMENTATION, + 'Missing docs for parameter: "%s"' % param_name, token) + + # pylint: disable=too-many-statements + def CheckToken(self, token, state): + """Checks a token, given the current parser_state, for warnings and errors. + + Args: + token: The current token under consideration + state: parser_state object that indicates the current state in the page + """ + + # Call the base class's CheckToken function. + super(JavaScriptLintRules, self).CheckToken(token, state) + + # Store some convenience variables + namespaces_info = self._namespaces_info + + if error_check.ShouldCheck(Rule.UNUSED_LOCAL_VARIABLES): + self._CheckUnusedLocalVariables(token, state) + + if error_check.ShouldCheck(Rule.UNUSED_PRIVATE_MEMBERS): + # Find all assignments to private members. + if token.type == Type.SIMPLE_LVALUE: + identifier = token.string + if identifier.endswith('_') and not identifier.endswith('__'): + doc_comment = state.GetDocComment() + suppressed = doc_comment and ( + 'underscore' in doc_comment.suppressions or + 'unusedPrivateMembers' in doc_comment.suppressions) + if not suppressed: + # Look for static members defined on a provided namespace. + if namespaces_info: + namespace = namespaces_info.GetClosurizedNamespace(identifier) + provided_namespaces = namespaces_info.GetProvidedNamespaces() + else: + namespace = None + provided_namespaces = set() + + # Skip cases of this.something_.somethingElse_. + regex = re.compile(r'^this\.[a-zA-Z_]+$') + if namespace in provided_namespaces or regex.match(identifier): + variable = identifier.split('.')[-1] + self._declared_private_member_tokens[variable] = token + self._declared_private_members.add(variable) + elif not identifier.endswith('__'): + # Consider setting public members of private members to be a usage. + for piece in identifier.split('.'): + if piece.endswith('_'): + self._used_private_members.add(piece) + + # Find all usages of private members. + if token.type == Type.IDENTIFIER: + for piece in token.string.split('.'): + if piece.endswith('_'): + self._used_private_members.add(piece) + + if token.type == Type.DOC_FLAG: + flag = token.attached_object + + if flag.flag_type == 'param' and flag.name_token is not None: + self._CheckForMissingSpaceBeforeToken( + token.attached_object.name_token) + + if flag.type is not None and flag.name is not None: + if error_check.ShouldCheck(Rule.VARIABLE_ARG_MARKER): + # Check for variable arguments marker in type. + if flag.jstype.IsVarArgsType() and flag.name != 'var_args': + self._HandleError(errors.JSDOC_MISSING_VAR_ARGS_NAME, + 'Variable length argument %s must be renamed ' + 'to var_args.' % flag.name, + token) + elif not flag.jstype.IsVarArgsType() and flag.name == 'var_args': + self._HandleError(errors.JSDOC_MISSING_VAR_ARGS_TYPE, + 'Variable length argument %s type must start ' + 'with \'...\'.' % flag.name, + token) + + if error_check.ShouldCheck(Rule.OPTIONAL_TYPE_MARKER): + # Check for optional marker in type. + if (flag.jstype.opt_arg and + not flag.name.startswith('opt_')): + self._HandleError(errors.JSDOC_MISSING_OPTIONAL_PREFIX, + 'Optional parameter name %s must be prefixed ' + 'with opt_.' % flag.name, + token) + elif (not flag.jstype.opt_arg and + flag.name.startswith('opt_')): + self._HandleError(errors.JSDOC_MISSING_OPTIONAL_TYPE, + 'Optional parameter %s type must end with =.' % + flag.name, + token) + + if flag.flag_type in state.GetDocFlag().HAS_TYPE: + # Check for both missing type token and empty type braces '{}' + # Missing suppress types are reported separately and we allow enums, + # const, private, public and protected without types. + if (flag.flag_type not in state.GetDocFlag().CAN_OMIT_TYPE + and (not flag.jstype or flag.jstype.IsEmpty())): + self._HandleError(errors.MISSING_JSDOC_TAG_TYPE, + 'Missing type in %s tag' % token.string, token) + + elif flag.name_token and flag.type_end_token and tokenutil.Compare( + flag.type_end_token, flag.name_token) > 0: + self._HandleError( + errors.OUT_OF_ORDER_JSDOC_TAG_TYPE, + 'Type should be immediately after %s tag' % token.string, + token) + + elif token.type == Type.DOUBLE_QUOTE_STRING_START: + next_token = token.next + while next_token.type == Type.STRING_TEXT: + if javascripttokenizer.JavaScriptTokenizer.SINGLE_QUOTE.search( + next_token.string): + break + next_token = next_token.next + else: + self._HandleError( + errors.UNNECESSARY_DOUBLE_QUOTED_STRING, + 'Single-quoted string preferred over double-quoted string.', + token, + position=Position.All(token.string)) + + elif token.type == Type.END_DOC_COMMENT: + doc_comment = state.GetDocComment() + + # When @externs appears in a @fileoverview comment, it should trigger + # the same limited doc checks as a special filename like externs.js. + if doc_comment.HasFlag('fileoverview') and doc_comment.HasFlag('externs'): + self._SetLimitedDocChecks(True) + + if (error_check.ShouldCheck(Rule.BLANK_LINES_AT_TOP_LEVEL) and + not self._is_html and + state.InTopLevel() and + not state.InNonScopeBlock()): + + # Check if we're in a fileoverview or constructor JsDoc. + is_constructor = ( + doc_comment.HasFlag('constructor') or + doc_comment.HasFlag('interface')) + # @fileoverview is an optional tag so if the dosctring is the first + # token in the file treat it as a file level docstring. + is_file_level_comment = ( + doc_comment.HasFlag('fileoverview') or + not doc_comment.start_token.previous) + + # If the comment is not a file overview, and it does not immediately + # precede some code, skip it. + # NOTE: The tokenutil methods are not used here because of their + # behavior at the top of a file. + next_token = token.next + if (not next_token or + (not is_file_level_comment and + next_token.type in Type.NON_CODE_TYPES)): + return + + # Don't require extra blank lines around suppression of extra + # goog.require errors. + if (doc_comment.SuppressionOnly() and + next_token.type == Type.IDENTIFIER and + next_token.string in ['goog.provide', 'goog.require']): + return + + # Find the start of this block (include comments above the block, unless + # this is a file overview). + block_start = doc_comment.start_token + if not is_file_level_comment: + token = block_start.previous + while token and token.type in Type.COMMENT_TYPES: + block_start = token + token = token.previous + + # Count the number of blank lines before this block. + blank_lines = 0 + token = block_start.previous + while token and token.type in [Type.WHITESPACE, Type.BLANK_LINE]: + if token.type == Type.BLANK_LINE: + # A blank line. + blank_lines += 1 + elif token.type == Type.WHITESPACE and not token.line.strip(): + # A line with only whitespace on it. + blank_lines += 1 + token = token.previous + + # Log errors. + error_message = False + expected_blank_lines = 0 + + # Only need blank line before file overview if it is not the beginning + # of the file, e.g. copyright is first. + if is_file_level_comment and blank_lines == 0 and block_start.previous: + error_message = 'Should have a blank line before a file overview.' + expected_blank_lines = 1 + elif is_constructor and blank_lines != 3: + error_message = ( + 'Should have 3 blank lines before a constructor/interface.') + expected_blank_lines = 3 + elif (not is_file_level_comment and not is_constructor and + blank_lines != 2): + error_message = 'Should have 2 blank lines between top-level blocks.' + expected_blank_lines = 2 + + if error_message: + self._HandleError( + errors.WRONG_BLANK_LINE_COUNT, error_message, + block_start, position=Position.AtBeginning(), + fix_data=expected_blank_lines - blank_lines) + + elif token.type == Type.END_BLOCK: + if state.InFunction() and state.IsFunctionClose(): + is_immediately_called = (token.next and + token.next.type == Type.START_PAREN) + + function = state.GetFunction() + if not self._limited_doc_checks: + if (function.has_return and function.doc and + not is_immediately_called and + not function.doc.HasFlag('return') and + not function.doc.InheritsDocumentation() and + not function.doc.HasFlag('constructor')): + # Check for proper documentation of return value. + self._HandleError( + errors.MISSING_RETURN_DOCUMENTATION, + 'Missing @return JsDoc in function with non-trivial return', + function.doc.end_token, position=Position.AtBeginning()) + elif (not function.has_return and + not function.has_throw and + function.doc and + function.doc.HasFlag('return') and + not state.InInterfaceMethod()): + flag = function.doc.GetFlag('return') + valid_no_return_names = ['undefined', 'void', '*'] + invalid_return = flag.jstype is None or not any( + sub_type.identifier in valid_no_return_names + for sub_type in flag.jstype.IterTypeGroup()) + + if invalid_return: + self._HandleError( + errors.UNNECESSARY_RETURN_DOCUMENTATION, + 'Found @return JsDoc on function that returns nothing', + flag.flag_token, position=Position.AtBeginning()) + + # b/4073735. Method in object literal definition of prototype can + # safely reference 'this'. + prototype_object_literal = False + block_start = None + previous_code = None + previous_previous_code = None + + # Search for cases where prototype is defined as object literal. + # previous_previous_code + # | previous_code + # | | block_start + # | | | + # a.b.prototype = { + # c : function() { + # this.d = 1; + # } + # } + + # If in object literal, find first token of block so to find previous + # tokens to check above condition. + if state.InObjectLiteral(): + block_start = state.GetCurrentBlockStart() + + # If an object literal then get previous token (code type). For above + # case it should be '='. + if block_start: + previous_code = tokenutil.SearchExcept(block_start, + Type.NON_CODE_TYPES, + reverse=True) + + # If previous token to block is '=' then get its previous token. + if previous_code and previous_code.IsOperator('='): + previous_previous_code = tokenutil.SearchExcept(previous_code, + Type.NON_CODE_TYPES, + reverse=True) + + # If variable/token before '=' ends with '.prototype' then its above + # case of prototype defined with object literal. + prototype_object_literal = (previous_previous_code and + previous_previous_code.string.endswith( + '.prototype')) + + if (function.has_this and function.doc and + not function.doc.HasFlag('this') and + not function.is_constructor and + not function.is_interface and + '.prototype.' not in function.name and + not prototype_object_literal): + self._HandleError( + errors.MISSING_JSDOC_TAG_THIS, + 'Missing @this JsDoc in function referencing "this". (' + 'this usually means you are trying to reference "this" in ' + 'a static function, or you have forgotten to mark a ' + 'constructor with @constructor)', + function.doc.end_token, position=Position.AtBeginning()) + + elif token.type == Type.IDENTIFIER: + if token.string == 'goog.inherits' and not state.InFunction(): + if state.GetLastNonSpaceToken().line_number == token.line_number: + self._HandleError( + errors.MISSING_LINE, + 'Missing newline between constructor and goog.inherits', + token, + position=Position.AtBeginning()) + + extra_space = state.GetLastNonSpaceToken().next + while extra_space != token: + if extra_space.type == Type.BLANK_LINE: + self._HandleError( + errors.EXTRA_LINE, + 'Extra line between constructor and goog.inherits', + extra_space) + extra_space = extra_space.next + + # TODO(robbyw): Test the last function was a constructor. + # TODO(robbyw): Test correct @extends and @implements documentation. + + elif (token.string == 'goog.provide' and + not state.InFunction() and + namespaces_info is not None): + namespace = tokenutil.GetStringAfterToken(token) + + # Report extra goog.provide statement. + if not namespace or namespaces_info.IsExtraProvide(token): + if not namespace: + msg = 'Empty namespace in goog.provide' + else: + msg = 'Unnecessary goog.provide: ' + namespace + + # Hint to user if this is a Test namespace. + if namespace.endswith('Test'): + msg += (' *Test namespaces must be mentioned in the ' + 'goog.setTestOnly() call') + + self._HandleError( + errors.EXTRA_GOOG_PROVIDE, + msg, + token, position=Position.AtBeginning()) + + if namespaces_info.IsLastProvide(token): + # Report missing provide statements after the last existing provide. + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, + tokenutil.GetLastTokenInSameLine(token).next, + False) + + # If there are no require statements, missing requires should be + # reported after the last provide. + if not namespaces_info.GetRequiredNamespaces(): + missing_requires, illegal_alias_statements = ( + namespaces_info.GetMissingRequires()) + if missing_requires: + self._ReportMissingRequires( + missing_requires, + tokenutil.GetLastTokenInSameLine(token).next, + True) + if illegal_alias_statements: + self._ReportIllegalAliasStatement(illegal_alias_statements) + + elif (token.string == 'goog.require' and + not state.InFunction() and + namespaces_info is not None): + namespace = tokenutil.GetStringAfterToken(token) + + # If there are no provide statements, missing provides should be + # reported before the first require. + if (namespaces_info.IsFirstRequire(token) and + not namespaces_info.GetProvidedNamespaces()): + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, + tokenutil.GetFirstTokenInSameLine(token), + True) + + # Report extra goog.require statement. + if not namespace or namespaces_info.IsExtraRequire(token): + if not namespace: + msg = 'Empty namespace in goog.require' + else: + msg = 'Unnecessary goog.require: ' + namespace + + self._HandleError( + errors.EXTRA_GOOG_REQUIRE, + msg, + token, position=Position.AtBeginning()) + + # Report missing goog.require statements. + if namespaces_info.IsLastRequire(token): + missing_requires, illegal_alias_statements = ( + namespaces_info.GetMissingRequires()) + if missing_requires: + self._ReportMissingRequires( + missing_requires, + tokenutil.GetLastTokenInSameLine(token).next, + False) + if illegal_alias_statements: + self._ReportIllegalAliasStatement(illegal_alias_statements) + + elif token.type == Type.OPERATOR: + last_in_line = token.IsLastInLine() + # If the token is unary and appears to be used in a unary context + # it's ok. Otherwise, if it's at the end of the line or immediately + # before a comment, it's ok. + # Don't report an error before a start bracket - it will be reported + # by that token's space checks. + if (not token.metadata.IsUnaryOperator() and not last_in_line + and not token.next.IsComment() + and not token.next.IsOperator(',') + and not tokenutil.IsDot(token) + and token.next.type not in (Type.WHITESPACE, Type.END_PAREN, + Type.END_BRACKET, Type.SEMICOLON, + Type.START_BRACKET)): + self._HandleError( + errors.MISSING_SPACE, + 'Missing space after "%s"' % token.string, + token, + position=Position.AtEnd(token.string)) + elif token.type == Type.WHITESPACE: + first_in_line = token.IsFirstInLine() + last_in_line = token.IsLastInLine() + # Check whitespace length if it's not the first token of the line and + # if it's not immediately before a comment. + if not last_in_line and not first_in_line and not token.next.IsComment(): + # Ensure there is no space after opening parentheses. + if (token.previous.type in (Type.START_PAREN, Type.START_BRACKET, + Type.FUNCTION_NAME) + or token.next.type == Type.START_PARAMETERS): + self._HandleError( + errors.EXTRA_SPACE, + 'Extra space after "%s"' % token.previous.string, + token, + position=Position.All(token.string)) + elif token.type == Type.SEMICOLON: + previous_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, + reverse=True) + if not previous_token: + self._HandleError( + errors.REDUNDANT_SEMICOLON, + 'Semicolon without any statement', + token, + position=Position.AtEnd(token.string)) + elif (previous_token.type == Type.KEYWORD and + previous_token.string not in ['break', 'continue', 'return']): + self._HandleError( + errors.REDUNDANT_SEMICOLON, + ('Semicolon after \'%s\' without any statement.' + ' Looks like an error.' % previous_token.string), + token, + position=Position.AtEnd(token.string)) + + def _CheckUnusedLocalVariables(self, token, state): + """Checks for unused local variables in function blocks. + + Args: + token: The token to check. + state: The state tracker. + """ + # We don't use state.InFunction because that disregards scope functions. + in_function = state.FunctionDepth() > 0 + if token.type == Type.SIMPLE_LVALUE or token.type == Type.IDENTIFIER: + if in_function: + identifier = token.string + # Check whether the previous token was var. + previous_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES, + reverse=True) + if previous_code_token and previous_code_token.IsKeyword('var'): + # Add local variable declaration to the top of the unused locals + # stack. + self._unused_local_variables_by_scope[-1][identifier] = token + elif token.type == Type.IDENTIFIER: + # This covers most cases where the variable is used as an identifier. + self._MarkLocalVariableUsed(token.string) + elif token.type == Type.SIMPLE_LVALUE and '.' in identifier: + # This covers cases where a value is assigned to a property of the + # variable. + self._MarkLocalVariableUsed(token.string) + elif token.type == Type.START_BLOCK: + if in_function and state.IsFunctionOpen(): + # Push a new map onto the stack + self._unused_local_variables_by_scope.append({}) + elif token.type == Type.END_BLOCK: + if state.IsFunctionClose(): + # Pop the stack and report any remaining locals as unused. + unused_local_variables = self._unused_local_variables_by_scope.pop() + for unused_token in unused_local_variables.values(): + self._HandleError( + errors.UNUSED_LOCAL_VARIABLE, + 'Unused local variable: %s.' % unused_token.string, + unused_token) + elif token.type == Type.DOC_FLAG: + # Flags that use aliased symbols should be counted. + flag = token.attached_object + js_type = flag and flag.jstype + if flag and flag.flag_type in state.GetDocFlag().HAS_TYPE and js_type: + self._MarkAliasUsed(js_type) + + def _MarkAliasUsed(self, js_type): + """Marks aliases in a type as used. + + Recursively iterates over all subtypes in a jsdoc type annotation and + tracks usage of aliased symbols (which may be local variables). + Marks the local variable as used in the scope nearest to the current + scope that matches the given token. + + Args: + js_type: The jsdoc type, a typeannotation.TypeAnnotation object. + """ + if js_type.alias: + self._MarkLocalVariableUsed(js_type.identifier) + for sub_type in js_type.IterTypes(): + self._MarkAliasUsed(sub_type) + + def _MarkLocalVariableUsed(self, identifier): + """Marks the local variable as used in the relevant scope. + + Marks the local variable in the scope nearest to the current scope that + matches the given identifier as used. + + Args: + identifier: The identifier representing the potential usage of a local + variable. + """ + identifier = identifier.split('.', 1)[0] + # Find the first instance of the identifier in the stack of function scopes + # and mark it used. + for unused_local_variables in reversed( + self._unused_local_variables_by_scope): + if identifier in unused_local_variables: + del unused_local_variables[identifier] + break + + def _ReportMissingProvides(self, missing_provides, token, need_blank_line): + """Reports missing provide statements to the error handler. + + Args: + missing_provides: A dictionary of string(key) and integer(value) where + each string(key) is a namespace that should be provided, but is not + and integer(value) is first line number where it's required. + token: The token where the error was detected (also where the new provides + will be inserted. + need_blank_line: Whether a blank line needs to be inserted after the new + provides are inserted. May be True, False, or None, where None + indicates that the insert location is unknown. + """ + + missing_provides_msg = 'Missing the following goog.provide statements:\n' + missing_provides_msg += '\n'.join(['goog.provide(\'%s\');' % x for x in + sorted(missing_provides)]) + missing_provides_msg += '\n' + + missing_provides_msg += '\nFirst line where provided: \n' + missing_provides_msg += '\n'.join( + [' %s : line %d' % (x, missing_provides[x]) for x in + sorted(missing_provides)]) + missing_provides_msg += '\n' + + self._HandleError( + errors.MISSING_GOOG_PROVIDE, + missing_provides_msg, + token, position=Position.AtBeginning(), + fix_data=(missing_provides.keys(), need_blank_line)) + + def _ReportMissingRequires(self, missing_requires, token, need_blank_line): + """Reports missing require statements to the error handler. + + Args: + missing_requires: A dictionary of string(key) and integer(value) where + each string(key) is a namespace that should be required, but is not + and integer(value) is first line number where it's required. + token: The token where the error was detected (also where the new requires + will be inserted. + need_blank_line: Whether a blank line needs to be inserted before the new + requires are inserted. May be True, False, or None, where None + indicates that the insert location is unknown. + """ + + missing_requires_msg = 'Missing the following goog.require statements:\n' + missing_requires_msg += '\n'.join(['goog.require(\'%s\');' % x for x in + sorted(missing_requires)]) + missing_requires_msg += '\n' + + missing_requires_msg += '\nFirst line where required: \n' + missing_requires_msg += '\n'.join( + [' %s : line %d' % (x, missing_requires[x]) for x in + sorted(missing_requires)]) + missing_requires_msg += '\n' + + self._HandleError( + errors.MISSING_GOOG_REQUIRE, + missing_requires_msg, + token, position=Position.AtBeginning(), + fix_data=(missing_requires.keys(), need_blank_line)) + + def _ReportIllegalAliasStatement(self, illegal_alias_statements): + """Reports alias statements that would need a goog.require.""" + for namespace, token in illegal_alias_statements.iteritems(): + self._HandleError( + errors.ALIAS_STMT_NEEDS_GOOG_REQUIRE, + 'The alias definition would need the namespace \'%s\' which is not ' + 'required through any other symbol.' % namespace, + token, position=Position.AtBeginning()) + + def Finalize(self, state): + """Perform all checks that need to occur after all lines are processed.""" + # Call the base class's Finalize function. + super(JavaScriptLintRules, self).Finalize(state) + + if error_check.ShouldCheck(Rule.UNUSED_PRIVATE_MEMBERS): + # Report an error for any declared private member that was never used. + unused_private_members = (self._declared_private_members - + self._used_private_members) + + for variable in unused_private_members: + token = self._declared_private_member_tokens[variable] + self._HandleError(errors.UNUSED_PRIVATE_MEMBER, + 'Unused private member: %s.' % token.string, + token) + + # Clear state to prepare for the next file. + self._declared_private_member_tokens = {} + self._declared_private_members = set() + self._used_private_members = set() + + namespaces_info = self._namespaces_info + if namespaces_info is not None: + # If there are no provide or require statements, missing provides and + # requires should be reported on line 1. + if (not namespaces_info.GetProvidedNamespaces() and + not namespaces_info.GetRequiredNamespaces()): + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, state.GetFirstToken(), None) + + missing_requires, illegal_alias = namespaces_info.GetMissingRequires() + if missing_requires: + self._ReportMissingRequires( + missing_requires, state.GetFirstToken(), None) + if illegal_alias: + self._ReportIllegalAliasStatement(illegal_alias) + + self._CheckSortedRequiresProvides(state.GetFirstToken()) + + def _CheckSortedRequiresProvides(self, token): + """Checks that all goog.require and goog.provide statements are sorted. + + Note that this method needs to be run after missing statements are added to + preserve alphabetical order. + + Args: + token: The first token in the token stream. + """ + sorter = requireprovidesorter.RequireProvideSorter() + first_provide_token = sorter.CheckProvides(token) + if first_provide_token: + new_order = sorter.GetFixedProvideString(first_provide_token) + self._HandleError( + errors.GOOG_PROVIDES_NOT_ALPHABETIZED, + 'goog.provide classes must be alphabetized. The correct code is:\n' + + new_order, + first_provide_token, + position=Position.AtBeginning(), + fix_data=first_provide_token) + + first_require_token = sorter.CheckRequires(token) + if first_require_token: + new_order = sorter.GetFixedRequireString(first_require_token) + self._HandleError( + errors.GOOG_REQUIRES_NOT_ALPHABETIZED, + 'goog.require classes must be alphabetized. The correct code is:\n' + + new_order, + first_require_token, + position=Position.AtBeginning(), + fix_data=first_require_token) + + def GetLongLineExceptions(self): + """Gets a list of regexps for lines which can be longer than the limit. + + Returns: + A list of regexps, used as matches (rather than searches). + """ + return [ + re.compile(r'(var .+\s*=\s*)?goog\.require\(.+\);?\s*$'), + re.compile(r'goog\.(provide|module|setTestOnly)\(.+\);?\s*$'), + re.compile(r'[\s/*]*@visibility\s*{.*}[\s*/]*$'), + ] diff --git a/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker.py b/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker.py new file mode 100644 index 00000000000000..e0a42f66a84aae --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Parser for JavaScript files.""" + + + +from closure_linter import javascripttokens +from closure_linter import statetracker +from closure_linter import tokenutil + +# Shorthand +Type = javascripttokens.JavaScriptTokenType + + +class JsDocFlag(statetracker.DocFlag): + """Javascript doc flag object. + + Attribute: + flag_type: param, return, define, type, etc. + flag_token: The flag token. + type_start_token: The first token specifying the flag JS type, + including braces. + type_end_token: The last token specifying the flag JS type, + including braces. + type: The type spec string. + jstype: The type spec, a TypeAnnotation instance. + name_token: The token specifying the flag name. + name: The flag name + description_start_token: The first token in the description. + description_end_token: The end token in the description. + description: The description. + """ + + # Please keep these lists alphabetized. + + # Some projects use the following extensions to JsDoc. + # TODO(robbyw): determine which of these, if any, should be illegal. + EXTENDED_DOC = frozenset([ + 'class', 'code', 'desc', 'final', 'hidden', 'inheritDoc', 'link', + 'meaning', 'provideGoog', 'throws']) + + LEGAL_DOC = EXTENDED_DOC | statetracker.DocFlag.LEGAL_DOC + + +class JavaScriptStateTracker(statetracker.StateTracker): + """JavaScript state tracker. + + Inherits from the core EcmaScript StateTracker adding extra state tracking + functionality needed for JavaScript. + """ + + def __init__(self): + """Initializes a JavaScript token stream state tracker.""" + statetracker.StateTracker.__init__(self, JsDocFlag) + + def Reset(self): + self._scope_depth = 0 + self._block_stack = [] + super(JavaScriptStateTracker, self).Reset() + + def InTopLevel(self): + """Compute whether we are at the top level in the class. + + This function call is language specific. In some languages like + JavaScript, a function is top level if it is not inside any parenthesis. + In languages such as ActionScript, a function is top level if it is directly + within a class. + + Returns: + Whether we are at the top level in the class. + """ + return self._scope_depth == self.ParenthesesDepth() + + def InFunction(self): + """Returns true if the current token is within a function. + + This js-specific override ignores goog.scope functions. + + Returns: + True if the current token is within a function. + """ + return self._scope_depth != self.FunctionDepth() + + def InNonScopeBlock(self): + """Compute whether we are nested within a non-goog.scope block. + + Returns: + True if the token is not enclosed in a block that does not originate from + a goog.scope statement. False otherwise. + """ + return self._scope_depth != self.BlockDepth() + + def GetBlockType(self, token): + """Determine the block type given a START_BLOCK token. + + Code blocks come after parameters, keywords like else, and closing parens. + + Args: + token: The current token. Can be assumed to be type START_BLOCK + Returns: + Code block type for current token. + """ + last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, reverse=True) + if last_code.type in (Type.END_PARAMETERS, Type.END_PAREN, + Type.KEYWORD) and not last_code.IsKeyword('return'): + return self.CODE + else: + return self.OBJECT_LITERAL + + def GetCurrentBlockStart(self): + """Gets the start token of current block. + + Returns: + Starting token of current block. None if not in block. + """ + if self._block_stack: + return self._block_stack[-1] + else: + return None + + def HandleToken(self, token, last_non_space_token): + """Handles the given token and updates state. + + Args: + token: The token to handle. + last_non_space_token: The last non space token encountered + """ + if token.type == Type.START_BLOCK: + self._block_stack.append(token) + if token.type == Type.IDENTIFIER and token.string == 'goog.scope': + self._scope_depth += 1 + if token.type == Type.END_BLOCK: + start_token = self._block_stack.pop() + if tokenutil.GoogScopeOrNoneFromStartBlock(start_token): + self._scope_depth -= 1 + super(JavaScriptStateTracker, self).HandleToken(token, + last_non_space_token) diff --git a/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker_test.py b/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker_test.py new file mode 100644 index 00000000000000..76dabd2c70d58a --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/javascriptstatetracker_test.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the javascriptstatetracker module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + + +import unittest as googletest + +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + + +_FUNCTION_SCRIPT = """\ +var a = 3; + +function foo(aaa, bbb, ccc) { + var b = 4; +} + + +/** + * JSDoc comment. + */ +var bar = function(ddd, eee, fff) { + +}; + + +/** + * Verify that nested functions get their proper parameters recorded. + */ +var baz = function(ggg, hhh, iii) { + var qux = function(jjj, kkk, lll) { + }; + // make sure that entering a new block does not change baz' parameters. + {}; +}; + +""" + + +class FunctionTest(googletest.TestCase): + + def testFunctionParse(self): + functions, _ = testutil.ParseFunctionsAndComments(_FUNCTION_SCRIPT) + self.assertEquals(4, len(functions)) + + # First function + function = functions[0] + self.assertEquals(['aaa', 'bbb', 'ccc'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(3, start_token.line_number) + self.assertEquals(0, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(5, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('foo', function.name) + + self.assertIsNone(function.doc) + + # Second function + function = functions[1] + self.assertEquals(['ddd', 'eee', 'fff'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(11, start_token.line_number) + self.assertEquals(10, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(13, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('bar', function.name) + + self.assertIsNotNone(function.doc) + + # Check function JSDoc + doc = function.doc + doc_tokens = tokenutil.GetTokenRange(doc.start_token, doc.end_token) + + comment_type = javascripttokens.JavaScriptTokenType.COMMENT + comment_tokens = filter(lambda t: t.type is comment_type, doc_tokens) + + self.assertEquals('JSDoc comment.', + tokenutil.TokensToString(comment_tokens).strip()) + + # Third function + function = functions[2] + self.assertEquals(['ggg', 'hhh', 'iii'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(19, start_token.line_number) + self.assertEquals(10, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(24, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('baz', function.name) + self.assertIsNotNone(function.doc) + + # Fourth function (inside third function) + function = functions[3] + self.assertEquals(['jjj', 'kkk', 'lll'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(20, start_token.line_number) + self.assertEquals(12, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(21, end_token.line_number) + self.assertEquals(2, end_token.start_index) + + self.assertEquals('qux', function.name) + self.assertIsNone(function.doc) + + + +class CommentTest(googletest.TestCase): + + def testGetDescription(self): + comment = self._ParseComment(""" + /** + * Comment targeting goog.foo. + * + * This is the second line. + * @param {number} foo The count of foo. + */ + target;""") + + self.assertEqual( + 'Comment targeting goog.foo.\n\nThis is the second line.', + comment.description) + + def testCommentGetTarget(self): + self.assertCommentTarget('goog.foo', """ + /** + * Comment targeting goog.foo. + */ + goog.foo = 6; + """) + + self.assertCommentTarget('bar', """ + /** + * Comment targeting bar. + */ + var bar = "Karate!"; + """) + + self.assertCommentTarget('doThing', """ + /** + * Comment targeting doThing. + */ + function doThing() {}; + """) + + self.assertCommentTarget('this.targetProperty', """ + goog.bar.Baz = function() { + /** + * Comment targeting targetProperty. + */ + this.targetProperty = 3; + }; + """) + + self.assertCommentTarget('goog.bar.prop', """ + /** + * Comment targeting goog.bar.prop. + */ + goog.bar.prop; + """) + + self.assertCommentTarget('goog.aaa.bbb', """ + /** + * Comment targeting goog.aaa.bbb. + */ + (goog.aaa.bbb) + """) + + self.assertCommentTarget('theTarget', """ + /** + * Comment targeting symbol preceded by newlines, whitespace, + * and parens -- things we ignore. + */ + (theTarget) + """) + + self.assertCommentTarget(None, """ + /** + * @fileoverview File overview. + */ + (notATarget) + """) + + self.assertCommentTarget(None, """ + /** + * Comment that doesn't find a target. + */ + """) + + self.assertCommentTarget('theTarget.is.split.across.lines', """ + /** + * Comment that addresses a symbol split across lines. + */ + (theTarget.is.split + .across.lines) + """) + + self.assertCommentTarget('theTarget.is.split.across.lines', """ + /** + * Comment that addresses a symbol split across lines. + */ + (theTarget.is.split. + across.lines) + """) + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + _, comments = testutil.ParseFunctionsAndComments(script) + self.assertEquals(1, len(comments)) + return comments[0] + + def assertCommentTarget(self, target, script): + comment = self._ParseComment(script) + self.assertEquals(target, comment.GetTargetIdentifier()) + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/javascripttokenizer.py b/tools/closure_linter/build/lib/closure_linter/javascripttokenizer.py new file mode 100644 index 00000000000000..2ee5b81ee13c65 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/javascripttokenizer.py @@ -0,0 +1,463 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Regular expression based JavaScript parsing classes.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import copy +import re + +from closure_linter import javascripttokens +from closure_linter.common import matcher +from closure_linter.common import tokenizer + +# Shorthand +Type = javascripttokens.JavaScriptTokenType +Matcher = matcher.Matcher + + +class JavaScriptModes(object): + """Enumeration of the different matcher modes used for JavaScript.""" + TEXT_MODE = 'text' + SINGLE_QUOTE_STRING_MODE = 'single_quote_string' + DOUBLE_QUOTE_STRING_MODE = 'double_quote_string' + BLOCK_COMMENT_MODE = 'block_comment' + DOC_COMMENT_MODE = 'doc_comment' + DOC_COMMENT_LEX_SPACES_MODE = 'doc_comment_spaces' + LINE_COMMENT_MODE = 'line_comment' + PARAMETER_MODE = 'parameter' + FUNCTION_MODE = 'function' + + +class JavaScriptTokenizer(tokenizer.Tokenizer): + """JavaScript tokenizer. + + Convert JavaScript code in to an array of tokens. + """ + + # Useful patterns for JavaScript parsing. + IDENTIFIER_CHAR = r'A-Za-z0-9_$' + + # Number patterns based on: + # http://www.mozilla.org/js/language/js20-2000-07/formal/lexer-grammar.html + MANTISSA = r""" + (\d+(?!\.)) | # Matches '10' + (\d+\.(?!\d)) | # Matches '10.' + (\d*\.\d+) # Matches '.5' or '10.5' + """ + DECIMAL_LITERAL = r'(%s)([eE][-+]?\d+)?' % MANTISSA + HEX_LITERAL = r'0[xX][0-9a-fA-F]+' + NUMBER = re.compile(r""" + ((%s)|(%s)) + """ % (HEX_LITERAL, DECIMAL_LITERAL), re.VERBOSE) + + # Strings come in three parts - first we match the start of the string, then + # the contents, then the end. The contents consist of any character except a + # backslash or end of string, or a backslash followed by any character, or a + # backslash followed by end of line to support correct parsing of multi-line + # strings. + SINGLE_QUOTE = re.compile(r"'") + SINGLE_QUOTE_TEXT = re.compile(r"([^'\\]|\\(.|$))+") + DOUBLE_QUOTE = re.compile(r'"') + DOUBLE_QUOTE_TEXT = re.compile(r'([^"\\]|\\(.|$))+') + + START_SINGLE_LINE_COMMENT = re.compile(r'//') + END_OF_LINE_SINGLE_LINE_COMMENT = re.compile(r'//$') + + START_DOC_COMMENT = re.compile(r'/\*\*') + START_BLOCK_COMMENT = re.compile(r'/\*') + END_BLOCK_COMMENT = re.compile(r'\*/') + BLOCK_COMMENT_TEXT = re.compile(r'([^*]|\*(?!/))+') + + # Comment text is anything that we are not going to parse into another special + # token like (inline) flags or end comments. Complicated regex to match + # most normal characters, and '*', '{', '}', and '@' when we are sure that + # it is safe. Expression [^*{\s]@ must come first, or the other options will + # match everything before @, and we won't match @'s that aren't part of flags + # like in email addresses in the @author tag. + DOC_COMMENT_TEXT = re.compile(r'([^*{}\s]@|[^*{}@]|\*(?!/))+') + DOC_COMMENT_NO_SPACES_TEXT = re.compile(r'([^*{}\s]@|[^*{}@\s]|\*(?!/))+') + # Match anything that is allowed in a type definition, except for tokens + # needed to parse it (and the lookahead assertion for "*/"). + DOC_COMMENT_TYPE_TEXT = re.compile(r'([^*|!?=<>(){}:,\s]|\*(?!/))+') + + # Match the prefix ' * ' that starts every line of jsdoc. Want to include + # spaces after the '*', but nothing else that occurs after a '*', and don't + # want to match the '*' in '*/'. + DOC_PREFIX = re.compile(r'\s*\*(\s+|(?!/))') + + START_BLOCK = re.compile('{') + END_BLOCK = re.compile('}') + + REGEX_CHARACTER_CLASS = r""" + \[ # Opening bracket + ([^\]\\]|\\.)* # Anything but a ] or \, + # or a backslash followed by anything + \] # Closing bracket + """ + # We ensure the regex is followed by one of the above tokens to avoid + # incorrectly parsing something like x / y / z as x REGEX(/ y /) z + POST_REGEX_LIST = [ + ';', ',', r'\.', r'\)', r'\]', '$', r'\/\/', r'\/\*', ':', '}'] + + REGEX = re.compile(r""" + / # opening slash + (?!\*) # not the start of a comment + (\\.|[^\[\/\\]|(%s))* # a backslash followed by anything, + # or anything but a / or [ or \, + # or a character class + / # closing slash + [gimsx]* # optional modifiers + (?=\s*(%s)) + """ % (REGEX_CHARACTER_CLASS, '|'.join(POST_REGEX_LIST)), + re.VERBOSE) + + ANYTHING = re.compile(r'.*') + PARAMETERS = re.compile(r'[^\)]+') + CLOSING_PAREN_WITH_SPACE = re.compile(r'\)\s*') + + FUNCTION_DECLARATION = re.compile(r'\bfunction\b') + + OPENING_PAREN = re.compile(r'\(') + CLOSING_PAREN = re.compile(r'\)') + + OPENING_BRACKET = re.compile(r'\[') + CLOSING_BRACKET = re.compile(r'\]') + + # We omit these JS keywords from the list: + # function - covered by FUNCTION_DECLARATION. + # delete, in, instanceof, new, typeof - included as operators. + # this - included in identifiers. + # null, undefined - not included, should go in some "special constant" list. + KEYWORD_LIST = [ + 'break', + 'case', + 'catch', + 'continue', + 'default', + 'do', + 'else', + 'finally', + 'for', + 'if', + 'return', + 'switch', + 'throw', + 'try', + 'var', + 'while', + 'with', + ] + + # List of regular expressions to match as operators. Some notes: for our + # purposes, the comma behaves similarly enough to a normal operator that we + # include it here. r'\bin\b' actually matches 'in' surrounded by boundary + # characters - this may not match some very esoteric uses of the in operator. + # Operators that are subsets of larger operators must come later in this list + # for proper matching, e.g., '>>' must come AFTER '>>>'. + OPERATOR_LIST = [ + ',', + r'\+\+', + '===', + '!==', + '>>>=', + '>>>', + '==', + '>=', + '<=', + '!=', + '<<=', + '>>=', + '<<', + '>>', + '=>', + '>', + '<', + r'\+=', + r'\+', + '--', + r'\^=', + '-=', + '-', + '/=', + '/', + r'\*=', + r'\*', + '%=', + '%', + '&&', + r'\|\|', + '&=', + '&', + r'\|=', + r'\|', + '=', + '!', + ':', + r'\?', + r'\^', + r'\bdelete\b', + r'\bin\b', + r'\binstanceof\b', + r'\bnew\b', + r'\btypeof\b', + r'\bvoid\b', + r'\.', + ] + OPERATOR = re.compile('|'.join(OPERATOR_LIST)) + + WHITESPACE = re.compile(r'\s+') + SEMICOLON = re.compile(r';') + # Technically JavaScript identifiers can't contain '.', but we treat a set of + # nested identifiers as a single identifier, except for trailing dots. + NESTED_IDENTIFIER = r'[a-zA-Z_$]([%s]|\.[a-zA-Z_$])*' % IDENTIFIER_CHAR + IDENTIFIER = re.compile(NESTED_IDENTIFIER) + + SIMPLE_LVALUE = re.compile(r""" + (?P%s) # a valid identifier + (?=\s* # optional whitespace + \= # look ahead to equal sign + (?!=)) # not follwed by equal + """ % NESTED_IDENTIFIER, re.VERBOSE) + + # A doc flag is a @ sign followed by non-space characters that appears at the + # beginning of the line, after whitespace, or after a '{'. The look-behind + # check is necessary to not match someone@google.com as a flag. + DOC_FLAG = re.compile(r'(^|(?<=\s))@(?P[a-zA-Z]+)') + # To properly parse parameter names and complex doctypes containing + # whitespace, we need to tokenize whitespace into a token after certain + # doctags. All statetracker.HAS_TYPE that are not listed here must not contain + # any whitespace in their types. + DOC_FLAG_LEX_SPACES = re.compile( + r'(^|(?<=\s))@(?P%s)\b' % + '|'.join([ + 'const', + 'enum', + 'extends', + 'final', + 'implements', + 'param', + 'private', + 'protected', + 'public', + 'return', + 'type', + 'typedef' + ])) + + DOC_INLINE_FLAG = re.compile(r'(?<={)@(?P[a-zA-Z]+)') + + DOC_TYPE_BLOCK_START = re.compile(r'[<(]') + DOC_TYPE_BLOCK_END = re.compile(r'[>)]') + DOC_TYPE_MODIFIERS = re.compile(r'[!?|,:=]') + + # Star followed by non-slash, i.e a star that does not end a comment. + # This is used for TYPE_GROUP below. + SAFE_STAR = r'(\*(?!/))' + + COMMON_DOC_MATCHERS = [ + # Find the end of the comment. + Matcher(END_BLOCK_COMMENT, Type.END_DOC_COMMENT, + JavaScriptModes.TEXT_MODE), + + # Tokenize documented flags like @private. + Matcher(DOC_INLINE_FLAG, Type.DOC_INLINE_FLAG), + Matcher(DOC_FLAG_LEX_SPACES, Type.DOC_FLAG, + JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE), + + # Encountering a doc flag should leave lex spaces mode. + Matcher(DOC_FLAG, Type.DOC_FLAG, JavaScriptModes.DOC_COMMENT_MODE), + + # Tokenize braces so we can find types. + Matcher(START_BLOCK, Type.DOC_START_BRACE), + Matcher(END_BLOCK, Type.DOC_END_BRACE), + + # And some more to parse types. + Matcher(DOC_TYPE_BLOCK_START, Type.DOC_TYPE_START_BLOCK), + Matcher(DOC_TYPE_BLOCK_END, Type.DOC_TYPE_END_BLOCK), + + Matcher(DOC_TYPE_MODIFIERS, Type.DOC_TYPE_MODIFIER), + Matcher(DOC_COMMENT_TYPE_TEXT, Type.COMMENT), + + Matcher(DOC_PREFIX, Type.DOC_PREFIX, None, True)] + + # When text is not matched, it is given this default type based on mode. + # If unspecified in this map, the default default is Type.NORMAL. + JAVASCRIPT_DEFAULT_TYPES = { + JavaScriptModes.DOC_COMMENT_MODE: Type.COMMENT, + JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: Type.COMMENT + } + + @classmethod + def BuildMatchers(cls): + """Builds the token matcher group. + + The token matcher groups work as follows: it is a list of Matcher objects. + The matchers will be tried in this order, and the first to match will be + returned. Hence the order is important because the matchers that come first + overrule the matchers that come later. + + Returns: + The completed token matcher group. + """ + # Match a keyword string followed by a non-identifier character in order to + # not match something like doSomething as do + Something. + keyword = re.compile('(%s)((?=[^%s])|$)' % ( + '|'.join(cls.KEYWORD_LIST), cls.IDENTIFIER_CHAR)) + return { + + # Matchers for basic text mode. + JavaScriptModes.TEXT_MODE: [ + # Check a big group - strings, starting comments, and regexes - all + # of which could be intertwined. 'string with /regex/', + # /regex with 'string'/, /* comment with /regex/ and string */ (and + # so on) + Matcher(cls.START_DOC_COMMENT, Type.START_DOC_COMMENT, + JavaScriptModes.DOC_COMMENT_MODE), + Matcher(cls.START_BLOCK_COMMENT, Type.START_BLOCK_COMMENT, + JavaScriptModes.BLOCK_COMMENT_MODE), + Matcher(cls.END_OF_LINE_SINGLE_LINE_COMMENT, + Type.START_SINGLE_LINE_COMMENT), + Matcher(cls.START_SINGLE_LINE_COMMENT, + Type.START_SINGLE_LINE_COMMENT, + JavaScriptModes.LINE_COMMENT_MODE), + Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_START, + JavaScriptModes.SINGLE_QUOTE_STRING_MODE), + Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_START, + JavaScriptModes.DOUBLE_QUOTE_STRING_MODE), + Matcher(cls.REGEX, Type.REGEX), + + # Next we check for start blocks appearing outside any of the items + # above. + Matcher(cls.START_BLOCK, Type.START_BLOCK), + Matcher(cls.END_BLOCK, Type.END_BLOCK), + + # Then we search for function declarations. + Matcher(cls.FUNCTION_DECLARATION, Type.FUNCTION_DECLARATION, + JavaScriptModes.FUNCTION_MODE), + + # Next, we convert non-function related parens to tokens. + Matcher(cls.OPENING_PAREN, Type.START_PAREN), + Matcher(cls.CLOSING_PAREN, Type.END_PAREN), + + # Next, we convert brackets to tokens. + Matcher(cls.OPENING_BRACKET, Type.START_BRACKET), + Matcher(cls.CLOSING_BRACKET, Type.END_BRACKET), + + # Find numbers. This has to happen before operators because + # scientific notation numbers can have + and - in them. + Matcher(cls.NUMBER, Type.NUMBER), + + # Find operators and simple assignments + Matcher(cls.SIMPLE_LVALUE, Type.SIMPLE_LVALUE), + Matcher(cls.OPERATOR, Type.OPERATOR), + + # Find key words and whitespace. + Matcher(keyword, Type.KEYWORD), + Matcher(cls.WHITESPACE, Type.WHITESPACE), + + # Find identifiers. + Matcher(cls.IDENTIFIER, Type.IDENTIFIER), + + # Finally, we convert semicolons to tokens. + Matcher(cls.SEMICOLON, Type.SEMICOLON)], + + # Matchers for single quote strings. + JavaScriptModes.SINGLE_QUOTE_STRING_MODE: [ + Matcher(cls.SINGLE_QUOTE_TEXT, Type.STRING_TEXT), + Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_END, + JavaScriptModes.TEXT_MODE)], + + # Matchers for double quote strings. + JavaScriptModes.DOUBLE_QUOTE_STRING_MODE: [ + Matcher(cls.DOUBLE_QUOTE_TEXT, Type.STRING_TEXT), + Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_END, + JavaScriptModes.TEXT_MODE)], + + # Matchers for block comments. + JavaScriptModes.BLOCK_COMMENT_MODE: [ + # First we check for exiting a block comment. + Matcher(cls.END_BLOCK_COMMENT, Type.END_BLOCK_COMMENT, + JavaScriptModes.TEXT_MODE), + + # Match non-comment-ending text.. + Matcher(cls.BLOCK_COMMENT_TEXT, Type.COMMENT)], + + # Matchers for doc comments. + JavaScriptModes.DOC_COMMENT_MODE: cls.COMMON_DOC_MATCHERS + [ + Matcher(cls.DOC_COMMENT_TEXT, Type.COMMENT)], + + JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: cls.COMMON_DOC_MATCHERS + [ + Matcher(cls.WHITESPACE, Type.COMMENT), + Matcher(cls.DOC_COMMENT_NO_SPACES_TEXT, Type.COMMENT)], + + # Matchers for single line comments. + JavaScriptModes.LINE_COMMENT_MODE: [ + # We greedy match until the end of the line in line comment mode. + Matcher(cls.ANYTHING, Type.COMMENT, JavaScriptModes.TEXT_MODE)], + + # Matchers for code after the function keyword. + JavaScriptModes.FUNCTION_MODE: [ + # Must match open paren before anything else and move into parameter + # mode, otherwise everything inside the parameter list is parsed + # incorrectly. + Matcher(cls.OPENING_PAREN, Type.START_PARAMETERS, + JavaScriptModes.PARAMETER_MODE), + Matcher(cls.WHITESPACE, Type.WHITESPACE), + Matcher(cls.IDENTIFIER, Type.FUNCTION_NAME)], + + # Matchers for function parameters + JavaScriptModes.PARAMETER_MODE: [ + # When in function parameter mode, a closing paren is treated + # specially. Everything else is treated as lines of parameters. + Matcher(cls.CLOSING_PAREN_WITH_SPACE, Type.END_PARAMETERS, + JavaScriptModes.TEXT_MODE), + Matcher(cls.PARAMETERS, Type.PARAMETERS, + JavaScriptModes.PARAMETER_MODE)]} + + def __init__(self, parse_js_doc=True): + """Create a tokenizer object. + + Args: + parse_js_doc: Whether to do detailed parsing of javascript doc comments, + or simply treat them as normal comments. Defaults to parsing JsDoc. + """ + matchers = self.BuildMatchers() + if not parse_js_doc: + # Make a copy so the original doesn't get modified. + matchers = copy.deepcopy(matchers) + matchers[JavaScriptModes.DOC_COMMENT_MODE] = matchers[ + JavaScriptModes.BLOCK_COMMENT_MODE] + + tokenizer.Tokenizer.__init__(self, JavaScriptModes.TEXT_MODE, matchers, + self.JAVASCRIPT_DEFAULT_TYPES) + + def _CreateToken(self, string, token_type, line, line_number, values=None): + """Creates a new JavaScriptToken object. + + Args: + string: The string of input the token contains. + token_type: The type of token. + line: The text of the line this token is in. + line_number: The line number of the token. + values: A dict of named values within the token. For instance, a + function declaration may have a value called 'name' which captures the + name of the function. + """ + return javascripttokens.JavaScriptToken(string, token_type, line, + line_number, values, line_number) diff --git a/tools/closure_linter/build/lib/closure_linter/javascripttokens.py b/tools/closure_linter/build/lib/closure_linter/javascripttokens.py new file mode 100644 index 00000000000000..f5815d2bf86119 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/javascripttokens.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Classes to represent JavaScript tokens.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +from closure_linter.common import tokens + +class JavaScriptTokenType(tokens.TokenType): + """Enumeration of JavaScript token types, and useful sets of token types.""" + NUMBER = 'number' + START_SINGLE_LINE_COMMENT = '//' + START_BLOCK_COMMENT = '/*' + START_DOC_COMMENT = '/**' + END_BLOCK_COMMENT = '*/' + END_DOC_COMMENT = 'doc */' + COMMENT = 'comment' + SINGLE_QUOTE_STRING_START = "'string" + SINGLE_QUOTE_STRING_END = "string'" + DOUBLE_QUOTE_STRING_START = '"string' + DOUBLE_QUOTE_STRING_END = 'string"' + STRING_TEXT = 'string' + START_BLOCK = '{' + END_BLOCK = '}' + START_PAREN = '(' + END_PAREN = ')' + START_BRACKET = '[' + END_BRACKET = ']' + REGEX = '/regex/' + FUNCTION_DECLARATION = 'function(...)' + FUNCTION_NAME = 'function functionName(...)' + START_PARAMETERS = 'startparams(' + PARAMETERS = 'pa,ra,ms' + END_PARAMETERS = ')endparams' + SEMICOLON = ';' + DOC_FLAG = '@flag' + DOC_INLINE_FLAG = '{@flag ...}' + DOC_START_BRACE = 'doc {' + DOC_END_BRACE = 'doc }' + DOC_PREFIX = 'comment prefix: * ' + DOC_TYPE_START_BLOCK = 'Type <' + DOC_TYPE_END_BLOCK = 'Type >' + DOC_TYPE_MODIFIER = 'modifier' + SIMPLE_LVALUE = 'lvalue=' + KEYWORD = 'keyword' + OPERATOR = 'operator' + IDENTIFIER = 'identifier' + + STRING_TYPES = frozenset([ + SINGLE_QUOTE_STRING_START, SINGLE_QUOTE_STRING_END, + DOUBLE_QUOTE_STRING_START, DOUBLE_QUOTE_STRING_END, STRING_TEXT]) + + COMMENT_TYPES = frozenset([ + START_SINGLE_LINE_COMMENT, COMMENT, + START_BLOCK_COMMENT, START_DOC_COMMENT, + END_BLOCK_COMMENT, END_DOC_COMMENT, + DOC_START_BRACE, DOC_END_BRACE, + DOC_FLAG, DOC_INLINE_FLAG, DOC_PREFIX, + DOC_TYPE_START_BLOCK, DOC_TYPE_END_BLOCK, DOC_TYPE_MODIFIER]) + + FLAG_DESCRIPTION_TYPES = frozenset([ + DOC_INLINE_FLAG, COMMENT, DOC_START_BRACE, DOC_END_BRACE, + DOC_TYPE_START_BLOCK, DOC_TYPE_END_BLOCK, DOC_TYPE_MODIFIER]) + + FLAG_ENDING_TYPES = frozenset([DOC_FLAG, END_DOC_COMMENT]) + + NON_CODE_TYPES = COMMENT_TYPES | frozenset([ + tokens.TokenType.WHITESPACE, tokens.TokenType.BLANK_LINE]) + + UNARY_OPERATORS = ['!', 'new', 'delete', 'typeof', 'void'] + + UNARY_OK_OPERATORS = ['--', '++', '-', '+'] + UNARY_OPERATORS + + UNARY_POST_OPERATORS = ['--', '++'] + + # An expression ender is any token that can end an object - i.e. we could have + # x.y or [1, 2], or (10 + 9) or {a: 10}. + EXPRESSION_ENDER_TYPES = [tokens.TokenType.NORMAL, IDENTIFIER, NUMBER, + SIMPLE_LVALUE, END_BRACKET, END_PAREN, END_BLOCK, + SINGLE_QUOTE_STRING_END, DOUBLE_QUOTE_STRING_END] + + +class JavaScriptToken(tokens.Token): + """JavaScript token subclass of Token, provides extra instance checks. + + The following token types have data in attached_object: + - All JsDoc flags: a parser.JsDocFlag object. + """ + + def IsKeyword(self, keyword): + """Tests if this token is the given keyword. + + Args: + keyword: The keyword to compare to. + + Returns: + True if this token is a keyword token with the given name. + """ + return self.type == JavaScriptTokenType.KEYWORD and self.string == keyword + + def IsOperator(self, operator): + """Tests if this token is the given operator. + + Args: + operator: The operator to compare to. + + Returns: + True if this token is a operator token with the given name. + """ + return self.type == JavaScriptTokenType.OPERATOR and self.string == operator + + def IsAssignment(self): + """Tests if this token is an assignment operator. + + Returns: + True if this token is an assignment operator. + """ + return (self.type == JavaScriptTokenType.OPERATOR and + self.string.endswith('=') and + self.string not in ('==', '!=', '>=', '<=', '===', '!==')) + + def IsComment(self): + """Tests if this token is any part of a comment. + + Returns: + True if this token is any part of a comment. + """ + return self.type in JavaScriptTokenType.COMMENT_TYPES + + def IsCode(self): + """Tests if this token is code, as opposed to a comment or whitespace.""" + return self.type not in JavaScriptTokenType.NON_CODE_TYPES + + def __repr__(self): + return '' % (self.line_number, + self.type, self.string, + self.values, + self.metadata) diff --git a/tools/closure_linter/build/lib/closure_linter/not_strict_test.py b/tools/closure_linter/build/lib/closure_linter/not_strict_test.py new file mode 100644 index 00000000000000..c92c13ee031e1b --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/not_strict_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for gjslint --nostrict. + +Tests errors that can be thrown by gjslint when not in strict mode. +""" + + + +import os +import sys +import unittest + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import filetestcase + +_RESOURCE_PREFIX = 'closure_linter/testdata' + +flags.FLAGS.strict = False +flags.FLAGS.custom_jsdoc_tags = ('customtag', 'requires') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') +flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js', + 'limited_doc_checks.js') + + +# List of files under testdata to test. +# We need to list files explicitly since pyglib can't list directories. +_TEST_FILES = [ + 'not_strict.js' + ] + + +class GJsLintTestSuite(unittest.TestSuite): + """Test suite to run a GJsLintTest for each of several files. + + If sys.argv[1:] is non-empty, it is interpreted as a list of filenames in + testdata to test. Otherwise, _TEST_FILES is used. + """ + + def __init__(self, tests=()): + unittest.TestSuite.__init__(self, tests) + + argv = sys.argv and sys.argv[1:] or [] + if argv: + test_files = argv + else: + test_files = _TEST_FILES + for test_file in test_files: + resource_path = os.path.join(_RESOURCE_PREFIX, test_file) + self.addTest(filetestcase.AnnotatedFileTestCase(resource_path, + runner.Run, + errors.ByName)) + +if __name__ == '__main__': + # Don't let main parse args; it happens in the TestSuite. + googletest.main(argv=sys.argv[0:1], defaultTest='GJsLintTestSuite') diff --git a/tools/closure_linter/build/lib/closure_linter/requireprovidesorter.py b/tools/closure_linter/build/lib/closure_linter/requireprovidesorter.py new file mode 100644 index 00000000000000..e7e08a13c2946f --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/requireprovidesorter.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Contains logic for sorting goog.provide and goog.require statements. + +Closurized JavaScript files use goog.provide and goog.require statements at the +top of the file to manage dependencies. These statements should be sorted +alphabetically, however, it is common for them to be accompanied by inline +comments or suppression annotations. In order to sort these statements without +disrupting their comments and annotations, the association between statements +and comments/annotations must be maintained while sorting. + + RequireProvideSorter: Handles checking/fixing of provide/require statements. +""" + + + +from closure_linter import javascripttokens +from closure_linter import tokenutil + +# Shorthand +Type = javascripttokens.JavaScriptTokenType + + +class RequireProvideSorter(object): + """Checks for and fixes alphabetization of provide and require statements. + + When alphabetizing, comments on the same line or comments directly above a + goog.provide or goog.require statement are associated with that statement and + stay with the statement as it gets sorted. + """ + + def CheckProvides(self, token): + """Checks alphabetization of goog.provide statements. + + Iterates over tokens in given token stream, identifies goog.provide tokens, + and checks that they occur in alphabetical order by the object being + provided. + + Args: + token: A token in the token stream before any goog.provide tokens. + + Returns: + The first provide token in the token stream. + + None is returned if all goog.provide statements are already sorted. + """ + provide_tokens = self._GetRequireOrProvideTokens(token, 'goog.provide') + provide_strings = self._GetRequireOrProvideTokenStrings(provide_tokens) + sorted_provide_strings = sorted(provide_strings) + if provide_strings != sorted_provide_strings: + return provide_tokens[0] + return None + + def CheckRequires(self, token): + """Checks alphabetization of goog.require statements. + + Iterates over tokens in given token stream, identifies goog.require tokens, + and checks that they occur in alphabetical order by the dependency being + required. + + Args: + token: A token in the token stream before any goog.require tokens. + + Returns: + The first require token in the token stream. + + None is returned if all goog.require statements are already sorted. + """ + require_tokens = self._GetRequireOrProvideTokens(token, 'goog.require') + require_strings = self._GetRequireOrProvideTokenStrings(require_tokens) + sorted_require_strings = sorted(require_strings) + if require_strings != sorted_require_strings: + return require_tokens[0] + return None + + def FixProvides(self, token): + """Sorts goog.provide statements in the given token stream alphabetically. + + Args: + token: The first token in the token stream. + """ + self._FixProvidesOrRequires( + self._GetRequireOrProvideTokens(token, 'goog.provide')) + + def FixRequires(self, token): + """Sorts goog.require statements in the given token stream alphabetically. + + Args: + token: The first token in the token stream. + """ + self._FixProvidesOrRequires( + self._GetRequireOrProvideTokens(token, 'goog.require')) + + def _FixProvidesOrRequires(self, tokens): + """Sorts goog.provide or goog.require statements. + + Args: + tokens: A list of goog.provide or goog.require tokens in the order they + appear in the token stream. i.e. the first token in this list must + be the first goog.provide or goog.require token. + """ + strings = self._GetRequireOrProvideTokenStrings(tokens) + sorted_strings = sorted(strings) + + # Make a separate pass to remove any blank lines between goog.require/ + # goog.provide tokens. + first_token = tokens[0] + last_token = tokens[-1] + i = last_token + while i != first_token and i is not None: + if i.type is Type.BLANK_LINE: + tokenutil.DeleteToken(i) + i = i.previous + + # A map from required/provided object name to tokens that make up the line + # it was on, including any comments immediately before it or after it on the + # same line. + tokens_map = self._GetTokensMap(tokens) + + # Iterate over the map removing all tokens. + for name in tokens_map: + tokens_to_delete = tokens_map[name] + for i in tokens_to_delete: + tokenutil.DeleteToken(i) + + # Save token to rest of file. Sorted token will be inserted before this. + rest_of_file = tokens_map[strings[-1]][-1].next + + # Re-add all tokens in the map in alphabetical order. + insert_after = tokens[0].previous + for string in sorted_strings: + for i in tokens_map[string]: + if rest_of_file: + tokenutil.InsertTokenBefore(i, rest_of_file) + else: + tokenutil.InsertTokenAfter(i, insert_after) + insert_after = i + + def _GetRequireOrProvideTokens(self, token, token_string): + """Gets all goog.provide or goog.require tokens in the given token stream. + + Args: + token: The first token in the token stream. + token_string: One of 'goog.provide' or 'goog.require' to indicate which + tokens to find. + + Returns: + A list of goog.provide or goog.require tokens in the order they appear in + the token stream. + """ + tokens = [] + while token: + if token.type == Type.IDENTIFIER: + if token.string == token_string: + tokens.append(token) + elif token.string not in [ + 'goog.provide', 'goog.require', 'goog.setTestOnly']: + # These 3 identifiers are at the top of the file. So if any other + # identifier is encountered, return. + # TODO(user): Once it's decided what ordering goog.require + # should use, add 'goog.module' to the list above and implement the + # decision. + break + token = token.next + + return tokens + + def _GetRequireOrProvideTokenStrings(self, tokens): + """Gets a list of strings corresponding to the given list of tokens. + + The string will be the next string in the token stream after each token in + tokens. This is used to find the object being provided/required by a given + goog.provide or goog.require token. + + Args: + tokens: A list of goog.provide or goog.require tokens. + + Returns: + A list of object names that are being provided or required by the given + list of tokens. For example: + + ['object.a', 'object.c', 'object.b'] + """ + token_strings = [] + for token in tokens: + if not token.is_deleted: + name = tokenutil.GetStringAfterToken(token) + token_strings.append(name) + return token_strings + + def _GetTokensMap(self, tokens): + """Gets a map from object name to tokens associated with that object. + + Starting from the goog.provide/goog.require token, searches backwards in the + token stream for any lines that start with a comment. These lines are + associated with the goog.provide/goog.require token. Also associates any + tokens on the same line as the goog.provide/goog.require token with that + token. + + Args: + tokens: A list of goog.provide or goog.require tokens. + + Returns: + A dictionary that maps object names to the tokens associated with the + goog.provide or goog.require of that object name. For example: + + { + 'object.a': [JavaScriptToken, JavaScriptToken, ...], + 'object.b': [...] + } + + The list of tokens includes any comment lines above the goog.provide or + goog.require statement and everything after the statement on the same + line. For example, all of the following would be associated with + 'object.a': + + /** @suppress {extraRequire} */ + goog.require('object.a'); // Some comment. + """ + tokens_map = {} + for token in tokens: + object_name = tokenutil.GetStringAfterToken(token) + # If the previous line starts with a comment, presume that the comment + # relates to the goog.require or goog.provide and keep them together when + # sorting. + first_token = token + previous_first_token = tokenutil.GetFirstTokenInPreviousLine(first_token) + while (previous_first_token and + previous_first_token.IsAnyType(Type.COMMENT_TYPES)): + first_token = previous_first_token + previous_first_token = tokenutil.GetFirstTokenInPreviousLine( + first_token) + + # Find the last token on the line. + last_token = tokenutil.GetLastTokenInSameLine(token) + + all_tokens = self._GetTokenList(first_token, last_token) + tokens_map[object_name] = all_tokens + return tokens_map + + def _GetTokenList(self, first_token, last_token): + """Gets a list of all tokens from first_token to last_token, inclusive. + + Args: + first_token: The first token to get. + last_token: The last token to get. + + Returns: + A list of all tokens between first_token and last_token, including both + first_token and last_token. + + Raises: + Exception: If the token stream ends before last_token is reached. + """ + token_list = [] + token = first_token + while token != last_token: + if not token: + raise Exception('ran out of tokens') + token_list.append(token) + token = token.next + token_list.append(last_token) + + return token_list + + def GetFixedRequireString(self, token): + """Get fixed/sorted order of goog.require statements. + + Args: + token: The first token in the token stream. + + Returns: + A string for correct sorted order of goog.require. + """ + return self._GetFixedRequireOrProvideString( + self._GetRequireOrProvideTokens(token, 'goog.require')) + + def GetFixedProvideString(self, token): + """Get fixed/sorted order of goog.provide statements. + + Args: + token: The first token in the token stream. + + Returns: + A string for correct sorted order of goog.provide. + """ + return self._GetFixedRequireOrProvideString( + self._GetRequireOrProvideTokens(token, 'goog.provide')) + + def _GetFixedRequireOrProvideString(self, tokens): + """Sorts goog.provide or goog.require statements. + + Args: + tokens: A list of goog.provide or goog.require tokens in the order they + appear in the token stream. i.e. the first token in this list must + be the first goog.provide or goog.require token. + + Returns: + A string for sorted goog.require or goog.provide statements + """ + + # A map from required/provided object name to tokens that make up the line + # it was on, including any comments immediately before it or after it on the + # same line. + tokens_map = self._GetTokensMap(tokens) + sorted_strings = sorted(tokens_map.keys()) + + new_order = '' + for string in sorted_strings: + for i in tokens_map[string]: + new_order += i.string + if i.IsLastInLine(): + new_order += '\n' + + return new_order diff --git a/tools/closure_linter/build/lib/closure_linter/requireprovidesorter_test.py b/tools/closure_linter/build/lib/closure_linter/requireprovidesorter_test.py new file mode 100644 index 00000000000000..fecb6d04dad9ce --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/requireprovidesorter_test.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for RequireProvideSorter.""" + + + +import unittest as googletest +from closure_linter import javascripttokens +from closure_linter import requireprovidesorter +from closure_linter import testutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + + +class RequireProvideSorterTest(googletest.TestCase): + """Tests for RequireProvideSorter.""" + + def testGetFixedProvideString(self): + """Tests that fixed string constains proper comments also.""" + input_lines = [ + 'goog.provide(\'package.xyz\');', + '/** @suppress {extraprovide} **/', + 'goog.provide(\'package.abcd\');' + ] + + expected_lines = [ + '/** @suppress {extraprovide} **/', + 'goog.provide(\'package.abcd\');', + 'goog.provide(\'package.xyz\');' + ] + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + fixed_provide_string = sorter.GetFixedProvideString(token) + + self.assertEquals(expected_lines, fixed_provide_string.splitlines()) + + def testGetFixedRequireString(self): + """Tests that fixed string constains proper comments also.""" + input_lines = [ + 'goog.require(\'package.xyz\');', + '/** This is needed for scope. **/', + 'goog.require(\'package.abcd\');' + ] + + expected_lines = [ + '/** This is needed for scope. **/', + 'goog.require(\'package.abcd\');', + 'goog.require(\'package.xyz\');' + ] + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + fixed_require_string = sorter.GetFixedRequireString(token) + + self.assertEquals(expected_lines, fixed_require_string.splitlines()) + + def testFixRequires_removeBlankLines(self): + """Tests that blank lines are omitted in sorted goog.require statements.""" + input_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassB\');', + '', + 'goog.require(\'package.subpackage.ClassA\');' + ] + expected_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassA\');', + 'goog.require(\'package.subpackage.ClassB\');' + ] + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(token) + + self.assertEquals(expected_lines, self._GetLines(token)) + + def fixRequiresTest_withTestOnly(self, position): + """Regression-tests sorting even with a goog.setTestOnly statement. + + Args: + position: The position in the list where to insert the goog.setTestOnly + statement. Will be used to test all possible combinations for + this test. + """ + input_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassB\');', + 'goog.require(\'package.subpackage.ClassA\');' + ] + expected_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassA\');', + 'goog.require(\'package.subpackage.ClassB\');' + ] + input_lines.insert(position, 'goog.setTestOnly();') + expected_lines.insert(position, 'goog.setTestOnly();') + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(token) + + self.assertEquals(expected_lines, self._GetLines(token)) + + def testFixRequires_withTestOnly(self): + """Regression-tests sorting even after a goog.setTestOnly statement.""" + + # goog.setTestOnly at first line. + self.fixRequiresTest_withTestOnly(position=0) + + # goog.setTestOnly after goog.provide. + self.fixRequiresTest_withTestOnly(position=1) + + # goog.setTestOnly before goog.require. + self.fixRequiresTest_withTestOnly(position=2) + + # goog.setTestOnly after goog.require. + self.fixRequiresTest_withTestOnly(position=4) + + def _GetLines(self, token): + """Returns an array of lines based on the specified token stream.""" + lines = [] + line = '' + while token: + line += token.string + if token.IsLastInLine(): + lines.append(line) + line = '' + token = token.next + return lines + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/runner.py b/tools/closure_linter/build/lib/closure_linter/runner.py new file mode 100644 index 00000000000000..04e7fa4ac87a1c --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/runner.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Main lint function. Tokenizes file, runs passes, and feeds to checker.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import traceback + +import gflags as flags + +from closure_linter import checker +from closure_linter import ecmalintrules +from closure_linter import ecmametadatapass +from closure_linter import error_check +from closure_linter import errors +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokenizer + +from closure_linter.common import error +from closure_linter.common import htmlutil +from closure_linter.common import tokens + +flags.DEFINE_list('limited_doc_files', ['dummy.js', 'externs.js'], + 'List of files with relaxed documentation checks. Will not ' + 'report errors for missing documentation, some missing ' + 'descriptions, or methods whose @return tags don\'t have a ' + 'matching return statement.') +flags.DEFINE_boolean('error_trace', False, + 'Whether to show error exceptions.') +flags.ADOPT_module_key_flags(checker) +flags.ADOPT_module_key_flags(ecmalintrules) +flags.ADOPT_module_key_flags(error_check) + + +def _GetLastNonWhiteSpaceToken(start_token): + """Get the last non-whitespace token in a token stream.""" + ret_token = None + + whitespace_tokens = frozenset([ + tokens.TokenType.WHITESPACE, tokens.TokenType.BLANK_LINE]) + for t in start_token: + if t.type not in whitespace_tokens: + ret_token = t + + return ret_token + + +def _IsHtml(filename): + return filename.endswith('.html') or filename.endswith('.htm') + + +def _Tokenize(fileobj): + """Tokenize a file. + + Args: + fileobj: file-like object (or iterable lines) with the source. + + Returns: + The first token in the token stream and the ending mode of the tokenizer. + """ + tokenizer = javascripttokenizer.JavaScriptTokenizer() + start_token = tokenizer.TokenizeFile(fileobj) + return start_token, tokenizer.mode + + +def _IsLimitedDocCheck(filename, limited_doc_files): + """Whether this this a limited-doc file. + + Args: + filename: The filename. + limited_doc_files: Iterable of strings. Suffixes of filenames that should + be limited doc check. + + Returns: + Whether the file should be limited check. + """ + for limited_doc_filename in limited_doc_files: + if filename.endswith(limited_doc_filename): + return True + return False + + +def Run(filename, error_handler, source=None): + """Tokenize, run passes, and check the given file. + + Args: + filename: The path of the file to check + error_handler: The error handler to report errors to. + source: A file-like object with the file source. If omitted, the file will + be read from the filename path. + """ + if not source: + try: + source = open(filename) + except IOError: + error_handler.HandleFile(filename, None) + error_handler.HandleError( + error.Error(errors.FILE_NOT_FOUND, 'File not found')) + error_handler.FinishFile() + return + + if _IsHtml(filename): + source_file = htmlutil.GetScriptLines(source) + else: + source_file = source + + token, tokenizer_mode = _Tokenize(source_file) + + error_handler.HandleFile(filename, token) + + # If we did not end in the basic mode, this a failed parse. + if tokenizer_mode is not javascripttokenizer.JavaScriptModes.TEXT_MODE: + error_handler.HandleError( + error.Error(errors.FILE_IN_BLOCK, + 'File ended in mode "%s".' % tokenizer_mode, + _GetLastNonWhiteSpaceToken(token))) + + # Run the ECMA pass + error_token = None + + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + error_token = RunMetaDataPass(token, ecma_pass, error_handler, filename) + + is_limited_doc_check = ( + _IsLimitedDocCheck(filename, flags.FLAGS.limited_doc_files)) + + _RunChecker(token, error_handler, + is_limited_doc_check, + is_html=_IsHtml(filename), + stop_token=error_token) + + error_handler.FinishFile() + + +def RunMetaDataPass(start_token, metadata_pass, error_handler, filename=''): + """Run a metadata pass over a token stream. + + Args: + start_token: The first token in a token stream. + metadata_pass: Metadata pass to run. + error_handler: The error handler to report errors to. + filename: Filename of the source. + + Returns: + The token where the error occurred (if any). + """ + + try: + metadata_pass.Process(start_token) + except ecmametadatapass.ParseError, parse_err: + if flags.FLAGS.error_trace: + traceback.print_exc() + error_token = parse_err.token + error_msg = str(parse_err) + error_handler.HandleError( + error.Error(errors.FILE_DOES_NOT_PARSE, + ('Error parsing file at token "%s". Unable to ' + 'check the rest of file.' + '\nError "%s"' % (error_token, error_msg)), error_token)) + return error_token + except Exception: # pylint: disable=broad-except + traceback.print_exc() + error_handler.HandleError( + error.Error( + errors.FILE_DOES_NOT_PARSE, + 'Internal error in %s' % filename)) + + +def _RunChecker(start_token, error_handler, + limited_doc_checks, is_html, + stop_token=None): + + state_tracker = javascriptstatetracker.JavaScriptStateTracker() + + style_checker = checker.JavaScriptStyleChecker( + state_tracker=state_tracker, + error_handler=error_handler) + + style_checker.Check(start_token, + is_html=is_html, + limited_doc_checks=limited_doc_checks, + stop_token=stop_token) diff --git a/tools/closure_linter/build/lib/closure_linter/runner_test.py b/tools/closure_linter/build/lib/closure_linter/runner_test.py new file mode 100644 index 00000000000000..da5857d30950f6 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/runner_test.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the runner module.""" + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import StringIO + + +import mox + + +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import error +from closure_linter.common import errorhandler +from closure_linter.common import tokens + + +class LimitedDocTest(googletest.TestCase): + + def testIsLimitedDocCheck(self): + self.assertTrue(runner._IsLimitedDocCheck('foo_test.js', ['_test.js'])) + self.assertFalse(runner._IsLimitedDocCheck('foo_bar.js', ['_test.js'])) + + self.assertTrue(runner._IsLimitedDocCheck( + 'foo_moo.js', ['moo.js', 'quack.js'])) + self.assertFalse(runner._IsLimitedDocCheck( + 'foo_moo.js', ['woof.js', 'quack.js'])) + + +class RunnerTest(googletest.TestCase): + + def setUp(self): + self.mox = mox.Mox() + + def testRunOnMissingFile(self): + mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) + + def ValidateError(err): + return (isinstance(err, error.Error) and + err.code is errors.FILE_NOT_FOUND and + err.token is None) + + mock_error_handler.HandleFile('does_not_exist.js', None) + mock_error_handler.HandleError(mox.Func(ValidateError)) + mock_error_handler.FinishFile() + + self.mox.ReplayAll() + + runner.Run('does_not_exist.js', mock_error_handler) + + self.mox.VerifyAll() + + def testBadTokenization(self): + mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) + + def ValidateError(err): + return (isinstance(err, error.Error) and + err.code is errors.FILE_IN_BLOCK and + err.token.string == '}') + + mock_error_handler.HandleFile('foo.js', mox.IsA(tokens.Token)) + mock_error_handler.HandleError(mox.Func(ValidateError)) + mock_error_handler.HandleError(mox.IsA(error.Error)) + mock_error_handler.FinishFile() + + self.mox.ReplayAll() + + source = StringIO.StringIO(_BAD_TOKENIZATION_SCRIPT) + runner.Run('foo.js', mock_error_handler, source) + + self.mox.VerifyAll() + + +_BAD_TOKENIZATION_SCRIPT = """ +function foo () { + var a = 3; + var b = 2; + return b + a; /* Comment not closed +} +""" + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/scopeutil.py b/tools/closure_linter/build/lib/closure_linter/scopeutil.py new file mode 100644 index 00000000000000..a7ca9b630a470c --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/scopeutil.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tools to match goog.scope alias statements.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import itertools + +from closure_linter import ecmametadatapass +from closure_linter import tokenutil +from closure_linter.javascripttokens import JavaScriptTokenType + + + +def IsGoogScopeBlock(context): + """Whether the given context is a goog.scope block. + + This function only checks that the block is a function block inside + a goog.scope() call. + + TODO(nnaze): Implement goog.scope checks that verify the call is + in the root context and contains only a single function literal. + + Args: + context: An EcmaContext of type block. + + Returns: + Whether the context is a goog.scope block. + """ + + if context.type != ecmametadatapass.EcmaContext.BLOCK: + return False + + if not _IsFunctionLiteralBlock(context): + return False + + # Check that this function is contained by a group + # of form "goog.scope(...)". + parent = context.parent + if parent and parent.type is ecmametadatapass.EcmaContext.GROUP: + + last_code_token = parent.start_token.metadata.last_code + + if (last_code_token and + last_code_token.type is JavaScriptTokenType.IDENTIFIER and + last_code_token.string == 'goog.scope'): + return True + + return False + + +def _IsFunctionLiteralBlock(block_context): + """Check if a context is a function literal block (without parameters). + + Example function literal block: 'function() {}' + + Args: + block_context: An EcmaContext of type block. + + Returns: + Whether this context is a function literal block. + """ + + previous_code_tokens_iter = itertools.ifilter( + lambda token: token not in JavaScriptTokenType.NON_CODE_TYPES, + reversed(block_context.start_token)) + + # Ignore the current token + next(previous_code_tokens_iter, None) + + # Grab the previous three tokens and put them in correct order. + previous_code_tokens = list(itertools.islice(previous_code_tokens_iter, 3)) + previous_code_tokens.reverse() + + # There aren't three previous tokens. + if len(previous_code_tokens) is not 3: + return False + + # Check that the previous three code tokens are "function ()" + previous_code_token_types = [token.type for token in previous_code_tokens] + if (previous_code_token_types == [ + JavaScriptTokenType.FUNCTION_DECLARATION, + JavaScriptTokenType.START_PARAMETERS, + JavaScriptTokenType.END_PARAMETERS]): + return True + + return False + + +def IsInClosurizedNamespace(symbol, closurized_namespaces): + """Match a goog.scope alias. + + Args: + symbol: An identifier like 'goog.events.Event'. + closurized_namespaces: Iterable of valid Closurized namespaces (strings). + + Returns: + True if symbol is an identifier in a Closurized namespace, otherwise False. + """ + for ns in closurized_namespaces: + if symbol.startswith(ns + '.'): + return True + + return False + + +def _GetVarAssignmentTokens(context): + """Returns the tokens from context if it is a var assignment. + + Args: + context: An EcmaContext. + + Returns: + If a var assignment, the tokens contained within it w/o the trailing + semicolon. + """ + if context.type != ecmametadatapass.EcmaContext.VAR: + return + + # Get the tokens in this statement. + if context.start_token and context.end_token: + statement_tokens = tokenutil.GetTokenRange(context.start_token, + context.end_token) + else: + return + + # And now just those tokens that are actually code. + is_non_code_type = lambda t: t.type not in JavaScriptTokenType.NON_CODE_TYPES + code_tokens = filter(is_non_code_type, statement_tokens) + + # Pop off the semicolon if present. + if code_tokens and code_tokens[-1].IsType(JavaScriptTokenType.SEMICOLON): + code_tokens.pop() + + if len(code_tokens) < 4: + return + + if (code_tokens[0].IsKeyword('var') and + code_tokens[1].IsType(JavaScriptTokenType.SIMPLE_LVALUE) and + code_tokens[2].IsOperator('=')): + return code_tokens + + +def MatchAlias(context): + """Match an alias statement (some identifier assigned to a variable). + + Example alias: var MyClass = proj.longNamespace.MyClass. + + Args: + context: An EcmaContext of type EcmaContext.VAR. + + Returns: + If a valid alias, returns a tuple of alias and symbol, otherwise None. + """ + code_tokens = _GetVarAssignmentTokens(context) + if code_tokens is None: + return + + if all(tokenutil.IsIdentifierOrDot(t) for t in code_tokens[3:]): + # var Foo = bar.Foo; + alias, symbol = code_tokens[1], code_tokens[3] + # Mark both tokens as an alias definition to not count them as usages. + alias.metadata.is_alias_definition = True + symbol.metadata.is_alias_definition = True + return alias.string, tokenutil.GetIdentifierForToken(symbol) + + +def MatchModuleAlias(context): + """Match an alias statement in a goog.module style import. + + Example alias: var MyClass = goog.require('proj.longNamespace.MyClass'). + + Args: + context: An EcmaContext. + + Returns: + If a valid alias, returns a tuple of alias and symbol, otherwise None. + """ + code_tokens = _GetVarAssignmentTokens(context) + if code_tokens is None: + return + + if(code_tokens[3].IsType(JavaScriptTokenType.IDENTIFIER) and + code_tokens[3].string == 'goog.require'): + # var Foo = goog.require('bar.Foo'); + alias = code_tokens[1] + symbol = tokenutil.GetStringAfterToken(code_tokens[3]) + if symbol: + alias.metadata.is_alias_definition = True + return alias.string, symbol diff --git a/tools/closure_linter/build/lib/closure_linter/scopeutil_test.py b/tools/closure_linter/build/lib/closure_linter/scopeutil_test.py new file mode 100644 index 00000000000000..722a95390022de --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/scopeutil_test.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the scopeutil module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + + +import unittest as googletest + +from closure_linter import ecmametadatapass +from closure_linter import scopeutil +from closure_linter import testutil + + +def _FindContexts(start_token): + """Depth first search of all contexts referenced by a token stream. + + Includes contexts' parents, which might not be directly referenced + by any token in the stream. + + Args: + start_token: First token in the token stream. + + Yields: + All contexts referenced by this token stream. + """ + + seen_contexts = set() + + # For each token, yield the context if we haven't seen it before. + for token in start_token: + + token_context = token.metadata.context + contexts = [token_context] + + # Also grab all the context's ancestors. + parent = token_context.parent + while parent: + contexts.append(parent) + parent = parent.parent + + # Yield each of these contexts if we've not seen them. + for context in contexts: + if context not in seen_contexts: + yield context + + seen_contexts.add(context) + + +def _FindFirstContextOfType(token, context_type): + """Returns the first statement context.""" + for context in _FindContexts(token): + if context.type == context_type: + return context + + +def _ParseAssignment(script): + start_token = testutil.TokenizeSourceAndRunEcmaPass(script) + statement = _FindFirstContextOfType( + start_token, ecmametadatapass.EcmaContext.VAR) + return statement + + +class StatementTest(googletest.TestCase): + + def assertAlias(self, expected_match, script): + statement = _ParseAssignment(script) + match = scopeutil.MatchAlias(statement) + self.assertEquals(expected_match, match) + + def assertModuleAlias(self, expected_match, script): + statement = _ParseAssignment(script) + match = scopeutil.MatchModuleAlias(statement) + self.assertEquals(expected_match, match) + + def testSimpleAliases(self): + self.assertAlias( + ('foo', 'goog.foo'), + 'var foo = goog.foo;') + + self.assertAlias( + ('foo', 'goog.foo'), + 'var foo = goog.foo') # No semicolon + + def testAliasWithComment(self): + self.assertAlias( + ('Component', 'goog.ui.Component'), + 'var Component = /* comment */ goog.ui.Component;') + + def testMultilineAlias(self): + self.assertAlias( + ('Component', 'goog.ui.Component'), + 'var Component = \n goog.ui.\n Component;') + + def testNonSymbolAliasVarStatements(self): + self.assertAlias(None, 'var foo = 3;') + self.assertAlias(None, 'var foo = function() {};') + self.assertAlias(None, 'var foo = bar ? baz : qux;') + + def testModuleAlias(self): + self.assertModuleAlias( + ('foo', 'goog.foo'), + 'var foo = goog.require("goog.foo");') + self.assertModuleAlias( + None, + 'var foo = goog.require(notastring);') + + +class ScopeBlockTest(googletest.TestCase): + + @staticmethod + def _GetBlocks(source): + start_token = testutil.TokenizeSourceAndRunEcmaPass(source) + for context in _FindContexts(start_token): + if context.type is ecmametadatapass.EcmaContext.BLOCK: + yield context + + def assertNoBlocks(self, script): + blocks = list(self._GetBlocks(script)) + self.assertEquals([], blocks) + + def testNotBlocks(self): + # Ensure these are not considered blocks. + self.assertNoBlocks('goog.scope(if{});') + self.assertNoBlocks('goog.scope(for{});') + self.assertNoBlocks('goog.scope(switch{});') + self.assertNoBlocks('goog.scope(function foo{});') + + def testNonScopeBlocks(self): + + blocks = list(self._GetBlocks('goog.scope(try{});')) + self.assertEquals(1, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(function(a,b){});')) + self.assertEquals(1, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(try{} catch(){});')) + # Two blocks: try and catch. + self.assertEquals(2, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(try{} catch(){} finally {});')) + self.assertEquals(3, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + +class AliasTest(googletest.TestCase): + + def setUp(self): + self.start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + + def testMatchAliasStatement(self): + matches = set() + for context in _FindContexts(self.start_token): + match = scopeutil.MatchAlias(context) + if match: + matches.add(match) + + self.assertEquals( + set([('bar', 'baz'), + ('foo', 'this.foo_'), + ('Component', 'goog.ui.Component'), + ('MyClass', 'myproject.foo.MyClass'), + ('NonClosurizedClass', 'aaa.bbb.NonClosurizedClass')]), + matches) + + def testMatchAliasStatement_withClosurizedNamespaces(self): + + closurized_namepaces = frozenset(['goog', 'myproject']) + + matches = set() + for context in _FindContexts(self.start_token): + match = scopeutil.MatchAlias(context) + if match: + unused_alias, symbol = match + if scopeutil.IsInClosurizedNamespace(symbol, closurized_namepaces): + matches.add(match) + + self.assertEquals( + set([('MyClass', 'myproject.foo.MyClass'), + ('Component', 'goog.ui.Component')]), + matches) + +_TEST_SCRIPT = """ +goog.scope(function() { + var Component = goog.ui.Component; // scope alias + var MyClass = myproject.foo.MyClass; // scope alias + + // Scope alias of non-Closurized namespace. + var NonClosurizedClass = aaa.bbb.NonClosurizedClass; + + var foo = this.foo_; // non-scope object property alias + var bar = baz; // variable alias + + var component = new Component(); +}); + +""" + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/statetracker.py b/tools/closure_linter/build/lib/closure_linter/statetracker.py new file mode 100644 index 00000000000000..52e363972f200a --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/statetracker.py @@ -0,0 +1,1294 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Light weight EcmaScript state tracker that reads tokens and tracks state.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import re + +from closure_linter import javascripttokenizer +from closure_linter import javascripttokens +from closure_linter import tokenutil +from closure_linter import typeannotation + +# Shorthand +Type = javascripttokens.JavaScriptTokenType + + +class DocFlag(object): + """Generic doc flag object. + + Attribute: + flag_type: param, return, define, type, etc. + flag_token: The flag token. + type_start_token: The first token specifying the flag type, + including braces. + type_end_token: The last token specifying the flag type, + including braces. + type: The type spec string. + jstype: The type spec, a TypeAnnotation instance. + name_token: The token specifying the flag name. + name: The flag name + description_start_token: The first token in the description. + description_end_token: The end token in the description. + description: The description. + """ + + # Please keep these lists alphabetized. + + # The list of standard jsdoc tags is from + STANDARD_DOC = frozenset([ + 'author', + 'bug', + 'classTemplate', + 'consistentIdGenerator', + 'const', + 'constructor', + 'define', + 'deprecated', + 'dict', + 'enum', + 'export', + 'expose', + 'extends', + 'externs', + 'fileoverview', + 'idGenerator', + 'implements', + 'implicitCast', + 'interface', + 'lends', + 'license', + 'ngInject', # This annotation is specific to AngularJS. + 'noalias', + 'nocompile', + 'nosideeffects', + 'override', + 'owner', + 'package', + 'param', + 'preserve', + 'private', + 'protected', + 'public', + 'return', + 'see', + 'stableIdGenerator', + 'struct', + 'supported', + 'template', + 'this', + 'type', + 'typedef', + 'unrestricted', + ]) + + ANNOTATION = frozenset(['preserveTry', 'suppress']) + + LEGAL_DOC = STANDARD_DOC | ANNOTATION + + # Includes all Closure Compiler @suppress types. + # Not all of these annotations are interpreted by Closure Linter. + # + # Specific cases: + # - accessControls is supported by the compiler at the expression + # and method level to suppress warnings about private/protected + # access (method level applies to all references in the method). + # The linter mimics the compiler behavior. + SUPPRESS_TYPES = frozenset([ + 'accessControls', + 'ambiguousFunctionDecl', + 'checkDebuggerStatement', + 'checkRegExp', + 'checkStructDictInheritance', + 'checkTypes', + 'checkVars', + 'const', + 'constantProperty', + 'deprecated', + 'duplicate', + 'es5Strict', + 'externsValidation', + 'extraProvide', + 'extraRequire', + 'fileoverviewTags', + 'globalThis', + 'internetExplorerChecks', + 'invalidCasts', + 'missingProperties', + 'missingProvide', + 'missingRequire', + 'missingReturn', + 'nonStandardJsDocs', + 'strictModuleDepCheck', + 'suspiciousCode', + 'tweakValidation', + 'typeInvalidation', + 'undefinedNames', + 'undefinedVars', + 'underscore', + 'unknownDefines', + 'unnecessaryCasts', + 'unusedPrivateMembers', + 'uselessCode', + 'visibility', + 'with', + ]) + + HAS_DESCRIPTION = frozenset([ + 'define', + 'deprecated', + 'desc', + 'fileoverview', + 'license', + 'param', + 'preserve', + 'return', + 'supported', + ]) + + # Docflags whose argument should be parsed using the typeannotation parser. + HAS_TYPE = frozenset([ + 'const', + 'define', + 'enum', + 'extends', + 'final', + 'implements', + 'mods', + 'package', + 'param', + 'private', + 'protected', + 'public', + 'return', + 'suppress', + 'type', + 'typedef', + ]) + + # Docflags for which it's ok to omit the type (flag without an argument). + CAN_OMIT_TYPE = frozenset([ + 'const', + 'enum', + 'final', + 'package', + 'private', + 'protected', + 'public', + 'suppress', # We'll raise a separate INCORRECT_SUPPRESS_SYNTAX instead. + ]) + + # Docflags that only take a type as an argument and should not parse a + # following description. + TYPE_ONLY = frozenset([ + 'const', + 'enum', + 'extends', + 'implements', + 'package', + 'suppress', + 'type', + ]) + + HAS_NAME = frozenset(['param']) + + EMPTY_COMMENT_LINE = re.compile(r'^\s*\*?\s*$') + EMPTY_STRING = re.compile(r'^\s*$') + + def __init__(self, flag_token, error_handler=None): + """Creates the DocFlag object and attaches it to the given start token. + + Args: + flag_token: The starting token of the flag. + error_handler: An optional error handler for errors occurring while + parsing the doctype. + """ + self.flag_token = flag_token + self.flag_type = flag_token.string.strip().lstrip('@') + + # Extract type, if applicable. + self.type = None + self.jstype = None + self.type_start_token = None + self.type_end_token = None + if self.flag_type in self.HAS_TYPE: + brace = tokenutil.SearchUntil(flag_token, [Type.DOC_START_BRACE], + Type.FLAG_ENDING_TYPES) + if brace: + end_token, contents = _GetMatchingEndBraceAndContents(brace) + self.type = contents + self.jstype = typeannotation.Parse(brace, end_token, + error_handler) + self.type_start_token = brace + self.type_end_token = end_token + elif (self.flag_type in self.TYPE_ONLY and + flag_token.next.type not in Type.FLAG_ENDING_TYPES and + flag_token.line_number == flag_token.next.line_number): + # b/10407058. If the flag is expected to be followed by a type then + # search for type in same line only. If no token after flag in same + # line then conclude that no type is specified. + self.type_start_token = flag_token.next + self.type_end_token, self.type = _GetEndTokenAndContents( + self.type_start_token) + if self.type is not None: + self.type = self.type.strip() + self.jstype = typeannotation.Parse(flag_token, self.type_end_token, + error_handler) + + # Extract name, if applicable. + self.name_token = None + self.name = None + if self.flag_type in self.HAS_NAME: + # Handle bad case, name could be immediately after flag token. + self.name_token = _GetNextPartialIdentifierToken(flag_token) + + # Handle good case, if found token is after type start, look for + # a identifier (substring to cover cases like [cnt] b/4197272) after + # type end, since types contain identifiers. + if (self.type and self.name_token and + tokenutil.Compare(self.name_token, self.type_start_token) > 0): + self.name_token = _GetNextPartialIdentifierToken(self.type_end_token) + + if self.name_token: + self.name = self.name_token.string + + # Extract description, if applicable. + self.description_start_token = None + self.description_end_token = None + self.description = None + if self.flag_type in self.HAS_DESCRIPTION: + search_start_token = flag_token + if self.name_token and self.type_end_token: + if tokenutil.Compare(self.type_end_token, self.name_token) > 0: + search_start_token = self.type_end_token + else: + search_start_token = self.name_token + elif self.name_token: + search_start_token = self.name_token + elif self.type: + search_start_token = self.type_end_token + + interesting_token = tokenutil.Search(search_start_token, + Type.FLAG_DESCRIPTION_TYPES | Type.FLAG_ENDING_TYPES) + if interesting_token.type in Type.FLAG_DESCRIPTION_TYPES: + self.description_start_token = interesting_token + self.description_end_token, self.description = ( + _GetEndTokenAndContents(interesting_token)) + + def HasType(self): + """Returns whether this flag should have a type annotation.""" + return self.flag_type in self.HAS_TYPE + + def __repr__(self): + return '' % (self.flag_type, repr(self.jstype)) + + +class DocComment(object): + """JavaScript doc comment object. + + Attributes: + ordered_params: Ordered list of parameters documented. + start_token: The token that starts the doc comment. + end_token: The token that ends the doc comment. + suppressions: Map of suppression type to the token that added it. + """ + def __init__(self, start_token): + """Create the doc comment object. + + Args: + start_token: The first token in the doc comment. + """ + self.__flags = [] + self.start_token = start_token + self.end_token = None + self.suppressions = {} + self.invalidated = False + + @property + def ordered_params(self): + """Gives the list of parameter names as a list of strings.""" + params = [] + for flag in self.__flags: + if flag.flag_type == 'param' and flag.name: + params.append(flag.name) + return params + + def Invalidate(self): + """Indicate that the JSDoc is well-formed but we had problems parsing it. + + This is a short-circuiting mechanism so that we don't emit false + positives about well-formed doc comments just because we don't support + hot new syntaxes. + """ + self.invalidated = True + + def IsInvalidated(self): + """Test whether Invalidate() has been called.""" + return self.invalidated + + def AddSuppression(self, token): + """Add a new error suppression flag. + + Args: + token: The suppression flag token. + """ + flag = token and token.attached_object + if flag and flag.jstype: + for suppression in flag.jstype.IterIdentifiers(): + self.suppressions[suppression] = token + + def SuppressionOnly(self): + """Returns whether this comment contains only suppression flags.""" + if not self.__flags: + return False + + for flag in self.__flags: + if flag.flag_type != 'suppress': + return False + + return True + + def AddFlag(self, flag): + """Add a new document flag. + + Args: + flag: DocFlag object. + """ + self.__flags.append(flag) + + def InheritsDocumentation(self): + """Test if the jsdoc implies documentation inheritance. + + Returns: + True if documentation may be pulled off the superclass. + """ + return self.HasFlag('inheritDoc') or self.HasFlag('override') + + def HasFlag(self, flag_type): + """Test if the given flag has been set. + + Args: + flag_type: The type of the flag to check. + + Returns: + True if the flag is set. + """ + for flag in self.__flags: + if flag.flag_type == flag_type: + return True + return False + + def GetFlag(self, flag_type): + """Gets the last flag of the given type. + + Args: + flag_type: The type of the flag to get. + + Returns: + The last instance of the given flag type in this doc comment. + """ + for flag in reversed(self.__flags): + if flag.flag_type == flag_type: + return flag + + def GetDocFlags(self): + """Return the doc flags for this comment.""" + return list(self.__flags) + + def _YieldDescriptionTokens(self): + for token in self.start_token: + + if (token is self.end_token or + token.type is javascripttokens.JavaScriptTokenType.DOC_FLAG or + token.type not in javascripttokens.JavaScriptTokenType.COMMENT_TYPES): + return + + if token.type not in [ + javascripttokens.JavaScriptTokenType.START_DOC_COMMENT, + javascripttokens.JavaScriptTokenType.END_DOC_COMMENT, + javascripttokens.JavaScriptTokenType.DOC_PREFIX]: + yield token + + @property + def description(self): + return tokenutil.TokensToString( + self._YieldDescriptionTokens()) + + def GetTargetIdentifier(self): + """Returns the identifier (as a string) that this is a comment for. + + Note that this uses method uses GetIdentifierForToken to get the full + identifier, even if broken up by whitespace, newlines, or comments, + and thus could be longer than GetTargetToken().string. + + Returns: + The identifier for the token this comment is for. + """ + token = self.GetTargetToken() + if token: + return tokenutil.GetIdentifierForToken(token) + + def GetTargetToken(self): + """Get this comment's target token. + + Returns: + The token that is the target of this comment, or None if there isn't one. + """ + + # File overviews describe the file, not a token. + if self.HasFlag('fileoverview'): + return + + skip_types = frozenset([ + Type.WHITESPACE, + Type.BLANK_LINE, + Type.START_PAREN]) + + target_types = frozenset([ + Type.FUNCTION_NAME, + Type.IDENTIFIER, + Type.SIMPLE_LVALUE]) + + token = self.end_token.next + while token: + if token.type in target_types: + return token + + # Handles the case of a comment on "var foo = ...' + if token.IsKeyword('var'): + next_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES) + + if (next_code_token and + next_code_token.IsType(Type.SIMPLE_LVALUE)): + return next_code_token + + return + + # Handles the case of a comment on "function foo () {}" + if token.type is Type.FUNCTION_DECLARATION: + next_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES) + + if next_code_token.IsType(Type.FUNCTION_NAME): + return next_code_token + + return + + # Skip types will end the search. + if token.type not in skip_types: + return + + token = token.next + + def CompareParameters(self, params): + """Computes the edit distance and list from the function params to the docs. + + Uses the Levenshtein edit distance algorithm, with code modified from + http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#Python + + Args: + params: The parameter list for the function declaration. + + Returns: + The edit distance, the edit list. + """ + source_len, target_len = len(self.ordered_params), len(params) + edit_lists = [[]] + distance = [[]] + for i in range(target_len+1): + edit_lists[0].append(['I'] * i) + distance[0].append(i) + + for j in range(1, source_len+1): + edit_lists.append([['D'] * j]) + distance.append([j]) + + for i in range(source_len): + for j in range(target_len): + cost = 1 + if self.ordered_params[i] == params[j]: + cost = 0 + + deletion = distance[i][j+1] + 1 + insertion = distance[i+1][j] + 1 + substitution = distance[i][j] + cost + + edit_list = None + best = None + if deletion <= insertion and deletion <= substitution: + # Deletion is best. + best = deletion + edit_list = list(edit_lists[i][j+1]) + edit_list.append('D') + + elif insertion <= substitution: + # Insertion is best. + best = insertion + edit_list = list(edit_lists[i+1][j]) + edit_list.append('I') + edit_lists[i+1].append(edit_list) + + else: + # Substitution is best. + best = substitution + edit_list = list(edit_lists[i][j]) + if cost: + edit_list.append('S') + else: + edit_list.append('=') + + edit_lists[i+1].append(edit_list) + distance[i+1].append(best) + + return distance[source_len][target_len], edit_lists[source_len][target_len] + + def __repr__(self): + """Returns a string representation of this object. + + Returns: + A string representation of this object. + """ + return '' % ( + str(self.ordered_params), str(self.__flags)) + + +# +# Helper methods used by DocFlag and DocComment to parse out flag information. +# + + +def _GetMatchingEndBraceAndContents(start_brace): + """Returns the matching end brace and contents between the two braces. + + If any FLAG_ENDING_TYPE token is encountered before a matching end brace, then + that token is used as the matching ending token. Contents will have all + comment prefixes stripped out of them, and all comment prefixes in between the + start and end tokens will be split out into separate DOC_PREFIX tokens. + + Args: + start_brace: The DOC_START_BRACE token immediately before desired contents. + + Returns: + The matching ending token (DOC_END_BRACE or FLAG_ENDING_TYPE) and a string + of the contents between the matching tokens, minus any comment prefixes. + """ + open_count = 1 + close_count = 0 + contents = [] + + # We don't consider the start brace part of the type string. + token = start_brace.next + while open_count != close_count: + if token.type == Type.DOC_START_BRACE: + open_count += 1 + elif token.type == Type.DOC_END_BRACE: + close_count += 1 + + if token.type != Type.DOC_PREFIX: + contents.append(token.string) + + if token.type in Type.FLAG_ENDING_TYPES: + break + token = token.next + + #Don't include the end token (end brace, end doc comment, etc.) in type. + token = token.previous + contents = contents[:-1] + + return token, ''.join(contents) + + +def _GetNextPartialIdentifierToken(start_token): + """Returns the first token having identifier as substring after a token. + + Searches each token after the start to see if it contains an identifier. + If found, token is returned. If no identifier is found returns None. + Search is abandoned when a FLAG_ENDING_TYPE token is found. + + Args: + start_token: The token to start searching after. + + Returns: + The token found containing identifier, None otherwise. + """ + token = start_token.next + + while token and token.type not in Type.FLAG_ENDING_TYPES: + match = javascripttokenizer.JavaScriptTokenizer.IDENTIFIER.search( + token.string) + if match is not None and token.type == Type.COMMENT: + return token + + token = token.next + + return None + + +def _GetEndTokenAndContents(start_token): + """Returns last content token and all contents before FLAG_ENDING_TYPE token. + + Comment prefixes are split into DOC_PREFIX tokens and stripped from the + returned contents. + + Args: + start_token: The token immediately before the first content token. + + Returns: + The last content token and a string of all contents including start and + end tokens, with comment prefixes stripped. + """ + iterator = start_token + last_line = iterator.line_number + last_token = None + contents = '' + doc_depth = 0 + while not iterator.type in Type.FLAG_ENDING_TYPES or doc_depth > 0: + if (iterator.IsFirstInLine() and + DocFlag.EMPTY_COMMENT_LINE.match(iterator.line)): + # If we have a blank comment line, consider that an implicit + # ending of the description. This handles a case like: + # + # * @return {boolean} True + # * + # * Note: This is a sentence. + # + # The note is not part of the @return description, but there was + # no definitive ending token. Rather there was a line containing + # only a doc comment prefix or whitespace. + break + + # b/2983692 + # don't prematurely match against a @flag if inside a doc flag + # need to think about what is the correct behavior for unterminated + # inline doc flags + if (iterator.type == Type.DOC_START_BRACE and + iterator.next.type == Type.DOC_INLINE_FLAG): + doc_depth += 1 + elif (iterator.type == Type.DOC_END_BRACE and + doc_depth > 0): + doc_depth -= 1 + + if iterator.type in Type.FLAG_DESCRIPTION_TYPES: + contents += iterator.string + last_token = iterator + + iterator = iterator.next + if iterator.line_number != last_line: + contents += '\n' + last_line = iterator.line_number + + end_token = last_token + if DocFlag.EMPTY_STRING.match(contents): + contents = None + else: + # Strip trailing newline. + contents = contents[:-1] + + return end_token, contents + + +class Function(object): + """Data about a JavaScript function. + + Attributes: + block_depth: Block depth the function began at. + doc: The DocComment associated with the function. + has_return: If the function has a return value. + has_this: If the function references the 'this' object. + is_assigned: If the function is part of an assignment. + is_constructor: If the function is a constructor. + name: The name of the function, whether given in the function keyword or + as the lvalue the function is assigned to. + start_token: First token of the function (the function' keyword token). + end_token: Last token of the function (the closing '}' token). + parameters: List of parameter names. + """ + + def __init__(self, block_depth, is_assigned, doc, name): + self.block_depth = block_depth + self.is_assigned = is_assigned + self.is_constructor = doc and doc.HasFlag('constructor') + self.is_interface = doc and doc.HasFlag('interface') + self.has_return = False + self.has_throw = False + self.has_this = False + self.name = name + self.doc = doc + self.start_token = None + self.end_token = None + self.parameters = None + + +class StateTracker(object): + """EcmaScript state tracker. + + Tracks block depth, function names, etc. within an EcmaScript token stream. + """ + + OBJECT_LITERAL = 'o' + CODE = 'c' + + def __init__(self, doc_flag=DocFlag): + """Initializes a JavaScript token stream state tracker. + + Args: + doc_flag: An optional custom DocFlag used for validating + documentation flags. + """ + self._doc_flag = doc_flag + self.Reset() + + def Reset(self): + """Resets the state tracker to prepare for processing a new page.""" + self._block_depth = 0 + self._is_block_close = False + self._paren_depth = 0 + self._function_stack = [] + self._functions_by_name = {} + self._last_comment = None + self._doc_comment = None + self._cumulative_params = None + self._block_types = [] + self._last_non_space_token = None + self._last_line = None + self._first_token = None + self._documented_identifiers = set() + self._variables_in_scope = [] + + def DocFlagPass(self, start_token, error_handler): + """Parses doc flags. + + This pass needs to be executed before the aliaspass and we don't want to do + a full-blown statetracker dry run for these. + + Args: + start_token: The token at which to start iterating + error_handler: An error handler for error reporting. + """ + if not start_token: + return + doc_flag_types = (Type.DOC_FLAG, Type.DOC_INLINE_FLAG) + for token in start_token: + if token.type in doc_flag_types: + token.attached_object = self._doc_flag(token, error_handler) + + def InFunction(self): + """Returns true if the current token is within a function. + + Returns: + True if the current token is within a function. + """ + return bool(self._function_stack) + + def InConstructor(self): + """Returns true if the current token is within a constructor. + + Returns: + True if the current token is within a constructor. + """ + return self.InFunction() and self._function_stack[-1].is_constructor + + def InInterfaceMethod(self): + """Returns true if the current token is within an interface method. + + Returns: + True if the current token is within an interface method. + """ + if self.InFunction(): + if self._function_stack[-1].is_interface: + return True + else: + name = self._function_stack[-1].name + prototype_index = name.find('.prototype.') + if prototype_index != -1: + class_function_name = name[0:prototype_index] + if (class_function_name in self._functions_by_name and + self._functions_by_name[class_function_name].is_interface): + return True + + return False + + def InTopLevelFunction(self): + """Returns true if the current token is within a top level function. + + Returns: + True if the current token is within a top level function. + """ + return len(self._function_stack) == 1 and self.InTopLevel() + + def InAssignedFunction(self): + """Returns true if the current token is within a function variable. + + Returns: + True if if the current token is within a function variable + """ + return self.InFunction() and self._function_stack[-1].is_assigned + + def IsFunctionOpen(self): + """Returns true if the current token is a function block open. + + Returns: + True if the current token is a function block open. + """ + return (self._function_stack and + self._function_stack[-1].block_depth == self._block_depth - 1) + + def IsFunctionClose(self): + """Returns true if the current token is a function block close. + + Returns: + True if the current token is a function block close. + """ + return (self._function_stack and + self._function_stack[-1].block_depth == self._block_depth) + + def InBlock(self): + """Returns true if the current token is within a block. + + Returns: + True if the current token is within a block. + """ + return bool(self._block_depth) + + def IsBlockClose(self): + """Returns true if the current token is a block close. + + Returns: + True if the current token is a block close. + """ + return self._is_block_close + + def InObjectLiteral(self): + """Returns true if the current token is within an object literal. + + Returns: + True if the current token is within an object literal. + """ + return self._block_depth and self._block_types[-1] == self.OBJECT_LITERAL + + def InObjectLiteralDescendant(self): + """Returns true if the current token has an object literal ancestor. + + Returns: + True if the current token has an object literal ancestor. + """ + return self.OBJECT_LITERAL in self._block_types + + def InParentheses(self): + """Returns true if the current token is within parentheses. + + Returns: + True if the current token is within parentheses. + """ + return bool(self._paren_depth) + + def ParenthesesDepth(self): + """Returns the number of parens surrounding the token. + + Returns: + The number of parenthesis surrounding the token. + """ + return self._paren_depth + + def BlockDepth(self): + """Returns the number of blocks in which the token is nested. + + Returns: + The number of blocks in which the token is nested. + """ + return self._block_depth + + def FunctionDepth(self): + """Returns the number of functions in which the token is nested. + + Returns: + The number of functions in which the token is nested. + """ + return len(self._function_stack) + + def InTopLevel(self): + """Whether we are at the top level in the class. + + This function call is language specific. In some languages like + JavaScript, a function is top level if it is not inside any parenthesis. + In languages such as ActionScript, a function is top level if it is directly + within a class. + """ + raise TypeError('Abstract method InTopLevel not implemented') + + def GetBlockType(self, token): + """Determine the block type given a START_BLOCK token. + + Code blocks come after parameters, keywords like else, and closing parens. + + Args: + token: The current token. Can be assumed to be type START_BLOCK. + Returns: + Code block type for current token. + """ + raise TypeError('Abstract method GetBlockType not implemented') + + def GetParams(self): + """Returns the accumulated input params as an array. + + In some EcmasSript languages, input params are specified like + (param:Type, param2:Type2, ...) + in other they are specified just as + (param, param2) + We handle both formats for specifying parameters here and leave + it to the compilers for each language to detect compile errors. + This allows more code to be reused between lint checkers for various + EcmaScript languages. + + Returns: + The accumulated input params as an array. + """ + params = [] + if self._cumulative_params: + params = re.compile(r'\s+').sub('', self._cumulative_params).split(',') + # Strip out the type from parameters of the form name:Type. + params = map(lambda param: param.split(':')[0], params) + + return params + + def GetLastComment(self): + """Return the last plain comment that could be used as documentation. + + Returns: + The last plain comment that could be used as documentation. + """ + return self._last_comment + + def GetDocComment(self): + """Return the most recent applicable documentation comment. + + Returns: + The last applicable documentation comment. + """ + return self._doc_comment + + def HasDocComment(self, identifier): + """Returns whether the identifier has been documented yet. + + Args: + identifier: The identifier. + + Returns: + Whether the identifier has been documented yet. + """ + return identifier in self._documented_identifiers + + def InDocComment(self): + """Returns whether the current token is in a doc comment. + + Returns: + Whether the current token is in a doc comment. + """ + return self._doc_comment and self._doc_comment.end_token is None + + def GetDocFlag(self): + """Returns the current documentation flags. + + Returns: + The current documentation flags. + """ + return self._doc_flag + + def IsTypeToken(self, t): + if self.InDocComment() and t.type not in (Type.START_DOC_COMMENT, + Type.DOC_FLAG, Type.DOC_INLINE_FLAG, Type.DOC_PREFIX): + f = tokenutil.SearchUntil(t, [Type.DOC_FLAG], [Type.START_DOC_COMMENT], + None, True) + if (f and f.attached_object.type_start_token is not None and + f.attached_object.type_end_token is not None): + return (tokenutil.Compare(t, f.attached_object.type_start_token) > 0 and + tokenutil.Compare(t, f.attached_object.type_end_token) < 0) + return False + + def GetFunction(self): + """Return the function the current code block is a part of. + + Returns: + The current Function object. + """ + if self._function_stack: + return self._function_stack[-1] + + def GetBlockDepth(self): + """Return the block depth. + + Returns: + The current block depth. + """ + return self._block_depth + + def GetLastNonSpaceToken(self): + """Return the last non whitespace token.""" + return self._last_non_space_token + + def GetLastLine(self): + """Return the last line.""" + return self._last_line + + def GetFirstToken(self): + """Return the very first token in the file.""" + return self._first_token + + def IsVariableInScope(self, token_string): + """Checks if string is variable in current scope. + + For given string it checks whether the string is a defined variable + (including function param) in current state. + + E.g. if variables defined (variables in current scope) is docs + then docs, docs.length etc will be considered as variable in current + scope. This will help in avoding extra goog.require for variables. + + Args: + token_string: String to check if its is a variable in current scope. + + Returns: + true if given string is a variable in current scope. + """ + for variable in self._variables_in_scope: + if (token_string == variable + or token_string.startswith(variable + '.')): + return True + + return False + + def HandleToken(self, token, last_non_space_token): + """Handles the given token and updates state. + + Args: + token: The token to handle. + last_non_space_token: + """ + self._is_block_close = False + + if not self._first_token: + self._first_token = token + + # Track block depth. + type = token.type + if type == Type.START_BLOCK: + self._block_depth += 1 + + # Subclasses need to handle block start very differently because + # whether a block is a CODE or OBJECT_LITERAL block varies significantly + # by language. + self._block_types.append(self.GetBlockType(token)) + + # When entering a function body, record its parameters. + if self.InFunction(): + function = self._function_stack[-1] + if self._block_depth == function.block_depth + 1: + function.parameters = self.GetParams() + + # Track block depth. + elif type == Type.END_BLOCK: + self._is_block_close = not self.InObjectLiteral() + self._block_depth -= 1 + self._block_types.pop() + + # Track parentheses depth. + elif type == Type.START_PAREN: + self._paren_depth += 1 + + # Track parentheses depth. + elif type == Type.END_PAREN: + self._paren_depth -= 1 + + elif type == Type.COMMENT: + self._last_comment = token.string + + elif type == Type.START_DOC_COMMENT: + self._last_comment = None + self._doc_comment = DocComment(token) + + elif type == Type.END_DOC_COMMENT: + self._doc_comment.end_token = token + + elif type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG): + # Don't overwrite flags if they were already parsed in a previous pass. + if token.attached_object is None: + flag = self._doc_flag(token) + token.attached_object = flag + else: + flag = token.attached_object + self._doc_comment.AddFlag(flag) + + if flag.flag_type == 'suppress': + self._doc_comment.AddSuppression(token) + + elif type == Type.FUNCTION_DECLARATION: + last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None, + True) + doc = None + # Only top-level functions are eligible for documentation. + if self.InTopLevel(): + doc = self._doc_comment + + name = '' + is_assigned = last_code and (last_code.IsOperator('=') or + last_code.IsOperator('||') or last_code.IsOperator('&&') or + (last_code.IsOperator(':') and not self.InObjectLiteral())) + if is_assigned: + # TODO(robbyw): This breaks for x[2] = ... + # Must use loop to find full function name in the case of line-wrapped + # declarations (bug 1220601) like: + # my.function.foo. + # bar = function() ... + identifier = tokenutil.Search(last_code, Type.SIMPLE_LVALUE, None, True) + while identifier and tokenutil.IsIdentifierOrDot(identifier): + name = identifier.string + name + # Traverse behind us, skipping whitespace and comments. + while True: + identifier = identifier.previous + if not identifier or not identifier.type in Type.NON_CODE_TYPES: + break + + else: + next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) + while next_token and next_token.IsType(Type.FUNCTION_NAME): + name += next_token.string + next_token = tokenutil.Search(next_token, Type.FUNCTION_NAME, 2) + + function = Function(self._block_depth, is_assigned, doc, name) + function.start_token = token + + self._function_stack.append(function) + self._functions_by_name[name] = function + + # Add a delimiter in stack for scope variables to define start of + # function. This helps in popping variables of this function when + # function declaration ends. + self._variables_in_scope.append('') + + elif type == Type.START_PARAMETERS: + self._cumulative_params = '' + + elif type == Type.PARAMETERS: + self._cumulative_params += token.string + self._variables_in_scope.extend(self.GetParams()) + + elif type == Type.KEYWORD and token.string == 'return': + next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) + if not next_token.IsType(Type.SEMICOLON): + function = self.GetFunction() + if function: + function.has_return = True + + elif type == Type.KEYWORD and token.string == 'throw': + function = self.GetFunction() + if function: + function.has_throw = True + + elif type == Type.KEYWORD and token.string == 'var': + function = self.GetFunction() + next_token = tokenutil.Search(token, [Type.IDENTIFIER, + Type.SIMPLE_LVALUE]) + + if next_token: + if next_token.type == Type.SIMPLE_LVALUE: + self._variables_in_scope.append(next_token.values['identifier']) + else: + self._variables_in_scope.append(next_token.string) + + elif type == Type.SIMPLE_LVALUE: + identifier = token.values['identifier'] + jsdoc = self.GetDocComment() + if jsdoc: + self._documented_identifiers.add(identifier) + + self._HandleIdentifier(identifier, True) + + elif type == Type.IDENTIFIER: + self._HandleIdentifier(token.string, False) + + # Detect documented non-assignments. + next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) + if next_token and next_token.IsType(Type.SEMICOLON): + if (self._last_non_space_token and + self._last_non_space_token.IsType(Type.END_DOC_COMMENT)): + self._documented_identifiers.add(token.string) + + def _HandleIdentifier(self, identifier, is_assignment): + """Process the given identifier. + + Currently checks if it references 'this' and annotates the function + accordingly. + + Args: + identifier: The identifer to process. + is_assignment: Whether the identifer is being written to. + """ + if identifier == 'this' or identifier.startswith('this.'): + function = self.GetFunction() + if function: + function.has_this = True + + def HandleAfterToken(self, token): + """Handle updating state after a token has been checked. + + This function should be used for destructive state changes such as + deleting a tracked object. + + Args: + token: The token to handle. + """ + type = token.type + if type == Type.SEMICOLON or type == Type.END_PAREN or ( + type == Type.END_BRACKET and + self._last_non_space_token.type not in ( + Type.SINGLE_QUOTE_STRING_END, Type.DOUBLE_QUOTE_STRING_END)): + # We end on any numeric array index, but keep going for string based + # array indices so that we pick up manually exported identifiers. + self._doc_comment = None + self._last_comment = None + + elif type == Type.END_BLOCK: + self._doc_comment = None + self._last_comment = None + + if self.InFunction() and self.IsFunctionClose(): + # TODO(robbyw): Detect the function's name for better errors. + function = self._function_stack.pop() + function.end_token = token + + # Pop all variables till delimiter ('') those were defined in the + # function being closed so make them out of scope. + while self._variables_in_scope and self._variables_in_scope[-1]: + self._variables_in_scope.pop() + + # Pop delimiter + if self._variables_in_scope: + self._variables_in_scope.pop() + + elif type == Type.END_PARAMETERS and self._doc_comment: + self._doc_comment = None + self._last_comment = None + + if not token.IsAnyType(Type.WHITESPACE, Type.BLANK_LINE): + self._last_non_space_token = token + + self._last_line = token.line diff --git a/tools/closure_linter/build/lib/closure_linter/statetracker_test.py b/tools/closure_linter/build/lib/closure_linter/statetracker_test.py new file mode 100644 index 00000000000000..494dc642fc5bde --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/statetracker_test.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the statetracker module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + + + +import unittest as googletest + +from closure_linter import javascripttokens +from closure_linter import statetracker +from closure_linter import testutil + + +class _FakeDocFlag(object): + + def __repr__(self): + return '@%s %s' % (self.flag_type, self.name) + + +class IdentifierTest(googletest.TestCase): + + def testJustIdentifier(self): + a = javascripttokens.JavaScriptToken( + 'abc', javascripttokens.JavaScriptTokenType.IDENTIFIER, 'abc', 1) + + st = statetracker.StateTracker() + st.HandleToken(a, None) + + +class DocCommentTest(googletest.TestCase): + + @staticmethod + def _MakeDocFlagFake(flag_type, name=None): + flag = _FakeDocFlag() + flag.flag_type = flag_type + flag.name = name + return flag + + def testDocFlags(self): + comment = statetracker.DocComment(None) + + a = self._MakeDocFlagFake('param', 'foo') + comment.AddFlag(a) + + b = self._MakeDocFlagFake('param', '') + comment.AddFlag(b) + + c = self._MakeDocFlagFake('param', 'bar') + comment.AddFlag(c) + + self.assertEquals( + ['foo', 'bar'], + comment.ordered_params) + + self.assertEquals( + [a, b, c], + comment.GetDocFlags()) + + def testInvalidate(self): + comment = statetracker.DocComment(None) + + self.assertFalse(comment.invalidated) + self.assertFalse(comment.IsInvalidated()) + + comment.Invalidate() + + self.assertTrue(comment.invalidated) + self.assertTrue(comment.IsInvalidated()) + + def testSuppressionOnly(self): + comment = statetracker.DocComment(None) + + self.assertFalse(comment.SuppressionOnly()) + comment.AddFlag(self._MakeDocFlagFake('suppress')) + self.assertTrue(comment.SuppressionOnly()) + comment.AddFlag(self._MakeDocFlagFake('foo')) + self.assertFalse(comment.SuppressionOnly()) + + def testRepr(self): + comment = statetracker.DocComment(None) + comment.AddFlag(self._MakeDocFlagFake('param', 'foo')) + comment.AddFlag(self._MakeDocFlagFake('param', 'bar')) + + self.assertEquals( + '', + repr(comment)) + + def testDocFlagParam(self): + comment = self._ParseComment(""" + /** + * @param {string} [name] Name of customer. + */""") + flag = comment.GetFlag('param') + self.assertEquals('string', flag.type) + self.assertEquals('string', flag.jstype.ToString()) + self.assertEquals('[name]', flag.name) + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + _, comments = testutil.ParseFunctionsAndComments(script) + self.assertEquals(1, len(comments)) + return comments[0] + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/strict_test.py b/tools/closure_linter/build/lib/closure_linter/strict_test.py new file mode 100644 index 00000000000000..2634456874f1d2 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/strict_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# Copyright 2013 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for gjslint --strict. + +Tests errors that can be thrown by gjslint when in strict mode. +""" + + + +import unittest + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import erroraccumulator + +flags.FLAGS.strict = True + + +class StrictTest(unittest.TestCase): + """Tests scenarios where strict generates warnings.""" + + def testUnclosedString(self): + """Tests warnings are reported when nothing is disabled. + + b/11450054. + """ + original = [ + 'bug = function() {', + ' (\'foo\'\');', + '};', + '', + ] + + expected = [errors.FILE_DOES_NOT_PARSE, errors.MULTI_LINE_STRING, + errors.FILE_IN_BLOCK] + self._AssertErrors(original, expected) + + def _AssertErrors(self, original, expected_errors): + """Asserts that the error fixer corrects original to expected.""" + + # Trap gjslint's output parse it to get messages added. + error_accumulator = erroraccumulator.ErrorAccumulator() + runner.Run('testing.js', error_accumulator, source=original) + error_nums = [e.code for e in error_accumulator.GetErrors()] + + error_nums.sort() + expected_errors.sort() + self.assertListEqual(error_nums, expected_errors) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/testutil.py b/tools/closure_linter/build/lib/closure_linter/testutil.py new file mode 100644 index 00000000000000..f7084ee37b0683 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/testutil.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility functions for testing gjslint components.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import StringIO + +from closure_linter import ecmametadatapass +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokenizer + + +def TokenizeSource(source): + """Convert a source into a string of tokens. + + Args: + source: A source file as a string or file-like object (iterates lines). + + Returns: + The first token of the resulting token stream. + """ + + if isinstance(source, basestring): + source = StringIO.StringIO(source) + + tokenizer = javascripttokenizer.JavaScriptTokenizer() + return tokenizer.TokenizeFile(source) + + +def TokenizeSourceAndRunEcmaPass(source): + """Tokenize a source and run the EcmaMetaDataPass on it. + + Args: + source: A source file as a string or file-like object (iterates lines). + + Returns: + The first token of the resulting token stream. + """ + start_token = TokenizeSource(source) + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + ecma_pass.Process(start_token) + return start_token + + +def ParseFunctionsAndComments(source, error_handler=None): + """Run the tokenizer and tracker and return comments and functions found. + + Args: + source: A source file as a string or file-like object (iterates lines). + error_handler: An error handler. + + Returns: + The functions and comments as a tuple. + """ + start_token = TokenizeSourceAndRunEcmaPass(source) + + tracker = javascriptstatetracker.JavaScriptStateTracker() + if error_handler is not None: + tracker.DocFlagPass(start_token, error_handler) + + functions = [] + comments = [] + for token in start_token: + tracker.HandleToken(token, tracker.GetLastNonSpaceToken()) + + function = tracker.GetFunction() + if function and function not in functions: + functions.append(function) + + comment = tracker.GetDocComment() + if comment and comment not in comments: + comments.append(comment) + + tracker.HandleAfterToken(token) + + return functions, comments diff --git a/tools/closure_linter/build/lib/closure_linter/tokenutil.py b/tools/closure_linter/build/lib/closure_linter/tokenutil.py new file mode 100644 index 00000000000000..11e3ccc68bbe06 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/tokenutil.py @@ -0,0 +1,697 @@ +#!/usr/bin/env python +# +# Copyright 2007 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Token utility functions.""" + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)') + +import copy +import StringIO + +from closure_linter.common import tokens +from closure_linter.javascripttokens import JavaScriptToken +from closure_linter.javascripttokens import JavaScriptTokenType + +# Shorthand +Type = tokens.TokenType + + +def GetFirstTokenInSameLine(token): + """Returns the first token in the same line as token. + + Args: + token: Any token in the line. + + Returns: + The first token in the same line as token. + """ + while not token.IsFirstInLine(): + token = token.previous + return token + + +def GetFirstTokenInPreviousLine(token): + """Returns the first token in the previous line as token. + + Args: + token: Any token in the line. + + Returns: + The first token in the previous line as token, or None if token is on the + first line. + """ + first_in_line = GetFirstTokenInSameLine(token) + if first_in_line.previous: + return GetFirstTokenInSameLine(first_in_line.previous) + + return None + + +def GetLastTokenInSameLine(token): + """Returns the last token in the same line as token. + + Args: + token: Any token in the line. + + Returns: + The last token in the same line as token. + """ + while not token.IsLastInLine(): + token = token.next + return token + + +def GetAllTokensInSameLine(token): + """Returns all tokens in the same line as the given token. + + Args: + token: Any token in the line. + + Returns: + All tokens on the same line as the given token. + """ + first_token = GetFirstTokenInSameLine(token) + last_token = GetLastTokenInSameLine(token) + + tokens_in_line = [] + while first_token != last_token: + tokens_in_line.append(first_token) + first_token = first_token.next + tokens_in_line.append(last_token) + + return tokens_in_line + + +def CustomSearch(start_token, func, end_func=None, distance=None, + reverse=False): + """Returns the first token where func is True within distance of this token. + + Args: + start_token: The token to start searching from + func: The function to call to test a token for applicability + end_func: The function to call to test a token to determine whether to abort + the search. + distance: The number of tokens to look through before failing search. Must + be positive. If unspecified, will search until the end of the token + chain + reverse: When true, search the tokens before this one instead of the tokens + after it + + Returns: + The first token matching func within distance of this token, or None if no + such token is found. + """ + token = start_token + if reverse: + while token and (distance is None or distance > 0): + previous = token.previous + if previous: + if func(previous): + return previous + if end_func and end_func(previous): + return None + + token = previous + if distance is not None: + distance -= 1 + + else: + while token and (distance is None or distance > 0): + next_token = token.next + if next_token: + if func(next_token): + return next_token + if end_func and end_func(next_token): + return None + + token = next_token + if distance is not None: + distance -= 1 + + return None + + +def Search(start_token, token_types, distance=None, reverse=False): + """Returns the first token of type in token_types within distance. + + Args: + start_token: The token to start searching from + token_types: The allowable types of the token being searched for + distance: The number of tokens to look through before failing search. Must + be positive. If unspecified, will search until the end of the token + chain + reverse: When true, search the tokens before this one instead of the tokens + after it + + Returns: + The first token of any type in token_types within distance of this token, or + None if no such token is found. + """ + return CustomSearch(start_token, lambda token: token.IsAnyType(token_types), + None, distance, reverse) + + +def SearchExcept(start_token, token_types, distance=None, reverse=False): + """Returns the first token not of any type in token_types within distance. + + Args: + start_token: The token to start searching from + token_types: The unallowable types of the token being searched for + distance: The number of tokens to look through before failing search. Must + be positive. If unspecified, will search until the end of the token + chain + reverse: When true, search the tokens before this one instead of the tokens + after it + + Returns: + The first token of any type in token_types within distance of this token, or + None if no such token is found. + """ + return CustomSearch(start_token, + lambda token: not token.IsAnyType(token_types), + None, distance, reverse) + + +def SearchUntil(start_token, token_types, end_types, distance=None, + reverse=False): + """Returns the first token of type in token_types before a token of end_type. + + Args: + start_token: The token to start searching from. + token_types: The allowable types of the token being searched for. + end_types: Types of tokens to abort search if we find. + distance: The number of tokens to look through before failing search. Must + be positive. If unspecified, will search until the end of the token + chain + reverse: When true, search the tokens before this one instead of the tokens + after it + + Returns: + The first token of any type in token_types within distance of this token + before any tokens of type in end_type, or None if no such token is found. + """ + return CustomSearch(start_token, lambda token: token.IsAnyType(token_types), + lambda token: token.IsAnyType(end_types), + distance, reverse) + + +def DeleteToken(token): + """Deletes the given token from the linked list. + + Args: + token: The token to delete + """ + # When deleting a token, we do not update the deleted token itself to make + # sure the previous and next pointers are still pointing to tokens which are + # not deleted. Also it is very hard to keep track of all previously deleted + # tokens to update them when their pointers become invalid. So we add this + # flag that any token linked list iteration logic can skip deleted node safely + # when its current token is deleted. + token.is_deleted = True + if token.previous: + token.previous.next = token.next + + if token.next: + token.next.previous = token.previous + + following_token = token.next + while following_token and following_token.metadata.last_code == token: + following_token.metadata.last_code = token.metadata.last_code + following_token = following_token.next + + +def DeleteTokens(token, token_count): + """Deletes the given number of tokens starting with the given token. + + Args: + token: The token to start deleting at. + token_count: The total number of tokens to delete. + """ + for i in xrange(1, token_count): + DeleteToken(token.next) + DeleteToken(token) + + +def InsertTokenBefore(new_token, token): + """Insert new_token before token. + + Args: + new_token: A token to be added to the stream + token: A token already in the stream + """ + new_token.next = token + new_token.previous = token.previous + + new_token.metadata = copy.copy(token.metadata) + + if new_token.IsCode(): + old_last_code = token.metadata.last_code + following_token = token + while (following_token and + following_token.metadata.last_code == old_last_code): + following_token.metadata.last_code = new_token + following_token = following_token.next + + token.previous = new_token + if new_token.previous: + new_token.previous.next = new_token + + if new_token.start_index is None: + if new_token.line_number == token.line_number: + new_token.start_index = token.start_index + else: + previous_token = new_token.previous + if previous_token: + new_token.start_index = (previous_token.start_index + + len(previous_token.string)) + else: + new_token.start_index = 0 + + iterator = new_token.next + while iterator and iterator.line_number == new_token.line_number: + iterator.start_index += len(new_token.string) + iterator = iterator.next + + +def InsertTokenAfter(new_token, token): + """Insert new_token after token. + + Args: + new_token: A token to be added to the stream + token: A token already in the stream + """ + new_token.previous = token + new_token.next = token.next + + new_token.metadata = copy.copy(token.metadata) + + if token.IsCode(): + new_token.metadata.last_code = token + + if new_token.IsCode(): + following_token = token.next + while following_token and following_token.metadata.last_code == token: + following_token.metadata.last_code = new_token + following_token = following_token.next + + token.next = new_token + if new_token.next: + new_token.next.previous = new_token + + if new_token.start_index is None: + if new_token.line_number == token.line_number: + new_token.start_index = token.start_index + len(token.string) + else: + new_token.start_index = 0 + + iterator = new_token.next + while iterator and iterator.line_number == new_token.line_number: + iterator.start_index += len(new_token.string) + iterator = iterator.next + + +def InsertTokensAfter(new_tokens, token): + """Insert multiple tokens after token. + + Args: + new_tokens: An array of tokens to be added to the stream + token: A token already in the stream + """ + # TODO(user): It would be nicer to have InsertTokenAfter defer to here + # instead of vice-versa. + current_token = token + for new_token in new_tokens: + InsertTokenAfter(new_token, current_token) + current_token = new_token + + +def InsertSpaceTokenAfter(token): + """Inserts a space token after the given token. + + Args: + token: The token to insert a space token after + + Returns: + A single space token + """ + space_token = JavaScriptToken(' ', Type.WHITESPACE, token.line, + token.line_number) + InsertTokenAfter(space_token, token) + + +def InsertBlankLineAfter(token): + """Inserts a blank line after the given token. + + Args: + token: The token to insert a blank line after + + Returns: + A single space token + """ + blank_token = JavaScriptToken('', Type.BLANK_LINE, '', + token.line_number + 1) + InsertLineAfter(token, [blank_token]) + + +def InsertLineAfter(token, new_tokens): + """Inserts a new line consisting of new_tokens after the given token. + + Args: + token: The token to insert after. + new_tokens: The tokens that will make up the new line. + """ + insert_location = token + for new_token in new_tokens: + InsertTokenAfter(new_token, insert_location) + insert_location = new_token + + # Update all subsequent line numbers. + next_token = new_tokens[-1].next + while next_token: + next_token.line_number += 1 + next_token = next_token.next + + +def SplitToken(token, position): + """Splits the token into two tokens at position. + + Args: + token: The token to split + position: The position to split at. Will be the beginning of second token. + + Returns: + The new second token. + """ + new_string = token.string[position:] + token.string = token.string[:position] + + new_token = JavaScriptToken(new_string, token.type, token.line, + token.line_number) + InsertTokenAfter(new_token, token) + + return new_token + + +def Compare(token1, token2): + """Compares two tokens and determines their relative order. + + Args: + token1: The first token to compare. + token2: The second token to compare. + + Returns: + A negative integer, zero, or a positive integer as the first token is + before, equal, or after the second in the token stream. + """ + if token2.line_number != token1.line_number: + return token1.line_number - token2.line_number + else: + return token1.start_index - token2.start_index + + +def GoogScopeOrNoneFromStartBlock(token): + """Determines if the given START_BLOCK is part of a goog.scope statement. + + Args: + token: A token of type START_BLOCK. + + Returns: + The goog.scope function call token, or None if such call doesn't exist. + """ + if token.type != JavaScriptTokenType.START_BLOCK: + return None + + # Search for a goog.scope statement, which will be 5 tokens before the + # block. Illustration of the tokens found prior to the start block: + # goog.scope(function() { + # 5 4 3 21 ^ + + maybe_goog_scope = token + for unused_i in xrange(5): + maybe_goog_scope = (maybe_goog_scope.previous if maybe_goog_scope and + maybe_goog_scope.previous else None) + if maybe_goog_scope and maybe_goog_scope.string == 'goog.scope': + return maybe_goog_scope + + +def GetTokenRange(start_token, end_token): + """Returns a list of tokens between the two given, inclusive. + + Args: + start_token: Start token in the range. + end_token: End token in the range. + + Returns: + A list of tokens, in order, from start_token to end_token (including start + and end). Returns none if the tokens do not describe a valid range. + """ + + token_range = [] + token = start_token + + while token: + token_range.append(token) + + if token == end_token: + return token_range + + token = token.next + + +def TokensToString(token_iterable): + """Convert a number of tokens into a string. + + Newlines will be inserted whenever the line_number of two neighboring + strings differ. + + Args: + token_iterable: The tokens to turn to a string. + + Returns: + A string representation of the given tokens. + """ + + buf = StringIO.StringIO() + token_list = list(token_iterable) + if not token_list: + return '' + + line_number = token_list[0].line_number + + for token in token_list: + + while line_number < token.line_number: + line_number += 1 + buf.write('\n') + + if line_number > token.line_number: + line_number = token.line_number + buf.write('\n') + + buf.write(token.string) + + return buf.getvalue() + + +def GetPreviousCodeToken(token): + """Returns the code token before the specified token. + + Args: + token: A token. + + Returns: + The code token before the specified token or None if no such token + exists. + """ + + return CustomSearch( + token, + lambda t: t and t.type not in JavaScriptTokenType.NON_CODE_TYPES, + reverse=True) + + +def GetNextCodeToken(token): + """Returns the next code token after the specified token. + + Args: + token: A token. + + Returns: + The next code token after the specified token or None if no such token + exists. + """ + + return CustomSearch( + token, + lambda t: t and t.type not in JavaScriptTokenType.NON_CODE_TYPES, + reverse=False) + + +def GetIdentifierStart(token): + """Returns the first token in an identifier. + + Given a token which is part of an identifier, returns the token at the start + of the identifier. + + Args: + token: A token which is part of an identifier. + + Returns: + The token at the start of the identifier or None if the identifier was not + of the form 'a.b.c' (e.g. "['a']['b'].c"). + """ + + start_token = token + previous_code_token = GetPreviousCodeToken(token) + + while (previous_code_token and ( + previous_code_token.IsType(JavaScriptTokenType.IDENTIFIER) or + IsDot(previous_code_token))): + start_token = previous_code_token + previous_code_token = GetPreviousCodeToken(previous_code_token) + + if IsDot(start_token): + return None + + return start_token + + +def GetIdentifierForToken(token): + """Get the symbol specified by a token. + + Given a token, this function additionally concatenates any parts of an + identifying symbol being identified that are split by whitespace or a + newline. + + The function will return None if the token is not the first token of an + identifier. + + Args: + token: The first token of a symbol. + + Returns: + The whole symbol, as a string. + """ + + # Search backward to determine if this token is the first token of the + # identifier. If it is not the first token, return None to signal that this + # token should be ignored. + prev_token = token.previous + while prev_token: + if (prev_token.IsType(JavaScriptTokenType.IDENTIFIER) or + IsDot(prev_token)): + return None + + if (prev_token.IsType(tokens.TokenType.WHITESPACE) or + prev_token.IsAnyType(JavaScriptTokenType.COMMENT_TYPES)): + prev_token = prev_token.previous + else: + break + + # A "function foo()" declaration. + if token.type is JavaScriptTokenType.FUNCTION_NAME: + return token.string + + # A "var foo" declaration (if the previous token is 'var') + previous_code_token = GetPreviousCodeToken(token) + + if previous_code_token and previous_code_token.IsKeyword('var'): + return token.string + + # Otherwise, this is potentially a namespaced (goog.foo.bar) identifier that + # could span multiple lines or be broken up by whitespace. We need + # to concatenate. + identifier_types = set([ + JavaScriptTokenType.IDENTIFIER, + JavaScriptTokenType.SIMPLE_LVALUE + ]) + + assert token.type in identifier_types + + # Start with the first token + symbol_tokens = [token] + + if token.next: + for t in token.next: + last_symbol_token = symbol_tokens[-1] + + # A dot is part of the previous symbol. + if IsDot(t): + symbol_tokens.append(t) + continue + + # An identifier is part of the previous symbol if the previous one was a + # dot. + if t.type in identifier_types: + if IsDot(last_symbol_token): + symbol_tokens.append(t) + continue + else: + break + + # Skip any whitespace + if t.type in JavaScriptTokenType.NON_CODE_TYPES: + continue + + # This is the end of the identifier. Stop iterating. + break + + if symbol_tokens: + return ''.join([t.string for t in symbol_tokens]) + + +def GetStringAfterToken(token): + """Get string after token. + + Args: + token: Search will be done after this token. + + Returns: + String if found after token else None (empty string will also + return None). + + Search until end of string as in case of empty string Type.STRING_TEXT is not + present/found and don't want to return next string. + E.g. + a = ''; + b = 'test'; + When searching for string after 'a' if search is not limited by end of string + then it will return 'test' which is not desirable as there is a empty string + before that. + + This will return None for cases where string is empty or no string found + as in both cases there is no Type.STRING_TEXT. + """ + string_token = SearchUntil(token, JavaScriptTokenType.STRING_TEXT, + [JavaScriptTokenType.SINGLE_QUOTE_STRING_END, + JavaScriptTokenType.DOUBLE_QUOTE_STRING_END]) + if string_token: + return string_token.string + else: + return None + + +def IsDot(token): + """Whether the token represents a "dot" operator (foo.bar).""" + return token.type is JavaScriptTokenType.OPERATOR and token.string == '.' + + +def IsIdentifierOrDot(token): + """Whether the token is either an identifier or a '.'.""" + return (token.type in [JavaScriptTokenType.IDENTIFIER, + JavaScriptTokenType.SIMPLE_LVALUE] or + IsDot(token)) diff --git a/tools/closure_linter/build/lib/closure_linter/tokenutil_test.py b/tools/closure_linter/build/lib/closure_linter/tokenutil_test.py new file mode 100644 index 00000000000000..c7d3854776bd48 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/tokenutil_test.py @@ -0,0 +1,297 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the scopeutil module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import unittest as googletest + +from closure_linter import ecmametadatapass +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + + +class FakeToken(object): + pass + + +class TokenUtilTest(googletest.TestCase): + + def testGetTokenRange(self): + + a = FakeToken() + b = FakeToken() + c = FakeToken() + d = FakeToken() + e = FakeToken() + + a.next = b + b.next = c + c.next = d + + self.assertEquals([a, b, c, d], tokenutil.GetTokenRange(a, d)) + + # This is an error as e does not come after a in the token chain. + self.assertRaises(Exception, lambda: tokenutil.GetTokenRange(a, e)) + + def testTokensToString(self): + + a = FakeToken() + b = FakeToken() + c = FakeToken() + d = FakeToken() + e = FakeToken() + + a.string = 'aaa' + b.string = 'bbb' + c.string = 'ccc' + d.string = 'ddd' + e.string = 'eee' + + a.line_number = 5 + b.line_number = 6 + c.line_number = 6 + d.line_number = 10 + e.line_number = 11 + + self.assertEquals( + 'aaa\nbbbccc\n\n\n\nddd\neee', + tokenutil.TokensToString([a, b, c, d, e])) + + self.assertEquals( + 'ddd\neee\naaa\nbbbccc', + tokenutil.TokensToString([d, e, a, b, c]), + 'Neighboring tokens not in line_number order should have a newline ' + 'between them.') + + def testGetPreviousCodeToken(self): + + tokens = testutil.TokenizeSource(""" +start1. // comment + /* another comment */ + end1 +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + None, + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('start1'))) + + self.assertEquals( + '.', + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('end1')).string) + + self.assertEquals( + 'start1', + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('.')).string) + + def testGetNextCodeToken(self): + + tokens = testutil.TokenizeSource(""" +start1. // comment + /* another comment */ + end1 +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + '.', + tokenutil.GetNextCodeToken(_GetTokenStartingWith('start1')).string) + + self.assertEquals( + 'end1', + tokenutil.GetNextCodeToken(_GetTokenStartingWith('.')).string) + + self.assertEquals( + None, + tokenutil.GetNextCodeToken(_GetTokenStartingWith('end1'))) + + def testGetIdentifierStart(self): + + tokens = testutil.TokenizeSource(""" +start1 . // comment + prototype. /* another comment */ + end1 + +['edge'][case].prototype. + end2 = function() {} +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + 'start1', + tokenutil.GetIdentifierStart(_GetTokenStartingWith('end1')).string) + + self.assertEquals( + 'start1', + tokenutil.GetIdentifierStart(_GetTokenStartingWith('start1')).string) + + self.assertEquals( + None, + tokenutil.GetIdentifierStart(_GetTokenStartingWith('end2'))) + + def testInsertTokenBefore(self): + + self.AssertInsertTokenAfterBefore(False) + + def testInsertTokenAfter(self): + + self.AssertInsertTokenAfterBefore(True) + + def AssertInsertTokenAfterBefore(self, after): + + new_token = javascripttokens.JavaScriptToken( + 'a', javascripttokens.JavaScriptTokenType.IDENTIFIER, 1, 1) + + existing_token1 = javascripttokens.JavaScriptToken( + 'var', javascripttokens.JavaScriptTokenType.KEYWORD, 1, 1) + existing_token1.start_index = 0 + existing_token1.metadata = ecmametadatapass.EcmaMetaData() + + existing_token2 = javascripttokens.JavaScriptToken( + ' ', javascripttokens.JavaScriptTokenType.WHITESPACE, 1, 1) + existing_token2.start_index = 3 + existing_token2.metadata = ecmametadatapass.EcmaMetaData() + existing_token2.metadata.last_code = existing_token1 + + existing_token1.next = existing_token2 + existing_token2.previous = existing_token1 + + if after: + tokenutil.InsertTokenAfter(new_token, existing_token1) + else: + tokenutil.InsertTokenBefore(new_token, existing_token2) + + self.assertEquals(existing_token1, new_token.previous) + self.assertEquals(existing_token2, new_token.next) + + self.assertEquals(new_token, existing_token1.next) + self.assertEquals(new_token, existing_token2.previous) + + self.assertEquals(existing_token1, new_token.metadata.last_code) + self.assertEquals(new_token, existing_token2.metadata.last_code) + + self.assertEquals(0, existing_token1.start_index) + self.assertEquals(3, new_token.start_index) + self.assertEquals(4, existing_token2.start_index) + + def testGetIdentifierForToken(self): + + tokens = testutil.TokenizeSource(""" +start1.abc.def.prototype. + onContinuedLine + +(start2.abc.def + .hij.klm + .nop) + +start3.abc.def + .hij = function() {}; + +// An absurd multi-liner. +start4.abc.def. + hij. + klm = function() {}; + +start5 . aaa . bbb . ccc + shouldntBePartOfThePreviousSymbol + +start6.abc.def ghi.shouldntBePartOfThePreviousSymbol + +var start7 = 42; + +function start8() { + +} + +start9.abc. // why is there a comment here? + def /* another comment */ + shouldntBePart + +start10.abc // why is there a comment here? + .def /* another comment */ + shouldntBePart + +start11.abc. middle1.shouldNotBeIdentifier +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + 'start1.abc.def.prototype.onContinuedLine', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start1'))) + + self.assertEquals( + 'start2.abc.def.hij.klm.nop', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start2'))) + + self.assertEquals( + 'start3.abc.def.hij', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start3'))) + + self.assertEquals( + 'start4.abc.def.hij.klm', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start4'))) + + self.assertEquals( + 'start5.aaa.bbb.ccc', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start5'))) + + self.assertEquals( + 'start6.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start6'))) + + self.assertEquals( + 'start7', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start7'))) + + self.assertEquals( + 'start8', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start8'))) + + self.assertEquals( + 'start9.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start9'))) + + self.assertEquals( + 'start10.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start10'))) + + self.assertIsNone( + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('middle1'))) + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/build/lib/closure_linter/typeannotation.py b/tools/closure_linter/build/lib/closure_linter/typeannotation.py new file mode 100644 index 00000000000000..00604c13a7b31b --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/typeannotation.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python +#*-* coding: utf-8 +"""Closure typeannotation parsing and utilities.""" + + + +from closure_linter import errors +from closure_linter import javascripttokens +from closure_linter.common import error + +# Shorthand +TYPE = javascripttokens.JavaScriptTokenType + + +class TypeAnnotation(object): + """Represents a structured view of a closure type annotation. + + Attribute: + identifier: The name of the type. + key_type: The name part before a colon. + sub_types: The list of sub_types used e.g. for Array.<…> + or_null: The '?' annotation + not_null: The '!' annotation + type_group: If this a a grouping (a|b), but does not include function(a). + return_type: The return type of a function definition. + alias: The actual type set by closurizednamespaceinfo if the identifier uses + an alias to shorten the name. + tokens: An ordered list of tokens used for this type. May contain + TypeAnnotation instances for sub_types, key_type or return_type. + """ + + IMPLICIT_TYPE_GROUP = 2 + + NULLABILITY_UNKNOWN = 2 + + # Frequently used known non-nullable types. + NON_NULLABLE = frozenset([ + 'boolean', 'function', 'number', 'string', 'undefined']) + # Frequently used known nullable types. + NULLABLE_TYPE_WHITELIST = frozenset([ + 'Array', 'Document', 'Element', 'Function', 'Node', 'NodeList', + 'Object']) + + def __init__(self): + self.identifier = '' + self.sub_types = [] + self.or_null = False + self.not_null = False + self.type_group = False + self.alias = None + self.key_type = None + self.record_type = False + self.opt_arg = False + self.return_type = None + self.tokens = [] + + def IsFunction(self): + """Determines whether this is a function definition.""" + return self.identifier == 'function' + + def IsConstructor(self): + """Determines whether this is a function definition for a constructor.""" + key_type = self.sub_types and self.sub_types[0].key_type + return self.IsFunction() and key_type.identifier == 'new' + + def IsRecordType(self): + """Returns True if this type is a record type.""" + return (self.record_type or + bool([t for t in self.sub_types if t.IsRecordType()])) + + def IsVarArgsType(self): + """Determines if the type is a var_args type, i.e. starts with '...'.""" + return self.identifier.startswith('...') or ( + self.type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP and + self.sub_types[0].identifier.startswith('...')) + + def IsEmpty(self): + """Returns True if the type is empty.""" + return not self.tokens + + def IsUnknownType(self): + """Returns True if this is the unknown type {?}.""" + return (self.or_null + and not self.identifier + and not self.sub_types + and not self.return_type) + + def Append(self, item): + """Adds a sub_type to this type and finalizes it. + + Args: + item: The TypeAnnotation item to append. + """ + # item is a TypeAnnotation instance, so pylint: disable=protected-access + self.sub_types.append(item._Finalize(self)) + + def __repr__(self): + """Reconstructs the type definition.""" + append = '' + if self.sub_types: + separator = (',' if not self.type_group else '|') + if self.identifier == 'function': + surround = '(%s)' + else: + surround = {False: '{%s}' if self.record_type else '<%s>', + True: '(%s)', + self.IMPLICIT_TYPE_GROUP: '%s'}[self.type_group] + append = surround % separator.join([repr(t) for t in self.sub_types]) + if self.return_type: + append += ':%s' % repr(self.return_type) + append += '=' if self.opt_arg else '' + prefix = '' + ('?' if self.or_null else '') + ('!' if self.not_null else '') + keyword = '%s:' % repr(self.key_type) if self.key_type else '' + return keyword + prefix + '%s' % (self.alias or self.identifier) + append + + def ToString(self): + """Concats the type's tokens to form a string again.""" + ret = [] + for token in self.tokens: + if not isinstance(token, TypeAnnotation): + ret.append(token.string) + else: + ret.append(token.ToString()) + return ''.join(ret) + + def Dump(self, indent=''): + """Dumps this type's structure for debugging purposes.""" + result = [] + for t in self.tokens: + if isinstance(t, TypeAnnotation): + result.append(indent + str(t) + ' =>\n' + t.Dump(indent + ' ')) + else: + result.append(indent + str(t)) + return '\n'.join(result) + + def IterIdentifiers(self): + """Iterates over all identifiers in this type and its subtypes.""" + if self.identifier: + yield self.identifier + for subtype in self.IterTypes(): + for identifier in subtype.IterIdentifiers(): + yield identifier + + def IterTypeGroup(self): + """Iterates over all types in the type group including self. + + Yields: + If this is a implicit or manual type-group: all sub_types. + Otherwise: self + E.g. for @type {Foo.} this will yield only Foo., + for @type {Foo|(Bar|Sample)} this will yield Foo, Bar and Sample. + + """ + if self.type_group: + for sub_type in self.sub_types: + for sub_type in sub_type.IterTypeGroup(): + yield sub_type + else: + yield self + + def IterTypes(self): + """Iterates over each subtype as well as return and key types.""" + if self.return_type: + yield self.return_type + + if self.key_type: + yield self.key_type + + for sub_type in self.sub_types: + yield sub_type + + def GetNullability(self, modifiers=True): + """Computes whether the type may be null. + + Args: + modifiers: Whether the modifiers ? and ! should be considered in the + evaluation. + Returns: + True if the type allows null, False if the type is strictly non nullable + and NULLABILITY_UNKNOWN if the nullability cannot be determined. + """ + + # Explicitly marked nullable types or 'null' are nullable. + if (modifiers and self.or_null) or self.identifier == 'null': + return True + + # Explicitly marked non-nullable types or non-nullable base types: + if ((modifiers and self.not_null) or self.record_type + or self.identifier in self.NON_NULLABLE): + return False + + # A type group is nullable if any of its elements are nullable. + if self.type_group: + maybe_nullable = False + for sub_type in self.sub_types: + nullability = sub_type.GetNullability() + if nullability == self.NULLABILITY_UNKNOWN: + maybe_nullable = nullability + elif nullability: + return True + return maybe_nullable + + # Whitelisted types are nullable. + if self.identifier.rstrip('.') in self.NULLABLE_TYPE_WHITELIST: + return True + + # All other types are unknown (most should be nullable, but + # enums are not and typedefs might not be). + return self.NULLABILITY_UNKNOWN + + def WillAlwaysBeNullable(self): + """Computes whether the ! flag is illegal for this type. + + This is the case if this type or any of the subtypes is marked as + explicitly nullable. + + Returns: + True if the ! flag would be illegal. + """ + if self.or_null or self.identifier == 'null': + return True + + if self.type_group: + return bool([t for t in self.sub_types if t.WillAlwaysBeNullable()]) + + return False + + def _Finalize(self, parent): + """Fixes some parsing issues once the TypeAnnotation is complete.""" + + # Normalize functions whose definition ended up in the key type because + # they defined a return type after a colon. + if self.key_type and self.key_type.identifier == 'function': + current = self.key_type + current.return_type = self + self.key_type = None + # opt_arg never refers to the return type but to the function itself. + current.opt_arg = self.opt_arg + self.opt_arg = False + return current + + # If a typedef just specified the key, it will not end up in the key type. + if parent.record_type and not self.key_type: + current = TypeAnnotation() + current.key_type = self + current.tokens.append(self) + return current + return self + + def FirstToken(self): + """Returns the first token used in this type or any of its subtypes.""" + first = self.tokens[0] + return first.FirstToken() if isinstance(first, TypeAnnotation) else first + + +def Parse(token, token_end, error_handler): + """Parses a type annotation and returns a TypeAnnotation object.""" + return TypeAnnotationParser(error_handler).Parse(token.next, token_end) + + +class TypeAnnotationParser(object): + """A parser for type annotations constructing the TypeAnnotation object.""" + + def __init__(self, error_handler): + self._stack = [] + self._error_handler = error_handler + self._closing_error = False + + def Parse(self, token, token_end): + """Parses a type annotation and returns a TypeAnnotation object.""" + root = TypeAnnotation() + self._stack.append(root) + current = TypeAnnotation() + root.tokens.append(current) + + while token and token != token_end: + if token.type in (TYPE.DOC_TYPE_START_BLOCK, TYPE.DOC_START_BRACE): + if token.string == '(': + if (current.identifier and + current.identifier not in ['function', '...']): + self.Error(token, + 'Invalid identifier for (): "%s"' % current.identifier) + current.type_group = current.identifier != 'function' + elif token.string == '{': + current.record_type = True + current.tokens.append(token) + self._stack.append(current) + current = TypeAnnotation() + self._stack[-1].tokens.append(current) + + elif token.type in (TYPE.DOC_TYPE_END_BLOCK, TYPE.DOC_END_BRACE): + prev = self._stack.pop() + prev.Append(current) + current = prev + + # If an implicit type group was created, close it as well. + if prev.type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP: + prev = self._stack.pop() + prev.Append(current) + current = prev + current.tokens.append(token) + + elif token.type == TYPE.DOC_TYPE_MODIFIER: + if token.string == '!': + current.tokens.append(token) + current.not_null = True + elif token.string == '?': + current.tokens.append(token) + current.or_null = True + elif token.string == ':': + current.tokens.append(token) + prev = current + current = TypeAnnotation() + prev.tokens.append(current) + current.key_type = prev + elif token.string == '=': + # For implicit type groups the '=' refers to the parent. + try: + if self._stack[-1].type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP: + self._stack[-1].tokens.append(token) + self._stack[-1].opt_arg = True + else: + current.tokens.append(token) + current.opt_arg = True + except IndexError: + self.ClosingError(token) + elif token.string == '|': + # If a type group has explicitly been opened do a normal append. + # Otherwise we have to open the type group and move the current + # type into it, before appending + if not self._stack[-1].type_group: + type_group = TypeAnnotation() + if current.key_type and current.key_type.identifier != 'function': + type_group.key_type = current.key_type + current.key_type = None + type_group.type_group = TypeAnnotation.IMPLICIT_TYPE_GROUP + # Fix the token order + prev = self._stack[-1].tokens.pop() + self._stack[-1].tokens.append(type_group) + type_group.tokens.append(prev) + self._stack.append(type_group) + self._stack[-1].tokens.append(token) + self.Append(current, error_token=token) + current = TypeAnnotation() + self._stack[-1].tokens.append(current) + elif token.string == ',': + self.Append(current, error_token=token) + current = TypeAnnotation() + self._stack[-1].tokens.append(token) + self._stack[-1].tokens.append(current) + else: + current.tokens.append(token) + self.Error(token, 'Invalid token') + + elif token.type == TYPE.COMMENT: + current.tokens.append(token) + current.identifier += token.string.strip() + + elif token.type in [TYPE.DOC_PREFIX, TYPE.WHITESPACE]: + current.tokens.append(token) + + else: + current.tokens.append(token) + self.Error(token, 'Unexpected token') + + token = token.next + + self.Append(current, error_token=token) + try: + ret = self._stack.pop() + except IndexError: + self.ClosingError(token) + # The type is screwed up, but let's return something. + return current + + if self._stack and (len(self._stack) != 1 or + ret.type_group != TypeAnnotation.IMPLICIT_TYPE_GROUP): + self.Error(token, 'Too many opening items.') + + return ret if len(ret.sub_types) > 1 else ret.sub_types[0] + + def Append(self, type_obj, error_token): + """Appends a new TypeAnnotation object to the current parent.""" + if self._stack: + self._stack[-1].Append(type_obj) + else: + self.ClosingError(error_token) + + def ClosingError(self, token): + """Reports an error about too many closing items, but only once.""" + if not self._closing_error: + self._closing_error = True + self.Error(token, 'Too many closing items.') + + def Error(self, token, message): + """Calls the error_handler to post an error message.""" + if self._error_handler: + self._error_handler.HandleError(error.Error( + errors.JSDOC_DOES_NOT_PARSE, + 'Error parsing jsdoc type at token "%s" (column: %d): %s' % + (token.string, token.start_index, message), token)) diff --git a/tools/closure_linter/build/lib/closure_linter/typeannotation_test.py b/tools/closure_linter/build/lib/closure_linter/typeannotation_test.py new file mode 100644 index 00000000000000..da9dfa369f0bc8 --- /dev/null +++ b/tools/closure_linter/build/lib/closure_linter/typeannotation_test.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +"""Unit tests for the typeannotation module.""" + + + + +import unittest as googletest + +from closure_linter import testutil +from closure_linter.common import erroraccumulator + +CRAZY_TYPE = ('Array.))>') + + +class TypeErrorException(Exception): + """Exception for TypeErrors.""" + + def __init__(self, errors): + super(TypeErrorException, self).__init__() + self.errors = errors + + +class TypeParserTest(googletest.TestCase): + """Tests for typeannotation parsing.""" + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + accumulator = erroraccumulator.ErrorAccumulator() + _, comments = testutil.ParseFunctionsAndComments(script, accumulator) + if accumulator.GetErrors(): + raise TypeErrorException(accumulator.GetErrors()) + self.assertEquals(1, len(comments)) + return comments[0] + + def _ParseType(self, type_str): + """Creates a comment to parse and returns the parsed type.""" + comment = self._ParseComment('/** @type {%s} **/' % type_str) + return comment.GetDocFlags()[0].jstype + + def assertProperReconstruction(self, type_str, matching_str=None): + """Parses the type and asserts the its repr matches the type. + + If matching_str is specified, it will assert that the repr matches this + string instead. + + Args: + type_str: The type string to parse. + matching_str: A string the __repr__ of the parsed type should match. + Returns: + The parsed js_type. + """ + parsed_type = self._ParseType(type_str) + # Use listEqual assertion to more easily identify the difference + self.assertListEqual(list(matching_str or type_str), + list(repr(parsed_type))) + self.assertEquals(matching_str or type_str, repr(parsed_type)) + + # Newlines will be inserted by the file writer. + self.assertEquals(type_str.replace('\n', ''), parsed_type.ToString()) + return parsed_type + + def assertNullable(self, type_str, nullable=True): + parsed_type = self.assertProperReconstruction(type_str) + self.assertEquals(nullable, parsed_type.GetNullability(), + '"%s" should %sbe nullable' % + (type_str, 'not ' if nullable else '')) + + def assertNotNullable(self, type_str): + return self.assertNullable(type_str, nullable=False) + + def testReconstruction(self): + self.assertProperReconstruction('*') + self.assertProperReconstruction('number') + self.assertProperReconstruction('(((number)))') + self.assertProperReconstruction('!number') + self.assertProperReconstruction('?!number') + self.assertProperReconstruction('number=') + self.assertProperReconstruction('number=!?', '?!number=') + self.assertProperReconstruction('number|?string') + self.assertProperReconstruction('(number|string)') + self.assertProperReconstruction('?(number|string)') + self.assertProperReconstruction('Object.') + self.assertProperReconstruction('function(new:Object)') + self.assertProperReconstruction('function(new:Object):number') + self.assertProperReconstruction('function(new:Object,Element):number') + self.assertProperReconstruction('function(this:T,...)') + self.assertProperReconstruction('{a:?number}') + self.assertProperReconstruction('{a:?number,b:(number|string)}') + self.assertProperReconstruction('{c:{nested_element:*}|undefined}') + self.assertProperReconstruction('{handleEvent:function(?):?}') + self.assertProperReconstruction('function():?|null') + self.assertProperReconstruction('null|function():?|bar') + + def testOptargs(self): + self.assertProperReconstruction('number=') + self.assertProperReconstruction('number|string=') + self.assertProperReconstruction('(number|string)=') + self.assertProperReconstruction('(number|string=)') + self.assertProperReconstruction('(number=|string)') + self.assertProperReconstruction('function(...):number=') + + def testIndepth(self): + # Do an deeper check of the crazy identifier + crazy = self.assertProperReconstruction(CRAZY_TYPE) + self.assertEquals('Array.', crazy.identifier) + self.assertEquals(1, len(crazy.sub_types)) + func1 = crazy.sub_types[0] + func2 = func1.return_type + self.assertEquals('function', func1.identifier) + self.assertEquals('function', func2.identifier) + self.assertEquals(3, len(func1.sub_types)) + self.assertEquals(1, len(func2.sub_types)) + self.assertEquals('Object.', func2.sub_types[0].sub_types[0].identifier) + + def testIterIdentifiers(self): + nested_identifiers = self._ParseType('(a|{b:(c|function(new:d):e)})') + for identifier in ('a', 'b', 'c', 'd', 'e'): + self.assertIn(identifier, nested_identifiers.IterIdentifiers()) + + def testIsEmpty(self): + self.assertTrue(self._ParseType('').IsEmpty()) + self.assertFalse(self._ParseType('?').IsEmpty()) + self.assertFalse(self._ParseType('!').IsEmpty()) + self.assertFalse(self._ParseType('').IsEmpty()) + + def testIsConstructor(self): + self.assertFalse(self._ParseType('').IsConstructor()) + self.assertFalse(self._ParseType('Array.').IsConstructor()) + self.assertTrue(self._ParseType('function(new:T)').IsConstructor()) + + def testIsVarArgsType(self): + self.assertTrue(self._ParseType('...number').IsVarArgsType()) + self.assertTrue(self._ParseType('...Object|Array').IsVarArgsType()) + self.assertTrue(self._ParseType('...(Object|Array)').IsVarArgsType()) + self.assertFalse(self._ParseType('Object|...Array').IsVarArgsType()) + self.assertFalse(self._ParseType('(...Object|Array)').IsVarArgsType()) + + def testIsUnknownType(self): + self.assertTrue(self._ParseType('?').IsUnknownType()) + self.assertTrue(self._ParseType('Foo.').sub_types[0].IsUnknownType()) + self.assertFalse(self._ParseType('?|!').IsUnknownType()) + self.assertTrue(self._ParseType('?|!').sub_types[0].IsUnknownType()) + self.assertFalse(self._ParseType('!').IsUnknownType()) + + long_type = 'function():?|{handleEvent:function(?=):?,sample:?}|?=' + record = self._ParseType(long_type) + # First check that there's not just one type with 3 return types, but three + # top-level types. + self.assertEquals(3, len(record.sub_types)) + + # Now extract all unknown type instances and verify that they really are. + handle_event, sample = record.sub_types[1].sub_types + for i, sub_type in enumerate([ + record.sub_types[0].return_type, + handle_event.return_type, + handle_event.sub_types[0], + sample, + record.sub_types[2]]): + self.assertTrue(sub_type.IsUnknownType(), + 'Type %d should be the unknown type: %s\n%s' % ( + i, sub_type.tokens, record.Dump())) + + def testTypedefNames(self): + easy = self._ParseType('{a}') + self.assertTrue(easy.record_type) + + easy = self.assertProperReconstruction('{a}', '{a:}').sub_types[0] + self.assertEquals('a', easy.key_type.identifier) + self.assertEquals('', easy.identifier) + + easy = self.assertProperReconstruction('{a:b}').sub_types[0] + self.assertEquals('a', easy.key_type.identifier) + self.assertEquals('b', easy.identifier) + + def assertTypeError(self, type_str): + """Asserts that parsing the given type raises a linter error.""" + self.assertRaises(TypeErrorException, self._ParseType, type_str) + + def testParseBadTypes(self): + """Tests that several errors in types don't break the parser.""" + self.assertTypeError('<') + self.assertTypeError('>') + self.assertTypeError('Foo.=') + self.assertTypeError('Foo.>=') + self.assertTypeError('(') + self.assertTypeError(')') + self.assertTypeError('Foo.') + self._ParseType(':') + self._ParseType(':foo') + self.assertTypeError(':)foo') + self.assertTypeError('(a|{b:(c|function(new:d):e') + + def testNullable(self): + self.assertNullable('null') + self.assertNullable('Object') + self.assertNullable('?string') + self.assertNullable('?number') + + self.assertNotNullable('string') + self.assertNotNullable('number') + self.assertNotNullable('boolean') + self.assertNotNullable('function(Object)') + self.assertNotNullable('function(Object):Object') + self.assertNotNullable('function(?Object):?Object') + self.assertNotNullable('!Object') + + self.assertNotNullable('boolean|string') + self.assertNotNullable('(boolean|string)') + + self.assertNullable('(boolean|string|null)') + self.assertNullable('(?boolean)') + self.assertNullable('?(boolean)') + + self.assertNullable('(boolean|Object)') + self.assertNotNullable('(boolean|(string|{a:}))') + + def testSpaces(self): + """Tests that spaces don't change the outcome.""" + type_str = (' A < b | ( c | ? ! d e f ) > | ' + 'function ( x : . . . ) : { y : z = } ') + two_spaces = type_str.replace(' ', ' ') + no_spaces = type_str.replace(' ', '') + newlines = type_str.replace(' ', '\n * ') + self.assertProperReconstruction(no_spaces) + self.assertProperReconstruction(type_str, no_spaces) + self.assertProperReconstruction(two_spaces, no_spaces) + self.assertProperReconstruction(newlines, no_spaces) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter.egg-info/PKG-INFO b/tools/closure_linter/closure_linter.egg-info/PKG-INFO index 918e2433f9e341..8055c15c21f1ee 100644 --- a/tools/closure_linter/closure_linter.egg-info/PKG-INFO +++ b/tools/closure_linter/closure_linter.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: closure-linter -Version: 2.2.6 +Version: 2.3.17 Summary: Closure Linter Home-page: http://code.google.com/p/closure-linter Author: The Closure Linter Authors diff --git a/tools/closure_linter/closure_linter.egg-info/SOURCES.txt b/tools/closure_linter/closure_linter.egg-info/SOURCES.txt index b64d829f7e9aea..a193cdfeb9442d 100644 --- a/tools/closure_linter/closure_linter.egg-info/SOURCES.txt +++ b/tools/closure_linter/closure_linter.egg-info/SOURCES.txt @@ -1,12 +1,20 @@ README setup.py closure_linter/__init__.py +closure_linter/aliaspass.py +closure_linter/aliaspass_test.py closure_linter/checker.py closure_linter/checkerbase.py +closure_linter/closurizednamespacesinfo.py +closure_linter/closurizednamespacesinfo_test.py closure_linter/ecmalintrules.py closure_linter/ecmametadatapass.py +closure_linter/error_check.py closure_linter/error_fixer.py +closure_linter/error_fixer_test.py +closure_linter/errorrecord.py closure_linter/errorrules.py +closure_linter/errorrules_test.py closure_linter/errors.py closure_linter/fixjsstyle.py closure_linter/fixjsstyle_test.py @@ -18,8 +26,21 @@ closure_linter/javascriptstatetracker.py closure_linter/javascriptstatetracker_test.py closure_linter/javascripttokenizer.py closure_linter/javascripttokens.py +closure_linter/not_strict_test.py +closure_linter/requireprovidesorter.py +closure_linter/requireprovidesorter_test.py +closure_linter/runner.py +closure_linter/runner_test.py +closure_linter/scopeutil.py +closure_linter/scopeutil_test.py closure_linter/statetracker.py +closure_linter/statetracker_test.py +closure_linter/strict_test.py +closure_linter/testutil.py closure_linter/tokenutil.py +closure_linter/tokenutil_test.py +closure_linter/typeannotation.py +closure_linter/typeannotation_test.py closure_linter.egg-info/PKG-INFO closure_linter.egg-info/SOURCES.txt closure_linter.egg-info/dependency_links.txt @@ -30,7 +51,7 @@ closure_linter/common/__init__.py closure_linter/common/error.py closure_linter/common/erroraccumulator.py closure_linter/common/errorhandler.py -closure_linter/common/errorprinter.py +closure_linter/common/erroroutput.py closure_linter/common/filetestcase.py closure_linter/common/htmlutil.py closure_linter/common/lintrunner.py @@ -38,4 +59,5 @@ closure_linter/common/matcher.py closure_linter/common/position.py closure_linter/common/simplefileflags.py closure_linter/common/tokenizer.py -closure_linter/common/tokens.py \ No newline at end of file +closure_linter/common/tokens.py +closure_linter/common/tokens_test.py \ No newline at end of file diff --git a/tools/closure_linter/closure_linter/__init__.py b/tools/closure_linter/closure_linter/__init__.py index 4265cc3e6c16c0..1798c8cfff57fa 100755 --- a/tools/closure_linter/closure_linter/__init__.py +++ b/tools/closure_linter/closure_linter/__init__.py @@ -1 +1,16 @@ #!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package indicator for gjslint.""" diff --git a/tools/closure_linter/closure_linter/aliaspass.py b/tools/closure_linter/closure_linter/aliaspass.py new file mode 100644 index 00000000000000..bb37bfa07b2d90 --- /dev/null +++ b/tools/closure_linter/closure_linter/aliaspass.py @@ -0,0 +1,248 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Pass that scans for goog.scope aliases and lint/usage errors.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +from closure_linter import ecmametadatapass +from closure_linter import errors +from closure_linter import javascripttokens +from closure_linter import scopeutil +from closure_linter import tokenutil +from closure_linter.common import error + + +# TODO(nnaze): Create a Pass interface and move this class, EcmaMetaDataPass, +# and related classes onto it. + + +def _GetAliasForIdentifier(identifier, alias_map): + """Returns the aliased_symbol name for an identifier. + + Example usage: + >>> alias_map = {'MyClass': 'goog.foo.MyClass'} + >>> _GetAliasForIdentifier('MyClass.prototype.action', alias_map) + 'goog.foo.MyClass.prototype.action' + + >>> _GetAliasForIdentifier('MyClass.prototype.action', {}) + None + + Args: + identifier: The identifier. + alias_map: A dictionary mapping a symbol to an alias. + + Returns: + The aliased symbol name or None if not found. + """ + ns = identifier.split('.', 1)[0] + aliased_symbol = alias_map.get(ns) + if aliased_symbol: + return aliased_symbol + identifier[len(ns):] + + +def _SetTypeAlias(js_type, alias_map): + """Updates the alias for identifiers in a type. + + Args: + js_type: A typeannotation.TypeAnnotation instance. + alias_map: A dictionary mapping a symbol to an alias. + """ + aliased_symbol = _GetAliasForIdentifier(js_type.identifier, alias_map) + if aliased_symbol: + js_type.alias = aliased_symbol + for sub_type in js_type.IterTypes(): + _SetTypeAlias(sub_type, alias_map) + + +class AliasPass(object): + """Pass to identify goog.scope() usages. + + Identifies goog.scope() usages and finds lint/usage errors. Notes any + aliases of symbols in Closurized namespaces (that is, reassignments + such as "var MyClass = goog.foo.MyClass;") and annotates identifiers + when they're using an alias (so they may be expanded to the full symbol + later -- that "MyClass.prototype.action" refers to + "goog.foo.MyClass.prototype.action" when expanded.). + """ + + def __init__(self, closurized_namespaces=None, error_handler=None): + """Creates a new pass. + + Args: + closurized_namespaces: A set of Closurized namespaces (e.g. 'goog'). + error_handler: An error handler to report lint errors to. + """ + + self._error_handler = error_handler + + # If we have namespaces, freeze the set. + if closurized_namespaces: + closurized_namespaces = frozenset(closurized_namespaces) + + self._closurized_namespaces = closurized_namespaces + + def Process(self, start_token): + """Runs the pass on a token stream. + + Args: + start_token: The first token in the stream. + """ + + if start_token is None: + return + + # TODO(nnaze): Add more goog.scope usage checks. + self._CheckGoogScopeCalls(start_token) + + # If we have closurized namespaces, identify aliased identifiers. + if self._closurized_namespaces: + context = start_token.metadata.context + root_context = context.GetRoot() + self._ProcessRootContext(root_context) + + def _CheckGoogScopeCalls(self, start_token): + """Check goog.scope calls for lint/usage errors.""" + + def IsScopeToken(token): + return (token.type is javascripttokens.JavaScriptTokenType.IDENTIFIER and + token.string == 'goog.scope') + + # Find all the goog.scope tokens in the file + scope_tokens = [t for t in start_token if IsScopeToken(t)] + + for token in scope_tokens: + scope_context = token.metadata.context + + if not (scope_context.type == ecmametadatapass.EcmaContext.STATEMENT and + scope_context.parent.type == ecmametadatapass.EcmaContext.ROOT): + self._MaybeReportError( + error.Error(errors.INVALID_USE_OF_GOOG_SCOPE, + 'goog.scope call not in global scope', token)) + + # There should be only one goog.scope reference. Register errors for + # every instance after the first. + for token in scope_tokens[1:]: + self._MaybeReportError( + error.Error(errors.EXTRA_GOOG_SCOPE_USAGE, + 'More than one goog.scope call in file.', token)) + + def _MaybeReportError(self, err): + """Report an error to the handler (if registered).""" + if self._error_handler: + self._error_handler.HandleError(err) + + @classmethod + def _YieldAllContexts(cls, context): + """Yields all contexts that are contained by the given context.""" + yield context + for child_context in context.children: + for descendent_child in cls._YieldAllContexts(child_context): + yield descendent_child + + @staticmethod + def _IsTokenInParentBlock(token, parent_block): + """Determines whether the given token is contained by the given block. + + Args: + token: A token + parent_block: An EcmaContext. + + Returns: + Whether the token is in a context that is or is a child of the given + parent_block context. + """ + context = token.metadata.context + + while context: + if context is parent_block: + return True + context = context.parent + + return False + + def _ProcessRootContext(self, root_context): + """Processes all goog.scope blocks under the root context.""" + + assert root_context.type is ecmametadatapass.EcmaContext.ROOT + + # Process aliases in statements in the root scope for goog.module-style + # aliases. + global_alias_map = {} + for context in root_context.children: + if context.type == ecmametadatapass.EcmaContext.STATEMENT: + for statement_child in context.children: + if statement_child.type == ecmametadatapass.EcmaContext.VAR: + match = scopeutil.MatchModuleAlias(statement_child) + if match: + # goog.require aliases cannot use further aliases, the symbol is + # the second part of match, directly. + symbol = match[1] + if scopeutil.IsInClosurizedNamespace(symbol, + self._closurized_namespaces): + global_alias_map[match[0]] = symbol + + # Process each block to find aliases. + for context in root_context.children: + self._ProcessBlock(context, global_alias_map) + + def _ProcessBlock(self, context, global_alias_map): + """Scans a goog.scope block to find aliases and mark alias tokens.""" + alias_map = global_alias_map.copy() + + # Iterate over every token in the context. Each token points to one + # context, but multiple tokens may point to the same context. We only want + # to check each context once, so keep track of those we've seen. + seen_contexts = set() + token = context.start_token + while token and self._IsTokenInParentBlock(token, context): + token_context = token.metadata.context if token.metadata else None + + # Check to see if this token is an alias. + if token_context and token_context not in seen_contexts: + seen_contexts.add(token_context) + + # If this is a alias statement in the goog.scope block. + if (token_context.type == ecmametadatapass.EcmaContext.VAR and + scopeutil.IsGoogScopeBlock(token_context.parent.parent)): + match = scopeutil.MatchAlias(token_context) + + # If this is an alias, remember it in the map. + if match: + alias, symbol = match + symbol = _GetAliasForIdentifier(symbol, alias_map) or symbol + if scopeutil.IsInClosurizedNamespace(symbol, + self._closurized_namespaces): + alias_map[alias] = symbol + + # If this token is an identifier that matches an alias, + # mark the token as an alias to the original symbol. + if (token.type is javascripttokens.JavaScriptTokenType.SIMPLE_LVALUE or + token.type is javascripttokens.JavaScriptTokenType.IDENTIFIER): + identifier = tokenutil.GetIdentifierForToken(token) + if identifier: + aliased_symbol = _GetAliasForIdentifier(identifier, alias_map) + if aliased_symbol: + token.metadata.aliased_symbol = aliased_symbol + + elif token.type == javascripttokens.JavaScriptTokenType.DOC_FLAG: + flag = token.attached_object + if flag and flag.HasType() and flag.jstype: + _SetTypeAlias(flag.jstype, alias_map) + + token = token.next # Get next token diff --git a/tools/closure_linter/closure_linter/aliaspass_test.py b/tools/closure_linter/closure_linter/aliaspass_test.py new file mode 100755 index 00000000000000..7042e5348763cb --- /dev/null +++ b/tools/closure_linter/closure_linter/aliaspass_test.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the aliaspass module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import unittest as googletest + +from closure_linter import aliaspass +from closure_linter import errors +from closure_linter import javascriptstatetracker +from closure_linter import testutil +from closure_linter.common import erroraccumulator + + +def _GetTokenByLineAndString(start_token, string, line_number): + for token in start_token: + if token.line_number == line_number and token.string == string: + return token + + +class AliasPassTest(googletest.TestCase): + + def testInvalidGoogScopeCall(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCOPE_SCRIPT) + + error_accumulator = erroraccumulator.ErrorAccumulator() + alias_pass = aliaspass.AliasPass( + error_handler=error_accumulator) + alias_pass.Process(start_token) + + alias_errors = error_accumulator.GetErrors() + self.assertEquals(1, len(alias_errors)) + + alias_error = alias_errors[0] + + self.assertEquals(errors.INVALID_USE_OF_GOOG_SCOPE, alias_error.code) + self.assertEquals('goog.scope', alias_error.token.string) + + def testAliasedIdentifiers(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_ALIAS_SCRIPT) + alias_pass = aliaspass.AliasPass(set(['goog', 'myproject'])) + alias_pass.Process(start_token) + + alias_token = _GetTokenByLineAndString(start_token, 'Event', 4) + self.assertTrue(alias_token.metadata.is_alias_definition) + + my_class_token = _GetTokenByLineAndString(start_token, 'myClass', 9) + self.assertIsNone(my_class_token.metadata.aliased_symbol) + + component_token = _GetTokenByLineAndString(start_token, 'Component', 17) + self.assertEquals('goog.ui.Component', + component_token.metadata.aliased_symbol) + + event_token = _GetTokenByLineAndString(start_token, 'Event.Something', 17) + self.assertEquals('goog.events.Event.Something', + event_token.metadata.aliased_symbol) + + non_closurized_token = _GetTokenByLineAndString( + start_token, 'NonClosurizedClass', 18) + self.assertIsNone(non_closurized_token.metadata.aliased_symbol) + + long_start_token = _GetTokenByLineAndString(start_token, 'Event', 24) + self.assertEquals('goog.events.Event.MultilineIdentifier.someMethod', + long_start_token.metadata.aliased_symbol) + + def testAliasedDoctypes(self): + """Tests that aliases are correctly expanded within type annotations.""" + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_ALIAS_SCRIPT) + tracker = javascriptstatetracker.JavaScriptStateTracker() + tracker.DocFlagPass(start_token, error_handler=None) + + alias_pass = aliaspass.AliasPass(set(['goog', 'myproject'])) + alias_pass.Process(start_token) + + flag_token = _GetTokenByLineAndString(start_token, '@type', 22) + self.assertEquals( + 'goog.events.Event.>', + repr(flag_token.attached_object.jstype)) + + def testModuleAlias(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(""" +goog.module('goog.test'); +var Alias = goog.require('goog.Alias'); +Alias.use(); +""") + alias_pass = aliaspass.AliasPass(set(['goog'])) + alias_pass.Process(start_token) + alias_token = _GetTokenByLineAndString(start_token, 'Alias', 3) + self.assertTrue(alias_token.metadata.is_alias_definition) + + def testMultipleGoogScopeCalls(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass( + _TEST_MULTIPLE_SCOPE_SCRIPT) + + error_accumulator = erroraccumulator.ErrorAccumulator() + + alias_pass = aliaspass.AliasPass( + set(['goog', 'myproject']), + error_handler=error_accumulator) + alias_pass.Process(start_token) + + alias_errors = error_accumulator.GetErrors() + + self.assertEquals(3, len(alias_errors)) + + error = alias_errors[0] + self.assertEquals(errors.INVALID_USE_OF_GOOG_SCOPE, error.code) + self.assertEquals(7, error.token.line_number) + + error = alias_errors[1] + self.assertEquals(errors.EXTRA_GOOG_SCOPE_USAGE, error.code) + self.assertEquals(7, error.token.line_number) + + error = alias_errors[2] + self.assertEquals(errors.EXTRA_GOOG_SCOPE_USAGE, error.code) + self.assertEquals(11, error.token.line_number) + + +_TEST_ALIAS_SCRIPT = """ +goog.scope(function() { +var events = goog.events; // scope alias +var Event = events. + Event; // nested multiline scope alias + +// This should not be registered as an aliased identifier because +// it appears before the alias. +var myClass = new MyClass(); + +var Component = goog.ui.Component; // scope alias +var MyClass = myproject.foo.MyClass; // scope alias + +// Scope alias of non-Closurized namespace. +var NonClosurizedClass = aaa.bbb.NonClosurizedClass; + +var component = new Component(Event.Something); +var nonClosurized = NonClosurizedClass(); + +/** + * A created namespace with a really long identifier. + * @type {events.Event.} + */ +Event. + MultilineIdentifier. + someMethod = function() {}; +}); +""" + +_TEST_SCOPE_SCRIPT = """ +function foo () { + // This goog.scope call is invalid. + goog.scope(function() { + + }); +} +""" + +_TEST_MULTIPLE_SCOPE_SCRIPT = """ +goog.scope(function() { + // do nothing +}); + +function foo() { + var test = goog.scope; // We should not see goog.scope mentioned. +} + +// This goog.scope invalid. There can be only one. +goog.scope(function() { + +}); +""" + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/checker.py b/tools/closure_linter/closure_linter/checker.py index 4cdac931ffa672..1c984173b06639 100755 --- a/tools/closure_linter/closure_linter/checker.py +++ b/tools/closure_linter/closure_linter/checker.py @@ -21,62 +21,88 @@ import gflags as flags +from closure_linter import aliaspass from closure_linter import checkerbase -from closure_linter import ecmametadatapass -from closure_linter import errors +from closure_linter import closurizednamespacesinfo from closure_linter import javascriptlintrules -from closure_linter import javascriptstatetracker -from closure_linter.common import errorprinter -from closure_linter.common import lintrunner -flags.DEFINE_list('limited_doc_files', ['dummy.js', 'externs.js'], - 'List of files with relaxed documentation checks. Will not ' - 'report errors for missing documentation, some missing ' - 'descriptions, or methods whose @return tags don\'t have a ' - 'matching return statement.') + +flags.DEFINE_list('closurized_namespaces', '', + 'Namespace prefixes, used for testing of' + 'goog.provide/require') +flags.DEFINE_list('ignored_extra_namespaces', '', + 'Fully qualified namespaces that should be not be reported ' + 'as extra by the linter.') class JavaScriptStyleChecker(checkerbase.CheckerBase): """Checker that applies JavaScriptLintRules.""" - def __init__(self, error_handler): + def __init__(self, state_tracker, error_handler): """Initialize an JavaScriptStyleChecker object. Args: - error_handler: Error handler to pass all errors to + state_tracker: State tracker. + error_handler: Error handler to pass all errors to. """ + self._namespaces_info = None + self._alias_pass = None + if flags.FLAGS.closurized_namespaces: + self._namespaces_info = ( + closurizednamespacesinfo.ClosurizedNamespacesInfo( + flags.FLAGS.closurized_namespaces, + flags.FLAGS.ignored_extra_namespaces)) + + self._alias_pass = aliaspass.AliasPass( + flags.FLAGS.closurized_namespaces, error_handler) + checkerbase.CheckerBase.__init__( self, error_handler=error_handler, - lint_rules=javascriptlintrules.JavaScriptLintRules(), - state_tracker=javascriptstatetracker.JavaScriptStateTracker( - closurized_namespaces=flags.FLAGS.closurized_namespaces), - metadata_pass=ecmametadatapass.EcmaMetaDataPass(), - limited_doc_files=flags.FLAGS.limited_doc_files) + lint_rules=javascriptlintrules.JavaScriptLintRules( + self._namespaces_info), + state_tracker=state_tracker) + def Check(self, start_token, limited_doc_checks=False, is_html=False, + stop_token=None): + """Checks a token stream for lint warnings/errors. -class GJsLintRunner(lintrunner.LintRunner): - """Wrapper class to run GJsLint.""" - - def Run(self, filenames, error_handler=None): - """Run GJsLint on the given filenames. + Adds a separate pass for computing dependency information based on + goog.require and goog.provide statements prior to the main linting pass. Args: - filenames: The filenames to check - error_handler: An optional ErrorHandler object, an ErrorPrinter is used if - none is specified. - - Returns: - error_count, file_count: The number of errors and the number of files that - contain errors. + start_token: The first token in the token stream. + limited_doc_checks: Whether to perform limited checks. + is_html: Whether this token stream is HTML. + stop_token: If given, checks should stop at this token. """ - if not error_handler: - error_handler = errorprinter.ErrorPrinter(errors.NEW_ERRORS) + self._lint_rules.Initialize(self, limited_doc_checks, is_html) + + self._state_tracker.DocFlagPass(start_token, self._error_handler) - checker = JavaScriptStyleChecker(error_handler) + if self._alias_pass: + self._alias_pass.Process(start_token) - # Check the list of files. - for filename in filenames: - checker.Check(filename) + # To maximize the amount of errors that get reported before a parse error + # is displayed, don't run the dependency pass if a parse error exists. + if self._namespaces_info: + self._namespaces_info.Reset() + self._ExecutePass(start_token, self._DependencyPass, stop_token) - return error_handler + self._ExecutePass(start_token, self._LintPass, stop_token) + + # If we have a stop_token, we didn't end up reading the whole file and, + # thus, don't call Finalize to do end-of-file checks. + if not stop_token: + self._lint_rules.Finalize(self._state_tracker) + + def _DependencyPass(self, token): + """Processes an individual token for dependency information. + + Used to encapsulate the logic needed to process an individual token so that + it can be passed to _ExecutePass. + + Args: + token: The token to process. + """ + self._namespaces_info.ProcessToken(token, self._state_tracker) diff --git a/tools/closure_linter/closure_linter/checkerbase.py b/tools/closure_linter/closure_linter/checkerbase.py index 123cb728603642..6679ded05be1e1 100755 --- a/tools/closure_linter/closure_linter/checkerbase.py +++ b/tools/closure_linter/closure_linter/checkerbase.py @@ -16,26 +16,16 @@ """Base classes for writing checkers that operate on tokens.""" +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + __author__ = ('robbyw@google.com (Robert Walker)', 'ajp@google.com (Andy Perelson)', 'jacobr@google.com (Jacob Richman)') -import traceback - -import gflags as flags -from closure_linter import ecmametadatapass from closure_linter import errorrules -from closure_linter import errors -from closure_linter import javascripttokenizer from closure_linter.common import error -from closure_linter.common import htmlutil -FLAGS = flags.FLAGS -flags.DEFINE_boolean('debug_tokens', False, - 'Whether to print all tokens for debugging.') - -flags.DEFINE_boolean('error_trace', False, - 'Whether to show error exceptions.') class LintRulesBase(object): """Base class for all classes defining the lint rules for a language.""" @@ -61,6 +51,14 @@ def _HandleError(self, code, message, token, position=None, if errorrules.ShouldReportError(code): self.__checker.HandleError(code, message, token, position, fix_data) + def _SetLimitedDocChecks(self, limited_doc_checks): + """Sets whether doc checking is relaxed for this file. + + Args: + limited_doc_checks: Whether doc checking is relaxed for this file. + """ + self._limited_doc_checks = limited_doc_checks + def CheckToken(self, token, parser_state): """Checks a token, given the current parser_state, for warnings and errors. @@ -73,12 +71,11 @@ def CheckToken(self, token, parser_state): """ raise TypeError('Abstract method CheckToken not implemented') - def Finalize(self, parser_state, tokenizer_mode): + def Finalize(self, parser_state): """Perform all checks that need to occur after all lines are processed. Args: parser_state: State of the parser after parsing all tokens - tokenizer_mode: Mode of the tokenizer after parsing the entire page Raises: TypeError: If not overridden. @@ -89,8 +86,7 @@ def Finalize(self, parser_state, tokenizer_mode): class CheckerBase(object): """This class handles checking a LintRules object against a file.""" - def __init__(self, error_handler, lint_rules, state_tracker, - limited_doc_files=None, metadata_pass=None): + def __init__(self, error_handler, lint_rules, state_tracker): """Initialize a checker object. Args: @@ -98,17 +94,13 @@ def __init__(self, error_handler, lint_rules, state_tracker, lint_rules: LintRules object defining lint errors given a token and state_tracker object. state_tracker: Object that tracks the current state in the token stream. - limited_doc_files: List of filenames that are not required to have - documentation comments. - metadata_pass: Object that builds metadata about the token stream. + """ - self.__error_handler = error_handler - self.__lint_rules = lint_rules - self.__state_tracker = state_tracker - self.__metadata_pass = metadata_pass - self.__limited_doc_files = limited_doc_files - self.__tokenizer = javascripttokenizer.JavaScriptTokenizer() - self.__has_errors = False + self._error_handler = error_handler + self._lint_rules = lint_rules + self._state_tracker = state_tracker + + self._has_errors = False def HandleError(self, code, message, token, position=None, fix_data=None): @@ -122,8 +114,8 @@ def HandleError(self, code, message, token, position=None, position: The position of the error, defaults to None. fix_data: Metadata used for fixing the error. """ - self.__has_errors = True - self.__error_handler.HandleError( + self._has_errors = True + self._error_handler.HandleError( error.Error(code, message, token, position, fix_data)) def HasErrors(self): @@ -132,106 +124,69 @@ def HasErrors(self): Returns: True if the style checker has found any errors. """ - return self.__has_errors + return self._has_errors + + def Check(self, start_token, limited_doc_checks=False, is_html=False, + stop_token=None): + """Checks a token stream, reporting errors to the error reporter. + + Args: + start_token: First token in token stream. + limited_doc_checks: Whether doc checking is relaxed for this file. + is_html: Whether the file being checked is an HTML file with extracted + contents. + stop_token: If given, check should stop at this token. + """ - def Check(self, filename): - """Checks the file, printing warnings and errors as they are found. + self._lint_rules.Initialize(self, limited_doc_checks, is_html) + self._ExecutePass(start_token, self._LintPass, stop_token=stop_token) + self._lint_rules.Finalize(self._state_tracker) + + def _LintPass(self, token): + """Checks an individual token for lint warnings/errors. + + Used to encapsulate the logic needed to check an individual token so that it + can be passed to _ExecutePass. Args: - filename: The name of the file to check. + token: The token to check. """ - try: - f = open(filename) - except IOError: - self.__error_handler.HandleFile(filename, None) - self.HandleError(errors.FILE_NOT_FOUND, 'File not found', None) - self.__error_handler.FinishFile() - return - - try: - if filename.endswith('.html') or filename.endswith('.htm'): - self.CheckLines(filename, htmlutil.GetScriptLines(f), True) - else: - self.CheckLines(filename, f, False) - finally: - f.close() - - def CheckLines(self, filename, lines_iter, is_html): - """Checks a file, given as an iterable of lines, for warnings and errors. + self._lint_rules.CheckToken(token, self._state_tracker) + + def _ExecutePass(self, token, pass_function, stop_token=None): + """Calls the given function for every token in the given token stream. + + As each token is passed to the given function, state is kept up to date and, + depending on the error_trace flag, errors are either caught and reported, or + allowed to bubble up so developers can see the full stack trace. If a parse + error is specified, the pass will proceed as normal until the token causing + the parse error is reached. Args: - filename: The name of the file to check. - lines_iter: An iterator that yields one line of the file at a time. - is_html: Whether the file being checked is an HTML file with extracted - contents. + token: The first token in the token stream. + pass_function: The function to call for each token in the token stream. + stop_token: The last token to check (if given). - Returns: - A boolean indicating whether the full file could be checked or if checking - failed prematurely. + Raises: + Exception: If any error occurred while calling the given function. """ - limited_doc_checks = False - if self.__limited_doc_files: - for limited_doc_filename in self.__limited_doc_files: - if filename.endswith(limited_doc_filename): - limited_doc_checks = True - break - - state_tracker = self.__state_tracker - lint_rules = self.__lint_rules - state_tracker.Reset() - lint_rules.Initialize(self, limited_doc_checks, is_html) - - token = self.__tokenizer.TokenizeFile(lines_iter) - - parse_error = None - if self.__metadata_pass: - try: - self.__metadata_pass.Reset() - self.__metadata_pass.Process(token) - except ecmametadatapass.ParseError, caught_parse_error: - if FLAGS.error_trace: - traceback.print_exc() - parse_error = caught_parse_error - except Exception: - print 'Internal error in %s' % filename - traceback.print_exc() - return False - - self.__error_handler.HandleFile(filename, token) + self._state_tracker.Reset() while token: - if FLAGS.debug_tokens: - print token - - if parse_error and parse_error.token == token: - # Report any parse errors from above once we find the token. - message = ('Error parsing file at token "%s". Unable to ' - 'check the rest of file.' % token.string) - self.HandleError(errors.FILE_DOES_NOT_PARSE, message, token) - self.__error_handler.FinishFile() - return False - - if FLAGS.error_trace: - state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken()) - else: - try: - state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken()) - except: - self.HandleError(errors.FILE_DOES_NOT_PARSE, - ('Error parsing file at token "%s". Unable to ' - 'check the rest of file.' % token.string), - token) - self.__error_handler.FinishFile() - return False - - # Check the token for style guide violations. - lint_rules.CheckToken(token, state_tracker) - - state_tracker.HandleAfterToken(token) - - # Move to the next token. - token = token.next + # When we are looking at a token and decided to delete the whole line, we + # will delete all of them in the "HandleToken()" below. So the current + # token and subsequent ones may already be deleted here. The way we + # delete a token does not wipe out the previous and next pointers of the + # deleted token. So we need to check the token itself to make sure it is + # not deleted. + if not token.is_deleted: + # End the pass at the stop token + if stop_token and token is stop_token: + return + + self._state_tracker.HandleToken( + token, self._state_tracker.GetLastNonSpaceToken()) + pass_function(token) + self._state_tracker.HandleAfterToken(token) - lint_rules.Finalize(state_tracker, self.__tokenizer.mode) - self.__error_handler.FinishFile() - return True + token = token.next diff --git a/tools/closure_linter/closure_linter/closurizednamespacesinfo.py b/tools/closure_linter/closure_linter/closurizednamespacesinfo.py new file mode 100755 index 00000000000000..e7cbfd3318974b --- /dev/null +++ b/tools/closure_linter/closure_linter/closurizednamespacesinfo.py @@ -0,0 +1,578 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Logic for computing dependency information for closurized JavaScript files. + +Closurized JavaScript files express dependencies using goog.require and +goog.provide statements. In order for the linter to detect when a statement is +missing or unnecessary, all identifiers in the JavaScript file must first be +processed to determine if they constitute the creation or usage of a dependency. +""" + + + +import re + +from closure_linter import javascripttokens +from closure_linter import tokenutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + +DEFAULT_EXTRA_NAMESPACES = [ + 'goog.testing.asserts', + 'goog.testing.jsunit', +] + + +class UsedNamespace(object): + """A type for information about a used namespace.""" + + def __init__(self, namespace, identifier, token, alias_definition): + """Initializes the instance. + + Args: + namespace: the namespace of an identifier used in the file + identifier: the complete identifier + token: the token that uses the namespace + alias_definition: a boolean stating whether the namespace is only to used + for an alias definition and should not be required. + """ + self.namespace = namespace + self.identifier = identifier + self.token = token + self.alias_definition = alias_definition + + def GetLine(self): + return self.token.line_number + + def __repr__(self): + return 'UsedNamespace(%s)' % ', '.join( + ['%s=%s' % (k, repr(v)) for k, v in self.__dict__.iteritems()]) + + +class ClosurizedNamespacesInfo(object): + """Dependency information for closurized JavaScript files. + + Processes token streams for dependency creation or usage and provides logic + for determining if a given require or provide statement is unnecessary or if + there are missing require or provide statements. + """ + + def __init__(self, closurized_namespaces, ignored_extra_namespaces): + """Initializes an instance the ClosurizedNamespacesInfo class. + + Args: + closurized_namespaces: A list of namespace prefixes that should be + processed for dependency information. Non-matching namespaces are + ignored. + ignored_extra_namespaces: A list of namespaces that should not be reported + as extra regardless of whether they are actually used. + """ + self._closurized_namespaces = closurized_namespaces + self._ignored_extra_namespaces = (ignored_extra_namespaces + + DEFAULT_EXTRA_NAMESPACES) + self.Reset() + + def Reset(self): + """Resets the internal state to prepare for processing a new file.""" + + # A list of goog.provide tokens in the order they appeared in the file. + self._provide_tokens = [] + + # A list of goog.require tokens in the order they appeared in the file. + self._require_tokens = [] + + # Namespaces that are already goog.provided. + self._provided_namespaces = [] + + # Namespaces that are already goog.required. + self._required_namespaces = [] + + # Note that created_namespaces and used_namespaces contain both namespaces + # and identifiers because there are many existing cases where a method or + # constant is provided directly instead of its namespace. Ideally, these + # two lists would only have to contain namespaces. + + # A list of tuples where the first element is the namespace of an identifier + # created in the file, the second is the identifier itself and the third is + # the line number where it's created. + self._created_namespaces = [] + + # A list of UsedNamespace instances. + self._used_namespaces = [] + + # A list of seemingly-unnecessary namespaces that are goog.required() and + # annotated with @suppress {extraRequire}. + self._suppressed_requires = [] + + # A list of goog.provide tokens which are duplicates. + self._duplicate_provide_tokens = [] + + # A list of goog.require tokens which are duplicates. + self._duplicate_require_tokens = [] + + # Whether this file is in a goog.scope. Someday, we may add support + # for checking scopified namespaces, but for now let's just fail + # in a more reasonable way. + self._scopified_file = False + + # TODO(user): Handle the case where there are 2 different requires + # that can satisfy the same dependency, but only one is necessary. + + def GetProvidedNamespaces(self): + """Returns the namespaces which are already provided by this file. + + Returns: + A list of strings where each string is a 'namespace' corresponding to an + existing goog.provide statement in the file being checked. + """ + return set(self._provided_namespaces) + + def GetRequiredNamespaces(self): + """Returns the namespaces which are already required by this file. + + Returns: + A list of strings where each string is a 'namespace' corresponding to an + existing goog.require statement in the file being checked. + """ + return set(self._required_namespaces) + + def IsExtraProvide(self, token): + """Returns whether the given goog.provide token is unnecessary. + + Args: + token: A goog.provide token. + + Returns: + True if the given token corresponds to an unnecessary goog.provide + statement, otherwise False. + """ + namespace = tokenutil.GetStringAfterToken(token) + + if self.GetClosurizedNamespace(namespace) is None: + return False + + if token in self._duplicate_provide_tokens: + return True + + # TODO(user): There's probably a faster way to compute this. + for created_namespace, created_identifier, _ in self._created_namespaces: + if namespace == created_namespace or namespace == created_identifier: + return False + + return True + + def IsExtraRequire(self, token): + """Returns whether the given goog.require token is unnecessary. + + Args: + token: A goog.require token. + + Returns: + True if the given token corresponds to an unnecessary goog.require + statement, otherwise False. + """ + namespace = tokenutil.GetStringAfterToken(token) + + if self.GetClosurizedNamespace(namespace) is None: + return False + + if namespace in self._ignored_extra_namespaces: + return False + + if token in self._duplicate_require_tokens: + return True + + if namespace in self._suppressed_requires: + return False + + # If the namespace contains a component that is initial caps, then that + # must be the last component of the namespace. + parts = namespace.split('.') + if len(parts) > 1 and parts[-2][0].isupper(): + return True + + # TODO(user): There's probably a faster way to compute this. + for ns in self._used_namespaces: + if (not ns.alias_definition and ( + namespace == ns.namespace or namespace == ns.identifier)): + return False + + return True + + def GetMissingProvides(self): + """Returns the dict of missing provided namespaces for the current file. + + Returns: + Returns a dictionary of key as string and value as integer where each + string(key) is a namespace that should be provided by this file, but is + not and integer(value) is first line number where it's defined. + """ + missing_provides = dict() + for namespace, identifier, line_number in self._created_namespaces: + if (not self._IsPrivateIdentifier(identifier) and + namespace not in self._provided_namespaces and + identifier not in self._provided_namespaces and + namespace not in self._required_namespaces and + namespace not in missing_provides): + missing_provides[namespace] = line_number + + return missing_provides + + def GetMissingRequires(self): + """Returns the dict of missing required namespaces for the current file. + + For each non-private identifier used in the file, find either a + goog.require, goog.provide or a created identifier that satisfies it. + goog.require statements can satisfy the identifier by requiring either the + namespace of the identifier or the identifier itself. goog.provide + statements can satisfy the identifier by providing the namespace of the + identifier. A created identifier can only satisfy the used identifier if + it matches it exactly (necessary since things can be defined on a + namespace in more than one file). Note that provided namespaces should be + a subset of created namespaces, but we check both because in some cases we + can't always detect the creation of the namespace. + + Returns: + Returns a dictionary of key as string and value integer where each + string(key) is a namespace that should be required by this file, but is + not and integer(value) is first line number where it's used. + """ + external_dependencies = set(self._required_namespaces) + + # Assume goog namespace is always available. + external_dependencies.add('goog') + # goog.module is treated as a builtin, too (for goog.module.get). + external_dependencies.add('goog.module') + + created_identifiers = set() + for unused_namespace, identifier, unused_line_number in ( + self._created_namespaces): + created_identifiers.add(identifier) + + missing_requires = dict() + illegal_alias_statements = dict() + + def ShouldRequireNamespace(namespace, identifier): + """Checks if a namespace would normally be required.""" + return ( + not self._IsPrivateIdentifier(identifier) and + namespace not in external_dependencies and + namespace not in self._provided_namespaces and + identifier not in external_dependencies and + identifier not in created_identifiers and + namespace not in missing_requires) + + # First check all the used identifiers where we know that their namespace + # needs to be provided (unless they are optional). + for ns in self._used_namespaces: + namespace = ns.namespace + identifier = ns.identifier + if (not ns.alias_definition and + ShouldRequireNamespace(namespace, identifier)): + missing_requires[namespace] = ns.GetLine() + + # Now that all required namespaces are known, we can check if the alias + # definitions (that are likely being used for typeannotations that don't + # need explicit goog.require statements) are already covered. If not + # the user shouldn't use the alias. + for ns in self._used_namespaces: + if (not ns.alias_definition or + not ShouldRequireNamespace(ns.namespace, ns.identifier)): + continue + if self._FindNamespace(ns.identifier, self._provided_namespaces, + created_identifiers, external_dependencies, + missing_requires): + continue + namespace = ns.identifier.rsplit('.', 1)[0] + illegal_alias_statements[namespace] = ns.token + + return missing_requires, illegal_alias_statements + + def _FindNamespace(self, identifier, *namespaces_list): + """Finds the namespace of an identifier given a list of other namespaces. + + Args: + identifier: An identifier whose parent needs to be defined. + e.g. for goog.bar.foo we search something that provides + goog.bar. + *namespaces_list: var args of iterables of namespace identifiers + Returns: + The namespace that the given identifier is part of or None. + """ + identifier = identifier.rsplit('.', 1)[0] + identifier_prefix = identifier + '.' + for namespaces in namespaces_list: + for namespace in namespaces: + if namespace == identifier or namespace.startswith(identifier_prefix): + return namespace + return None + + def _IsPrivateIdentifier(self, identifier): + """Returns whether the given identifier is private.""" + pieces = identifier.split('.') + for piece in pieces: + if piece.endswith('_'): + return True + return False + + def IsFirstProvide(self, token): + """Returns whether token is the first provide token.""" + return self._provide_tokens and token == self._provide_tokens[0] + + def IsFirstRequire(self, token): + """Returns whether token is the first require token.""" + return self._require_tokens and token == self._require_tokens[0] + + def IsLastProvide(self, token): + """Returns whether token is the last provide token.""" + return self._provide_tokens and token == self._provide_tokens[-1] + + def IsLastRequire(self, token): + """Returns whether token is the last require token.""" + return self._require_tokens and token == self._require_tokens[-1] + + def ProcessToken(self, token, state_tracker): + """Processes the given token for dependency information. + + Args: + token: The token to process. + state_tracker: The JavaScript state tracker. + """ + + # Note that this method is in the critical path for the linter and has been + # optimized for performance in the following ways: + # - Tokens are checked by type first to minimize the number of function + # calls necessary to determine if action needs to be taken for the token. + # - The most common tokens types are checked for first. + # - The number of function calls has been minimized (thus the length of this + # function. + + if token.type == TokenType.IDENTIFIER: + # TODO(user): Consider saving the whole identifier in metadata. + whole_identifier_string = tokenutil.GetIdentifierForToken(token) + if whole_identifier_string is None: + # We only want to process the identifier one time. If the whole string + # identifier is None, that means this token was part of a multi-token + # identifier, but it was not the first token of the identifier. + return + + # In the odd case that a goog.require is encountered inside a function, + # just ignore it (e.g. dynamic loading in test runners). + if token.string == 'goog.require' and not state_tracker.InFunction(): + self._require_tokens.append(token) + namespace = tokenutil.GetStringAfterToken(token) + if namespace in self._required_namespaces: + self._duplicate_require_tokens.append(token) + else: + self._required_namespaces.append(namespace) + + # If there is a suppression for the require, add a usage for it so it + # gets treated as a regular goog.require (i.e. still gets sorted). + if self._HasSuppression(state_tracker, 'extraRequire'): + self._suppressed_requires.append(namespace) + self._AddUsedNamespace(state_tracker, namespace, token) + + elif token.string == 'goog.provide': + self._provide_tokens.append(token) + namespace = tokenutil.GetStringAfterToken(token) + if namespace in self._provided_namespaces: + self._duplicate_provide_tokens.append(token) + else: + self._provided_namespaces.append(namespace) + + # If there is a suppression for the provide, add a creation for it so it + # gets treated as a regular goog.provide (i.e. still gets sorted). + if self._HasSuppression(state_tracker, 'extraProvide'): + self._AddCreatedNamespace(state_tracker, namespace, token.line_number) + + elif token.string == 'goog.scope': + self._scopified_file = True + + elif token.string == 'goog.setTestOnly': + + # Since the message is optional, we don't want to scan to later lines. + for t in tokenutil.GetAllTokensInSameLine(token): + if t.type == TokenType.STRING_TEXT: + message = t.string + + if re.match(r'^\w+(\.\w+)+$', message): + # This looks like a namespace. If it's a Closurized namespace, + # consider it created. + base_namespace = message.split('.', 1)[0] + if base_namespace in self._closurized_namespaces: + self._AddCreatedNamespace(state_tracker, message, + token.line_number) + + break + else: + jsdoc = state_tracker.GetDocComment() + if token.metadata and token.metadata.aliased_symbol: + whole_identifier_string = token.metadata.aliased_symbol + elif (token.string == 'goog.module.get' and + not self._HasSuppression(state_tracker, 'extraRequire')): + # Cannot use _AddUsedNamespace as this is not an identifier, but + # already the entire namespace that's required. + namespace = tokenutil.GetStringAfterToken(token) + namespace = UsedNamespace(namespace, namespace, token, + alias_definition=False) + self._used_namespaces.append(namespace) + if jsdoc and jsdoc.HasFlag('typedef'): + self._AddCreatedNamespace(state_tracker, whole_identifier_string, + token.line_number, + namespace=self.GetClosurizedNamespace( + whole_identifier_string)) + else: + is_alias_definition = (token.metadata and + token.metadata.is_alias_definition) + self._AddUsedNamespace(state_tracker, whole_identifier_string, + token, is_alias_definition) + + elif token.type == TokenType.SIMPLE_LVALUE: + identifier = token.values['identifier'] + start_token = tokenutil.GetIdentifierStart(token) + if start_token and start_token != token: + # Multi-line identifier being assigned. Get the whole identifier. + identifier = tokenutil.GetIdentifierForToken(start_token) + else: + start_token = token + # If an alias is defined on the start_token, use it instead. + if (start_token and + start_token.metadata and + start_token.metadata.aliased_symbol and + not start_token.metadata.is_alias_definition): + identifier = start_token.metadata.aliased_symbol + + if identifier: + namespace = self.GetClosurizedNamespace(identifier) + if state_tracker.InFunction(): + self._AddUsedNamespace(state_tracker, identifier, token) + elif namespace and namespace != 'goog': + self._AddCreatedNamespace(state_tracker, identifier, + token.line_number, namespace=namespace) + + elif token.type == TokenType.DOC_FLAG: + flag = token.attached_object + flag_type = flag.flag_type + if flag and flag.HasType() and flag.jstype: + is_interface = state_tracker.GetDocComment().HasFlag('interface') + if flag_type == 'implements' or (flag_type == 'extends' + and is_interface): + identifier = flag.jstype.alias or flag.jstype.identifier + self._AddUsedNamespace(state_tracker, identifier, token) + # Since we process doctypes only for implements and extends, the + # type is a simple one and we don't need any iteration for subtypes. + + def _AddCreatedNamespace(self, state_tracker, identifier, line_number, + namespace=None): + """Adds the namespace of an identifier to the list of created namespaces. + + If the identifier is annotated with a 'missingProvide' suppression, it is + not added. + + Args: + state_tracker: The JavaScriptStateTracker instance. + identifier: The identifier to add. + line_number: Line number where namespace is created. + namespace: The namespace of the identifier or None if the identifier is + also the namespace. + """ + if not namespace: + namespace = identifier + + if self._HasSuppression(state_tracker, 'missingProvide'): + return + + self._created_namespaces.append([namespace, identifier, line_number]) + + def _AddUsedNamespace(self, state_tracker, identifier, token, + is_alias_definition=False): + """Adds the namespace of an identifier to the list of used namespaces. + + If the identifier is annotated with a 'missingRequire' suppression, it is + not added. + + Args: + state_tracker: The JavaScriptStateTracker instance. + identifier: An identifier which has been used. + token: The token in which the namespace is used. + is_alias_definition: If the used namespace is part of an alias_definition. + Aliased symbols need their parent namespace to be available, if it is + not yet required through another symbol, an error will be thrown. + """ + if self._HasSuppression(state_tracker, 'missingRequire'): + return + + namespace = self.GetClosurizedNamespace(identifier) + # b/5362203 If its a variable in scope then its not a required namespace. + if namespace and not state_tracker.IsVariableInScope(namespace): + namespace = UsedNamespace(namespace, identifier, token, + is_alias_definition) + self._used_namespaces.append(namespace) + + def _HasSuppression(self, state_tracker, suppression): + jsdoc = state_tracker.GetDocComment() + return jsdoc and suppression in jsdoc.suppressions + + def GetClosurizedNamespace(self, identifier): + """Given an identifier, returns the namespace that identifier is from. + + Args: + identifier: The identifier to extract a namespace from. + + Returns: + The namespace the given identifier resides in, or None if one could not + be found. + """ + if identifier.startswith('goog.global'): + # Ignore goog.global, since it is, by definition, global. + return None + + parts = identifier.split('.') + for namespace in self._closurized_namespaces: + if not identifier.startswith(namespace + '.'): + continue + + # The namespace for a class is the shortest prefix ending in a class + # name, which starts with a capital letter but is not a capitalized word. + # + # We ultimately do not want to allow requiring or providing of inner + # classes/enums. Instead, a file should provide only the top-level class + # and users should require only that. + namespace = [] + for part in parts: + if part == 'prototype' or part.isupper(): + return '.'.join(namespace) + namespace.append(part) + if part[0].isupper(): + return '.'.join(namespace) + + # At this point, we know there's no class or enum, so the namespace is + # just the identifier with the last part removed. With the exception of + # apply, inherits, and call, which should also be stripped. + if parts[-1] in ('apply', 'inherits', 'call'): + parts.pop() + parts.pop() + + # If the last part ends with an underscore, it is a private variable, + # method, or enum. The namespace is whatever is before it. + if parts and parts[-1].endswith('_'): + parts.pop() + + return '.'.join(parts) + + return None diff --git a/tools/closure_linter/closure_linter/closurizednamespacesinfo_test.py b/tools/closure_linter/closure_linter/closurizednamespacesinfo_test.py new file mode 100755 index 00000000000000..7aeae21956af8d --- /dev/null +++ b/tools/closure_linter/closure_linter/closurizednamespacesinfo_test.py @@ -0,0 +1,873 @@ +#!/usr/bin/env python +# +# Copyright 2010 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for ClosurizedNamespacesInfo.""" + + + +import unittest as googletest +from closure_linter import aliaspass +from closure_linter import closurizednamespacesinfo +from closure_linter import ecmametadatapass +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + + +def _ToLineDict(illegal_alias_stmts): + """Replaces tokens with the respective line number.""" + return {k: v.line_number for k, v in illegal_alias_stmts.iteritems()} + + +class ClosurizedNamespacesInfoTest(googletest.TestCase): + """Tests for ClosurizedNamespacesInfo.""" + + _test_cases = { + 'goog.global.anything': None, + 'package.CONSTANT': 'package', + 'package.methodName': 'package', + 'package.subpackage.methodName': 'package.subpackage', + 'package.subpackage.methodName.apply': 'package.subpackage', + 'package.ClassName.something': 'package.ClassName', + 'package.ClassName.Enum.VALUE.methodName': 'package.ClassName', + 'package.ClassName.CONSTANT': 'package.ClassName', + 'package.namespace.CONSTANT.methodName': 'package.namespace', + 'package.ClassName.inherits': 'package.ClassName', + 'package.ClassName.apply': 'package.ClassName', + 'package.ClassName.methodName.apply': 'package.ClassName', + 'package.ClassName.methodName.call': 'package.ClassName', + 'package.ClassName.prototype.methodName': 'package.ClassName', + 'package.ClassName.privateMethod_': 'package.ClassName', + 'package.className.privateProperty_': 'package.className', + 'package.className.privateProperty_.methodName': 'package.className', + 'package.ClassName.PrivateEnum_': 'package.ClassName', + 'package.ClassName.prototype.methodName.apply': 'package.ClassName', + 'package.ClassName.property.subProperty': 'package.ClassName', + 'package.className.prototype.something.somethingElse': 'package.className' + } + + def testGetClosurizedNamespace(self): + """Tests that the correct namespace is returned for various identifiers.""" + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=['package'], ignored_extra_namespaces=[]) + for identifier, expected_namespace in self._test_cases.items(): + actual_namespace = namespaces_info.GetClosurizedNamespace(identifier) + self.assertEqual( + expected_namespace, + actual_namespace, + 'expected namespace "' + str(expected_namespace) + + '" for identifier "' + str(identifier) + '" but was "' + + str(actual_namespace) + '"') + + def testIgnoredExtraNamespaces(self): + """Tests that ignored_extra_namespaces are ignored.""" + token = self._GetRequireTokens('package.Something') + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=['package'], + ignored_extra_namespaces=['package.Something']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should be valid since it is in ignored namespaces.') + + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + ['package'], []) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be invalid since it is not in ignored namespaces.') + + def testIsExtraProvide_created(self): + """Tests that provides for created namespaces are not extra.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is created.') + + def testIsExtraProvide_createdIdentifier(self): + """Tests that provides for created identifiers are not extra.""" + input_lines = [ + 'goog.provide(\'package.Foo.methodName\');', + 'package.Foo.methodName = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is created.') + + def testIsExtraProvide_notCreated(self): + """Tests that provides for non-created namespaces are extra.""" + input_lines = ['goog.provide(\'package.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is not created.') + + def testIsExtraProvide_notCreatedMultipartClosurizedNamespace(self): + """Tests that provides for non-created namespaces are extra.""" + input_lines = ['goog.provide(\'multi.part.namespace.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['multi.part']) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is not created.') + + def testIsExtraProvide_duplicate(self): + """Tests that providing a namespace twice makes the second one extra.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + # Advance to the second goog.provide token. + token = tokenutil.Search(token.next, TokenType.IDENTIFIER) + + self.assertTrue(namespaces_info.IsExtraProvide(token), + 'Should be extra since it is already provided.') + + def testIsExtraProvide_notClosurized(self): + """Tests that provides of non-closurized namespaces are not extra.""" + input_lines = ['goog.provide(\'notclosurized.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraProvide(token), + 'Should not be extra since it is not closurized.') + + def testIsExtraRequire_used(self): + """Tests that requires for used namespaces are not extra.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'var x = package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is used.') + + def testIsExtraRequire_usedIdentifier(self): + """Tests that requires for used methods on classes are extra.""" + input_lines = [ + 'goog.require(\'package.Foo.methodName\');', + 'var x = package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should require the package, not the method specifically.') + + def testIsExtraRequire_notUsed(self): + """Tests that requires for unused namespaces are extra.""" + input_lines = ['goog.require(\'package.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be extra since it is not used.') + + def testIsExtraRequire_notUsedMultiPartClosurizedNamespace(self): + """Tests unused require with multi-part closurized namespaces.""" + + input_lines = ['goog.require(\'multi.part.namespace.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['multi.part']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'Should be extra since it is not used.') + + def testIsExtraRequire_notClosurized(self): + """Tests that requires of non-closurized namespaces are not extra.""" + input_lines = ['goog.require(\'notclosurized.Foo\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is not closurized.') + + def testIsExtraRequire_objectOnClass(self): + """Tests that requiring an object on a class is extra.""" + input_lines = [ + 'goog.require(\'package.Foo.Enum\');', + 'var x = package.Foo.Enum.VALUE1;', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'The whole class, not the object, should be required.'); + + def testIsExtraRequire_constantOnClass(self): + """Tests that requiring a constant on a class is extra.""" + input_lines = [ + 'goog.require(\'package.Foo.CONSTANT\');', + 'var x = package.Foo.CONSTANT', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertTrue(namespaces_info.IsExtraRequire(token), + 'The class, not the constant, should be required.'); + + def testIsExtraRequire_constantNotOnClass(self): + """Tests that requiring a constant not on a class is OK.""" + input_lines = [ + 'goog.require(\'package.subpackage.CONSTANT\');', + 'var x = package.subpackage.CONSTANT', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Constants can be required except on classes.'); + + def testIsExtraRequire_methodNotOnClass(self): + """Tests that requiring a method not on a class is OK.""" + input_lines = [ + 'goog.require(\'package.subpackage.method\');', + 'var x = package.subpackage.method()', + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Methods can be required except on classes.'); + + def testIsExtraRequire_defaults(self): + """Tests that there are no warnings about extra requires for test utils""" + input_lines = ['goog.require(\'goog.testing.jsunit\');'] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['goog']) + + self.assertFalse(namespaces_info.IsExtraRequire(token), + 'Should not be extra since it is for testing.') + + def testGetMissingProvides_provided(self): + """Tests that provided functions don't cause a missing provide.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript( + input_lines, ['package']) + + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_providedIdentifier(self): + """Tests that provided identifiers don't cause a missing provide.""" + input_lines = [ + 'goog.provide(\'package.Foo.methodName\');', + 'package.Foo.methodName = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_providedParentIdentifier(self): + """Tests that provided identifiers on a class don't cause a missing provide + on objects attached to that class.""" + input_lines = [ + 'goog.provide(\'package.foo.ClassName\');', + 'package.foo.ClassName.methodName = function() {};', + 'package.foo.ClassName.ObjectName = 1;', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_unprovided(self): + """Tests that unprovided functions cause a missing provide.""" + input_lines = ['package.Foo = function() {};'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_provides = namespaces_info.GetMissingProvides() + self.assertEquals(1, len(missing_provides)) + missing_provide = missing_provides.popitem() + self.assertEquals('package.Foo', missing_provide[0]) + self.assertEquals(1, missing_provide[1]) + + def testGetMissingProvides_privatefunction(self): + """Tests that unprovided private functions don't cause a missing provide.""" + input_lines = ['package.Foo_ = function() {};'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingProvides_required(self): + """Tests that required namespaces don't cause a missing provide.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName = function() {};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + self.assertEquals(0, len(namespaces_info.GetMissingProvides())) + + def testGetMissingRequires_required(self): + """Tests that required namespaces don't cause a missing require.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredIdentifier(self): + """Tests that required namespaces satisfy identifiers on that namespace.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredNamespace(self): + """Tests that required namespaces satisfy the namespace.""" + input_lines = [ + 'goog.require(\'package.soy.fooTemplate\');', + 'render(package.soy.fooTemplate);' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_requiredParentClass(self): + """Tests that requiring a parent class of an object is sufficient to prevent + a missing require on that object.""" + input_lines = [ + 'goog.require(\'package.Foo\');', + 'package.Foo.methodName();', + 'package.Foo.methodName(package.Foo.ObjectName);' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_unrequired(self): + """Tests that unrequired namespaces cause a missing require.""" + input_lines = ['package.Foo();'] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires)) + missing_req = missing_requires.popitem() + self.assertEquals('package.Foo', missing_req[0]) + self.assertEquals(1, missing_req[1]) + + def testGetMissingRequires_provided(self): + """Tests that provided namespaces satisfy identifiers on that namespace.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_created(self): + """Tests that created namespaces do not satisfy usage of an identifier.""" + input_lines = [ + 'package.Foo = function();', + 'package.Foo.methodName();', + 'package.Foo.anotherMethodName1();', + 'package.Foo.anotherMethodName2();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires)) + missing_require = missing_requires.popitem() + self.assertEquals('package.Foo', missing_require[0]) + # Make sure line number of first occurrence is reported + self.assertEquals(2, missing_require[1]) + + def testGetMissingRequires_createdIdentifier(self): + """Tests that created identifiers satisfy usage of the identifier.""" + input_lines = [ + 'package.Foo.methodName = function();', + 'package.Foo.methodName();' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(0, len(missing_requires)) + + def testGetMissingRequires_implements(self): + """Tests that a parametrized type requires the correct identifier.""" + input_lines = [ + '/** @constructor @implements {package.Bar} */', + 'package.Foo = function();', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertItemsEqual({'package.Bar': 1}, missing_requires) + + def testGetMissingRequires_objectOnClass(self): + """Tests that we should require a class, not the object on the class.""" + input_lines = [ + 'goog.require(\'package.Foo.Enum\');', + 'var x = package.Foo.Enum.VALUE1;', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['package']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(1, len(missing_requires), + 'The whole class, not the object, should be required.') + + def testGetMissingRequires_variableWithSameName(self): + """Tests that we should not goog.require variables and parameters. + + b/5362203 Variables in scope are not missing namespaces. + """ + input_lines = [ + 'goog.provide(\'Foo\');', + 'Foo.A = function();', + 'Foo.A.prototype.method = function(ab) {', + ' if (ab) {', + ' var docs;', + ' var lvalue = new Obj();', + ' // Variable in scope hence not goog.require here.', + ' docs.foo.abc = 1;', + ' lvalue.next();', + ' }', + ' // Since js is function scope this should also not goog.require.', + ' docs.foo.func();', + ' // Its not a variable in scope hence goog.require.', + ' dummy.xyz.reset();', + ' return this.method2();', + '};', + 'Foo.A.prototype.method1 = function(docs, abcd, xyz) {', + ' // Parameter hence not goog.require.', + ' docs.nodes.length = 2;', + ' lvalue.abc.reset();', + '};' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['Foo', + 'docs', + 'lvalue', + 'dummy']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals(2, len(missing_requires)) + self.assertItemsEqual( + {'dummy.xyz': 14, + 'lvalue.abc': 20}, missing_requires) + + def testIsFirstProvide(self): + """Tests operation of the isFirstProvide method.""" + input_lines = [ + 'goog.provide(\'package.Foo\');', + 'package.Foo.methodName();' + ] + + token, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + input_lines, ['package']) + self.assertTrue(namespaces_info.IsFirstProvide(token)) + + def testGetWholeIdentifierString(self): + """Tests that created identifiers satisfy usage of the identifier.""" + input_lines = [ + 'package.Foo.', + ' veryLong.', + ' identifier;' + ] + + token = testutil.TokenizeSource(input_lines) + + self.assertEquals('package.Foo.veryLong.identifier', + tokenutil.GetIdentifierForToken(token)) + + self.assertEquals(None, + tokenutil.GetIdentifierForToken(token.next)) + + def testScopified(self): + """Tests that a goog.scope call is noticed.""" + input_lines = [ + 'goog.scope(function() {', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertTrue(namespaces_info._scopified_file) + + def testScope_unusedAlias(self): + """Tests that an unused alias symbol is illegal.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_usedMultilevelAlias(self): + """Tests that an used alias symbol in a deep namespace is ok.""" + input_lines = [ + 'goog.require(\'goog.Events\');', + 'goog.scope(function() {', + 'var Event = goog.Events.DeepNamespace.Event;', + 'Event();', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_usedAlias(self): + """Tests that aliased symbols result in correct requires.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + 'var dom = goog.dom;', + 'Event(dom.classes.get);', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, illegal_alias_stmts) + self.assertEquals({'goog.dom.classes': 4, 'goog.events.Event': 4}, + missing_requires) + + def testModule_alias(self): + """Tests that goog.module style aliases are supported.""" + input_lines = [ + 'goog.module(\'test.module\');', + 'var Unused = goog.require(\'goog.Unused\');', + 'var AliasedClass = goog.require(\'goog.AliasedClass\');', + 'var x = new AliasedClass();', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + namespaceToken = self._GetRequireTokens('goog.AliasedClass') + self.assertFalse(namespaces_info.IsExtraRequire(namespaceToken), + 'AliasedClass should be marked as used') + unusedToken = self._GetRequireTokens('goog.Unused') + self.assertTrue(namespaces_info.IsExtraRequire(unusedToken), + 'Unused should be marked as not used') + + def testModule_aliasInScope(self): + """Tests that goog.module style aliases are supported.""" + input_lines = [ + 'goog.module(\'test.module\');', + 'var AliasedClass = goog.require(\'goog.AliasedClass\');', + 'goog.scope(function() {', + 'var x = new AliasedClass();', + '});', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + namespaceToken = self._GetRequireTokens('goog.AliasedClass') + self.assertFalse(namespaces_info.IsExtraRequire(namespaceToken), + 'AliasedClass should be marked as used') + + def testModule_getAlwaysProvided(self): + """Tests that goog.module.get is recognized as a built-in.""" + input_lines = [ + 'goog.provide(\'test.MyClass\');', + 'goog.require(\'goog.someModule\');', + 'goog.scope(function() {', + 'var someModule = goog.module.get(\'goog.someModule\');', + 'test.MyClass = function() {};', + '});', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertEquals({}, namespaces_info.GetMissingRequires()[0]) + + def testModule_requireForGet(self): + """Tests that goog.module.get needs a goog.require call.""" + input_lines = [ + 'goog.provide(\'test.MyClass\');', + 'function foo() {', + ' var someModule = goog.module.get(\'goog.someModule\');', + ' someModule.doSth();', + '}', + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + self.assertEquals({'goog.someModule': 3}, + namespaces_info.GetMissingRequires()[0]) + + def testScope_usedTypeAlias(self): + """Tests aliased symbols in type annotations.""" + input_lines = [ + 'goog.scope(function() {', + 'var Event = goog.events.Event;', + '/** @type {Event} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_partialAlias_typeOnly(self): + """Tests a partial alias only used in type annotations. + + In this example, some goog.events namespace would need to be required + so that evaluating goog.events.bar doesn't throw an error. + """ + input_lines = [ + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Foo} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_partialAlias(self): + """Tests a partial alias in conjunction with a type annotation. + + In this example, the partial alias is already defined by another type, + therefore the doc-only type doesn't need to be required. + """ + input_lines = [ + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({'goog.events.bar.EventType': 4}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_partialAliasRequires(self): + """Tests partial aliases with correct requires.""" + input_lines = [ + 'goog.require(\'goog.events.bar.EventType\');', + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_partialAliasRequiresBoth(self): + """Tests partial aliases with correct requires.""" + input_lines = [ + 'goog.require(\'goog.events.bar.Event\');', + 'goog.require(\'goog.events.bar.EventType\');', + 'goog.scope(function() {', + 'var bar = goog.events.bar;', + '/** @type {bar.Event} */;', + 'bar.EventType();' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + event_token = self._GetRequireTokens('goog.events.bar.Event') + self.assertTrue(namespaces_info.IsExtraRequire(event_token)) + + def testScope_partialAliasNoSubtypeRequires(self): + """Tests that partial aliases don't yield subtype requires (regression).""" + input_lines = [ + 'goog.provide(\'goog.events.Foo\');', + 'goog.scope(function() {', + 'goog.events.Foo = {};', + 'var Foo = goog.events.Foo;' + 'Foo.CssName_ = {};' + 'var CssName_ = Foo.CssName_;' + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, _ = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + + def testScope_aliasNamespace(self): + """Tests that an unused alias namespace is not required when available. + + In the example goog.events.Bar is not required, because the namespace + goog.events is already defined because goog.events.Foo is required. + """ + input_lines = [ + 'goog.require(\'goog.events.Foo\');', + 'goog.scope(function() {', + 'var Bar = goog.events.Bar;', + '/** @type {Bar} */;', + 'goog.events.Foo;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({}, illegal_alias_stmts) + + def testScope_aliasNamespaceIllegal(self): + """Tests that an unused alias namespace is not required when available.""" + input_lines = [ + 'goog.scope(function() {', + 'var Bar = goog.events.Bar;', + '/** @type {Bar} */;', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_requires, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, missing_requires) + self.assertEquals({'goog.events': 2}, _ToLineDict(illegal_alias_stmts)) + + def testScope_provides(self): + """Tests that aliased symbols result in correct provides.""" + input_lines = [ + 'goog.scope(function() {', + 'goog.bar = {};', + 'var bar = goog.bar;', + 'bar.Foo = {};', + '});' + ] + + namespaces_info = self._GetNamespacesInfoForScript(input_lines, ['goog']) + missing_provides = namespaces_info.GetMissingProvides() + self.assertEquals({'goog.bar.Foo': 4}, missing_provides) + _, illegal_alias_stmts = namespaces_info.GetMissingRequires() + self.assertEquals({}, illegal_alias_stmts) + + def testSetTestOnlyNamespaces(self): + """Tests that a namespace in setTestOnly makes it a valid provide.""" + namespaces_info = self._GetNamespacesInfoForScript([ + 'goog.setTestOnly(\'goog.foo.barTest\');' + ], ['goog']) + + token = self._GetProvideTokens('goog.foo.barTest') + self.assertFalse(namespaces_info.IsExtraProvide(token)) + + token = self._GetProvideTokens('goog.foo.bazTest') + self.assertTrue(namespaces_info.IsExtraProvide(token)) + + def testSetTestOnlyComment(self): + """Ensure a comment in setTestOnly does not cause a created namespace.""" + namespaces_info = self._GetNamespacesInfoForScript([ + 'goog.setTestOnly(\'this is a comment\');' + ], ['goog']) + + self.assertEquals( + [], namespaces_info._created_namespaces, + 'A comment in setTestOnly should not modify created namespaces.') + + def _GetNamespacesInfoForScript(self, script, closurized_namespaces=None): + _, namespaces_info = self._GetStartTokenAndNamespacesInfoForScript( + script, closurized_namespaces) + + return namespaces_info + + def _GetStartTokenAndNamespacesInfoForScript( + self, script, closurized_namespaces): + + token = testutil.TokenizeSource(script) + return token, self._GetInitializedNamespacesInfo( + token, closurized_namespaces, []) + + def _GetInitializedNamespacesInfo(self, token, closurized_namespaces, + ignored_extra_namespaces): + """Returns a namespaces info initialized with the given token stream.""" + namespaces_info = closurizednamespacesinfo.ClosurizedNamespacesInfo( + closurized_namespaces=closurized_namespaces, + ignored_extra_namespaces=ignored_extra_namespaces) + state_tracker = javascriptstatetracker.JavaScriptStateTracker() + + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + ecma_pass.Process(token) + + state_tracker.DocFlagPass(token, error_handler=None) + + alias_pass = aliaspass.AliasPass(closurized_namespaces) + alias_pass.Process(token) + + while token: + state_tracker.HandleToken(token, state_tracker.GetLastNonSpaceToken()) + namespaces_info.ProcessToken(token, state_tracker) + state_tracker.HandleAfterToken(token) + token = token.next + + return namespaces_info + + def _GetProvideTokens(self, namespace): + """Returns a list of tokens for a goog.require of the given namespace.""" + line_text = 'goog.require(\'' + namespace + '\');\n' + return testutil.TokenizeSource([line_text]) + + def _GetRequireTokens(self, namespace): + """Returns a list of tokens for a goog.require of the given namespace.""" + line_text = 'goog.require(\'' + namespace + '\');\n' + return testutil.TokenizeSource([line_text]) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/common/__init__.py b/tools/closure_linter/closure_linter/common/__init__.py index 4265cc3e6c16c0..57930436ce4323 100755 --- a/tools/closure_linter/closure_linter/common/__init__.py +++ b/tools/closure_linter/closure_linter/common/__init__.py @@ -1 +1,16 @@ #!/usr/bin/env python +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Package indicator for gjslint.common.""" diff --git a/tools/closure_linter/closure_linter/common/error.py b/tools/closure_linter/closure_linter/common/error.py index 0e3b4760107aa3..4209c235b85425 100755 --- a/tools/closure_linter/closure_linter/common/error.py +++ b/tools/closure_linter/closure_linter/common/error.py @@ -23,7 +23,7 @@ class Error(object): """Object representing a style error.""" - def __init__(self, code, message, token, position, fix_data): + def __init__(self, code, message, token=None, position=None, fix_data=None): """Initialize the error object. Args: diff --git a/tools/closure_linter/closure_linter/common/erroraccumulator.py b/tools/closure_linter/closure_linter/common/erroraccumulator.py index 7bb0c979597fcc..55844ba60356fa 100755 --- a/tools/closure_linter/closure_linter/common/erroraccumulator.py +++ b/tools/closure_linter/closure_linter/common/erroraccumulator.py @@ -35,7 +35,7 @@ def HandleError(self, error): Args: error: The error object """ - self._errors.append((error.token.line_number, error.code)) + self._errors.append(error) def GetErrors(self): """Returns the accumulated errors. diff --git a/tools/closure_linter/closure_linter/common/erroroutput.py b/tools/closure_linter/closure_linter/common/erroroutput.py new file mode 100644 index 00000000000000..149738b5d4f173 --- /dev/null +++ b/tools/closure_linter/closure_linter/common/erroroutput.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility functions to format errors.""" + + +__author__ = ('robbyw@google.com (Robert Walker)', + 'ajp@google.com (Andy Perelson)', + 'nnaze@google.com (Nathan Naze)') + + +def GetUnixErrorOutput(filename, error, new_error=False): + """Get a output line for an error in UNIX format.""" + + line = '' + + if error.token: + line = '%d' % error.token.line_number + + error_code = '%04d' % error.code + if new_error: + error_code = 'New Error ' + error_code + return '%s:%s:(%s) %s' % (filename, line, error_code, error.message) + + +def GetErrorOutput(error, new_error=False): + """Get a output line for an error in regular format.""" + + line = '' + if error.token: + line = 'Line %d, ' % error.token.line_number + + code = 'E:%04d' % error.code + + error_message = error.message + if new_error: + error_message = 'New Error ' + error_message + + return '%s%s: %s' % (line, code, error.message) diff --git a/tools/closure_linter/closure_linter/common/errorprinter.py b/tools/closure_linter/closure_linter/common/errorprinter.py deleted file mode 100755 index c9754068f1f542..00000000000000 --- a/tools/closure_linter/closure_linter/common/errorprinter.py +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2008 The Closure Linter Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS-IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Linter error handler class that prints errors to stdout.""" - -__author__ = ('robbyw@google.com (Robert Walker)', - 'ajp@google.com (Andy Perelson)') - -from closure_linter.common import error -from closure_linter.common import errorhandler - -Error = error.Error - - -# The error message is of the format: -# Line , E:: message -DEFAULT_FORMAT = 1 - -# The error message is of the format: -# filename:[line number]:message -UNIX_FORMAT = 2 - - -class ErrorPrinter(errorhandler.ErrorHandler): - """ErrorHandler that prints errors to stdout.""" - - def __init__(self, new_errors=None): - """Initializes this error printer. - - Args: - new_errors: A sequence of error codes representing recently introduced - errors, defaults to None. - """ - # Number of errors - self._error_count = 0 - - # Number of new errors - self._new_error_count = 0 - - # Number of files checked - self._total_file_count = 0 - - # Number of files with errors - self._error_file_count = 0 - - # Dict of file name to number of errors - self._file_table = {} - - # List of errors for each file - self._file_errors = None - - # Current file - self._filename = None - - self._format = DEFAULT_FORMAT - - if new_errors: - self._new_errors = frozenset(new_errors) - else: - self._new_errors = frozenset(set()) - - def SetFormat(self, format): - """Sets the print format of errors. - - Args: - format: One of {DEFAULT_FORMAT, UNIX_FORMAT}. - """ - self._format = format - - def HandleFile(self, filename, first_token): - """Notifies this ErrorPrinter that subsequent errors are in filename. - - Sets the current file name, and sets a flag stating the header for this file - has not been printed yet. - - Should be called by a linter before a file is style checked. - - Args: - filename: The name of the file about to be checked. - first_token: The first token in the file, or None if there was an error - opening the file - """ - if self._filename and self._file_table[self._filename]: - print - - self._filename = filename - self._file_table[filename] = 0 - self._total_file_count += 1 - self._file_errors = [] - - def HandleError(self, error): - """Prints a formatted error message about the specified error. - - The error message is of the format: - Error #, line #: message - - Args: - error: The error object - """ - self._file_errors.append(error) - self._file_table[self._filename] += 1 - self._error_count += 1 - - if self._new_errors and error.code in self._new_errors: - self._new_error_count += 1 - - def _PrintError(self, error): - """Prints a formatted error message about the specified error. - - Args: - error: The error object - """ - new_error = self._new_errors and error.code in self._new_errors - if self._format == DEFAULT_FORMAT: - line = '' - if error.token: - line = 'Line %d, ' % error.token.line_number - - code = 'E:%04d' % error.code - if new_error: - print '%s%s: (New error) %s' % (line, code, error.message) - else: - print '%s%s: %s' % (line, code, error.message) - else: - # UNIX format - filename = self._filename - line = '' - if error.token: - line = '%d' % error.token.line_number - - error_code = '%04d' % error.code - if new_error: - error_code = 'New Error ' + error_code - print '%s:%s:(%s) %s' % (filename, line, error_code, error.message) - - def FinishFile(self): - """Finishes handling the current file.""" - if self._file_errors: - self._error_file_count += 1 - - if self._format != UNIX_FORMAT: - print '----- FILE : %s -----' % (self._filename) - - self._file_errors.sort(Error.Compare) - - for error in self._file_errors: - self._PrintError(error) - - def HasErrors(self): - """Whether this error printer encountered any errors. - - Returns: - True if the error printer encountered any errors. - """ - return self._error_count - - def HasNewErrors(self): - """Whether this error printer encountered any new errors. - - Returns: - True if the error printer encountered any new errors. - """ - return self._new_error_count - - def HasOldErrors(self): - """Whether this error printer encountered any old errors. - - Returns: - True if the error printer encountered any old errors. - """ - return self._error_count - self._new_error_count - - def PrintSummary(self): - """Print a summary of the number of errors and files.""" - if self.HasErrors() or self.HasNewErrors(): - print ('Found %d errors, including %d new errors, in %d files ' - '(%d files OK).' % ( - self._error_count, - self._new_error_count, - self._error_file_count, - self._total_file_count - self._error_file_count)) - else: - print '%d files checked, no errors found.' % self._total_file_count - - def PrintFileSummary(self): - """Print a detailed summary of the number of errors in each file.""" - keys = self._file_table.keys() - keys.sort() - for filename in keys: - print '%s: %d' % (filename, self._file_table[filename]) diff --git a/tools/closure_linter/closure_linter/common/filetestcase.py b/tools/closure_linter/closure_linter/common/filetestcase.py index ae4b883fe2b387..7cd83cd1dcf58c 100755 --- a/tools/closure_linter/closure_linter/common/filetestcase.py +++ b/tools/closure_linter/closure_linter/common/filetestcase.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2007 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +25,7 @@ import re +import gflags as flags import unittest as googletest from closure_linter.common import erroraccumulator @@ -41,21 +41,27 @@ class AnnotatedFileTestCase(googletest.TestCase): _EXPECTED_RE = re.compile(r'\s*//\s*(?:(?P[+-]?[0-9]+):)?' r'\s*(?P%(msg)s(?:,\s*%(msg)s)*)' % _MESSAGE) - def __init__(self, filename, runner, converter): + def __init__(self, filename, lint_callable, converter): """Create a single file lint test case. Args: filename: Filename to test. - runner: Object implementing the LintRunner interface that lints a file. + lint_callable: Callable that lints a file. This is usually runner.Run(). converter: Function taking an error string and returning an error code. """ googletest.TestCase.__init__(self, 'runTest') self._filename = filename self._messages = [] - self._runner = runner + self._lint_callable = lint_callable self._converter = converter + def setUp(self): + flags.FLAGS.dot_on_next_line = True + + def tearDown(self): + flags.FLAGS.dot_on_next_line = False + def shortDescription(self): """Provides a description for the test.""" return 'Run linter on %s' % self._filename @@ -65,7 +71,7 @@ def runTest(self): try: filename = self._filename stream = open(filename) - except IOError, ex: + except IOError as ex: raise IOError('Could not find testdata resource for %s: %s' % (self._filename, ex)) @@ -96,10 +102,14 @@ def _GetExpectedMessages(self, stream): return messages def _ProcessFileAndGetMessages(self, filename): - """Trap gpylint's output parse it to get messages added.""" - errors = erroraccumulator.ErrorAccumulator() - self._runner.Run([filename], errors) + """Trap gjslint's output parse it to get messages added.""" + error_accumulator = erroraccumulator.ErrorAccumulator() + self._lint_callable(filename, error_accumulator) + + errors = error_accumulator.GetErrors() + + # Convert to expected tuple format. - errors = errors.GetErrors() - errors.sort() - return errors + error_msgs = [(error.token.line_number, error.code) for error in errors] + error_msgs.sort() + return error_msgs diff --git a/tools/closure_linter/closure_linter/common/tokenizer.py b/tools/closure_linter/closure_linter/common/tokenizer.py index 0234720d73b951..9420ea3267a5a2 100755 --- a/tools/closure_linter/closure_linter/common/tokenizer.py +++ b/tools/closure_linter/closure_linter/common/tokenizer.py @@ -90,7 +90,8 @@ def _CreateToken(self, string, token_type, line, line_number, values=None): Returns: The newly created Token object. """ - return tokens.Token(string, token_type, line, line_number, values) + return tokens.Token(string, token_type, line, line_number, values, + line_number) def __TokenizeLine(self, line): """Tokenizes the given line. diff --git a/tools/closure_linter/closure_linter/common/tokens.py b/tools/closure_linter/closure_linter/common/tokens.py index 5eaffa8cba4cad..4703998752b036 100755 --- a/tools/closure_linter/closure_linter/common/tokens.py +++ b/tools/closure_linter/closure_linter/common/tokens.py @@ -47,7 +47,8 @@ class Token(object): a separate metadata pass. """ - def __init__(self, string, token_type, line, line_number, values=None): + def __init__(self, string, token_type, line, line_number, values=None, + orig_line_number=None): """Creates a new Token object. Args: @@ -58,13 +59,18 @@ def __init__(self, string, token_type, line, line_number, values=None): values: A dict of named values within the token. For instance, a function declaration may have a value called 'name' which captures the name of the function. + orig_line_number: The line number of the original file this token comes + from. This should be only set during the tokenization process. For newly + created error fix tokens after that, it should be None. """ self.type = token_type self.string = string self.length = len(string) self.line = line self.line_number = line_number + self.orig_line_number = orig_line_number self.values = values + self.is_deleted = False # These parts can only be computed when the file is fully tokenized self.previous = None @@ -123,3 +129,17 @@ def __repr__(self): return '' % (self.type, self.string, self.values, self.line_number, self.metadata) + + def __iter__(self): + """Returns a token iterator.""" + node = self + while node: + yield node + node = node.next + + def __reversed__(self): + """Returns a reverse-direction token iterator.""" + node = self + while node: + yield node + node = node.previous diff --git a/tools/closure_linter/closure_linter/common/tokens_test.py b/tools/closure_linter/closure_linter/common/tokens_test.py new file mode 100644 index 00000000000000..01ec89d01bc357 --- /dev/null +++ b/tools/closure_linter/closure_linter/common/tokens_test.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import unittest as googletest +from closure_linter.common import tokens + + +def _CreateDummyToken(): + return tokens.Token('foo', None, 1, 1) + + +def _CreateDummyTokens(count): + dummy_tokens = [] + for _ in xrange(count): + dummy_tokens.append(_CreateDummyToken()) + return dummy_tokens + + +def _SetTokensAsNeighbors(neighbor_tokens): + for i in xrange(len(neighbor_tokens)): + prev_index = i - 1 + next_index = i + 1 + + if prev_index >= 0: + neighbor_tokens[i].previous = neighbor_tokens[prev_index] + + if next_index < len(neighbor_tokens): + neighbor_tokens[i].next = neighbor_tokens[next_index] + + +class TokensTest(googletest.TestCase): + + def testIsFirstInLine(self): + + # First token in file (has no previous). + self.assertTrue(_CreateDummyToken().IsFirstInLine()) + + a, b = _CreateDummyTokens(2) + _SetTokensAsNeighbors([a, b]) + + # Tokens on same line + a.line_number = 30 + b.line_number = 30 + + self.assertFalse(b.IsFirstInLine()) + + # Tokens on different lines + b.line_number = 31 + self.assertTrue(b.IsFirstInLine()) + + def testIsLastInLine(self): + # Last token in file (has no next). + self.assertTrue(_CreateDummyToken().IsLastInLine()) + + a, b = _CreateDummyTokens(2) + _SetTokensAsNeighbors([a, b]) + + # Tokens on same line + a.line_number = 30 + b.line_number = 30 + self.assertFalse(a.IsLastInLine()) + + b.line_number = 31 + self.assertTrue(a.IsLastInLine()) + + def testIsType(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertTrue(a.IsType('fakeType1')) + self.assertFalse(a.IsType('fakeType2')) + + def testIsAnyType(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertTrue(a.IsAnyType(['fakeType1', 'fakeType2'])) + self.assertFalse(a.IsAnyType(['fakeType3', 'fakeType4'])) + + def testRepr(self): + a = tokens.Token('foo', 'fakeType1', 1, 1) + self.assertEquals('', str(a)) + + def testIter(self): + dummy_tokens = _CreateDummyTokens(5) + _SetTokensAsNeighbors(dummy_tokens) + a, b, c, d, e = dummy_tokens + + i = iter(a) + self.assertListEqual([a, b, c, d, e], list(i)) + + def testReverseIter(self): + dummy_tokens = _CreateDummyTokens(5) + _SetTokensAsNeighbors(dummy_tokens) + a, b, c, d, e = dummy_tokens + + ri = reversed(e) + self.assertListEqual([e, d, c, b, a], list(ri)) + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/ecmalintrules.py b/tools/closure_linter/closure_linter/ecmalintrules.py index a971b44d77e1b1..c07dffc86eeae3 100755 --- a/tools/closure_linter/closure_linter/ecmalintrules.py +++ b/tools/closure_linter/closure_linter/ecmalintrules.py @@ -23,25 +23,28 @@ import re +import gflags as flags + from closure_linter import checkerbase from closure_linter import ecmametadatapass +from closure_linter import error_check +from closure_linter import errorrules from closure_linter import errors from closure_linter import indentation -from closure_linter import javascripttokens from closure_linter import javascripttokenizer +from closure_linter import javascripttokens from closure_linter import statetracker from closure_linter import tokenutil from closure_linter.common import error -from closure_linter.common import htmlutil -from closure_linter.common import lintrunner from closure_linter.common import position -from closure_linter.common import tokens -import gflags as flags + FLAGS = flags.FLAGS -flags.DEFINE_boolean('strict', False, - 'Whether to validate against the stricter Closure style.') flags.DEFINE_list('custom_jsdoc_tags', '', 'Extra jsdoc tags to allow') +# TODO(user): When flipping this to True, remove logic from unit tests +# that overrides this flag. +flags.DEFINE_boolean('dot_on_next_line', False, 'Require dots to be' + 'placed on the next line for wrapped expressions') # TODO(robbyw): Check for extra parens on return statements # TODO(robbyw): Check for 0px in strings @@ -53,8 +56,10 @@ Error = error.Error Modes = javascripttokenizer.JavaScriptModes Position = position.Position +Rule = error_check.Rule Type = javascripttokens.JavaScriptTokenType + class EcmaScriptLintRules(checkerbase.LintRulesBase): """EmcaScript lint style checking rules. @@ -67,14 +72,15 @@ class EcmaScriptLintRules(checkerbase.LintRulesBase): language. """ - # Static constants. - MAX_LINE_LENGTH = 80 + # It will be initialized in constructor so the flags are initialized. + max_line_length = -1 + # Static constants. MISSING_PARAMETER_SPACE = re.compile(r',\S') - EXTRA_SPACE = re.compile('(\(\s|\s\))') + EXTRA_SPACE = re.compile(r'(\(\s|\s\))') - ENDS_WITH_SPACE = re.compile('\s$') + ENDS_WITH_SPACE = re.compile(r'\s$') ILLEGAL_TAB = re.compile(r'\t') @@ -85,12 +91,18 @@ class EcmaScriptLintRules(checkerbase.LintRulesBase): AUTHOR_SPEC = re.compile(r'(\s*)[^\s]+@[^(\s]+(\s*)\(.+\)') # Acceptable tokens to remove for line too long testing. - LONG_LINE_IGNORE = frozenset(['*', '//', '@see'] + + LONG_LINE_IGNORE = frozenset( + ['*', '//', '@see'] + ['@%s' % tag for tag in statetracker.DocFlag.HAS_TYPE]) + JSDOC_FLAGS_DESCRIPTION_NOT_REQUIRED = frozenset([ + '@fileoverview', '@param', '@return', '@returns']) + def __init__(self): """Initialize this lint rule object.""" checkerbase.LintRulesBase.__init__(self) + if EcmaScriptLintRules.max_line_length == -1: + EcmaScriptLintRules.max_line_length = errorrules.GetMaxLineLength() def Initialize(self, checker, limited_doc_checks, is_html): """Initialize this lint rule object before parsing a new file.""" @@ -107,6 +119,7 @@ def _CheckLineLength(self, last_token, state): Args: last_token: The last token in the line. + state: parser_state object that indicates the current state in the page """ # Start from the last token so that we have the flag object attached to # and DOC_FLAG tokens. @@ -119,8 +132,8 @@ def _CheckLineLength(self, last_token, state): while token and token.line_number == line_number: if state.IsTypeToken(token): line.insert(0, 'x' * len(token.string)) - elif token.type in (Type.IDENTIFIER, Type.NORMAL): - # Dots are acceptable places to wrap. + elif token.type in (Type.IDENTIFIER, Type.OPERATOR): + # Dots are acceptable places to wrap (may be tokenized as identifiers). line.insert(0, token.string.replace('.', ' ')) else: line.insert(0, token.string) @@ -130,7 +143,7 @@ def _CheckLineLength(self, last_token, state): line = line.rstrip('\n\r\f') try: length = len(unicode(line, 'utf-8')) - except: + except (LookupError, UnicodeDecodeError): # Unknown encoding. The line length may be wrong, as was originally the # case for utf-8 (see bug 1735846). For now just accept the default # length, but as we find problems we can either add test for other @@ -138,7 +151,7 @@ def _CheckLineLength(self, last_token, state): # false positives at the cost of more false negatives. length = len(line) - if length > self.MAX_LINE_LENGTH: + if length > EcmaScriptLintRules.max_line_length: # If the line matches one of the exceptions, then it's ok. for long_line_regexp in self.GetLongLineExceptions(): @@ -150,43 +163,42 @@ def _CheckLineLength(self, last_token, state): parts = set(line.split()) # We allow two "words" (type and name) when the line contains @param - max = 1 + max_parts = 1 if '@param' in parts: - max = 2 + max_parts = 2 # Custom tags like @requires may have url like descriptions, so ignore # the tag, similar to how we handle @see. custom_tags = set(['@%s' % f for f in FLAGS.custom_jsdoc_tags]) - if (len(parts.difference(self.LONG_LINE_IGNORE | custom_tags)) > max): - self._HandleError(errors.LINE_TOO_LONG, + if (len(parts.difference(self.LONG_LINE_IGNORE | custom_tags)) + > max_parts): + self._HandleError( + errors.LINE_TOO_LONG, 'Line too long (%d characters).' % len(line), last_token) - def _CheckJsDocType(self, token): + def _CheckJsDocType(self, token, js_type): """Checks the given type for style errors. Args: token: The DOC_FLAG token for the flag whose type to check. + js_type: The flag's typeannotation.TypeAnnotation instance. """ - flag = token.attached_object - type = flag.type - if type and type is not None and not type.isspace(): - pieces = self.TYPE_SPLIT.split(type) - if len(pieces) == 1 and type.count('|') == 1 and ( - type.endswith('|null') or type.startswith('null|')): - self._HandleError(errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL, - 'Prefer "?Type" to "Type|null": "%s"' % type, token) - - for p in pieces: - if p.count('|') and p.count('?'): - # TODO(robbyw): We should do actual parsing of JsDoc types. As is, - # this won't report an error for {number|Array.?}, etc. - self._HandleError(errors.JSDOC_ILLEGAL_QUESTION_WITH_PIPE, - 'JsDoc types cannot contain both "?" and "|": "%s"' % p, token) - - if FLAGS.strict and (flag.type_start_token.type != Type.DOC_START_BRACE or - flag.type_end_token.type != Type.DOC_END_BRACE): - self._HandleError(errors.MISSING_BRACES_AROUND_TYPE, - 'Type must always be surrounded by curly braces.', token) + if not js_type: return + + if js_type.type_group and len(js_type.sub_types) == 2: + identifiers = [t.identifier for t in js_type.sub_types] + if 'null' in identifiers: + # Don't warn if the identifier is a template type (e.g. {TYPE|null}. + if not identifiers[0].isupper() and not identifiers[1].isupper(): + self._HandleError( + errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL, + 'Prefer "?Type" to "Type|null": "%s"' % js_type, token) + + # TODO(user): We should report an error for wrong usage of '?' and '|' + # e.g. {?number|string|null} etc. + + for sub_type in js_type.IterTypes(): + self._CheckJsDocType(token, sub_type) def _CheckForMissingSpaceBeforeToken(self, token): """Checks for a missing space at the beginning of a token. @@ -206,7 +218,60 @@ def _CheckForMissingSpaceBeforeToken(self, token): errors.MISSING_SPACE, 'Missing space before "%s"' % token.string, token, - Position.AtBeginning()) + position=Position.AtBeginning()) + + def _CheckOperator(self, token): + """Checks an operator for spacing and line style. + + Args: + token: The operator token. + """ + last_code = token.metadata.last_code + + if not self._ExpectSpaceBeforeOperator(token): + if (token.previous and token.previous.type == Type.WHITESPACE and + last_code and last_code.type in (Type.NORMAL, Type.IDENTIFIER) and + last_code.line_number == token.line_number): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "%s"' % token.string, + token.previous, position=Position.All(token.previous.string)) + + elif (token.previous and + not token.previous.IsComment() and + not tokenutil.IsDot(token) and + token.previous.type in Type.EXPRESSION_ENDER_TYPES): + self._HandleError(errors.MISSING_SPACE, + 'Missing space before "%s"' % token.string, token, + position=Position.AtBeginning()) + + # Check wrapping of operators. + next_code = tokenutil.GetNextCodeToken(token) + + is_dot = tokenutil.IsDot(token) + wrapped_before = last_code and last_code.line_number != token.line_number + wrapped_after = next_code and next_code.line_number != token.line_number + + if FLAGS.dot_on_next_line and is_dot and wrapped_after: + self._HandleError( + errors.LINE_ENDS_WITH_DOT, + '"." must go on the following line', + token) + if (not is_dot and wrapped_before and + not token.metadata.IsUnaryOperator()): + self._HandleError( + errors.LINE_STARTS_WITH_OPERATOR, + 'Binary operator must go on previous line "%s"' % token.string, + token) + + def _IsLabel(self, token): + # A ':' token is considered part of a label if it occurs in a case + # statement, a plain label, or an object literal, i.e. is not part of a + # ternary. + + return (token.string == ':' and + token.metadata.context.type in (Context.LITERAL_ELEMENT, + Context.CASE_BLOCK, + Context.STATEMENT)) def _ExpectSpaceBeforeOperator(self, token): """Returns whether a space should appear before the given operator token. @@ -220,13 +285,13 @@ def _ExpectSpaceBeforeOperator(self, token): if token.string == ',' or token.metadata.IsUnaryPostOperator(): return False + if tokenutil.IsDot(token): + return False + # Colons should appear in labels, object literals, the case of a switch # statement, and ternary operator. Only want a space in the case of the # ternary operator. - if (token.string == ':' and - token.metadata.context.type in (Context.LITERAL_ELEMENT, - Context.CASE_BLOCK, - Context.STATEMENT)): + if self._IsLabel(token): return False if token.metadata.IsUnaryOperator() and token.IsFirstInLine(): @@ -246,10 +311,10 @@ def CheckToken(self, token, state): last_in_line = token.IsLastInLine() last_non_space_token = state.GetLastNonSpaceToken() - type = token.type + token_type = token.type # Process the line change. - if not self._is_html and FLAGS.strict: + if not self._is_html and error_check.ShouldCheck(Rule.INDENTATION): # TODO(robbyw): Support checking indentation in HTML files. indentation_errors = self._indentation.CheckToken(token, state) for indentation_error in indentation_errors: @@ -258,11 +323,12 @@ def CheckToken(self, token, state): if last_in_line: self._CheckLineLength(token, state) - if type == Type.PARAMETERS: + if token_type == Type.PARAMETERS: # Find missing spaces in parameter lists. if self.MISSING_PARAMETER_SPACE.search(token.string): + fix_data = ', '.join([s.strip() for s in token.string.split(',')]) self._HandleError(errors.MISSING_SPACE, 'Missing space after ","', - token) + token, position=None, fix_data=fix_data.strip()) # Find extra spaces at the beginning of parameter lists. Make sure # we aren't at the beginning of a continuing multi-line list. @@ -270,54 +336,56 @@ def CheckToken(self, token, state): space_count = len(token.string) - len(token.string.lstrip()) if space_count: self._HandleError(errors.EXTRA_SPACE, 'Extra space after "("', - token, Position(0, space_count)) + token, position=Position(0, space_count)) - elif (type == Type.START_BLOCK and + elif (token_type == Type.START_BLOCK and token.metadata.context.type == Context.BLOCK): self._CheckForMissingSpaceBeforeToken(token) - elif type == Type.END_BLOCK: - # This check is for object literal end block tokens, but there is no need - # to test that condition since a comma at the end of any other kind of - # block is undoubtedly a parse error. + elif token_type == Type.END_BLOCK: last_code = token.metadata.last_code - if last_code.IsOperator(','): - self._HandleError(errors.COMMA_AT_END_OF_LITERAL, - 'Illegal comma at end of object literal', last_code, - Position.All(last_code.string)) - if state.InFunction() and state.IsFunctionClose(): - is_immediately_called = (token.next and - token.next.type == Type.START_PAREN) if state.InTopLevelFunction(): - # When the function was top-level and not immediately called, check - # that it's terminated by a semi-colon. - if state.InAssignedFunction(): - if not is_immediately_called and (last_in_line or - not token.next.type == Type.SEMICOLON): - self._HandleError(errors.MISSING_SEMICOLON_AFTER_FUNCTION, - 'Missing semicolon after function assigned to a variable', - token, Position.AtEnd(token.string)) - else: + # A semicolons should not be included at the end of a function + # declaration. + if not state.InAssignedFunction(): if not last_in_line and token.next.type == Type.SEMICOLON: - self._HandleError(errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION, + self._HandleError( + errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION, 'Illegal semicolon after function declaration', - token.next, Position.All(token.next.string)) + token.next, position=Position.All(token.next.string)) + + # A semicolon should be included at the end of a function expression + # that is not immediately called or used by a dot operator. + if (state.InAssignedFunction() and token.next + and token.next.type != Type.SEMICOLON): + next_token = tokenutil.GetNextCodeToken(token) + is_immediately_used = (next_token.type == Type.START_PAREN or + tokenutil.IsDot(next_token)) + if not is_immediately_used: + self._HandleError( + errors.MISSING_SEMICOLON_AFTER_FUNCTION, + 'Missing semicolon after function assigned to a variable', + token, position=Position.AtEnd(token.string)) - if (state.InInterfaceMethod() and last_code.type != Type.START_BLOCK): + if state.InInterfaceMethod() and last_code.type != Type.START_BLOCK: self._HandleError(errors.INTERFACE_METHOD_CANNOT_HAVE_CODE, - 'Interface methods cannot contain code', last_code) + 'Interface methods cannot contain code', last_code) elif (state.IsBlockClose() and token.next and token.next.type == Type.SEMICOLON): - self._HandleError(errors.REDUNDANT_SEMICOLON, - 'No semicolon is required to end a code block', - token.next, Position.All(token.next.string)) - - elif type == Type.SEMICOLON: + if (last_code.metadata.context.parent.type != Context.OBJECT_LITERAL + and last_code.metadata.context.type != Context.OBJECT_LITERAL): + self._HandleError( + errors.REDUNDANT_SEMICOLON, + 'No semicolon is required to end a code block', + token.next, position=Position.All(token.next.string)) + + elif token_type == Type.SEMICOLON: if token.previous and token.previous.type == Type.WHITESPACE: - self._HandleError(errors.EXTRA_SPACE, 'Extra space before ";"', - token.previous, Position.All(token.previous.string)) + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before ";"', + token.previous, position=Position.All(token.previous.string)) if token.next and token.next.line_number == token.line_number: if token.metadata.context.type != Context.FOR_GROUP_BLOCK: @@ -326,10 +394,11 @@ def CheckToken(self, token, state): elif token.next.type not in ( Type.WHITESPACE, Type.SEMICOLON, Type.END_PAREN): - self._HandleError(errors.MISSING_SPACE, + self._HandleError( + errors.MISSING_SPACE, 'Missing space after ";" in for statement', token.next, - Position.AtBeginning()) + position=Position.AtBeginning()) last_code = token.metadata.last_code if last_code and last_code.type == Type.SEMICOLON: @@ -338,7 +407,8 @@ def CheckToken(self, token, state): # NOTE(user): This is not a perfect check, and will not throw an error # for cases like: for (var i = 0;; i < n; i++) {}, but then your code # probably won't work either. - for_token = tokenutil.CustomSearch(last_code, + for_token = tokenutil.CustomSearch( + last_code, lambda token: token.type == Type.KEYWORD and token.string == 'for', end_func=lambda token: token.type == Type.SEMICOLON, distance=None, @@ -346,113 +416,83 @@ def CheckToken(self, token, state): if not for_token: self._HandleError(errors.REDUNDANT_SEMICOLON, 'Redundant semicolon', - token, Position.All(token.string)) - - elif type == Type.START_PAREN: - if token.previous and token.previous.type == Type.KEYWORD: + token, position=Position.All(token.string)) + + elif token_type == Type.START_PAREN: + # Ensure that opening parentheses have a space before any keyword + # that is not being invoked like a member function. + if (token.previous and token.previous.type == Type.KEYWORD and + (not token.previous.metadata or + not token.previous.metadata.last_code or + not token.previous.metadata.last_code.string or + token.previous.metadata.last_code.string[-1:] != '.')): self._HandleError(errors.MISSING_SPACE, 'Missing space before "("', - token, Position.AtBeginning()) + token, position=Position.AtBeginning()) elif token.previous and token.previous.type == Type.WHITESPACE: before_space = token.previous.previous + # Ensure that there is no extra space before a function invocation, + # even if the function being invoked happens to be a keyword. if (before_space and before_space.line_number == token.line_number and - before_space.type == Type.IDENTIFIER): - self._HandleError(errors.EXTRA_SPACE, 'Extra space before "("', - token.previous, Position.All(token.previous.string)) - - elif type == Type.START_BRACKET: - if (not first_in_line and token.previous.type == Type.WHITESPACE and - last_non_space_token and - last_non_space_token.type in Type.EXPRESSION_ENDER_TYPES): - self._HandleError(errors.EXTRA_SPACE, 'Extra space before "["', - token.previous, Position.All(token.previous.string)) - # If the [ token is the first token in a line we shouldn't complain - # about a missing space before [. This is because some Ecma script - # languages allow syntax like: - # [Annotation] - # class MyClass {...} - # So we don't want to blindly warn about missing spaces before [. - # In the the future, when rules for computing exactly how many spaces - # lines should be indented are added, then we can return errors for - # [ tokens that are improperly indented. - # For example: - # var someVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariableName = - # [a,b,c]; - # should trigger a proper indentation warning message as [ is not indented - # by four spaces. - elif (not first_in_line and token.previous and - not token.previous.type in ( - [Type.WHITESPACE, Type.START_PAREN, Type.START_BRACKET] + - Type.EXPRESSION_ENDER_TYPES)): - self._HandleError(errors.MISSING_SPACE, 'Missing space before "["', - token, Position.AtBeginning()) - - elif type in (Type.END_PAREN, Type.END_BRACKET): + before_space.type == Type.IDENTIFIER or + (before_space.type == Type.KEYWORD and before_space.metadata and + before_space.metadata.last_code and + before_space.metadata.last_code.string and + before_space.metadata.last_code.string[-1:] == '.')): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "("', + token.previous, position=Position.All(token.previous.string)) + + elif token_type == Type.START_BRACKET: + self._HandleStartBracket(token, last_non_space_token) + elif token_type in (Type.END_PAREN, Type.END_BRACKET): # Ensure there is no space before closing parentheses, except when # it's in a for statement with an omitted section, or when it's at the # beginning of a line. if (token.previous and token.previous.type == Type.WHITESPACE and not token.previous.IsFirstInLine() and not (last_non_space_token and last_non_space_token.line_number == - token.line_number and + token.line_number and last_non_space_token.type == Type.SEMICOLON)): - self._HandleError(errors.EXTRA_SPACE, 'Extra space before "%s"' % - token.string, token.previous, Position.All(token.previous.string)) - - if token.type == Type.END_BRACKET: - last_code = token.metadata.last_code - if last_code.IsOperator(','): - self._HandleError(errors.COMMA_AT_END_OF_LITERAL, - 'Illegal comma at end of array literal', last_code, - Position.All(last_code.string)) + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "%s"' % + token.string, token.previous, + position=Position.All(token.previous.string)) - elif type == Type.WHITESPACE: + elif token_type == Type.WHITESPACE: if self.ILLEGAL_TAB.search(token.string): if token.IsFirstInLine(): - self._HandleError(errors.ILLEGAL_TAB, - 'Illegal tab in whitespace before "%s"' % token.next.string, - token, Position.All(token.string)) + if token.next: + self._HandleError( + errors.ILLEGAL_TAB, + 'Illegal tab in whitespace before "%s"' % token.next.string, + token, position=Position.All(token.string)) + else: + self._HandleError( + errors.ILLEGAL_TAB, + 'Illegal tab in whitespace', + token, position=Position.All(token.string)) else: - self._HandleError(errors.ILLEGAL_TAB, + self._HandleError( + errors.ILLEGAL_TAB, 'Illegal tab in whitespace after "%s"' % token.previous.string, - token, Position.All(token.string)) + token, position=Position.All(token.string)) # Check whitespace length if it's not the first token of the line and # if it's not immediately before a comment. if last_in_line: # Check for extra whitespace at the end of a line. self._HandleError(errors.EXTRA_SPACE, 'Extra space at end of line', - token, Position.All(token.string)) + token, position=Position.All(token.string)) elif not first_in_line and not token.next.IsComment(): if token.length > 1: - self._HandleError(errors.EXTRA_SPACE, 'Extra space after "%s"' % + self._HandleError( + errors.EXTRA_SPACE, 'Extra space after "%s"' % token.previous.string, token, - Position(1, len(token.string) - 1)) - - elif type == Type.OPERATOR: - last_code = token.metadata.last_code + position=Position(1, len(token.string) - 1)) - if not self._ExpectSpaceBeforeOperator(token): - if (token.previous and token.previous.type == Type.WHITESPACE and - last_code and last_code.type in (Type.NORMAL, Type.IDENTIFIER)): - self._HandleError(errors.EXTRA_SPACE, - 'Extra space before "%s"' % token.string, token.previous, - Position.All(token.previous.string)) - - elif (token.previous and - not token.previous.IsComment() and - token.previous.type in Type.EXPRESSION_ENDER_TYPES): - self._HandleError(errors.MISSING_SPACE, - 'Missing space before "%s"' % token.string, token, - Position.AtBeginning()) - - # Check that binary operators are not used to start lines. - if ((not last_code or last_code.line_number != token.line_number) and - not token.metadata.IsUnaryOperator()): - self._HandleError(errors.LINE_STARTS_WITH_OPERATOR, - 'Binary operator should go on previous line "%s"' % token.string, - token) - - elif type == Type.DOC_FLAG: + elif token_type == Type.OPERATOR: + self._CheckOperator(token) + elif token_type == Type.DOC_FLAG: flag = token.attached_object if flag.flag_type == 'bug': @@ -462,21 +502,25 @@ def CheckToken(self, token, state): if not string.isdigit(): self._HandleError(errors.NO_BUG_NUMBER_AFTER_BUG_TAG, - '@bug should be followed by a bug number', token) + '@bug should be followed by a bug number', token) elif flag.flag_type == 'suppress': if flag.type is None: # A syntactically invalid suppress tag will get tokenized as a normal # flag, indicating an error. - self._HandleError(errors.INCORRECT_SUPPRESS_SYNTAX, + self._HandleError( + errors.INCORRECT_SUPPRESS_SYNTAX, 'Invalid suppress syntax: should be @suppress {errortype}. ' 'Spaces matter.', token) - elif flag.type not in state.GetDocFlag().SUPPRESS_TYPES: - self._HandleError(errors.INVALID_SUPPRESS_TYPE, - 'Invalid suppression type: %s' % flag.type, - token) - - elif FLAGS.strict and flag.flag_type == 'author': + else: + for suppress_type in flag.jstype.IterIdentifiers(): + if suppress_type not in state.GetDocFlag().SUPPRESS_TYPES: + self._HandleError( + errors.INVALID_SUPPRESS_TYPE, + 'Invalid suppression type: %s' % suppress_type, token) + + elif (error_check.ShouldCheck(Rule.WELL_FORMED_AUTHOR) and + flag.flag_type == 'author'): # TODO(user): In non strict mode check the author tag for as much as # it exists, though the full form checked below isn't required. string = token.next.string @@ -494,12 +538,12 @@ def CheckToken(self, token, state): if num_spaces < 1: self._HandleError(errors.MISSING_SPACE, 'Missing space after email address', - token.next, Position(result.start(2), 0)) + token.next, position=Position(result.start(2), 0)) elif num_spaces > 1: - self._HandleError(errors.EXTRA_SPACE, - 'Extra space after email address', - token.next, - Position(result.start(2) + 1, num_spaces - 1)) + self._HandleError( + errors.EXTRA_SPACE, 'Extra space after email address', + token.next, + position=Position(result.start(2) + 1, num_spaces - 1)) # Check for extra spaces before email address. Can't be too few, if # not at least one we wouldn't match @author tag. @@ -507,80 +551,61 @@ def CheckToken(self, token, state): if num_spaces > 1: self._HandleError(errors.EXTRA_SPACE, 'Extra space before email address', - token.next, Position(1, num_spaces - 1)) + token.next, position=Position(1, num_spaces - 1)) elif (flag.flag_type in state.GetDocFlag().HAS_DESCRIPTION and not self._limited_doc_checks): if flag.flag_type == 'param': if flag.name is None: self._HandleError(errors.MISSING_JSDOC_PARAM_NAME, - 'Missing name in @param tag', token) + 'Missing name in @param tag', token) if not flag.description or flag.description is None: flag_name = token.type if 'name' in token.values: flag_name = '@' + token.values['name'] - self._HandleError(errors.MISSING_JSDOC_TAG_DESCRIPTION, - 'Missing description in %s tag' % flag_name, token) - else: - self._CheckForMissingSpaceBeforeToken(flag.description_start_token) - - # We want punctuation to be inside of any tags ending a description, - # so strip tags before checking description. See bug 1127192. Note - # that depending on how lines break, the real description end token - # may consist only of stripped html and the effective end token can - # be different. - end_token = flag.description_end_token - end_string = htmlutil.StripTags(end_token.string).strip() - while (end_string == '' and not - end_token.type in Type.FLAG_ENDING_TYPES): - end_token = end_token.previous - if end_token.type in Type.FLAG_DESCRIPTION_TYPES: - end_string = htmlutil.StripTags(end_token.string).rstrip() - - if not (end_string.endswith('.') or end_string.endswith('?') or - end_string.endswith('!')): - # Find the position for the missing punctuation, inside of any html - # tags. - desc_str = end_token.string.rstrip() - while desc_str.endswith('>'): - start_tag_index = desc_str.rfind('<') - if start_tag_index < 0: - break - desc_str = desc_str[:start_tag_index].rstrip() - end_position = Position(len(desc_str), 0) + if flag_name not in self.JSDOC_FLAGS_DESCRIPTION_NOT_REQUIRED: self._HandleError( - errors.JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER, - ('%s descriptions must end with valid punctuation such as a ' - 'period.' % token.string), - end_token, end_position) + errors.MISSING_JSDOC_TAG_DESCRIPTION, + 'Missing description in %s tag' % flag_name, token) + else: + self._CheckForMissingSpaceBeforeToken(flag.description_start_token) - if flag.flag_type in state.GetDocFlag().HAS_TYPE: + if flag.HasType(): if flag.type_start_token is not None: self._CheckForMissingSpaceBeforeToken( token.attached_object.type_start_token) - if flag.type and flag.type != '' and not flag.type.isspace(): - self._CheckJsDocType(token) - - if type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG): - if (token.values['name'] not in state.GetDocFlag().LEGAL_DOC and - token.values['name'] not in FLAGS.custom_jsdoc_tags): - self._HandleError(errors.INVALID_JSDOC_TAG, - 'Invalid JsDoc tag: %s' % token.values['name'], token) + if flag.jstype and not flag.jstype.IsEmpty(): + self._CheckJsDocType(token, flag.jstype) - if (FLAGS.strict and token.values['name'] == 'inheritDoc' and - type == Type.DOC_INLINE_FLAG): - self._HandleError(errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC, - 'Unnecessary braces around @inheritDoc', - token) - - elif type == Type.SIMPLE_LVALUE: + if error_check.ShouldCheck(Rule.BRACES_AROUND_TYPE) and ( + flag.type_start_token.type != Type.DOC_START_BRACE or + flag.type_end_token.type != Type.DOC_END_BRACE): + self._HandleError( + errors.MISSING_BRACES_AROUND_TYPE, + 'Type must always be surrounded by curly braces.', token) + + if token_type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG): + if (token.values['name'] not in state.GetDocFlag().LEGAL_DOC and + token.values['name'] not in FLAGS.custom_jsdoc_tags): + self._HandleError( + errors.INVALID_JSDOC_TAG, + 'Invalid JsDoc tag: %s' % token.values['name'], token) + + if (error_check.ShouldCheck(Rule.NO_BRACES_AROUND_INHERIT_DOC) and + token.values['name'] == 'inheritDoc' and + token_type == Type.DOC_INLINE_FLAG): + self._HandleError(errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC, + 'Unnecessary braces around @inheritDoc', + token) + + elif token_type == Type.SIMPLE_LVALUE: identifier = token.values['identifier'] if ((not state.InFunction() or state.InConstructor()) and - not state.InParentheses() and not state.InObjectLiteralDescendant()): + state.InTopLevel() and not state.InObjectLiteralDescendant()): jsdoc = state.GetDocComment() if not state.HasDocComment(identifier): # Only test for documentation on identifiers with .s in them to @@ -592,45 +617,62 @@ def CheckToken(self, token, state): self._limited_doc_checks): comment = state.GetLastComment() if not (comment and comment.lower().count('jsdoc inherited')): - self._HandleError(errors.MISSING_MEMBER_DOCUMENTATION, + self._HandleError( + errors.MISSING_MEMBER_DOCUMENTATION, "No docs found for member '%s'" % identifier, - token); + token) elif jsdoc and (not state.InConstructor() or identifier.startswith('this.')): # We are at the top level and the function/member is documented. if identifier.endswith('_') and not identifier.endswith('__'): - if jsdoc.HasFlag('override'): - self._HandleError(errors.INVALID_OVERRIDE_PRIVATE, - '%s should not override a private member.' % identifier, - jsdoc.GetFlag('override').flag_token) # Can have a private class which inherits documentation from a # public superclass. - if jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor'): - self._HandleError(errors.INVALID_INHERIT_DOC_PRIVATE, + # + # @inheritDoc is deprecated in favor of using @override, and they + if (jsdoc.HasFlag('override') and not jsdoc.HasFlag('constructor') + and ('accessControls' not in jsdoc.suppressions)): + self._HandleError( + errors.INVALID_OVERRIDE_PRIVATE, + '%s should not override a private member.' % identifier, + jsdoc.GetFlag('override').flag_token) + if (jsdoc.HasFlag('inheritDoc') and not jsdoc.HasFlag('constructor') + and ('accessControls' not in jsdoc.suppressions)): + self._HandleError( + errors.INVALID_INHERIT_DOC_PRIVATE, '%s should not inherit from a private member.' % identifier, jsdoc.GetFlag('inheritDoc').flag_token) if (not jsdoc.HasFlag('private') and - not ('underscore' in jsdoc.suppressions)): - self._HandleError(errors.MISSING_PRIVATE, + ('underscore' not in jsdoc.suppressions) and not + ((jsdoc.HasFlag('inheritDoc') or jsdoc.HasFlag('override')) and + ('accessControls' in jsdoc.suppressions))): + self._HandleError( + errors.MISSING_PRIVATE, 'Member "%s" must have @private JsDoc.' % identifier, token) if jsdoc.HasFlag('private') and 'underscore' in jsdoc.suppressions: - self._HandleError(errors.UNNECESSARY_SUPPRESS, + self._HandleError( + errors.UNNECESSARY_SUPPRESS, '@suppress {underscore} is not necessary with @private', jsdoc.suppressions['underscore']) - elif jsdoc.HasFlag('private'): - self._HandleError(errors.EXTRA_PRIVATE, + elif (jsdoc.HasFlag('private') and + not self.InExplicitlyTypedLanguage()): + # It is convention to hide public fields in some ECMA + # implementations from documentation using the @private tag. + self._HandleError( + errors.EXTRA_PRIVATE, 'Member "%s" must not have @private JsDoc' % identifier, token) - if ((jsdoc.HasFlag('desc') or jsdoc.HasFlag('hidden')) - and not identifier.startswith('MSG_') - and identifier.find('.MSG_') == -1): - # TODO(user): Update error message to show the actual invalid - # tag, either @desc or @hidden. - self._HandleError(errors.INVALID_USE_OF_DESC_TAG, - 'Member "%s" should not have @desc JsDoc' % identifier, - token) + # These flags are only legal on localizable message definitions; + # such variables always begin with the prefix MSG_. + for f in ('desc', 'hidden', 'meaning'): + if (jsdoc.HasFlag(f) + and not identifier.startswith('MSG_') + and identifier.find('.MSG_') == -1): + self._HandleError( + errors.INVALID_USE_OF_DESC_TAG, + 'Member "%s" should not have @%s JsDoc' % (identifier, f), + token) # Check for illegaly assigning live objects as prototype property values. index = identifier.find('.prototype.') @@ -641,28 +683,30 @@ def CheckToken(self, token, state): if next_code and ( next_code.type in (Type.START_BRACKET, Type.START_BLOCK) or next_code.IsOperator('new')): - self._HandleError(errors.ILLEGAL_PROTOTYPE_MEMBER_VALUE, + self._HandleError( + errors.ILLEGAL_PROTOTYPE_MEMBER_VALUE, 'Member %s cannot have a non-primitive value' % identifier, token) - elif type == Type.END_PARAMETERS: + elif token_type == Type.END_PARAMETERS: # Find extra space at the end of parameter lists. We check the token # prior to the current one when it is a closing paren. if (token.previous and token.previous.type == Type.PARAMETERS and self.ENDS_WITH_SPACE.search(token.previous.string)): self._HandleError(errors.EXTRA_SPACE, 'Extra space before ")"', - token.previous) + token.previous) jsdoc = state.GetDocComment() if state.GetFunction().is_interface: if token.previous and token.previous.type == Type.PARAMETERS: - self._HandleError(errors.INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS, + self._HandleError( + errors.INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS, 'Interface constructor cannot have parameters', token.previous) elif (state.InTopLevel() and jsdoc and not jsdoc.HasFlag('see') - and not jsdoc.InheritsDocumentation() - and not state.InObjectLiteralDescendant() and not - jsdoc.IsInvalidated()): + and not jsdoc.InheritsDocumentation() + and not state.InObjectLiteralDescendant() and not + jsdoc.IsInvalidated()): distance, edit = jsdoc.CompareParameters(state.GetParams()) if distance: params_iter = iter(state.GetParams()) @@ -677,68 +721,108 @@ def CheckToken(self, token, state): # Languages that don't allow variables to by typed such as # JavaScript care but languages such as ActionScript or Java # that allow variables to be typed don't care. - self.HandleMissingParameterDoc(token, params_iter.next()) + if not self._limited_doc_checks: + self.HandleMissingParameterDoc(token, params_iter.next()) elif op == 'D': # Deletion self._HandleError(errors.EXTRA_PARAMETER_DOCUMENTATION, - 'Found docs for non-existing parameter: "%s"' % - docs_iter.next(), token) + 'Found docs for non-existing parameter: "%s"' % + docs_iter.next(), token) elif op == 'S': # Substitution - self._HandleError(errors.WRONG_PARAMETER_DOCUMENTATION, - 'Parameter mismatch: got "%s", expected "%s"' % - (params_iter.next(), docs_iter.next()), token) + if not self._limited_doc_checks: + self._HandleError( + errors.WRONG_PARAMETER_DOCUMENTATION, + 'Parameter mismatch: got "%s", expected "%s"' % + (params_iter.next(), docs_iter.next()), token) else: # Equality - just advance the iterators params_iter.next() docs_iter.next() - elif type == Type.STRING_TEXT: + elif token_type == Type.STRING_TEXT: # If this is the first token after the start of the string, but it's at # the end of a line, we know we have a multi-line string. - if token.previous.type in (Type.SINGLE_QUOTE_STRING_START, + if token.previous.type in ( + Type.SINGLE_QUOTE_STRING_START, Type.DOUBLE_QUOTE_STRING_START) and last_in_line: self._HandleError(errors.MULTI_LINE_STRING, - 'Multi-line strings are not allowed', token) - + 'Multi-line strings are not allowed', token) # This check is orthogonal to the ones above, and repeats some types, so # it is a plain if and not an elif. if token.type in Type.COMMENT_TYPES: if self.ILLEGAL_TAB.search(token.string): self._HandleError(errors.ILLEGAL_TAB, - 'Illegal tab in comment "%s"' % token.string, token) + 'Illegal tab in comment "%s"' % token.string, token) trimmed = token.string.rstrip() if last_in_line and token.string != trimmed: # Check for extra whitespace at the end of a line. - self._HandleError(errors.EXTRA_SPACE, 'Extra space at end of line', - token, Position(len(trimmed), len(token.string) - len(trimmed))) + self._HandleError( + errors.EXTRA_SPACE, 'Extra space at end of line', token, + position=Position(len(trimmed), len(token.string) - len(trimmed))) # This check is also orthogonal since it is based on metadata. if token.metadata.is_implied_semicolon: self._HandleError(errors.MISSING_SEMICOLON, - 'Missing semicolon at end of line', token) + 'Missing semicolon at end of line', token) + + def _HandleStartBracket(self, token, last_non_space_token): + """Handles a token that is an open bracket. + + Args: + token: The token to handle. + last_non_space_token: The last token that was not a space. + """ + if (not token.IsFirstInLine() and token.previous.type == Type.WHITESPACE and + last_non_space_token and + last_non_space_token.type in Type.EXPRESSION_ENDER_TYPES): + self._HandleError( + errors.EXTRA_SPACE, 'Extra space before "["', + token.previous, position=Position.All(token.previous.string)) + # If the [ token is the first token in a line we shouldn't complain + # about a missing space before [. This is because some Ecma script + # languages allow syntax like: + # [Annotation] + # class MyClass {...} + # So we don't want to blindly warn about missing spaces before [. + # In the the future, when rules for computing exactly how many spaces + # lines should be indented are added, then we can return errors for + # [ tokens that are improperly indented. + # For example: + # var someVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongVariableName = + # [a,b,c]; + # should trigger a proper indentation warning message as [ is not indented + # by four spaces. + elif (not token.IsFirstInLine() and token.previous and + token.previous.type not in ( + [Type.WHITESPACE, Type.START_PAREN, Type.START_BRACKET] + + Type.EXPRESSION_ENDER_TYPES)): + self._HandleError(errors.MISSING_SPACE, 'Missing space before "["', + token, position=Position.AtBeginning()) + + def Finalize(self, state): + """Perform all checks that need to occur after all lines are processed. + + Args: + state: State of the parser after parsing all tokens - def Finalize(self, state, tokenizer_mode): + Raises: + TypeError: If not overridden. + """ last_non_space_token = state.GetLastNonSpaceToken() # Check last line for ending with newline. - if state.GetLastLine() and not (state.GetLastLine().isspace() or + if state.GetLastLine() and not ( + state.GetLastLine().isspace() or state.GetLastLine().rstrip('\n\r\f') != state.GetLastLine()): self._HandleError( errors.FILE_MISSING_NEWLINE, 'File does not end with new line. (%s)' % state.GetLastLine(), last_non_space_token) - # Check that the mode is not mid comment, argument list, etc. - if not tokenizer_mode == Modes.TEXT_MODE: - self._HandleError( - errors.FILE_IN_BLOCK, - 'File ended in mode "%s".' % tokenizer_mode, - last_non_space_token) - try: self._indentation.Finalize() except Exception, e: @@ -748,5 +832,13 @@ def Finalize(self, state, tokenizer_mode): last_non_space_token) def GetLongLineExceptions(self): - """Gets a list of regexps for lines which can be longer than the limit.""" + """Gets a list of regexps for lines which can be longer than the limit. + + Returns: + A list of regexps, used as matches (rather than searches). + """ return [] + + def InExplicitlyTypedLanguage(self): + """Returns whether this ecma implementation is explicitly typed.""" + return False diff --git a/tools/closure_linter/closure_linter/ecmametadatapass.py b/tools/closure_linter/closure_linter/ecmametadatapass.py index 2c797b3c399a02..50621610efe08d 100755 --- a/tools/closure_linter/closure_linter/ecmametadatapass.py +++ b/tools/closure_linter/closure_linter/ecmametadatapass.py @@ -115,18 +115,30 @@ class EcmaContext(object): BLOCK_TYPES = frozenset([ ROOT, BLOCK, CASE_BLOCK, FOR_GROUP_BLOCK, IMPLIED_BLOCK]) - def __init__(self, type, start_token, parent): + def __init__(self, context_type, start_token, parent=None): """Initializes the context object. Args: + context_type: The context type. + start_token: The token where this context starts. + parent: The parent context. + + Attributes: type: The context type. start_token: The token where this context starts. + end_token: The token where this context ends. parent: The parent context. + children: The child contexts of this context, in order. """ - self.type = type + self.type = context_type self.start_token = start_token self.end_token = None - self.parent = parent + + self.parent = None + self.children = [] + + if parent: + parent.AddChild(self) def __repr__(self): """Returns a string representation of the context object.""" @@ -137,6 +149,32 @@ def __repr__(self): context = context.parent return 'Context(%s)' % ' > '.join(stack) + def AddChild(self, child): + """Adds a child to this context and sets child's parent to this context. + + Args: + child: A child EcmaContext. The child's parent will be set to this + context. + """ + + child.parent = self + + self.children.append(child) + self.children.sort(EcmaContext._CompareContexts) + + def GetRoot(self): + """Get the root context that contains this context, if any.""" + context = self + while context: + if context.type is EcmaContext.ROOT: + return context + context = context.parent + + @staticmethod + def _CompareContexts(context1, context2): + """Sorts contexts 1 and 2 by start token document position.""" + return tokenutil.Compare(context1.start_token, context2.start_token) + class EcmaMetaData(object): """Token metadata for EcmaScript languages. @@ -146,6 +184,11 @@ class EcmaMetaData(object): context: The context this token appears in. operator_type: The operator type, will be one of the *_OPERATOR constants defined below. + aliased_symbol: The full symbol being identified, as a string (e.g. an + 'XhrIo' alias for 'goog.net.XhrIo'). Only applicable to identifier + tokens. This is set in aliaspass.py and is a best guess. + is_alias_definition: True if the symbol is part of an alias definition. + If so, these symbols won't be counted towards goog.requires/provides. """ UNARY_OPERATOR = 'unary' @@ -164,6 +207,8 @@ def __init__(self): self.is_implied_semicolon = False self.is_implied_block = False self.is_implied_block_close = False + self.aliased_symbol = None + self.is_alias_definition = False def __repr__(self): """Returns a string representation of the context object.""" @@ -172,6 +217,8 @@ def __repr__(self): parts.append('optype: %r' % self.operator_type) if self.is_implied_semicolon: parts.append('implied;') + if self.aliased_symbol: + parts.append('alias for: %s' % self.aliased_symbol) return 'MetaData(%s)' % ', '.join(parts) def IsUnaryOperator(self): @@ -196,21 +243,21 @@ def Reset(self): self._AddContext(EcmaContext.ROOT) self._last_code = None - def _CreateContext(self, type): + def _CreateContext(self, context_type): """Overridable by subclasses to create the appropriate context type.""" - return EcmaContext(type, self._token, self._context) + return EcmaContext(context_type, self._token, self._context) def _CreateMetaData(self): """Overridable by subclasses to create the appropriate metadata type.""" return EcmaMetaData() - def _AddContext(self, type): + def _AddContext(self, context_type): """Adds a context of the given type to the context stack. Args: - type: The type of context to create + context_type: The type of context to create """ - self._context = self._CreateContext(type) + self._context = self._CreateContext(context_type) def _PopContext(self): """Moves up one level in the context stack. @@ -233,7 +280,7 @@ def _PopContextType(self, *stop_types): """Pops the context stack until a context of the given type is popped. Args: - stop_types: The types of context to pop to - stops at the first match. + *stop_types: The types of context to pop to - stops at the first match. Returns: The context object of the given type that was popped. @@ -364,10 +411,14 @@ def _ProcessContext(self): self._AddContext(EcmaContext.SWITCH) elif (token_type == TokenType.KEYWORD and - token.string in ('case', 'default')): + token.string in ('case', 'default') and + self._context.type != EcmaContext.OBJECT_LITERAL): # Pop up to but not including the switch block. while self._context.parent.type != EcmaContext.SWITCH: self._PopContext() + if self._context.parent is None: + raise ParseError(token, 'Encountered case/default statement ' + 'without switch statement') elif token.IsOperator('?'): self._AddContext(EcmaContext.TERNARY_TRUE) @@ -386,9 +437,9 @@ def _ProcessContext(self): # ternary_false > ternary_true > statement > root elif (self._context.type == EcmaContext.TERNARY_FALSE and self._context.parent.type == EcmaContext.TERNARY_TRUE): - self._PopContext() # Leave current ternary false context. - self._PopContext() # Leave current parent ternary true - self._AddContext(EcmaContext.TERNARY_FALSE) + self._PopContext() # Leave current ternary false context. + self._PopContext() # Leave current parent ternary true + self._AddContext(EcmaContext.TERNARY_FALSE) elif self._context.parent.type == EcmaContext.SWITCH: self._AddContext(EcmaContext.CASE_BLOCK) @@ -444,25 +495,27 @@ def _ProcessToken(self): is_implied_block = self._context == EcmaContext.IMPLIED_BLOCK is_last_code_in_line = token.IsCode() and ( not next_code or next_code.line_number != token.line_number) - is_continued_identifier = (token.type == TokenType.IDENTIFIER and - token.string.endswith('.')) is_continued_operator = (token.type == TokenType.OPERATOR and not token.metadata.IsUnaryPostOperator()) is_continued_dot = token.string == '.' next_code_is_operator = next_code and next_code.type == TokenType.OPERATOR - next_code_is_dot = next_code and next_code.string == '.' - is_end_of_block = (token.type == TokenType.END_BLOCK and + is_end_of_block = ( + token.type == TokenType.END_BLOCK and token.metadata.context.type != EcmaContext.OBJECT_LITERAL) is_multiline_string = token.type == TokenType.STRING_TEXT + is_continued_var_decl = (token.IsKeyword('var') and + next_code and + (next_code.type in [TokenType.IDENTIFIER, + TokenType.SIMPLE_LVALUE]) and + token.line_number < next_code.line_number) next_code_is_block = next_code and next_code.type == TokenType.START_BLOCK if (is_last_code_in_line and self._StatementCouldEndInContext() and not is_multiline_string and not is_end_of_block and - not is_continued_identifier and + not is_continued_var_decl and not is_continued_operator and not is_continued_dot and - not next_code_is_dot and not next_code_is_operator and not is_implied_block and not next_code_is_block): @@ -470,7 +523,7 @@ def _ProcessToken(self): self._EndStatement() def _StatementCouldEndInContext(self): - """Returns whether the current statement (if any) may end in this context.""" + """Returns if the current statement (if any) may end in this context.""" # In the basic statement or variable declaration context, statement can # always end in this context. if self._context.type in (EcmaContext.STATEMENT, EcmaContext.VAR): diff --git a/tools/closure_linter/closure_linter/error_check.py b/tools/closure_linter/closure_linter/error_check.py new file mode 100755 index 00000000000000..8d657fe9174fff --- /dev/null +++ b/tools/closure_linter/closure_linter/error_check.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""Specific JSLint errors checker.""" + + + +import gflags as flags + +FLAGS = flags.FLAGS + + +class Rule(object): + """Different rules to check.""" + + # Documentations for specific rules goes in flag definition. + BLANK_LINES_AT_TOP_LEVEL = 'blank_lines_at_top_level' + INDENTATION = 'indentation' + WELL_FORMED_AUTHOR = 'well_formed_author' + NO_BRACES_AROUND_INHERIT_DOC = 'no_braces_around_inherit_doc' + BRACES_AROUND_TYPE = 'braces_around_type' + OPTIONAL_TYPE_MARKER = 'optional_type_marker' + VARIABLE_ARG_MARKER = 'variable_arg_marker' + UNUSED_PRIVATE_MEMBERS = 'unused_private_members' + UNUSED_LOCAL_VARIABLES = 'unused_local_variables' + + # Rule to raise all known errors. + ALL = 'all' + + # All rules that are to be checked when using the strict flag. E.g. the rules + # that are specific to the stricter Closure style. + CLOSURE_RULES = frozenset([BLANK_LINES_AT_TOP_LEVEL, + INDENTATION, + WELL_FORMED_AUTHOR, + NO_BRACES_AROUND_INHERIT_DOC, + BRACES_AROUND_TYPE, + OPTIONAL_TYPE_MARKER, + VARIABLE_ARG_MARKER]) + + +flags.DEFINE_boolean('strict', False, + 'Whether to validate against the stricter Closure style. ' + 'This includes ' + (', '.join(Rule.CLOSURE_RULES)) + '.') +flags.DEFINE_multistring('jslint_error', [], + 'List of specific lint errors to check. Here is a list' + ' of accepted values:\n' + ' - ' + Rule.ALL + ': enables all following errors.\n' + ' - ' + Rule.BLANK_LINES_AT_TOP_LEVEL + ': validates' + 'number of blank lines between blocks at top level.\n' + ' - ' + Rule.INDENTATION + ': checks correct ' + 'indentation of code.\n' + ' - ' + Rule.WELL_FORMED_AUTHOR + ': validates the ' + '@author JsDoc tags.\n' + ' - ' + Rule.NO_BRACES_AROUND_INHERIT_DOC + ': ' + 'forbids braces around @inheritdoc JsDoc tags.\n' + ' - ' + Rule.BRACES_AROUND_TYPE + ': enforces braces ' + 'around types in JsDoc tags.\n' + ' - ' + Rule.OPTIONAL_TYPE_MARKER + ': checks correct ' + 'use of optional marker = in param types.\n' + ' - ' + Rule.UNUSED_PRIVATE_MEMBERS + ': checks for ' + 'unused private variables.\n' + ' - ' + Rule.UNUSED_LOCAL_VARIABLES + ': checks for ' + 'unused local variables.\n') + + +def ShouldCheck(rule): + """Returns whether the optional rule should be checked. + + Computes different flags (strict, jslint_error, jslint_noerror) to find out if + this specific rule should be checked. + + Args: + rule: Name of the rule (see Rule). + + Returns: + True if the rule should be checked according to the flags, otherwise False. + """ + if rule in FLAGS.jslint_error or Rule.ALL in FLAGS.jslint_error: + return True + # Checks strict rules. + return FLAGS.strict and rule in Rule.CLOSURE_RULES diff --git a/tools/closure_linter/closure_linter/error_fixer.py b/tools/closure_linter/closure_linter/error_fixer.py index 904cf86605bdcd..88f9c720ab3517 100755 --- a/tools/closure_linter/closure_linter/error_fixer.py +++ b/tools/closure_linter/closure_linter/error_fixer.py @@ -16,6 +16,9 @@ """Main class responsible for automatically fixing simple style violations.""" +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + __author__ = 'robbyw@google.com (Robert Walker)' import re @@ -24,6 +27,7 @@ from closure_linter import errors from closure_linter import javascriptstatetracker from closure_linter import javascripttokens +from closure_linter import requireprovidesorter from closure_linter import tokenutil from closure_linter.common import errorhandler @@ -33,24 +37,46 @@ END_OF_FLAG_TYPE = re.compile(r'(}?\s*)$') +# Regex to represent common mistake inverting author name and email as +# @author User Name (user@company) +INVERTED_AUTHOR_SPEC = re.compile(r'(?P\s*)' + r'(?P[^(]+)' + r'(?P\s+)' + r'\(' + r'(?P[^\s]+@[^)\s]+)' + r'\)' + r'(?P.*)') + FLAGS = flags.FLAGS flags.DEFINE_boolean('disable_indentation_fixing', False, 'Whether to disable automatic fixing of indentation.') +flags.DEFINE_list('fix_error_codes', [], 'A list of specific error codes to ' + 'fix. Defaults to all supported error codes when empty. ' + 'See errors.py for a list of error codes.') + class ErrorFixer(errorhandler.ErrorHandler): """Object that fixes simple style errors.""" - def __init__(self, external_file = None): + def __init__(self, external_file=None): """Initialize the error fixer. Args: external_file: If included, all output will be directed to this file instead of overwriting the files the errors are found in. """ + errorhandler.ErrorHandler.__init__(self) + self._file_name = None self._file_token = None self._external_file = external_file + try: + self._fix_error_codes = set([errors.ByName(error.upper()) for error in + FLAGS.fix_error_codes]) + except KeyError as ke: + raise ValueError('Unknown error code ' + ke.args[0]) + def HandleFile(self, filename, first_token): """Notifies this ErrorPrinter that subsequent errors are in filename. @@ -59,6 +85,7 @@ def HandleFile(self, filename, first_token): first_token: The first token in the file. """ self._file_name = filename + self._file_is_html = filename.endswith('.html') or filename.endswith('.htm') self._file_token = first_token self._file_fix_count = 0 self._file_changed_lines = set() @@ -76,6 +103,44 @@ def _AddFix(self, tokens): for token in tokens: self._file_changed_lines.add(token.line_number) + def _FixJsDocPipeNull(self, js_type): + """Change number|null or null|number to ?number. + + Args: + js_type: The typeannotation.TypeAnnotation instance to fix. + """ + + # Recurse into all sub_types if the error was at a deeper level. + map(self._FixJsDocPipeNull, js_type.IterTypes()) + + if js_type.type_group and len(js_type.sub_types) == 2: + # Find and remove the null sub_type: + sub_type = None + for sub_type in js_type.sub_types: + if sub_type.identifier == 'null': + map(tokenutil.DeleteToken, sub_type.tokens) + self._AddFix(sub_type.tokens) + break + else: + return + + first_token = js_type.FirstToken() + question_mark = Token('?', Type.DOC_TYPE_MODIFIER, first_token.line, + first_token.line_number) + tokenutil.InsertTokenBefore(question_mark, first_token) + js_type.tokens.insert(0, question_mark) + js_type.tokens.remove(sub_type) + js_type.or_null = True + + # Now also remove the separator, which is in the parent's token list, + # either before or after the sub_type, there is exactly one. Scan for it. + for token in js_type.tokens: + if (token and isinstance(token, Token) and + token.type == Type.DOC_TYPE_MODIFIER and token.string == '|'): + tokenutil.DeleteToken(token) + self._AddFix(token) + break + def HandleError(self, error): """Attempts to fix the error. @@ -85,20 +150,33 @@ def HandleError(self, error): code = error.code token = error.token + if self._fix_error_codes and code not in self._fix_error_codes: + return + if code == errors.JSDOC_PREFER_QUESTION_TO_PIPE_NULL: + self._FixJsDocPipeNull(token.attached_object.jstype) + + elif code == errors.JSDOC_MISSING_OPTIONAL_TYPE: + iterator = token.attached_object.type_end_token + if iterator.type == Type.DOC_END_BRACE or iterator.string.isspace(): + iterator = iterator.previous + + ending_space = len(iterator.string) - len(iterator.string.rstrip()) + iterator.string = '%s=%s' % (iterator.string.rstrip(), + ' ' * ending_space) + + # Create a new flag object with updated type info. + token.attached_object = javascriptstatetracker.JsDocFlag(token) + self._AddFix(token) + + elif code == errors.JSDOC_MISSING_VAR_ARGS_TYPE: iterator = token.attached_object.type_start_token if iterator.type == Type.DOC_START_BRACE or iterator.string.isspace(): iterator = iterator.next - leading_space = len(iterator.string) - len(iterator.string.lstrip()) - iterator.string = '%s?%s' % (' ' * leading_space, - iterator.string.lstrip()) - - # Cover the no outer brace case where the end token is part of the type. - while iterator and iterator != token.attached_object.type_end_token.next: - iterator.string = iterator.string.replace( - 'null|', '').replace('|null', '') - iterator = iterator.next + starting_space = len(iterator.string) - len(iterator.string.lstrip()) + iterator.string = '%s...%s' % (' ' * starting_space, + iterator.string.lstrip()) # Create a new flag object with updated type info. token.attached_object = javascriptstatetracker.JsDocFlag(token) @@ -116,7 +194,7 @@ def HandleError(self, error): elif code in (errors.ILLEGAL_SEMICOLON_AFTER_FUNCTION, errors.REDUNDANT_SEMICOLON, errors.COMMA_AT_END_OF_LITERAL): - tokenutil.DeleteToken(token) + self._DeleteToken(token) self._AddFix(token) elif code == errors.INVALID_JSDOC_TAG: @@ -129,7 +207,10 @@ def HandleError(self, error): self._AddFix(token) elif code == errors.MISSING_SPACE: - if error.position: + if error.fix_data: + token.string = error.fix_data + self._AddFix(token) + elif error.position: if error.position.IsAtBeginning(): tokenutil.InsertSpaceTokenAfter(token.previous) elif error.position.IsAtEnd(token.string): @@ -143,19 +224,15 @@ def HandleError(self, error): token.string = error.position.Set(token.string, '') self._AddFix(token) - elif code == errors.JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER: - token.string = error.position.Set(token.string, '.') - self._AddFix(token) - elif code == errors.MISSING_LINE: if error.position.IsAtBeginning(): - tokenutil.InsertLineAfter(token.previous) + tokenutil.InsertBlankLineAfter(token.previous) else: - tokenutil.InsertLineAfter(token) + tokenutil.InsertBlankLineAfter(token) self._AddFix(token) elif code == errors.EXTRA_LINE: - tokenutil.DeleteToken(token) + self._DeleteToken(token) self._AddFix(token) elif code == errors.WRONG_BLANK_LINE_COUNT: @@ -167,29 +244,30 @@ def HandleError(self, error): should_delete = False if num_lines < 0: - num_lines = num_lines * -1 + num_lines *= -1 should_delete = True - for i in xrange(1, num_lines + 1): + for unused_i in xrange(1, num_lines + 1): if should_delete: # TODO(user): DeleteToken should update line numbers. - tokenutil.DeleteToken(token.previous) + self._DeleteToken(token.previous) else: - tokenutil.InsertLineAfter(token.previous) + tokenutil.InsertBlankLineAfter(token.previous) self._AddFix(token) elif code == errors.UNNECESSARY_DOUBLE_QUOTED_STRING: end_quote = tokenutil.Search(token, Type.DOUBLE_QUOTE_STRING_END) if end_quote: - single_quote_start = Token("'", Type.SINGLE_QUOTE_STRING_START, - token.line, token.line_number) - single_quote_end = Token("'", Type.SINGLE_QUOTE_STRING_START, - end_quote.line, token.line_number) + single_quote_start = Token( + "'", Type.SINGLE_QUOTE_STRING_START, token.line, token.line_number) + single_quote_end = Token( + "'", Type.SINGLE_QUOTE_STRING_START, end_quote.line, + token.line_number) tokenutil.InsertTokenAfter(single_quote_start, token) tokenutil.InsertTokenAfter(single_quote_end, end_quote) - tokenutil.DeleteToken(token) - tokenutil.DeleteToken(end_quote) + self._DeleteToken(token) + self._DeleteToken(end_quote) self._AddFix([token, end_quote]) elif code == errors.MISSING_BRACES_AROUND_TYPE: @@ -197,15 +275,15 @@ def HandleError(self, error): start_token = token.attached_object.type_start_token if start_token.type != Type.DOC_START_BRACE: - leading_space = (len(start_token.string) - - len(start_token.string.lstrip())) + leading_space = ( + len(start_token.string) - len(start_token.string.lstrip())) if leading_space: start_token = tokenutil.SplitToken(start_token, leading_space) # Fix case where start and end token were the same. if token.attached_object.type_end_token == start_token.previous: token.attached_object.type_end_token = start_token - new_token = Token("{", Type.DOC_START_BRACE, start_token.line, + new_token = Token('{', Type.DOC_START_BRACE, start_token.line, start_token.line_number) tokenutil.InsertTokenAfter(new_token, start_token.previous) token.attached_object.type_start_token = new_token @@ -217,7 +295,7 @@ def HandleError(self, error): # FLAG_ENDING_TYPE token, if there wasn't a starting brace then # the end token is the last token of the actual type. last_type = end_token - if not len(fixed_tokens): + if not fixed_tokens: last_type = end_token.previous while last_type.string.isspace(): @@ -233,7 +311,7 @@ def HandleError(self, error): tokenutil.SplitToken(last_type, len(last_type.string) - trailing_space) - new_token = Token("}", Type.DOC_END_BRACE, last_type.line, + new_token = Token('}', Type.DOC_END_BRACE, last_type.line, last_type.line_number) tokenutil.InsertTokenAfter(new_token, last_type) token.attached_object.type_end_token = new_token @@ -241,35 +319,86 @@ def HandleError(self, error): self._AddFix(fixed_tokens) - elif code in (errors.GOOG_REQUIRES_NOT_ALPHABETIZED, - errors.GOOG_PROVIDES_NOT_ALPHABETIZED): - tokens = error.fix_data - strings = map(lambda x: x.string, tokens) - sorted_strings = sorted(strings) + elif code == errors.LINE_STARTS_WITH_OPERATOR: + # Remove whitespace following the operator so the line starts clean. + self._StripSpace(token, before=False) - index = 0 - changed_tokens = [] - for token in tokens: - if token.string != sorted_strings[index]: - token.string = sorted_strings[index] - changed_tokens.append(token) - index += 1 + # Remove the operator. + tokenutil.DeleteToken(token) + self._AddFix(token) + + insertion_point = tokenutil.GetPreviousCodeToken(token) - self._AddFix(changed_tokens) + # Insert a space between the previous token and the new operator. + space = Token(' ', Type.WHITESPACE, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenAfter(space, insertion_point) + + # Insert the operator on the end of the previous line. + new_token = Token(token.string, token.type, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenAfter(new_token, space) + self._AddFix(new_token) + + elif code == errors.LINE_ENDS_WITH_DOT: + # Remove whitespace preceding the operator to remove trailing whitespace. + self._StripSpace(token, before=True) + + # Remove the dot. + tokenutil.DeleteToken(token) + self._AddFix(token) + + insertion_point = tokenutil.GetNextCodeToken(token) + + # Insert the dot at the beginning of the next line of code. + new_token = Token(token.string, token.type, insertion_point.line, + insertion_point.line_number) + tokenutil.InsertTokenBefore(new_token, insertion_point) + self._AddFix(new_token) + + elif code == errors.GOOG_REQUIRES_NOT_ALPHABETIZED: + require_start_token = error.fix_data + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(require_start_token) + + self._AddFix(require_start_token) + + elif code == errors.GOOG_PROVIDES_NOT_ALPHABETIZED: + provide_start_token = error.fix_data + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixProvides(provide_start_token) + + self._AddFix(provide_start_token) elif code == errors.UNNECESSARY_BRACES_AROUND_INHERIT_DOC: if token.previous.string == '{' and token.next.string == '}': - tokenutil.DeleteToken(token.previous) - tokenutil.DeleteToken(token.next) + self._DeleteToken(token.previous) + self._DeleteToken(token.next) self._AddFix([token]) + elif code == errors.INVALID_AUTHOR_TAG_DESCRIPTION: + match = INVERTED_AUTHOR_SPEC.match(token.string) + if match: + token.string = '%s%s%s(%s)%s' % (match.group('leading_whitespace'), + match.group('email'), + match.group('whitespace_after_name'), + match.group('name'), + match.group('trailing_characters')) + self._AddFix(token) + elif (code == errors.WRONG_INDENTATION and - not FLAGS.disable_indentation_fixing): + not FLAGS.disable_indentation_fixing): token = tokenutil.GetFirstTokenInSameLine(token) actual = error.position.start expected = error.position.length - if token.type in (Type.WHITESPACE, Type.PARAMETERS): + # Cases where first token is param but with leading spaces. + if (len(token.string.lstrip()) == len(token.string) - actual and + token.string.lstrip()): + token.string = token.string.lstrip() + actual = 0 + + if token.type in (Type.WHITESPACE, Type.PARAMETERS) and actual != 0: token.string = token.string.lstrip() + (' ' * expected) self._AddFix([token]) else: @@ -282,52 +411,205 @@ def HandleError(self, error): tokenutil.InsertTokenAfter(new_token, token.previous) self._AddFix([token]) - elif code == errors.EXTRA_GOOG_REQUIRE: - fixed_tokens = [] - while token: - if token.type == Type.IDENTIFIER: - if token.string not in ['goog.require', 'goog.provide']: - # Stop iterating over tokens once we're out of the requires and - # provides. - break - if token.string == 'goog.require': - # Text of form: goog.require('required'), skipping past open paren - # and open quote to the string text. - required = token.next.next.next.string - if required in error.fix_data: - fixed_tokens.append(token) - # Want to delete: goog.require + open paren + open single-quote + - # text + close single-quote + close paren + semi-colon = 7. - tokenutil.DeleteTokens(token, 7) - token = token.next + elif code in [errors.MALFORMED_END_OF_SCOPE_COMMENT, + errors.MISSING_END_OF_SCOPE_COMMENT]: + # Only fix cases where }); is found with no trailing content on the line + # other than a comment. Value of 'token' is set to } for this error. + if (token.type == Type.END_BLOCK and + token.next.type == Type.END_PAREN and + token.next.next.type == Type.SEMICOLON): + current_token = token.next.next.next + removed_tokens = [] + while current_token and current_token.line_number == token.line_number: + if current_token.IsAnyType(Type.WHITESPACE, + Type.START_SINGLE_LINE_COMMENT, + Type.COMMENT): + removed_tokens.append(current_token) + current_token = current_token.next + else: + return + + if removed_tokens: + self._DeleteTokens(removed_tokens[0], len(removed_tokens)) + + whitespace_token = Token(' ', Type.WHITESPACE, token.line, + token.line_number) + start_comment_token = Token('//', Type.START_SINGLE_LINE_COMMENT, + token.line, token.line_number) + comment_token = Token(' goog.scope', Type.COMMENT, token.line, + token.line_number) + insertion_tokens = [whitespace_token, start_comment_token, + comment_token] + + tokenutil.InsertTokensAfter(insertion_tokens, token.next.next) + self._AddFix(removed_tokens + insertion_tokens) + + elif code in [errors.EXTRA_GOOG_PROVIDE, errors.EXTRA_GOOG_REQUIRE]: + tokens_in_line = tokenutil.GetAllTokensInSameLine(token) + num_delete_tokens = len(tokens_in_line) + # If line being deleted is preceded and succeed with blank lines then + # delete one blank line also. + if (tokens_in_line[0].previous and tokens_in_line[-1].next + and tokens_in_line[0].previous.type == Type.BLANK_LINE + and tokens_in_line[-1].next.type == Type.BLANK_LINE): + num_delete_tokens += 1 + self._DeleteTokens(tokens_in_line[0], num_delete_tokens) + self._AddFix(tokens_in_line) + + elif code in [errors.MISSING_GOOG_PROVIDE, errors.MISSING_GOOG_REQUIRE]: + missing_namespaces = error.fix_data[0] + need_blank_line = error.fix_data[1] or (not token.previous) + + insert_location = Token('', Type.NORMAL, '', token.line_number - 1) + dummy_first_token = insert_location + tokenutil.InsertTokenBefore(insert_location, token) + + # If inserting a blank line check blank line does not exist before + # token to avoid extra blank lines. + if (need_blank_line and insert_location.previous + and insert_location.previous.type != Type.BLANK_LINE): + tokenutil.InsertBlankLineAfter(insert_location) + insert_location = insert_location.next + + for missing_namespace in missing_namespaces: + new_tokens = self._GetNewRequireOrProvideTokens( + code == errors.MISSING_GOOG_PROVIDE, + missing_namespace, insert_location.line_number + 1) + tokenutil.InsertLineAfter(insert_location, new_tokens) + insert_location = new_tokens[-1] + self._AddFix(new_tokens) + + # If inserting a blank line check blank line does not exist after + # token to avoid extra blank lines. + if (need_blank_line and insert_location.next + and insert_location.next.type != Type.BLANK_LINE): + tokenutil.InsertBlankLineAfter(insert_location) + + tokenutil.DeleteToken(dummy_first_token) + + def _StripSpace(self, token, before): + """Strip whitespace tokens either preceding or following the given token. - self._AddFix(fixed_tokens) + Args: + token: The token. + before: If true, strip space before the token, if false, after it. + """ + token = token.previous if before else token.next + while token and token.type == Type.WHITESPACE: + tokenutil.DeleteToken(token) + token = token.previous if before else token.next + + def _GetNewRequireOrProvideTokens(self, is_provide, namespace, line_number): + """Returns a list of tokens to create a goog.require/provide statement. + + Args: + is_provide: True if getting tokens for a provide, False for require. + namespace: The required or provided namespaces to get tokens for. + line_number: The line number the new require or provide statement will be + on. + + Returns: + Tokens to create a new goog.require or goog.provide statement. + """ + string = 'goog.require' + if is_provide: + string = 'goog.provide' + line_text = string + '(\'' + namespace + '\');\n' + return [ + Token(string, Type.IDENTIFIER, line_text, line_number), + Token('(', Type.START_PAREN, line_text, line_number), + Token('\'', Type.SINGLE_QUOTE_STRING_START, line_text, line_number), + Token(namespace, Type.STRING_TEXT, line_text, line_number), + Token('\'', Type.SINGLE_QUOTE_STRING_END, line_text, line_number), + Token(')', Type.END_PAREN, line_text, line_number), + Token(';', Type.SEMICOLON, line_text, line_number) + ] + + def _DeleteToken(self, token): + """Deletes the specified token from the linked list of tokens. + + Updates instance variables pointing to tokens such as _file_token if + they reference the deleted token. + + Args: + token: The token to delete. + """ + if token == self._file_token: + self._file_token = token.next + + tokenutil.DeleteToken(token) + + def _DeleteTokens(self, token, token_count): + """Deletes the given number of tokens starting with the given token. + + Updates instance variables pointing to tokens such as _file_token if + they reference the deleted token. + + Args: + token: The first token to delete. + token_count: The total number of tokens to delete. + """ + if token == self._file_token: + for unused_i in xrange(token_count): + self._file_token = self._file_token.next + + tokenutil.DeleteTokens(token, token_count) def FinishFile(self): """Called when the current file has finished style checking. - Used to go back and fix any errors in the file. + Used to go back and fix any errors in the file. It currently supports both + js and html files. For js files it does a simple dump of all tokens, but in + order to support html file, we need to merge the original file with the new + token set back together. This works because the tokenized html file is the + original html file with all non js lines kept but blanked out with one blank + line token per line of html. """ if self._file_fix_count: + # Get the original file content for html. + if self._file_is_html: + f = open(self._file_name, 'r') + original_lines = f.readlines() + f.close() + f = self._external_file if not f: - print "Fixed %d errors in %s" % (self._file_fix_count, self._file_name) + error_noun = 'error' if self._file_fix_count == 1 else 'errors' + print 'Fixed %d %s in %s' % ( + self._file_fix_count, error_noun, self._file_name) f = open(self._file_name, 'w') token = self._file_token + # Finding the first not deleted token. + while token.is_deleted: + token = token.next + # If something got inserted before first token (e.g. due to sorting) + # then move to start. Bug 8398202. + while token.previous: + token = token.previous char_count = 0 + line = '' while token: - f.write(token.string) + line += token.string char_count += len(token.string) if token.IsLastInLine(): - f.write('\n') + # We distinguish if a blank line in html was from stripped original + # file or newly added error fix by looking at the "org_line_number" + # field on the token. It is only set in the tokenizer, so for all + # error fixes, the value should be None. + if (line or not self._file_is_html or + token.orig_line_number is None): + f.write(line) + f.write('\n') + else: + f.write(original_lines[token.orig_line_number - 1]) + line = '' if char_count > 80 and token.line_number in self._file_changed_lines: - print "WARNING: Line %d of %s is now longer than 80 characters." % ( + print 'WARNING: Line %d of %s is now longer than 80 characters.' % ( token.line_number, self._file_name) char_count = 0 - self._file_changed_lines token = token.next diff --git a/tools/closure_linter/closure_linter/error_fixer_test.py b/tools/closure_linter/closure_linter/error_fixer_test.py new file mode 100644 index 00000000000000..49f449de42f36f --- /dev/null +++ b/tools/closure_linter/closure_linter/error_fixer_test.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the error_fixer module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + + + +import unittest as googletest +from closure_linter import error_fixer +from closure_linter import testutil + + +class ErrorFixerTest(googletest.TestCase): + """Unit tests for error_fixer.""" + + def setUp(self): + self.error_fixer = error_fixer.ErrorFixer() + + def testDeleteToken(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + second_token = start_token.next + self.error_fixer.HandleFile('test_file', start_token) + + self.error_fixer._DeleteToken(start_token) + + self.assertEqual(second_token, self.error_fixer._file_token) + + def testDeleteTokens(self): + start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + fourth_token = start_token.next.next.next + self.error_fixer.HandleFile('test_file', start_token) + + self.error_fixer._DeleteTokens(start_token, 3) + + self.assertEqual(fourth_token, self.error_fixer._file_token) + +_TEST_SCRIPT = """\ +var x = 3; +""" + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/errorrecord.py b/tools/closure_linter/closure_linter/errorrecord.py new file mode 100644 index 00000000000000..ce9fb908c75e71 --- /dev/null +++ b/tools/closure_linter/closure_linter/errorrecord.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +"""A simple, pickle-serializable class to represent a lint error.""" + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import gflags as flags + +from closure_linter import errors +from closure_linter.common import erroroutput + +FLAGS = flags.FLAGS + + +class ErrorRecord(object): + """Record-keeping struct that can be serialized back from a process. + + Attributes: + path: Path to the file. + error_string: Error string for the user. + new_error: Whether this is a "new error" (see errors.NEW_ERRORS). + """ + + def __init__(self, path, error_string, new_error): + self.path = path + self.error_string = error_string + self.new_error = new_error + + +def MakeErrorRecord(path, error): + """Make an error record with correctly formatted error string. + + Errors are not able to be serialized (pickled) over processes because of + their pointers to the complex token/context graph. We use an intermediary + serializable class to pass back just the relevant information. + + Args: + path: Path of file the error was found in. + error: An error.Error instance. + + Returns: + _ErrorRecord instance. + """ + new_error = error.code in errors.NEW_ERRORS + + if FLAGS.unix_mode: + error_string = erroroutput.GetUnixErrorOutput( + path, error, new_error=new_error) + else: + error_string = erroroutput.GetErrorOutput(error, new_error=new_error) + + return ErrorRecord(path, error_string, new_error) diff --git a/tools/closure_linter/closure_linter/errorrules.py b/tools/closure_linter/closure_linter/errorrules.py index afb6fa9606ca5b..b1b72aab6dabdc 100755 --- a/tools/closure_linter/closure_linter/errorrules.py +++ b/tools/closure_linter/closure_linter/errorrules.py @@ -25,18 +25,48 @@ FLAGS = flags.FLAGS flags.DEFINE_boolean('jsdoc', True, 'Whether to report errors for missing JsDoc.') +flags.DEFINE_list('disable', None, + 'Disable specific error. Usage Ex.: gjslint --disable 1,' + '0011 foo.js.') +flags.DEFINE_integer('max_line_length', 80, 'Maximum line length allowed ' + 'without warning.', lower_bound=1) + +disabled_error_nums = None + + +def GetMaxLineLength(): + """Returns allowed maximum length of line. + + Returns: + Length of line allowed without any warning. + """ + return FLAGS.max_line_length def ShouldReportError(error): """Whether the given error should be reported. - + Returns: - True for all errors except missing documentation errors. For these, - it returns the value of the jsdoc flag. + True for all errors except missing documentation errors and disabled + errors. For missing documentation, it returns the value of the + jsdoc flag. """ - return FLAGS.jsdoc or error not in ( + global disabled_error_nums + if disabled_error_nums is None: + disabled_error_nums = [] + if FLAGS.disable: + for error_str in FLAGS.disable: + error_num = 0 + try: + error_num = int(error_str) + except ValueError: + pass + disabled_error_nums.append(error_num) + + return ((FLAGS.jsdoc or error not in ( errors.MISSING_PARAMETER_DOCUMENTATION, errors.MISSING_RETURN_DOCUMENTATION, errors.MISSING_MEMBER_DOCUMENTATION, errors.MISSING_PRIVATE, - errors.MISSING_JSDOC_TAG_THIS) + errors.MISSING_JSDOC_TAG_THIS)) and + (not FLAGS.disable or error not in disabled_error_nums)) diff --git a/tools/closure_linter/closure_linter/errorrules_test.py b/tools/closure_linter/closure_linter/errorrules_test.py new file mode 100644 index 00000000000000..cb903785e60fec --- /dev/null +++ b/tools/closure_linter/closure_linter/errorrules_test.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# Copyright 2013 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Medium tests for the gjslint errorrules. + +Currently its just verifying that warnings can't be disabled. +""" + + + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import erroraccumulator + +flags.FLAGS.strict = True +flags.FLAGS.limited_doc_files = ('dummy.js', 'externs.js') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') + + +class ErrorRulesTest(googletest.TestCase): + """Test case to for gjslint errorrules.""" + + def testNoMaxLineLengthFlagExists(self): + """Tests that --max_line_length flag does not exists.""" + self.assertTrue('max_line_length' not in flags.FLAGS.FlagDict()) + + def testGetMaxLineLength(self): + """Tests warning are reported for line greater than 80. + """ + + # One line > 100 and one line > 80 and < 100. So should produce two + # line too long error. + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'function a() {', + ' dummy.aa.i = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13' + ' + 14 + 15 + 16 + 17 + 18 + 19 + 20;', + ' dummy.aa.j = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13' + ' + 14 + 15 + 16 + 17 + 18;', + '}', + '' + ] + + # Expect line too long. + expected = [errors.LINE_TOO_LONG, errors.LINE_TOO_LONG] + + self._AssertErrors(original, expected) + + def testNoDisableFlagExists(self): + """Tests that --disable flag does not exists.""" + self.assertTrue('disable' not in flags.FLAGS.FlagDict()) + + def testWarningsNotDisabled(self): + """Tests warnings are reported when nothing is disabled. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] + + expected = [errors.GOOG_REQUIRES_NOT_ALPHABETIZED, + errors.FILE_MISSING_NEWLINE] + + self._AssertErrors(original, expected) + + def _AssertErrors(self, original, expected_errors, include_header=True): + """Asserts that the error fixer corrects original to expected.""" + if include_header: + original = self._GetHeader() + original + + # Trap gjslint's output parse it to get messages added. + error_accumulator = erroraccumulator.ErrorAccumulator() + runner.Run('testing.js', error_accumulator, source=original) + error_nums = [e.code for e in error_accumulator.GetErrors()] + + error_nums.sort() + expected_errors.sort() + self.assertListEqual(error_nums, expected_errors) + + def _GetHeader(self): + """Returns a fake header for a JavaScript file.""" + return [ + '// Copyright 2011 Google Inc. All Rights Reserved.', + '', + '/**', + ' * @fileoverview Fake file overview.', + ' * @author fake@google.com (Fake Person)', + ' */', + '' + ] + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/errors.py b/tools/closure_linter/closure_linter/errors.py index 7c86941f39c5d4..356ee0c5a6441d 100755 --- a/tools/closure_linter/closure_linter/errors.py +++ b/tools/closure_linter/closure_linter/errors.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2007 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +18,7 @@ __author__ = ('robbyw@google.com (Robert Walker)', 'ajp@google.com (Andy Perelson)') + def ByName(name): """Get the error code for the given error name. @@ -55,8 +55,11 @@ def ByName(name): LINE_TOO_LONG = 110 LINE_STARTS_WITH_OPERATOR = 120 COMMA_AT_END_OF_LITERAL = 121 +LINE_ENDS_WITH_DOT = 122 MULTI_LINE_STRING = 130 UNNECESSARY_DOUBLE_QUOTED_STRING = 131 +UNUSED_PRIVATE_MEMBER = 132 +UNUSED_LOCAL_VARIABLE = 133 # Requires, provides GOOG_REQUIRES_NOT_ALPHABETIZED = 140 @@ -64,6 +67,8 @@ def ByName(name): MISSING_GOOG_REQUIRE = 142 MISSING_GOOG_PROVIDE = 143 EXTRA_GOOG_REQUIRE = 144 +EXTRA_GOOG_PROVIDE = 145 +ALIAS_STMT_NEEDS_GOOG_REQUIRE = 146 # JsDoc INVALID_JSDOC_TAG = 200 @@ -89,7 +94,11 @@ def ByName(name): INVALID_AUTHOR_TAG_DESCRIPTION = 227 JSDOC_PREFER_QUESTION_TO_PIPE_NULL = 230 JSDOC_ILLEGAL_QUESTION_WITH_PIPE = 231 -JSDOC_TAG_DESCRIPTION_ENDS_WITH_INVALID_CHARACTER = 240 +JSDOC_MISSING_OPTIONAL_TYPE = 232 +JSDOC_MISSING_OPTIONAL_PREFIX = 233 +JSDOC_MISSING_VAR_ARGS_TYPE = 234 +JSDOC_MISSING_VAR_ARGS_NAME = 235 +JSDOC_DOES_NOT_PARSE = 236 # TODO(robbyw): Split this in to more specific syntax problems. INCORRECT_SUPPRESS_SYNTAX = 250 INVALID_SUPPRESS_TYPE = 251 @@ -103,6 +112,15 @@ def ByName(name): INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS = 400 INTERFACE_METHOD_CANNOT_HAVE_CODE = 401 +# Comments +MISSING_END_OF_SCOPE_COMMENT = 500 +MALFORMED_END_OF_SCOPE_COMMENT = 501 + +# goog.scope - Namespace aliasing +# TODO(nnaze) Add additional errors here and in aliaspass.py +INVALID_USE_OF_GOOG_SCOPE = 600 +EXTRA_GOOG_SCOPE_USAGE = 601 + # ActionScript specific errors: # TODO(user): move these errors to their own file and move all JavaScript # specific errors to their own file as well. @@ -125,7 +143,12 @@ def ByName(name): # Errors added after 2.0.2: WRONG_INDENTATION, MISSING_SEMICOLON, - # Errors added after 2.2.5: - WRONG_BLANK_LINE_COUNT, - EXTRA_GOOG_REQUIRE, + # Errors added after 2.3.9: + JSDOC_MISSING_VAR_ARGS_TYPE, + JSDOC_MISSING_VAR_ARGS_NAME, + # Errors added after 2.3.15: + ALIAS_STMT_NEEDS_GOOG_REQUIRE, + JSDOC_DOES_NOT_PARSE, + LINE_ENDS_WITH_DOT, + # Errors added after 2.3.17: ]) diff --git a/tools/closure_linter/closure_linter/fixjsstyle.py b/tools/closure_linter/closure_linter/fixjsstyle.py index 8782e648e6afa8..2d65e0398fdcc6 100755 --- a/tools/closure_linter/closure_linter/fixjsstyle.py +++ b/tools/closure_linter/closure_linter/fixjsstyle.py @@ -18,15 +18,23 @@ __author__ = 'robbyw@google.com (Robert Walker)' +import StringIO import sys import gflags as flags -from closure_linter import checker + from closure_linter import error_fixer +from closure_linter import runner from closure_linter.common import simplefileflags as fileflags +FLAGS = flags.FLAGS +flags.DEFINE_list('additional_extensions', None, 'List of additional file ' + 'extensions (not js) that should be treated as ' + 'JavaScript files.') +flags.DEFINE_boolean('dry_run', False, 'Do not modify the file, only print it.') + -def main(argv = None): +def main(argv=None): """Main function. Args: @@ -35,13 +43,24 @@ def main(argv = None): if argv is None: argv = flags.FLAGS(sys.argv) - files = fileflags.GetFileList(argv, 'JavaScript', ['.js']) + suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] + + files = fileflags.GetFileList(argv, 'JavaScript', suffixes) - style_checker = checker.JavaScriptStyleChecker(error_fixer.ErrorFixer()) + output_buffer = None + if FLAGS.dry_run: + output_buffer = StringIO.StringIO() + + fixer = error_fixer.ErrorFixer(output_buffer) # Check the list of files. for filename in files: - style_checker.Check(filename) + runner.Run(filename, fixer) + if FLAGS.dry_run: + print output_buffer.getvalue() + if __name__ == '__main__': main() diff --git a/tools/closure_linter/closure_linter/fixjsstyle_test.py b/tools/closure_linter/closure_linter/fixjsstyle_test.py index 42e9c593774b16..34de3f8488d351 100755 --- a/tools/closure_linter/closure_linter/fixjsstyle_test.py +++ b/tools/closure_linter/closure_linter/fixjsstyle_test.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2008 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,8 +21,9 @@ import gflags as flags import unittest as googletest -from closure_linter import checker from closure_linter import error_fixer +from closure_linter import runner + _RESOURCE_PREFIX = 'closure_linter/testdata' @@ -31,30 +31,584 @@ flags.FLAGS.limited_doc_files = ('dummy.js', 'externs.js') flags.FLAGS.closurized_namespaces = ('goog', 'dummy') + class FixJsStyleTest(googletest.TestCase): """Test case to for gjslint auto-fixing.""" + def setUp(self): + flags.FLAGS.dot_on_next_line = True + + def tearDown(self): + flags.FLAGS.dot_on_next_line = False + def testFixJsStyle(self): - input_filename = None - try: - input_filename = '%s/fixjsstyle.in.js' % (_RESOURCE_PREFIX) + test_cases = [ + ['fixjsstyle.in.js', 'fixjsstyle.out.js'], + ['indentation.js', 'fixjsstyle.indentation.out.js'], + ['fixjsstyle.html.in.html', 'fixjsstyle.html.out.html'], + ['fixjsstyle.oplineend.in.js', 'fixjsstyle.oplineend.out.js']] + for [running_input_file, running_output_file] in test_cases: + print 'Checking %s vs %s' % (running_input_file, running_output_file) + input_filename = None + golden_filename = None + current_filename = None + try: + input_filename = '%s/%s' % (_RESOURCE_PREFIX, running_input_file) + current_filename = input_filename - golden_filename = '%s/fixjsstyle.out.js' % (_RESOURCE_PREFIX) - except IOError, ex: - raise IOError('Could not find testdata resource for %s: %s' % - (self._filename, ex)) + golden_filename = '%s/%s' % (_RESOURCE_PREFIX, running_output_file) + current_filename = golden_filename + except IOError as ex: + raise IOError('Could not find testdata resource for %s: %s' % + (current_filename, ex)) - # Autofix the file, sending output to a fake file. - actual = StringIO.StringIO() - style_checker = checker.JavaScriptStyleChecker( - error_fixer.ErrorFixer(actual)) - style_checker.Check(input_filename) + if running_input_file == 'fixjsstyle.in.js': + with open(input_filename) as f: + for line in f: + # Go to last line. + pass + self.assertTrue(line == line.rstrip(), '%s file should not end ' + 'with a new line.' % (input_filename)) + + # Autofix the file, sending output to a fake file. + actual = StringIO.StringIO() + runner.Run(input_filename, error_fixer.ErrorFixer(actual)) + + # Now compare the files. + actual.seek(0) + expected = open(golden_filename, 'r') + + # Uncomment to generate new golden files and run + # open('/'.join(golden_filename.split('/')[4:]), 'w').write(actual.read()) + # actual.seek(0) + + self.assertEqual(actual.readlines(), expected.readlines()) + + def testAddProvideFirstLine(self): + """Tests handling of case where goog.provide is added.""" + original = [ + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testAddRequireFirstLine(self): + """Tests handling of case where goog.require is added.""" + original = [ + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteProvideAndAddProvideFirstLine(self): + """Tests handling of case where goog.provide is deleted and added. + + Bug 14832597. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.provide(\'dummy.aa\');', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteProvideAndAddRequireFirstLine(self): + """Tests handling where goog.provide is deleted and goog.require added. + + Bug 14832597. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + '', + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.provide(\'dummy.aa\');', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteRequireAndAddRequireFirstLine(self): + """Tests handling of case where goog.require is deleted and added. + + Bug 14832597. + """ + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'a = dummy.bb.cc;', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + '', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.require(\'dummy.aa\');', + 'a = dummy.bb.cc;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testDeleteRequireAndAddProvideFirstLine(self): + """Tests handling where goog.require is deleted and goog.provide added. + + Bug 14832597. + """ + original = [ + 'goog.require(\'dummy.aa\');', + '', + 'dummy.bb.cc = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.bb\');', + '', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + original = [ + 'goog.require(\'dummy.aa\');', + 'dummy.bb.cc = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMultipleProvideInsert(self): + original = [ + 'goog.provide(\'dummy.bb\');', + 'goog.provide(\'dummy.dd\');', + '', + 'dummy.aa.ff = 1;', + 'dummy.bb.ff = 1;', + 'dummy.cc.ff = 1;', + 'dummy.dd.ff = 1;', + 'dummy.ee.ff = 1;', + ] + + expected = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.bb\');', + 'goog.provide(\'dummy.cc\');', + 'goog.provide(\'dummy.dd\');', + 'goog.provide(\'dummy.ee\');', + '', + 'dummy.aa.ff = 1;', + 'dummy.bb.ff = 1;', + 'dummy.cc.ff = 1;', + 'dummy.dd.ff = 1;', + 'dummy.ee.ff = 1;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMultipleRequireInsert(self): + original = [ + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.dd\');', + '', + 'a = dummy.aa.ff;', + 'b = dummy.bb.ff;', + 'c = dummy.cc.ff;', + 'd = dummy.dd.ff;', + 'e = dummy.ee.ff;', + ] + + expected = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.cc\');', + 'goog.require(\'dummy.dd\');', + 'goog.require(\'dummy.ee\');', + '', + 'a = dummy.aa.ff;', + 'b = dummy.bb.ff;', + 'c = dummy.cc.ff;', + 'd = dummy.dd.ff;', + 'e = dummy.ee.ff;', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testUnsortedRequires(self): + """Tests handling of unsorted goog.require statements without header. + + Bug 8398202. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] - # Now compare the files. + expected = [ + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + 'goog.require(\'dummy.aa\');', + '', + 'function a() {', + ' dummy.aa.i = 1;', + ' dummy.Cc.i = 1;', + ' dummy.Dd.i = 1;', + '}', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMissingExtraAndUnsortedRequires(self): + """Tests handling of missing extra and unsorted goog.require statements.""" + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.Dd\');', + '', + 'var x = new dummy.Bb();', + 'dummy.Cc.someMethod();', + 'dummy.aa.someMethod();', + ] + + expected = [ + 'goog.require(\'dummy.Bb\');', + 'goog.require(\'dummy.Cc\');', + 'goog.require(\'dummy.aa\');', + '', + 'var x = new dummy.Bb();', + 'dummy.Cc.someMethod();', + 'dummy.aa.someMethod();', + ] + + self._AssertFixes(original, expected) + + def testExtraRequireOnFirstLine(self): + """Tests handling of extra goog.require statement on the first line. + + There was a bug when fixjsstyle quits with an exception. It happened if + - the first line of the file is an extra goog.require() statement, + - goog.require() statements are not sorted. + """ + original = [ + 'goog.require(\'dummy.aa\');', + 'goog.require(\'dummy.cc\');', + 'goog.require(\'dummy.bb\');', + '', + 'var x = new dummy.bb();', + 'var y = new dummy.cc();', + ] + + expected = [ + 'goog.require(\'dummy.bb\');', + 'goog.require(\'dummy.cc\');', + '', + 'var x = new dummy.bb();', + 'var y = new dummy.cc();', + ] + + self._AssertFixes(original, expected, include_header=False) + + def testUnsortedProvides(self): + """Tests handling of unsorted goog.provide statements without header. + + Bug 8398202. + """ + original = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + '', + 'dummy.aa = function() {};' + 'dummy.Cc = function() {};' + 'dummy.Dd = function() {};' + ] + + expected = [ + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.aa = function() {};' + 'dummy.Cc = function() {};' + 'dummy.Dd = function() {};' + ] + + self._AssertFixes(original, expected, include_header=False) + + def testMissingExtraAndUnsortedProvides(self): + """Tests handling of missing extra and unsorted goog.provide statements.""" + original = [ + 'goog.provide(\'dummy.aa\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.Dd\');', + '', + 'dummy.Cc = function() {};', + 'dummy.Bb = function() {};', + 'dummy.aa.someMethod = function();', + ] + + expected = [ + 'goog.provide(\'dummy.Bb\');', + 'goog.provide(\'dummy.Cc\');', + 'goog.provide(\'dummy.aa\');', + '', + 'dummy.Cc = function() {};', + 'dummy.Bb = function() {};', + 'dummy.aa.someMethod = function();', + ] + + self._AssertFixes(original, expected) + + def testNoRequires(self): + """Tests positioning of missing requires without existing requires.""" + original = [ + 'goog.provide(\'dummy.Something\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + expected = [ + 'goog.provide(\'dummy.Something\');', + '', + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + self._AssertFixes(original, expected) + + def testNoProvides(self): + """Tests positioning of missing provides without existing provides.""" + original = [ + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + expected = [ + 'goog.provide(\'dummy.Something\');', + '', + 'goog.require(\'dummy.Bb\');', + '', + 'dummy.Something = function() {};', + '', + 'var x = new dummy.Bb();', + ] + + self._AssertFixes(original, expected) + + def testOutputOkayWhenFirstTokenIsDeleted(self): + """Tests that autofix output is is correct when first token is deleted. + + Regression test for bug 4581567 + """ + original = ['"use strict";'] + expected = ["'use strict';"] + + self._AssertFixes(original, expected, include_header=False) + + def testGoogScopeIndentation(self): + """Tests Handling a typical end-of-scope indentation fix.""" + original = [ + 'goog.scope(function() {', + ' // TODO(brain): Take over the world.', + '}); // goog.scope', + ] + + expected = [ + 'goog.scope(function() {', + '// TODO(brain): Take over the world.', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMissingEndOfScopeComment(self): + """Tests Handling a missing comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + '});', + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMissingEndOfScopeCommentWithOtherComment(self): + """Tests handling an irrelevant comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + "}); // I don't belong here!", + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testMalformedEndOfScopeComment(self): + """Tests Handling a malformed comment at end of goog.scope.""" + original = [ + 'goog.scope(function() {', + '}); // goog.scope FTW', + ] + + expected = [ + 'goog.scope(function() {', + '}); // goog.scope', + ] + + self._AssertFixes(original, expected) + + def testEndsWithIdentifier(self): + """Tests Handling case where script ends with identifier. Bug 7643404.""" + original = [ + 'goog.provide(\'xyz\');', + '', + 'abc' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected) + + def testFileStartsWithSemicolon(self): + """Tests handling files starting with semicolon. + + b/10062516 + """ + original = [ + ';goog.provide(\'xyz\');', + '', + 'abc;' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected, include_header=False) + + def testCodeStartsWithSemicolon(self): + """Tests handling code in starting with semicolon after comments. + + b/10062516 + """ + original = [ + ';goog.provide(\'xyz\');', + '', + 'abc;' + ] + + expected = [ + 'goog.provide(\'xyz\');', + '', + 'abc;' + ] + + self._AssertFixes(original, expected) + + def _AssertFixes(self, original, expected, include_header=True): + """Asserts that the error fixer corrects original to expected.""" + if include_header: + original = self._GetHeader() + original + expected = self._GetHeader() + expected + + actual = StringIO.StringIO() + runner.Run('testing.js', error_fixer.ErrorFixer(actual), original) actual.seek(0) - expected = open(golden_filename, 'r') - self.assertEqual(actual.readlines(), expected.readlines()) + expected = [x + '\n' for x in expected] + + self.assertListEqual(actual.readlines(), expected) + + def _GetHeader(self): + """Returns a fake header for a JavaScript file.""" + return [ + '// Copyright 2011 Google Inc. All Rights Reserved.', + '', + '/**', + ' * @fileoverview Fake file overview.', + ' * @author fake@google.com (Fake Person)', + ' */', + '' + ] if __name__ == '__main__': diff --git a/tools/closure_linter/closure_linter/full_test.py b/tools/closure_linter/closure_linter/full_test.py index f11f235493f208..d0a1557dc23dbe 100755 --- a/tools/closure_linter/closure_linter/full_test.py +++ b/tools/closure_linter/closure_linter/full_test.py @@ -23,7 +23,6 @@ __author__ = ('robbyw@google.com (Robert Walker)', 'ajp@google.com (Andy Perelson)') -import re import os import sys import unittest @@ -31,8 +30,9 @@ import gflags as flags import unittest as googletest -from closure_linter import checker +from closure_linter import error_check from closure_linter import errors +from closure_linter import runner from closure_linter.common import filetestcase _RESOURCE_PREFIX = 'closure_linter/testdata' @@ -40,38 +40,57 @@ flags.FLAGS.strict = True flags.FLAGS.custom_jsdoc_tags = ('customtag', 'requires') flags.FLAGS.closurized_namespaces = ('goog', 'dummy') -flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js') +flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js', + 'limited_doc_checks.js') +flags.FLAGS.jslint_error = error_check.Rule.ALL # List of files under testdata to test. # We need to list files explicitly since pyglib can't list directories. +# TODO(user): Figure out how to list the directory. _TEST_FILES = [ 'all_js_wrapped.js', 'blank_lines.js', 'ends_with_block.js', + 'empty_file.js', 'externs.js', + 'externs_jsdoc.js', + 'goog_scope.js', 'html_parse_error.html', 'indentation.js', 'interface.js', 'jsdoc.js', + 'limited_doc_checks.js', 'minimal.js', 'other.js', + 'provide_blank.js', + 'provide_extra.js', + 'provide_missing.js', + 'require_alias.js', 'require_all_caps.js', + 'require_blank.js', 'require_extra.js', 'require_function.js', 'require_function_missing.js', 'require_function_through_both.js', 'require_function_through_namespace.js', 'require_interface.js', + 'require_interface_alias.js', + 'require_interface_base.js', 'require_lower_case.js', + 'require_missing.js', 'require_numeric.js', - 'require_provide_ok.js', + 'require_provide_blank.js', 'require_provide_missing.js', + 'require_provide_ok.js', + 'semicolon_missing.js', 'simple.html', 'spaces.js', 'tokenizer.js', 'unparseable.js', - 'utf8.html' - ] + 'unused_local_variables.js', + 'unused_private_members.js', + 'utf8.html', +] class GJsLintTestSuite(unittest.TestSuite): @@ -91,8 +110,11 @@ def __init__(self, tests=()): test_files = _TEST_FILES for test_file in test_files: resource_path = os.path.join(_RESOURCE_PREFIX, test_file) - self.addTest(filetestcase.AnnotatedFileTestCase(resource_path, - checker.GJsLintRunner(), errors.ByName)) + self.addTest( + filetestcase.AnnotatedFileTestCase( + resource_path, + runner.Run, + errors.ByName)) if __name__ == '__main__': # Don't let main parse args; it happens in the TestSuite. diff --git a/tools/closure_linter/closure_linter/gjslint.py b/tools/closure_linter/closure_linter/gjslint.py index e33bdddc19f694..824e025dcb00de 100755 --- a/tools/closure_linter/closure_linter/gjslint.py +++ b/tools/closure_linter/closure_linter/gjslint.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2007 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,33 +32,201 @@ """ __author__ = ('robbyw@google.com (Robert Walker)', - 'ajp@google.com (Andy Perelson)') + 'ajp@google.com (Andy Perelson)', + 'nnaze@google.com (Nathan Naze)',) +import errno +import itertools +import os +import platform +import re import sys import time -from closure_linter import checker -from closure_linter import errors -from closure_linter.common import errorprinter -from closure_linter.common import simplefileflags as fileflags import gflags as flags +from closure_linter import errorrecord +from closure_linter import runner +from closure_linter.common import erroraccumulator +from closure_linter.common import simplefileflags as fileflags + +# Attempt import of multiprocessing (should be available in Python 2.6 and up). +try: + # pylint: disable=g-import-not-at-top + import multiprocessing +except ImportError: + multiprocessing = None FLAGS = flags.FLAGS flags.DEFINE_boolean('unix_mode', False, 'Whether to emit warnings in standard unix format.') flags.DEFINE_boolean('beep', True, 'Whether to beep when errors are found.') flags.DEFINE_boolean('time', False, 'Whether to emit timing statistics.') +flags.DEFINE_boolean('quiet', False, 'Whether to minimize logged messages. ' + 'Most useful for per-file linting, such as that performed ' + 'by the presubmit linter service.') flags.DEFINE_boolean('check_html', False, 'Whether to check javascript in html files.') flags.DEFINE_boolean('summary', False, 'Whether to show an error count summary.') +flags.DEFINE_list('additional_extensions', None, 'List of additional file ' + 'extensions (not js) that should be treated as ' + 'JavaScript files.') +flags.DEFINE_boolean('multiprocess', + platform.system() is 'Linux' and bool(multiprocessing), + 'Whether to attempt parallelized linting using the ' + 'multiprocessing module. Enabled by default on Linux ' + 'if the multiprocessing module is present (Python 2.6+). ' + 'Otherwise disabled by default. ' + 'Disabling may make debugging easier.') +flags.ADOPT_module_key_flags(fileflags) +flags.ADOPT_module_key_flags(runner) + GJSLINT_ONLY_FLAGS = ['--unix_mode', '--beep', '--nobeep', '--time', - '--check_html', '--summary'] + '--check_html', '--summary', '--quiet'] + + + +def _MultiprocessCheckPaths(paths): + """Run _CheckPath over mutltiple processes. + + Tokenization, passes, and checks are expensive operations. Running in a + single process, they can only run on one CPU/core. Instead, + shard out linting over all CPUs with multiprocessing to parallelize. + + Args: + paths: paths to check. + + Yields: + errorrecord.ErrorRecords for any found errors. + """ + + pool = multiprocessing.Pool() + + path_results = pool.imap(_CheckPath, paths) + for results in path_results: + for result in results: + yield result + + # Force destruct before returning, as this can sometimes raise spurious + # "interrupted system call" (EINTR), which we can ignore. + try: + pool.close() + pool.join() + del pool + except OSError as err: + if err.errno is not errno.EINTR: + raise err + + +def _CheckPaths(paths): + """Run _CheckPath on all paths in one thread. + + Args: + paths: paths to check. + + Yields: + errorrecord.ErrorRecords for any found errors. + """ + + for path in paths: + results = _CheckPath(path) + for record in results: + yield record + + +def _CheckPath(path): + """Check a path and return any errors. + + Args: + path: paths to check. + + Returns: + A list of errorrecord.ErrorRecords for any found errors. + """ + + error_handler = erroraccumulator.ErrorAccumulator() + runner.Run(path, error_handler) + + make_error_record = lambda err: errorrecord.MakeErrorRecord(path, err) + return map(make_error_record, error_handler.GetErrors()) -def FormatTime(t): +def _GetFilePaths(argv): + suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] + if FLAGS.check_html: + suffixes += ['.html', '.htm'] + return fileflags.GetFileList(argv, 'JavaScript', suffixes) + + +# Error printing functions + + +def _PrintFileSummary(paths, records): + """Print a detailed summary of the number of errors in each file.""" + + paths = list(paths) + paths.sort() + + for path in paths: + path_errors = [e for e in records if e.path == path] + print '%s: %d' % (path, len(path_errors)) + + +def _PrintFileSeparator(path): + print '----- FILE : %s -----' % path + + +def _PrintSummary(paths, error_records): + """Print a summary of the number of errors and files.""" + + error_count = len(error_records) + all_paths = set(paths) + all_paths_count = len(all_paths) + + if error_count is 0: + print '%d files checked, no errors found.' % all_paths_count + + new_error_count = len([e for e in error_records if e.new_error]) + + error_paths = set([e.path for e in error_records]) + error_paths_count = len(error_paths) + no_error_paths_count = all_paths_count - error_paths_count + + if (error_count or new_error_count) and not FLAGS.quiet: + error_noun = 'error' if error_count == 1 else 'errors' + new_error_noun = 'error' if new_error_count == 1 else 'errors' + error_file_noun = 'file' if error_paths_count == 1 else 'files' + ok_file_noun = 'file' if no_error_paths_count == 1 else 'files' + print ('Found %d %s, including %d new %s, in %d %s (%d %s OK).' % + (error_count, + error_noun, + new_error_count, + new_error_noun, + error_paths_count, + error_file_noun, + no_error_paths_count, + ok_file_noun)) + + +def _PrintErrorRecords(error_records): + """Print error records strings in the expected format.""" + + current_path = None + for record in error_records: + + if current_path != record.path: + current_path = record.path + if not FLAGS.unix_mode: + _PrintFileSeparator(current_path) + + print record.error_string + + +def _FormatTime(t): """Formats a duration as a human-readable string. Args: @@ -74,7 +241,9 @@ def FormatTime(t): return '%.2fs' % t -def main(argv = None): + + +def main(argv=None): """Main function. Args: @@ -82,33 +251,41 @@ def main(argv = None): """ if argv is None: argv = flags.FLAGS(sys.argv) - + if FLAGS.time: - start_time = time.time() + start_time = time.time() suffixes = ['.js'] + if FLAGS.additional_extensions: + suffixes += ['.%s' % ext for ext in FLAGS.additional_extensions] if FLAGS.check_html: suffixes += ['.html', '.htm'] - files = fileflags.GetFileList(argv, 'JavaScript', suffixes) + paths = fileflags.GetFileList(argv, 'JavaScript', suffixes) - error_handler = None - if FLAGS.unix_mode: - error_handler = errorprinter.ErrorPrinter(errors.NEW_ERRORS) - error_handler.SetFormat(errorprinter.UNIX_FORMAT) + if FLAGS.multiprocess: + records_iter = _MultiprocessCheckPaths(paths) + else: + records_iter = _CheckPaths(paths) + + records_iter, records_iter_copy = itertools.tee(records_iter, 2) + _PrintErrorRecords(records_iter_copy) - runner = checker.GJsLintRunner() - result = runner.Run(files, error_handler) - result.PrintSummary() + error_records = list(records_iter) + _PrintSummary(paths, error_records) exit_code = 0 - if result.HasOldErrors(): + + # If there are any errors + if error_records: exit_code += 1 - if result.HasNewErrors(): + + # If there are any new errors + if [r for r in error_records if r.new_error]: exit_code += 2 if exit_code: if FLAGS.summary: - result.PrintFileSummary() + _PrintFileSummary(paths, error_records) if FLAGS.beep: # Make a beep noise. @@ -124,16 +301,16 @@ def main(argv = None): else: fix_args.append(flag) - print """ + if not FLAGS.quiet: + print """ Some of the errors reported by GJsLint may be auto-fixable using the script fixjsstyle. Please double check any changes it makes and report any bugs. The script can be run by executing: -fixjsstyle %s -""" % ' '.join(fix_args) +fixjsstyle %s """ % ' '.join(fix_args) if FLAGS.time: - print 'Done in %s.' % FormatTime(time.time() - start_time) + print 'Done in %s.' % _FormatTime(time.time() - start_time) sys.exit(exit_code) diff --git a/tools/closure_linter/closure_linter/indentation.py b/tools/closure_linter/closure_linter/indentation.py index d740607530c8e6..d48ad2b862c43a 100755 --- a/tools/closure_linter/closure_linter/indentation.py +++ b/tools/closure_linter/closure_linter/indentation.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2010 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,6 +17,8 @@ __author__ = ('robbyw@google.com (Robert Walker)') +import gflags as flags + from closure_linter import ecmametadatapass from closure_linter import errors from closure_linter import javascripttokens @@ -25,7 +26,6 @@ from closure_linter.common import error from closure_linter.common import position -import gflags as flags flags.DEFINE_boolean('debug_indentation', False, 'Whether to print debugging information for indentation.') @@ -89,7 +89,7 @@ def __init__(self, token, is_block=False): self.overridden_by = None self.is_permanent_override = False self.is_block = is_block - self.is_transient = not is_block and not token.type in ( + self.is_transient = not is_block and token.type not in ( Type.START_PAREN, Type.START_PARAMETERS) self.line_number = token.line_number @@ -121,7 +121,7 @@ def Finalize(self): if self._stack: old_stack = self._stack self._stack = [] - raise Exception("INTERNAL ERROR: indentation stack is not empty: %r" % + raise Exception('INTERNAL ERROR: indentation stack is not empty: %r' % old_stack) def CheckToken(self, token, state): @@ -152,26 +152,40 @@ def CheckToken(self, token, state): self._PopTo(Type.START_BRACKET) elif token_type == Type.END_BLOCK: - self._PopTo(Type.START_BLOCK) + start_token = self._PopTo(Type.START_BLOCK) + # Check for required goog.scope comment. + if start_token: + goog_scope = tokenutil.GoogScopeOrNoneFromStartBlock(start_token.token) + if goog_scope is not None: + if not token.line.endswith('; // goog.scope\n'): + if (token.line.find('//') > -1 and + token.line.find('goog.scope') > + token.line.find('//')): + indentation_errors.append([ + errors.MALFORMED_END_OF_SCOPE_COMMENT, + ('Malformed end of goog.scope comment. Please use the ' + 'exact following syntax to close the scope:\n' + '}); // goog.scope'), + token, + Position(token.start_index, token.length)]) + else: + indentation_errors.append([ + errors.MISSING_END_OF_SCOPE_COMMENT, + ('Missing comment for end of goog.scope which opened at line ' + '%d. End the scope with:\n' + '}); // goog.scope' % + (start_token.line_number)), + token, + Position(token.start_index, token.length)]) elif token_type == Type.KEYWORD and token.string in ('case', 'default'): self._Add(self._PopTo(Type.START_BLOCK)) - elif is_first and token.string == '.': - # This token should have been on the previous line, so treat it as if it - # was there. - info = TokenInfo(token) - info.line_number = token.line_number - 1 - self._Add(info) - elif token_type == Type.SEMICOLON: self._PopTransient() - not_binary_operator = (token_type != Type.OPERATOR or - token.metadata.IsUnaryOperator()) - not_dot = token.string != '.' - if is_first and not_binary_operator and not_dot and token.type not in ( - Type.COMMENT, Type.DOC_PREFIX, Type.STRING_TEXT): + if (is_first and + token_type not in (Type.COMMENT, Type.DOC_PREFIX, Type.STRING_TEXT)): if flags.FLAGS.debug_indentation: print 'Line #%d: stack %r' % (token.line_number, stack) @@ -198,21 +212,21 @@ def CheckToken(self, token, state): indentation_errors.append([ errors.WRONG_INDENTATION, 'Wrong indentation: expected any of {%s} but got %d' % ( - ', '.join( - ['%d' % x for x in expected]), actual), + ', '.join('%d' % x for x in expected if x < 80), actual), token, Position(actual, expected[0])]) self._start_index_offset[token.line_number] = expected[0] - actual # Add tokens that could increase indentation. if token_type == Type.START_BRACKET: - self._Add(TokenInfo(token=token, + self._Add(TokenInfo( + token=token, is_block=token.metadata.context.type == Context.ARRAY_LITERAL)) elif token_type == Type.START_BLOCK or token.metadata.is_implied_block: self._Add(TokenInfo(token=token, is_block=True)) - elif token_type in (Type.START_PAREN, Type.START_PARAMETERS): + elif token_type in (Type.START_PAREN, Type.START_PARAMETERS): self._Add(TokenInfo(token=token, is_block=False)) elif token_type == Type.KEYWORD and token.string == 'return': @@ -229,12 +243,15 @@ def CheckToken(self, token, state): # Add some tokens only if they appear at the end of the line. is_last = self._IsLastCodeInLine(token) if is_last: + next_code_token = tokenutil.GetNextCodeToken(token) + # Increase required indentation if this is an overlong wrapped statement + # ending in an operator. if token_type == Type.OPERATOR: if token.string == ':': - if (stack and stack[-1].token.string == '?'): + if stack and stack[-1].token.string == '?': # When a ternary : is on a different line than its '?', it doesn't # add indentation. - if (token.line_number == stack[-1].token.line_number): + if token.line_number == stack[-1].token.line_number: self._Add(TokenInfo(token)) elif token.metadata.context.type == Context.CASE_BLOCK: # Pop transient tokens from say, line continuations, e.g., @@ -249,7 +266,6 @@ def CheckToken(self, token, state): # When in an object literal, acts as operator indicating line # continuations. self._Add(TokenInfo(token)) - pass else: # ':' might also be a statement label, no effect on indentation in # this case. @@ -263,13 +279,16 @@ def CheckToken(self, token, state): self._Add(TokenInfo(token)) elif token.metadata.context.type != Context.PARAMETERS: self._PopTransient() - - elif (token.string.endswith('.') - and token_type in (Type.IDENTIFIER, Type.NORMAL)): + # Increase required indentation if this is the end of a statement that's + # continued with an operator on the next line (e.g. the '.'). + elif (next_code_token and next_code_token.type == Type.OPERATOR and + not next_code_token.metadata.IsUnaryOperator()): self._Add(TokenInfo(token)) elif token_type == Type.PARAMETERS and token.string.endswith(','): # Parameter lists. self._Add(TokenInfo(token)) + elif token.IsKeyword('var'): + self._Add(TokenInfo(token)) elif token.metadata.is_implied_semicolon: self._PopTransient() elif token.IsAssignment(): @@ -297,6 +316,12 @@ def _AddToEach(self, original, amount): def _IsHardStop(self, token): """Determines if the given token can have a hard stop after it. + Args: + token: token to examine + + Returns: + Whether the token can have a hard stop after it. + Hard stops are indentations defined by the position of another token as in indentation lined up with return, (, [, and ?. """ @@ -341,7 +366,15 @@ def _GetAllowableIndentations(self): # Handle hard stops after (, [, return, =, and ? if self._IsHardStop(token): override_is_hard_stop = (token_info.overridden_by and - self._IsHardStop(token_info.overridden_by.token)) + self._IsHardStop( + token_info.overridden_by.token)) + if token.type == Type.START_PAREN and token.previous: + # For someFunction(...) we allow to indent at the beginning of the + # identifier +4 + prev = token.previous + if (prev.type == Type.IDENTIFIER and + prev.line_number == token.line_number): + hard_stops.add(prev.start_index + 4) if not override_is_hard_stop: start_index = token.start_index if token.line_number in self._start_index_offset: @@ -353,7 +386,7 @@ def _GetAllowableIndentations(self): elif token.string == 'return' and not token_info.overridden_by: hard_stops.add(start_index + 7) - elif (token.type == Type.START_BRACKET): + elif token.type == Type.START_BRACKET: hard_stops.add(start_index + 1) elif token.IsAssignment(): @@ -423,6 +456,31 @@ def _IsLastCodeInLine(self, token): if token.type not in Type.NON_CODE_TYPES: return False + def _AllFunctionPropertyAssignTokens(self, start_token, end_token): + """Checks if tokens are (likely) a valid function property assignment. + + Args: + start_token: Start of the token range. + end_token: End of the token range. + + Returns: + True if all tokens between start_token and end_token are legal tokens + within a function declaration and assignment into a property. + """ + for token in tokenutil.GetTokenRange(start_token, end_token): + fn_decl_tokens = (Type.FUNCTION_DECLARATION, + Type.PARAMETERS, + Type.START_PARAMETERS, + Type.END_PARAMETERS, + Type.END_PAREN) + if (token.type not in fn_decl_tokens and + token.IsCode() and + not tokenutil.IsIdentifierOrDot(token) and + not token.IsAssignment() and + not (token.type == Type.OPERATOR and token.string == ',')): + return False + return True + def _Add(self, token_info): """Adds the given token info to the stack. @@ -434,9 +492,35 @@ def _Add(self, token_info): return if token_info.is_block or token_info.token.type == Type.START_PAREN: - index = 1 - while index <= len(self._stack): - stack_info = self._stack[-index] + scope_token = tokenutil.GoogScopeOrNoneFromStartBlock(token_info.token) + token_info.overridden_by = TokenInfo(scope_token) if scope_token else None + + if (token_info.token.type == Type.START_BLOCK and + token_info.token.metadata.context.type == Context.BLOCK): + # Handle function() {} assignments: their block contents get special + # treatment and are allowed to just indent by two whitespace. + # For example + # long.long.name = function( + # a) { + # In this case the { and the = are on different lines. But the + # override should still apply for all previous stack tokens that are + # part of an assignment of a block. + + has_assignment = any(x for x in self._stack if x.token.IsAssignment()) + if has_assignment: + last_token = token_info.token.previous + for stack_info in reversed(self._stack): + if (last_token and + not self._AllFunctionPropertyAssignTokens(stack_info.token, + last_token)): + break + stack_info.overridden_by = token_info + stack_info.is_permanent_override = True + last_token = stack_info.token + + index = len(self._stack) - 1 + while index >= 0: + stack_info = self._stack[index] stack_token = stack_info.token if stack_info.line_number == token_info.line_number: @@ -451,24 +535,14 @@ def _Add(self, token_info): # a: 10 # }, # 30); + # b/11450054. If a string is not closed properly then close_block + # could be null. close_block = token_info.token.metadata.context.end_token - stack_info.is_permanent_override = \ - close_block.line_number != token_info.token.line_number - elif (token_info.token.type == Type.START_BLOCK and - token_info.token.metadata.context.type == Context.BLOCK and - (stack_token.IsAssignment() or - stack_token.type == Type.IDENTIFIER)): - # When starting a function block, the override can transcend lines. - # For example - # long.long.name = function( - # a) { - # In this case the { and the = are on different lines. But the - # override should still apply. - stack_info.overridden_by = token_info - stack_info.is_permanent_override = True + stack_info.is_permanent_override = close_block and ( + close_block.line_number != token_info.token.line_number) else: break - index += 1 + index -= 1 self._stack.append(token_info) diff --git a/tools/closure_linter/closure_linter/javascriptlintrules.py b/tools/closure_linter/closure_linter/javascriptlintrules.py old mode 100755 new mode 100644 index 6b9f1be705c720..9578009daacb5a --- a/tools/closure_linter/closure_linter/javascriptlintrules.py +++ b/tools/closure_linter/closure_linter/javascriptlintrules.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -# -# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,50 +23,46 @@ 'ajp@google.com (Andy Perelson)', 'jacobr@google.com (Jacob Richman)') -import gflags as flags +import re + from closure_linter import ecmalintrules +from closure_linter import error_check from closure_linter import errors from closure_linter import javascripttokenizer from closure_linter import javascripttokens +from closure_linter import requireprovidesorter from closure_linter import tokenutil from closure_linter.common import error from closure_linter.common import position -FLAGS = flags.FLAGS -flags.DEFINE_list('closurized_namespaces', '', - 'Namespace prefixes, used for testing of' - 'goog.provide/require') -flags.DEFINE_list('ignored_extra_namespaces', '', - 'Fully qualified namespaces that should be not be reported ' - 'as extra by the linter.') - # Shorthand Error = error.Error Position = position.Position +Rule = error_check.Rule Type = javascripttokens.JavaScriptTokenType class JavaScriptLintRules(ecmalintrules.EcmaScriptLintRules): """JavaScript lint rules that catch JavaScript specific style errors.""" + def __init__(self, namespaces_info): + """Initializes a JavaScriptLintRules instance.""" + ecmalintrules.EcmaScriptLintRules.__init__(self) + self._namespaces_info = namespaces_info + self._declared_private_member_tokens = {} + self._declared_private_members = set() + self._used_private_members = set() + # A stack of dictionaries, one for each function scope entered. Each + # dictionary is keyed by an identifier that defines a local variable and has + # a token as its value. + self._unused_local_variables_by_scope = [] + def HandleMissingParameterDoc(self, token, param_name): """Handle errors associated with a parameter missing a param tag.""" self._HandleError(errors.MISSING_PARAMETER_DOCUMENTATION, 'Missing docs for parameter: "%s"' % param_name, token) - def __ContainsRecordType(self, token): - """Check whether the given token contains a record type. - - Args: - token: The token being checked - """ - # If we see more than one left-brace in the string of an annotation token, - # then there's a record type in there. - return (token and token.type == Type.DOC_FLAG and - token.attached_object.type is not None and - token.attached_object.type.find('{') != token.string.rfind('{')) - - + # pylint: disable=too-many-statements def CheckToken(self, token, state): """Checks a token, given the current parser_state, for warnings and errors. @@ -75,33 +70,94 @@ def CheckToken(self, token, state): token: The current token under consideration state: parser_state object that indicates the current state in the page """ - if self.__ContainsRecordType(token): - # We should bail out and not emit any warnings for this annotation. - # TODO(nicksantos): Support record types for real. - state.GetDocComment().Invalidate() - return # Call the base class's CheckToken function. super(JavaScriptLintRules, self).CheckToken(token, state) # Store some convenience variables - first_in_line = token.IsFirstInLine() - last_in_line = token.IsLastInLine() - type = token.type - - if type == Type.DOC_FLAG: + namespaces_info = self._namespaces_info + + if error_check.ShouldCheck(Rule.UNUSED_LOCAL_VARIABLES): + self._CheckUnusedLocalVariables(token, state) + + if error_check.ShouldCheck(Rule.UNUSED_PRIVATE_MEMBERS): + # Find all assignments to private members. + if token.type == Type.SIMPLE_LVALUE: + identifier = token.string + if identifier.endswith('_') and not identifier.endswith('__'): + doc_comment = state.GetDocComment() + suppressed = doc_comment and ( + 'underscore' in doc_comment.suppressions or + 'unusedPrivateMembers' in doc_comment.suppressions) + if not suppressed: + # Look for static members defined on a provided namespace. + if namespaces_info: + namespace = namespaces_info.GetClosurizedNamespace(identifier) + provided_namespaces = namespaces_info.GetProvidedNamespaces() + else: + namespace = None + provided_namespaces = set() + + # Skip cases of this.something_.somethingElse_. + regex = re.compile(r'^this\.[a-zA-Z_]+$') + if namespace in provided_namespaces or regex.match(identifier): + variable = identifier.split('.')[-1] + self._declared_private_member_tokens[variable] = token + self._declared_private_members.add(variable) + elif not identifier.endswith('__'): + # Consider setting public members of private members to be a usage. + for piece in identifier.split('.'): + if piece.endswith('_'): + self._used_private_members.add(piece) + + # Find all usages of private members. + if token.type == Type.IDENTIFIER: + for piece in token.string.split('.'): + if piece.endswith('_'): + self._used_private_members.add(piece) + + if token.type == Type.DOC_FLAG: flag = token.attached_object if flag.flag_type == 'param' and flag.name_token is not None: self._CheckForMissingSpaceBeforeToken( token.attached_object.name_token) + if flag.type is not None and flag.name is not None: + if error_check.ShouldCheck(Rule.VARIABLE_ARG_MARKER): + # Check for variable arguments marker in type. + if flag.jstype.IsVarArgsType() and flag.name != 'var_args': + self._HandleError(errors.JSDOC_MISSING_VAR_ARGS_NAME, + 'Variable length argument %s must be renamed ' + 'to var_args.' % flag.name, + token) + elif not flag.jstype.IsVarArgsType() and flag.name == 'var_args': + self._HandleError(errors.JSDOC_MISSING_VAR_ARGS_TYPE, + 'Variable length argument %s type must start ' + 'with \'...\'.' % flag.name, + token) + + if error_check.ShouldCheck(Rule.OPTIONAL_TYPE_MARKER): + # Check for optional marker in type. + if (flag.jstype.opt_arg and + not flag.name.startswith('opt_')): + self._HandleError(errors.JSDOC_MISSING_OPTIONAL_PREFIX, + 'Optional parameter name %s must be prefixed ' + 'with opt_.' % flag.name, + token) + elif (not flag.jstype.opt_arg and + flag.name.startswith('opt_')): + self._HandleError(errors.JSDOC_MISSING_OPTIONAL_TYPE, + 'Optional parameter %s type must end with =.' % + flag.name, + token) + if flag.flag_type in state.GetDocFlag().HAS_TYPE: # Check for both missing type token and empty type braces '{}' - # Missing suppress types are reported separately and we allow enums - # without types. - if (flag.flag_type not in ('suppress', 'enum') and - (flag.type == None or flag.type == '' or flag.type.isspace())): + # Missing suppress types are reported separately and we allow enums, + # const, private, public and protected without types. + if (flag.flag_type not in state.GetDocFlag().CAN_OMIT_TYPE + and (not flag.jstype or flag.jstype.IsEmpty())): self._HandleError(errors.MISSING_JSDOC_TAG_TYPE, 'Missing type in %s tag' % token.string, token) @@ -112,43 +168,64 @@ def CheckToken(self, token, state): 'Type should be immediately after %s tag' % token.string, token) - elif type == Type.DOUBLE_QUOTE_STRING_START: - next = token.next - while next.type == Type.STRING_TEXT: + elif token.type == Type.DOUBLE_QUOTE_STRING_START: + next_token = token.next + while next_token.type == Type.STRING_TEXT: if javascripttokenizer.JavaScriptTokenizer.SINGLE_QUOTE.search( - next.string): + next_token.string): break - next = next.next + next_token = next_token.next else: self._HandleError( errors.UNNECESSARY_DOUBLE_QUOTED_STRING, 'Single-quoted string preferred over double-quoted string.', token, - Position.All(token.string)) + position=Position.All(token.string)) + + elif token.type == Type.END_DOC_COMMENT: + doc_comment = state.GetDocComment() + + # When @externs appears in a @fileoverview comment, it should trigger + # the same limited doc checks as a special filename like externs.js. + if doc_comment.HasFlag('fileoverview') and doc_comment.HasFlag('externs'): + self._SetLimitedDocChecks(True) - elif type == Type.END_DOC_COMMENT: - if (FLAGS.strict and not self._is_html and state.InTopLevel() and - not state.InBlock()): + if (error_check.ShouldCheck(Rule.BLANK_LINES_AT_TOP_LEVEL) and + not self._is_html and + state.InTopLevel() and + not state.InNonScopeBlock()): # Check if we're in a fileoverview or constructor JsDoc. - doc_comment = state.GetDocComment() - is_constructor = (doc_comment.HasFlag('constructor') or + is_constructor = ( + doc_comment.HasFlag('constructor') or doc_comment.HasFlag('interface')) - is_file_overview = doc_comment.HasFlag('fileoverview') + # @fileoverview is an optional tag so if the dosctring is the first + # token in the file treat it as a file level docstring. + is_file_level_comment = ( + doc_comment.HasFlag('fileoverview') or + not doc_comment.start_token.previous) # If the comment is not a file overview, and it does not immediately # precede some code, skip it. # NOTE: The tokenutil methods are not used here because of their # behavior at the top of a file. - next = token.next - if (not next or - (not is_file_overview and next.type in Type.NON_CODE_TYPES)): + next_token = token.next + if (not next_token or + (not is_file_level_comment and + next_token.type in Type.NON_CODE_TYPES)): + return + + # Don't require extra blank lines around suppression of extra + # goog.require errors. + if (doc_comment.SuppressionOnly() and + next_token.type == Type.IDENTIFIER and + next_token.string in ['goog.provide', 'goog.require']): return # Find the start of this block (include comments above the block, unless # this is a file overview). block_start = doc_comment.start_token - if not is_file_overview: + if not is_file_level_comment: token = block_start.previous while token and token.type in Type.COMMENT_TYPES: block_start = token @@ -170,23 +247,27 @@ def CheckToken(self, token, state): error_message = False expected_blank_lines = 0 - if is_file_overview and blank_lines == 0: + # Only need blank line before file overview if it is not the beginning + # of the file, e.g. copyright is first. + if is_file_level_comment and blank_lines == 0 and block_start.previous: error_message = 'Should have a blank line before a file overview.' expected_blank_lines = 1 elif is_constructor and blank_lines != 3: - error_message = ('Should have 3 blank lines before a constructor/' - 'interface.') + error_message = ( + 'Should have 3 blank lines before a constructor/interface.') expected_blank_lines = 3 - elif not is_file_overview and not is_constructor and blank_lines != 2: + elif (not is_file_level_comment and not is_constructor and + blank_lines != 2): error_message = 'Should have 2 blank lines between top-level blocks.' expected_blank_lines = 2 if error_message: - self._HandleError(errors.WRONG_BLANK_LINE_COUNT, error_message, - block_start, Position.AtBeginning(), - expected_blank_lines - blank_lines) + self._HandleError( + errors.WRONG_BLANK_LINE_COUNT, error_message, + block_start, position=Position.AtBeginning(), + fix_data=expected_blank_lines - blank_lines) - elif type == Type.END_BLOCK: + elif token.type == Type.END_BLOCK: if state.InFunction() and state.IsFunctionClose(): is_immediately_called = (token.next and token.next.type == Type.START_PAREN) @@ -202,44 +283,88 @@ def CheckToken(self, token, state): self._HandleError( errors.MISSING_RETURN_DOCUMENTATION, 'Missing @return JsDoc in function with non-trivial return', - function.doc.end_token, Position.AtBeginning()) - elif (not function.has_return and function.doc and + function.doc.end_token, position=Position.AtBeginning()) + elif (not function.has_return and + not function.has_throw and + function.doc and function.doc.HasFlag('return') and not state.InInterfaceMethod()): - return_flag = function.doc.GetFlag('return') - if (return_flag.type is None or ( - 'undefined' not in return_flag.type and - 'void' not in return_flag.type and - '*' not in return_flag.type)): + flag = function.doc.GetFlag('return') + valid_no_return_names = ['undefined', 'void', '*'] + invalid_return = flag.jstype is None or not any( + sub_type.identifier in valid_no_return_names + for sub_type in flag.jstype.IterTypeGroup()) + + if invalid_return: self._HandleError( errors.UNNECESSARY_RETURN_DOCUMENTATION, 'Found @return JsDoc on function that returns nothing', - return_flag.flag_token, Position.AtBeginning()) + flag.flag_token, position=Position.AtBeginning()) + + # b/4073735. Method in object literal definition of prototype can + # safely reference 'this'. + prototype_object_literal = False + block_start = None + previous_code = None + previous_previous_code = None + + # Search for cases where prototype is defined as object literal. + # previous_previous_code + # | previous_code + # | | block_start + # | | | + # a.b.prototype = { + # c : function() { + # this.d = 1; + # } + # } + + # If in object literal, find first token of block so to find previous + # tokens to check above condition. + if state.InObjectLiteral(): + block_start = state.GetCurrentBlockStart() + + # If an object literal then get previous token (code type). For above + # case it should be '='. + if block_start: + previous_code = tokenutil.SearchExcept(block_start, + Type.NON_CODE_TYPES, + reverse=True) + + # If previous token to block is '=' then get its previous token. + if previous_code and previous_code.IsOperator('='): + previous_previous_code = tokenutil.SearchExcept(previous_code, + Type.NON_CODE_TYPES, + reverse=True) + + # If variable/token before '=' ends with '.prototype' then its above + # case of prototype defined with object literal. + prototype_object_literal = (previous_previous_code and + previous_previous_code.string.endswith( + '.prototype')) - if state.InFunction() and state.IsFunctionClose(): - is_immediately_called = (token.next and - token.next.type == Type.START_PAREN) if (function.has_this and function.doc and not function.doc.HasFlag('this') and not function.is_constructor and not function.is_interface and - '.prototype.' not in function.name): + '.prototype.' not in function.name and + not prototype_object_literal): self._HandleError( errors.MISSING_JSDOC_TAG_THIS, 'Missing @this JsDoc in function referencing "this". (' 'this usually means you are trying to reference "this" in ' 'a static function, or you have forgotten to mark a ' 'constructor with @constructor)', - function.doc.end_token, Position.AtBeginning()) + function.doc.end_token, position=Position.AtBeginning()) - elif type == Type.IDENTIFIER: + elif token.type == Type.IDENTIFIER: if token.string == 'goog.inherits' and not state.InFunction(): if state.GetLastNonSpaceToken().line_number == token.line_number: self._HandleError( errors.MISSING_LINE, 'Missing newline between constructor and goog.inherits', token, - Position.AtBeginning()) + position=Position.AtBeginning()) extra_space = state.GetLastNonSpaceToken().next while extra_space != token: @@ -253,7 +378,92 @@ def CheckToken(self, token, state): # TODO(robbyw): Test the last function was a constructor. # TODO(robbyw): Test correct @extends and @implements documentation. - elif type == Type.OPERATOR: + elif (token.string == 'goog.provide' and + not state.InFunction() and + namespaces_info is not None): + namespace = tokenutil.GetStringAfterToken(token) + + # Report extra goog.provide statement. + if not namespace or namespaces_info.IsExtraProvide(token): + if not namespace: + msg = 'Empty namespace in goog.provide' + else: + msg = 'Unnecessary goog.provide: ' + namespace + + # Hint to user if this is a Test namespace. + if namespace.endswith('Test'): + msg += (' *Test namespaces must be mentioned in the ' + 'goog.setTestOnly() call') + + self._HandleError( + errors.EXTRA_GOOG_PROVIDE, + msg, + token, position=Position.AtBeginning()) + + if namespaces_info.IsLastProvide(token): + # Report missing provide statements after the last existing provide. + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, + tokenutil.GetLastTokenInSameLine(token).next, + False) + + # If there are no require statements, missing requires should be + # reported after the last provide. + if not namespaces_info.GetRequiredNamespaces(): + missing_requires, illegal_alias_statements = ( + namespaces_info.GetMissingRequires()) + if missing_requires: + self._ReportMissingRequires( + missing_requires, + tokenutil.GetLastTokenInSameLine(token).next, + True) + if illegal_alias_statements: + self._ReportIllegalAliasStatement(illegal_alias_statements) + + elif (token.string == 'goog.require' and + not state.InFunction() and + namespaces_info is not None): + namespace = tokenutil.GetStringAfterToken(token) + + # If there are no provide statements, missing provides should be + # reported before the first require. + if (namespaces_info.IsFirstRequire(token) and + not namespaces_info.GetProvidedNamespaces()): + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, + tokenutil.GetFirstTokenInSameLine(token), + True) + + # Report extra goog.require statement. + if not namespace or namespaces_info.IsExtraRequire(token): + if not namespace: + msg = 'Empty namespace in goog.require' + else: + msg = 'Unnecessary goog.require: ' + namespace + + self._HandleError( + errors.EXTRA_GOOG_REQUIRE, + msg, + token, position=Position.AtBeginning()) + + # Report missing goog.require statements. + if namespaces_info.IsLastRequire(token): + missing_requires, illegal_alias_statements = ( + namespaces_info.GetMissingRequires()) + if missing_requires: + self._ReportMissingRequires( + missing_requires, + tokenutil.GetLastTokenInSameLine(token).next, + False) + if illegal_alias_statements: + self._ReportIllegalAliasStatement(illegal_alias_statements) + + elif token.type == Type.OPERATOR: + last_in_line = token.IsLastInLine() # If the token is unary and appears to be used in a unary context # it's ok. Otherwise, if it's at the end of the line or immediately # before a comment, it's ok. @@ -262,15 +472,18 @@ def CheckToken(self, token, state): if (not token.metadata.IsUnaryOperator() and not last_in_line and not token.next.IsComment() and not token.next.IsOperator(',') - and not token.next.type in (Type.WHITESPACE, Type.END_PAREN, + and not tokenutil.IsDot(token) + and token.next.type not in (Type.WHITESPACE, Type.END_PAREN, Type.END_BRACKET, Type.SEMICOLON, Type.START_BRACKET)): self._HandleError( errors.MISSING_SPACE, 'Missing space after "%s"' % token.string, token, - Position.AtEnd(token.string)) - elif type == Type.WHITESPACE: + position=Position.AtEnd(token.string)) + elif token.type == Type.WHITESPACE: + first_in_line = token.IsFirstInLine() + last_in_line = token.IsLastInLine() # Check whitespace length if it's not the first token of the line and # if it's not immediately before a comment. if not last_in_line and not first_in_line and not token.next.IsComment(): @@ -282,114 +495,260 @@ def CheckToken(self, token, state): errors.EXTRA_SPACE, 'Extra space after "%s"' % token.previous.string, token, - Position.All(token.string)) + position=Position.All(token.string)) + elif token.type == Type.SEMICOLON: + previous_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, + reverse=True) + if not previous_token: + self._HandleError( + errors.REDUNDANT_SEMICOLON, + 'Semicolon without any statement', + token, + position=Position.AtEnd(token.string)) + elif (previous_token.type == Type.KEYWORD and + previous_token.string not in ['break', 'continue', 'return']): + self._HandleError( + errors.REDUNDANT_SEMICOLON, + ('Semicolon after \'%s\' without any statement.' + ' Looks like an error.' % previous_token.string), + token, + position=Position.AtEnd(token.string)) - def Finalize(self, state, tokenizer_mode): - """Perform all checks that need to occur after all lines are processed.""" - # Call the base class's Finalize function. - super(JavaScriptLintRules, self).Finalize(state, tokenizer_mode) - - # Check for sorted requires statements. - goog_require_tokens = state.GetGoogRequireTokens() - requires = [require_token.string for require_token in goog_require_tokens] - sorted_requires = sorted(requires) - index = 0 - bad = False - for item in requires: - if item != sorted_requires[index]: - bad = True + def _CheckUnusedLocalVariables(self, token, state): + """Checks for unused local variables in function blocks. + + Args: + token: The token to check. + state: The state tracker. + """ + # We don't use state.InFunction because that disregards scope functions. + in_function = state.FunctionDepth() > 0 + if token.type == Type.SIMPLE_LVALUE or token.type == Type.IDENTIFIER: + if in_function: + identifier = token.string + # Check whether the previous token was var. + previous_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES, + reverse=True) + if previous_code_token and previous_code_token.IsKeyword('var'): + # Add local variable declaration to the top of the unused locals + # stack. + self._unused_local_variables_by_scope[-1][identifier] = token + elif token.type == Type.IDENTIFIER: + # This covers most cases where the variable is used as an identifier. + self._MarkLocalVariableUsed(token.string) + elif token.type == Type.SIMPLE_LVALUE and '.' in identifier: + # This covers cases where a value is assigned to a property of the + # variable. + self._MarkLocalVariableUsed(token.string) + elif token.type == Type.START_BLOCK: + if in_function and state.IsFunctionOpen(): + # Push a new map onto the stack + self._unused_local_variables_by_scope.append({}) + elif token.type == Type.END_BLOCK: + if state.IsFunctionClose(): + # Pop the stack and report any remaining locals as unused. + unused_local_variables = self._unused_local_variables_by_scope.pop() + for unused_token in unused_local_variables.values(): + self._HandleError( + errors.UNUSED_LOCAL_VARIABLE, + 'Unused local variable: %s.' % unused_token.string, + unused_token) + elif token.type == Type.DOC_FLAG: + # Flags that use aliased symbols should be counted. + flag = token.attached_object + js_type = flag and flag.jstype + if flag and flag.flag_type in state.GetDocFlag().HAS_TYPE and js_type: + self._MarkAliasUsed(js_type) + + def _MarkAliasUsed(self, js_type): + """Marks aliases in a type as used. + + Recursively iterates over all subtypes in a jsdoc type annotation and + tracks usage of aliased symbols (which may be local variables). + Marks the local variable as used in the scope nearest to the current + scope that matches the given token. + + Args: + js_type: The jsdoc type, a typeannotation.TypeAnnotation object. + """ + if js_type.alias: + self._MarkLocalVariableUsed(js_type.identifier) + for sub_type in js_type.IterTypes(): + self._MarkAliasUsed(sub_type) + + def _MarkLocalVariableUsed(self, identifier): + """Marks the local variable as used in the relevant scope. + + Marks the local variable in the scope nearest to the current scope that + matches the given identifier as used. + + Args: + identifier: The identifier representing the potential usage of a local + variable. + """ + identifier = identifier.split('.', 1)[0] + # Find the first instance of the identifier in the stack of function scopes + # and mark it used. + for unused_local_variables in reversed( + self._unused_local_variables_by_scope): + if identifier in unused_local_variables: + del unused_local_variables[identifier] break - index += 1 - if bad: + def _ReportMissingProvides(self, missing_provides, token, need_blank_line): + """Reports missing provide statements to the error handler. + + Args: + missing_provides: A dictionary of string(key) and integer(value) where + each string(key) is a namespace that should be provided, but is not + and integer(value) is first line number where it's required. + token: The token where the error was detected (also where the new provides + will be inserted. + need_blank_line: Whether a blank line needs to be inserted after the new + provides are inserted. May be True, False, or None, where None + indicates that the insert location is unknown. + """ + + missing_provides_msg = 'Missing the following goog.provide statements:\n' + missing_provides_msg += '\n'.join(['goog.provide(\'%s\');' % x for x in + sorted(missing_provides)]) + missing_provides_msg += '\n' + + missing_provides_msg += '\nFirst line where provided: \n' + missing_provides_msg += '\n'.join( + [' %s : line %d' % (x, missing_provides[x]) for x in + sorted(missing_provides)]) + missing_provides_msg += '\n' + + self._HandleError( + errors.MISSING_GOOG_PROVIDE, + missing_provides_msg, + token, position=Position.AtBeginning(), + fix_data=(missing_provides.keys(), need_blank_line)) + + def _ReportMissingRequires(self, missing_requires, token, need_blank_line): + """Reports missing require statements to the error handler. + + Args: + missing_requires: A dictionary of string(key) and integer(value) where + each string(key) is a namespace that should be required, but is not + and integer(value) is first line number where it's required. + token: The token where the error was detected (also where the new requires + will be inserted. + need_blank_line: Whether a blank line needs to be inserted before the new + requires are inserted. May be True, False, or None, where None + indicates that the insert location is unknown. + """ + + missing_requires_msg = 'Missing the following goog.require statements:\n' + missing_requires_msg += '\n'.join(['goog.require(\'%s\');' % x for x in + sorted(missing_requires)]) + missing_requires_msg += '\n' + + missing_requires_msg += '\nFirst line where required: \n' + missing_requires_msg += '\n'.join( + [' %s : line %d' % (x, missing_requires[x]) for x in + sorted(missing_requires)]) + missing_requires_msg += '\n' + + self._HandleError( + errors.MISSING_GOOG_REQUIRE, + missing_requires_msg, + token, position=Position.AtBeginning(), + fix_data=(missing_requires.keys(), need_blank_line)) + + def _ReportIllegalAliasStatement(self, illegal_alias_statements): + """Reports alias statements that would need a goog.require.""" + for namespace, token in illegal_alias_statements.iteritems(): self._HandleError( - errors.GOOG_REQUIRES_NOT_ALPHABETIZED, - 'goog.require classes must be alphabetized. The correct code is:\n' + - '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x, - sorted_requires)), - goog_require_tokens[index], - position=Position.AtBeginning(), - fix_data=goog_require_tokens) - - # Check for sorted provides statements. - goog_provide_tokens = state.GetGoogProvideTokens() - provides = [provide_token.string for provide_token in goog_provide_tokens] - sorted_provides = sorted(provides) - index = 0 - bad = False - for item in provides: - if item != sorted_provides[index]: - bad = True - break - index += 1 + errors.ALIAS_STMT_NEEDS_GOOG_REQUIRE, + 'The alias definition would need the namespace \'%s\' which is not ' + 'required through any other symbol.' % namespace, + token, position=Position.AtBeginning()) - if bad: + def Finalize(self, state): + """Perform all checks that need to occur after all lines are processed.""" + # Call the base class's Finalize function. + super(JavaScriptLintRules, self).Finalize(state) + + if error_check.ShouldCheck(Rule.UNUSED_PRIVATE_MEMBERS): + # Report an error for any declared private member that was never used. + unused_private_members = (self._declared_private_members - + self._used_private_members) + + for variable in unused_private_members: + token = self._declared_private_member_tokens[variable] + self._HandleError(errors.UNUSED_PRIVATE_MEMBER, + 'Unused private member: %s.' % token.string, + token) + + # Clear state to prepare for the next file. + self._declared_private_member_tokens = {} + self._declared_private_members = set() + self._used_private_members = set() + + namespaces_info = self._namespaces_info + if namespaces_info is not None: + # If there are no provide or require statements, missing provides and + # requires should be reported on line 1. + if (not namespaces_info.GetProvidedNamespaces() and + not namespaces_info.GetRequiredNamespaces()): + missing_provides = namespaces_info.GetMissingProvides() + if missing_provides: + self._ReportMissingProvides( + missing_provides, state.GetFirstToken(), None) + + missing_requires, illegal_alias = namespaces_info.GetMissingRequires() + if missing_requires: + self._ReportMissingRequires( + missing_requires, state.GetFirstToken(), None) + if illegal_alias: + self._ReportIllegalAliasStatement(illegal_alias) + + self._CheckSortedRequiresProvides(state.GetFirstToken()) + + def _CheckSortedRequiresProvides(self, token): + """Checks that all goog.require and goog.provide statements are sorted. + + Note that this method needs to be run after missing statements are added to + preserve alphabetical order. + + Args: + token: The first token in the token stream. + """ + sorter = requireprovidesorter.RequireProvideSorter() + first_provide_token = sorter.CheckProvides(token) + if first_provide_token: + new_order = sorter.GetFixedProvideString(first_provide_token) self._HandleError( errors.GOOG_PROVIDES_NOT_ALPHABETIZED, 'goog.provide classes must be alphabetized. The correct code is:\n' + - '\n'.join(map(lambda x: 'goog.provide(\'%s\');' % x, - sorted_provides)), - goog_provide_tokens[index], + new_order, + first_provide_token, position=Position.AtBeginning(), - fix_data=goog_provide_tokens) + fix_data=first_provide_token) - if FLAGS.closurized_namespaces: - # Check that we provide everything we need. - provided_namespaces = state.GetProvidedNamespaces() - missing_provides = provided_namespaces - set(provides) - if missing_provides: - self._HandleError( - errors.MISSING_GOOG_PROVIDE, - 'Missing the following goog.provide statements:\n' + - '\n'.join(map(lambda x: 'goog.provide(\'%s\');' % x, - sorted(missing_provides))), - state.GetFirstToken(), position=Position.AtBeginning(), - fix_data=missing_provides) - - # Compose a set of all available namespaces. Explicitly omit goog - # because if you can call goog.require, you already have goog. - available_namespaces = (set(requires) | set(provides) | set(['goog']) | - provided_namespaces) - - # Check that we require everything we need. - missing_requires = set() - for namespace_variants in state.GetUsedNamespaces(): - # Namespace variants is a list of potential things to require. If we - # find we're missing one, we are lazy and choose to require the first - # in the sequence - which should be the namespace. - if not set(namespace_variants) & available_namespaces: - missing_requires.add(namespace_variants[0]) - - if missing_requires: - self._HandleError( - errors.MISSING_GOOG_REQUIRE, - 'Missing the following goog.require statements:\n' + - '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x, - sorted(missing_requires))), - state.GetFirstToken(), position=Position.AtBeginning(), - fix_data=missing_requires) - - # Check that we don't require things we don't actually use. - namespace_variants = state.GetUsedNamespaces() - used_namespaces = set() - for a, b in namespace_variants: - used_namespaces.add(a) - used_namespaces.add(b) - - extra_requires = set() - for i in requires: - baseNamespace = i.split('.')[0] - if (i not in used_namespaces and - baseNamespace in FLAGS.closurized_namespaces and - i not in FLAGS.ignored_extra_namespaces): - extra_requires.add(i) - - if extra_requires: - self._HandleError( - errors.EXTRA_GOOG_REQUIRE, - 'The following goog.require statements appear unnecessary:\n' + - '\n'.join(map(lambda x: 'goog.require(\'%s\');' % x, - sorted(extra_requires))), - state.GetFirstToken(), position=Position.AtBeginning(), - fix_data=extra_requires) + first_require_token = sorter.CheckRequires(token) + if first_require_token: + new_order = sorter.GetFixedRequireString(first_require_token) + self._HandleError( + errors.GOOG_REQUIRES_NOT_ALPHABETIZED, + 'goog.require classes must be alphabetized. The correct code is:\n' + + new_order, + first_require_token, + position=Position.AtBeginning(), + fix_data=first_require_token) + def GetLongLineExceptions(self): + """Gets a list of regexps for lines which can be longer than the limit. + + Returns: + A list of regexps, used as matches (rather than searches). + """ + return [ + re.compile(r'(var .+\s*=\s*)?goog\.require\(.+\);?\s*$'), + re.compile(r'goog\.(provide|module|setTestOnly)\(.+\);?\s*$'), + re.compile(r'[\s/*]*@visibility\s*{.*}[\s*/]*$'), + ] diff --git a/tools/closure_linter/closure_linter/javascriptstatetracker.py b/tools/closure_linter/closure_linter/javascriptstatetracker.py index 9cce37632ee83c..e0a42f66a84aae 100755 --- a/tools/closure_linter/closure_linter/javascriptstatetracker.py +++ b/tools/closure_linter/closure_linter/javascriptstatetracker.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# # Copyright 2008 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +35,8 @@ class JsDocFlag(statetracker.DocFlag): including braces. type_end_token: The last token specifying the flag JS type, including braces. - type: The JavaScript type spec. + type: The type spec string. + jstype: The type spec, a TypeAnnotation instance. name_token: The token specifying the flag name. name: The flag name description_start_token: The first token in the description. @@ -50,18 +50,10 @@ class JsDocFlag(statetracker.DocFlag): # TODO(robbyw): determine which of these, if any, should be illegal. EXTENDED_DOC = frozenset([ 'class', 'code', 'desc', 'final', 'hidden', 'inheritDoc', 'link', - 'protected', 'notypecheck', 'throws']) + 'meaning', 'provideGoog', 'throws']) LEGAL_DOC = EXTENDED_DOC | statetracker.DocFlag.LEGAL_DOC - def __init__(self, flag_token): - """Creates the JsDocFlag object and attaches it to the given start token. - - Args: - flag_token: The starting token of the flag. - """ - statetracker.DocFlag.__init__(self, flag_token) - class JavaScriptStateTracker(statetracker.StateTracker): """JavaScript state tracker. @@ -70,25 +62,15 @@ class JavaScriptStateTracker(statetracker.StateTracker): functionality needed for JavaScript. """ - def __init__(self, closurized_namespaces=''): - """Initializes a JavaScript token stream state tracker. - - Args: - closurized_namespaces: An optional list of namespace prefixes used for - testing of goog.provide/require. - """ + def __init__(self): + """Initializes a JavaScript token stream state tracker.""" statetracker.StateTracker.__init__(self, JsDocFlag) - self.__closurized_namespaces = closurized_namespaces def Reset(self): - """Resets the state tracker to prepare for processing a new page.""" + self._scope_depth = 0 + self._block_stack = [] super(JavaScriptStateTracker, self).Reset() - self.__goog_require_tokens = [] - self.__goog_provide_tokens = [] - self.__provided_namespaces = set() - self.__used_namespaces = [] - def InTopLevel(self): """Compute whether we are at the top level in the class. @@ -100,23 +82,26 @@ def InTopLevel(self): Returns: Whether we are at the top level in the class. """ - return not self.InParentheses() + return self._scope_depth == self.ParenthesesDepth() + + def InFunction(self): + """Returns true if the current token is within a function. - def GetGoogRequireTokens(self): - """Returns list of require tokens.""" - return self.__goog_require_tokens + This js-specific override ignores goog.scope functions. - def GetGoogProvideTokens(self): - """Returns list of provide tokens.""" - return self.__goog_provide_tokens + Returns: + True if the current token is within a function. + """ + return self._scope_depth != self.FunctionDepth() - def GetProvidedNamespaces(self): - """Returns list of provided namespaces.""" - return self.__provided_namespaces + def InNonScopeBlock(self): + """Compute whether we are nested within a non-goog.scope block. - def GetUsedNamespaces(self): - """Returns list of used namespaces, is a list of sequences.""" - return self.__used_namespaces + Returns: + True if the token is not enclosed in a block that does not originate from + a goog.scope statement. False otherwise. + """ + return self._scope_depth != self.BlockDepth() def GetBlockType(self, token): """Determine the block type given a START_BLOCK token. @@ -128,111 +113,38 @@ def GetBlockType(self, token): Returns: Code block type for current token. """ - last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None, - True) + last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, reverse=True) if last_code.type in (Type.END_PARAMETERS, Type.END_PAREN, Type.KEYWORD) and not last_code.IsKeyword('return'): return self.CODE else: return self.OBJECT_LITERAL + def GetCurrentBlockStart(self): + """Gets the start token of current block. + + Returns: + Starting token of current block. None if not in block. + """ + if self._block_stack: + return self._block_stack[-1] + else: + return None + def HandleToken(self, token, last_non_space_token): """Handles the given token and updates state. Args: token: The token to handle. - last_non_space_token: + last_non_space_token: The last non space token encountered """ + if token.type == Type.START_BLOCK: + self._block_stack.append(token) + if token.type == Type.IDENTIFIER and token.string == 'goog.scope': + self._scope_depth += 1 + if token.type == Type.END_BLOCK: + start_token = self._block_stack.pop() + if tokenutil.GoogScopeOrNoneFromStartBlock(start_token): + self._scope_depth -= 1 super(JavaScriptStateTracker, self).HandleToken(token, last_non_space_token) - - if token.IsType(Type.IDENTIFIER): - if token.string == 'goog.require': - class_token = tokenutil.Search(token, Type.STRING_TEXT) - self.__goog_require_tokens.append(class_token) - - elif token.string == 'goog.provide': - class_token = tokenutil.Search(token, Type.STRING_TEXT) - self.__goog_provide_tokens.append(class_token) - - elif self.__closurized_namespaces: - self.__AddUsedNamespace(token.string) - if token.IsType(Type.SIMPLE_LVALUE) and not self.InFunction(): - identifier = token.values['identifier'] - - if self.__closurized_namespaces: - namespace = self.GetClosurizedNamespace(identifier) - if namespace and identifier == namespace: - self.__provided_namespaces.add(namespace) - if (self.__closurized_namespaces and - token.IsType(Type.DOC_FLAG) and - token.attached_object.flag_type == 'implements'): - # Interfaces should be goog.require'd. - doc_start = tokenutil.Search(token, Type.DOC_START_BRACE) - interface = tokenutil.Search(doc_start, Type.COMMENT) - self.__AddUsedNamespace(interface.string) - - def __AddUsedNamespace(self, identifier): - """Adds the namespace of an identifier to the list of used namespaces. - - Args: - identifier: An identifier which has been used. - """ - namespace = self.GetClosurizedNamespace(identifier) - - if namespace: - # We add token.string as a 'namespace' as it is something that could - # potentially be provided to satisfy this dependency. - self.__used_namespaces.append([namespace, identifier]) - - def GetClosurizedNamespace(self, identifier): - """Given an identifier, returns the namespace that identifier is from. - - Args: - identifier: The identifier to extract a namespace from. - - Returns: - The namespace the given identifier resides in, or None if one could not - be found. - """ - parts = identifier.split('.') - for part in parts: - if part.endswith('_'): - # Ignore private variables / inner classes. - return None - - if identifier.startswith('goog.global'): - # Ignore goog.global, since it is, by definition, global. - return None - - for namespace in self.__closurized_namespaces: - if identifier.startswith(namespace + '.'): - last_part = parts[-1] - if not last_part: - # TODO(robbyw): Handle this: it's a multi-line identifier. - return None - - if last_part in ('apply', 'inherits', 'call'): - # Calling one of Function's methods usually indicates use of a - # superclass. - parts.pop() - last_part = parts[-1] - - for i in xrange(1, len(parts)): - part = parts[i] - if part.isupper(): - # If an identifier is of the form foo.bar.BAZ.x or foo.bar.BAZ, - # the namespace is foo.bar. - return '.'.join(parts[:i]) - if part == 'prototype': - # If an identifier is of the form foo.bar.prototype.x, the - # namespace is foo.bar. - return '.'.join(parts[:i]) - - if last_part.isupper() or not last_part[0].isupper(): - # Strip off the last part of an enum or constant reference. - parts.pop() - - return '.'.join(parts) - - return None diff --git a/tools/closure_linter/closure_linter/javascriptstatetracker_test.py b/tools/closure_linter/closure_linter/javascriptstatetracker_test.py old mode 100755 new mode 100644 index e4288b7b647878..76dabd2c70d58a --- a/tools/closure_linter/closure_linter/javascriptstatetracker_test.py +++ b/tools/closure_linter/closure_linter/javascriptstatetracker_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -# Copyright 2010 The Closure Linter Authors. All Rights Reserved. -# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -14,40 +13,266 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Unit tests for JavaScriptStateTracker.""" +"""Unit tests for the javascriptstatetracker module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header +__author__ = ('nnaze@google.com (Nathan Naze)') import unittest as googletest -from closure_linter import javascriptstatetracker - -class JavaScriptStateTrackerTest(googletest.TestCase): - - __test_cases = { - 'package.CONSTANT' : 'package', - 'package.methodName' : 'package', - 'package.subpackage.methodName' : 'package.subpackage', - 'package.ClassName.something' : 'package.ClassName', - 'package.ClassName.Enum.VALUE.methodName' : 'package.ClassName.Enum', - 'package.ClassName.CONSTANT' : 'package.ClassName', - 'package.ClassName.inherits' : 'package.ClassName', - 'package.ClassName.apply' : 'package.ClassName', - 'package.ClassName.methodName.apply' : 'package.ClassName', - 'package.ClassName.methodName.call' : 'package.ClassName', - 'package.ClassName.prototype.methodName' : 'package.ClassName', - 'package.ClassName.privateMethod_' : None, - 'package.ClassName.prototype.methodName.apply' : 'package.ClassName' - } - - def testGetClosurizedNamespace(self): - stateTracker = javascriptstatetracker.JavaScriptStateTracker(['package']) - for identifier, expected_namespace in self.__test_cases.items(): - actual_namespace = stateTracker.GetClosurizedNamespace(identifier) - self.assertEqual(expected_namespace, actual_namespace, - 'expected namespace "' + str(expected_namespace) + - '" for identifier "' + str(identifier) + '" but was "' + - str(actual_namespace) + '"') + +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + + +_FUNCTION_SCRIPT = """\ +var a = 3; + +function foo(aaa, bbb, ccc) { + var b = 4; +} + + +/** + * JSDoc comment. + */ +var bar = function(ddd, eee, fff) { + +}; + + +/** + * Verify that nested functions get their proper parameters recorded. + */ +var baz = function(ggg, hhh, iii) { + var qux = function(jjj, kkk, lll) { + }; + // make sure that entering a new block does not change baz' parameters. + {}; +}; + +""" + + +class FunctionTest(googletest.TestCase): + + def testFunctionParse(self): + functions, _ = testutil.ParseFunctionsAndComments(_FUNCTION_SCRIPT) + self.assertEquals(4, len(functions)) + + # First function + function = functions[0] + self.assertEquals(['aaa', 'bbb', 'ccc'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(3, start_token.line_number) + self.assertEquals(0, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(5, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('foo', function.name) + + self.assertIsNone(function.doc) + + # Second function + function = functions[1] + self.assertEquals(['ddd', 'eee', 'fff'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(11, start_token.line_number) + self.assertEquals(10, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(13, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('bar', function.name) + + self.assertIsNotNone(function.doc) + + # Check function JSDoc + doc = function.doc + doc_tokens = tokenutil.GetTokenRange(doc.start_token, doc.end_token) + + comment_type = javascripttokens.JavaScriptTokenType.COMMENT + comment_tokens = filter(lambda t: t.type is comment_type, doc_tokens) + + self.assertEquals('JSDoc comment.', + tokenutil.TokensToString(comment_tokens).strip()) + + # Third function + function = functions[2] + self.assertEquals(['ggg', 'hhh', 'iii'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(19, start_token.line_number) + self.assertEquals(10, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(24, end_token.line_number) + self.assertEquals(0, end_token.start_index) + + self.assertEquals('baz', function.name) + self.assertIsNotNone(function.doc) + + # Fourth function (inside third function) + function = functions[3] + self.assertEquals(['jjj', 'kkk', 'lll'], function.parameters) + + start_token = function.start_token + end_token = function.end_token + + self.assertEquals( + javascripttokens.JavaScriptTokenType.FUNCTION_DECLARATION, + function.start_token.type) + + self.assertEquals('function', start_token.string) + self.assertEquals(20, start_token.line_number) + self.assertEquals(12, start_token.start_index) + + self.assertEquals('}', end_token.string) + self.assertEquals(21, end_token.line_number) + self.assertEquals(2, end_token.start_index) + + self.assertEquals('qux', function.name) + self.assertIsNone(function.doc) + + + +class CommentTest(googletest.TestCase): + + def testGetDescription(self): + comment = self._ParseComment(""" + /** + * Comment targeting goog.foo. + * + * This is the second line. + * @param {number} foo The count of foo. + */ + target;""") + + self.assertEqual( + 'Comment targeting goog.foo.\n\nThis is the second line.', + comment.description) + + def testCommentGetTarget(self): + self.assertCommentTarget('goog.foo', """ + /** + * Comment targeting goog.foo. + */ + goog.foo = 6; + """) + + self.assertCommentTarget('bar', """ + /** + * Comment targeting bar. + */ + var bar = "Karate!"; + """) + + self.assertCommentTarget('doThing', """ + /** + * Comment targeting doThing. + */ + function doThing() {}; + """) + + self.assertCommentTarget('this.targetProperty', """ + goog.bar.Baz = function() { + /** + * Comment targeting targetProperty. + */ + this.targetProperty = 3; + }; + """) + + self.assertCommentTarget('goog.bar.prop', """ + /** + * Comment targeting goog.bar.prop. + */ + goog.bar.prop; + """) + + self.assertCommentTarget('goog.aaa.bbb', """ + /** + * Comment targeting goog.aaa.bbb. + */ + (goog.aaa.bbb) + """) + + self.assertCommentTarget('theTarget', """ + /** + * Comment targeting symbol preceded by newlines, whitespace, + * and parens -- things we ignore. + */ + (theTarget) + """) + + self.assertCommentTarget(None, """ + /** + * @fileoverview File overview. + */ + (notATarget) + """) + + self.assertCommentTarget(None, """ + /** + * Comment that doesn't find a target. + */ + """) + + self.assertCommentTarget('theTarget.is.split.across.lines', """ + /** + * Comment that addresses a symbol split across lines. + */ + (theTarget.is.split + .across.lines) + """) + + self.assertCommentTarget('theTarget.is.split.across.lines', """ + /** + * Comment that addresses a symbol split across lines. + */ + (theTarget.is.split. + across.lines) + """) + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + _, comments = testutil.ParseFunctionsAndComments(script) + self.assertEquals(1, len(comments)) + return comments[0] + + def assertCommentTarget(self, target, script): + comment = self._ParseComment(script) + self.assertEquals(target, comment.GetTargetIdentifier()) + if __name__ == '__main__': googletest.main() - diff --git a/tools/closure_linter/closure_linter/javascripttokenizer.py b/tools/closure_linter/closure_linter/javascripttokenizer.py index 097d3fd1164628..2ee5b81ee13c65 100755 --- a/tools/closure_linter/closure_linter/javascripttokenizer.py +++ b/tools/closure_linter/closure_linter/javascripttokenizer.py @@ -51,7 +51,7 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): """ # Useful patterns for JavaScript parsing. - IDENTIFIER_CHAR = r'A-Za-z0-9_$.'; + IDENTIFIER_CHAR = r'A-Za-z0-9_$' # Number patterns based on: # http://www.mozilla.org/js/language/js20-2000-07/formal/lexer-grammar.html @@ -92,6 +92,9 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): # like in email addresses in the @author tag. DOC_COMMENT_TEXT = re.compile(r'([^*{}\s]@|[^*{}@]|\*(?!/))+') DOC_COMMENT_NO_SPACES_TEXT = re.compile(r'([^*{}\s]@|[^*{}@\s]|\*(?!/))+') + # Match anything that is allowed in a type definition, except for tokens + # needed to parse it (and the lookahead assertion for "*/"). + DOC_COMMENT_TYPE_TEXT = re.compile(r'([^*|!?=<>(){}:,\s]|\*(?!/))+') # Match the prefix ' * ' that starts every line of jsdoc. Want to include # spaces after the '*', but nothing else that occurs after a '*', and don't @@ -141,13 +144,25 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): # delete, in, instanceof, new, typeof - included as operators. # this - included in identifiers. # null, undefined - not included, should go in some "special constant" list. - KEYWORD_LIST = ['break', 'case', 'catch', 'continue', 'default', 'do', 'else', - 'finally', 'for', 'if', 'return', 'switch', 'throw', 'try', 'var', - 'while', 'with'] - # Match a keyword string followed by a non-identifier character in order to - # not match something like doSomething as do + Something. - KEYWORD = re.compile('(%s)((?=[^%s])|$)' % ( - '|'.join(KEYWORD_LIST), IDENTIFIER_CHAR)) + KEYWORD_LIST = [ + 'break', + 'case', + 'catch', + 'continue', + 'default', + 'do', + 'else', + 'finally', + 'for', + 'if', + 'return', + 'switch', + 'throw', + 'try', + 'var', + 'while', + 'with', + ] # List of regular expressions to match as operators. Some notes: for our # purposes, the comma behaves similarly enough to a normal operator that we @@ -155,19 +170,62 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): # characters - this may not match some very esoteric uses of the in operator. # Operators that are subsets of larger operators must come later in this list # for proper matching, e.g., '>>' must come AFTER '>>>'. - OPERATOR_LIST = [',', r'\+\+', '===', '!==', '>>>=', '>>>', '==', '>=', '<=', - '!=', '<<=', '>>=', '<<', '>>', '>', '<', r'\+=', r'\+', - '--', '\^=', '-=', '-', '/=', '/', r'\*=', r'\*', '%=', '%', - '&&', r'\|\|', '&=', '&', r'\|=', r'\|', '=', '!', ':', '\?', - r'\bdelete\b', r'\bin\b', r'\binstanceof\b', r'\bnew\b', - r'\btypeof\b', r'\bvoid\b'] + OPERATOR_LIST = [ + ',', + r'\+\+', + '===', + '!==', + '>>>=', + '>>>', + '==', + '>=', + '<=', + '!=', + '<<=', + '>>=', + '<<', + '>>', + '=>', + '>', + '<', + r'\+=', + r'\+', + '--', + r'\^=', + '-=', + '-', + '/=', + '/', + r'\*=', + r'\*', + '%=', + '%', + '&&', + r'\|\|', + '&=', + '&', + r'\|=', + r'\|', + '=', + '!', + ':', + r'\?', + r'\^', + r'\bdelete\b', + r'\bin\b', + r'\binstanceof\b', + r'\bnew\b', + r'\btypeof\b', + r'\bvoid\b', + r'\.', + ] OPERATOR = re.compile('|'.join(OPERATOR_LIST)) WHITESPACE = re.compile(r'\s+') SEMICOLON = re.compile(r';') # Technically JavaScript identifiers can't contain '.', but we treat a set of - # nested identifiers as a single identifier. - NESTED_IDENTIFIER = r'[a-zA-Z_$][%s.]*' % IDENTIFIER_CHAR + # nested identifiers as a single identifier, except for trailing dots. + NESTED_IDENTIFIER = r'[a-zA-Z_$]([%s]|\.[a-zA-Z_$])*' % IDENTIFIER_CHAR IDENTIFIER = re.compile(NESTED_IDENTIFIER) SIMPLE_LVALUE = re.compile(r""" @@ -181,13 +239,33 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): # beginning of the line, after whitespace, or after a '{'. The look-behind # check is necessary to not match someone@google.com as a flag. DOC_FLAG = re.compile(r'(^|(?<=\s))@(?P[a-zA-Z]+)') - # To properly parse parameter names, we need to tokenize whitespace into a - # token. - DOC_FLAG_LEX_SPACES = re.compile(r'(^|(?<=\s))@(?P%s)\b' % - '|'.join(['param'])) + # To properly parse parameter names and complex doctypes containing + # whitespace, we need to tokenize whitespace into a token after certain + # doctags. All statetracker.HAS_TYPE that are not listed here must not contain + # any whitespace in their types. + DOC_FLAG_LEX_SPACES = re.compile( + r'(^|(?<=\s))@(?P%s)\b' % + '|'.join([ + 'const', + 'enum', + 'extends', + 'final', + 'implements', + 'param', + 'private', + 'protected', + 'public', + 'return', + 'type', + 'typedef' + ])) DOC_INLINE_FLAG = re.compile(r'(?<={)@(?P[a-zA-Z]+)') + DOC_TYPE_BLOCK_START = re.compile(r'[<(]') + DOC_TYPE_BLOCK_END = re.compile(r'[>)]') + DOC_TYPE_MODIFIERS = re.compile(r'[!?|,:=]') + # Star followed by non-slash, i.e a star that does not end a comment. # This is used for TYPE_GROUP below. SAFE_STAR = r'(\*(?!/))' @@ -201,145 +279,165 @@ class JavaScriptTokenizer(tokenizer.Tokenizer): Matcher(DOC_INLINE_FLAG, Type.DOC_INLINE_FLAG), Matcher(DOC_FLAG_LEX_SPACES, Type.DOC_FLAG, JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE), - Matcher(DOC_FLAG, Type.DOC_FLAG), + + # Encountering a doc flag should leave lex spaces mode. + Matcher(DOC_FLAG, Type.DOC_FLAG, JavaScriptModes.DOC_COMMENT_MODE), # Tokenize braces so we can find types. Matcher(START_BLOCK, Type.DOC_START_BRACE), Matcher(END_BLOCK, Type.DOC_END_BRACE), - Matcher(DOC_PREFIX, Type.DOC_PREFIX, None, True)] - - - # The token matcher groups work as follows: it is an list of Matcher objects. - # The matchers will be tried in this order, and the first to match will be - # returned. Hence the order is important because the matchers that come first - # overrule the matchers that come later. - JAVASCRIPT_MATCHERS = { - # Matchers for basic text mode. - JavaScriptModes.TEXT_MODE: [ - # Check a big group - strings, starting comments, and regexes - all - # of which could be intertwined. 'string with /regex/', - # /regex with 'string'/, /* comment with /regex/ and string */ (and so on) - Matcher(START_DOC_COMMENT, Type.START_DOC_COMMENT, - JavaScriptModes.DOC_COMMENT_MODE), - Matcher(START_BLOCK_COMMENT, Type.START_BLOCK_COMMENT, - JavaScriptModes.BLOCK_COMMENT_MODE), - Matcher(END_OF_LINE_SINGLE_LINE_COMMENT, - Type.START_SINGLE_LINE_COMMENT), - Matcher(START_SINGLE_LINE_COMMENT, Type.START_SINGLE_LINE_COMMENT, - JavaScriptModes.LINE_COMMENT_MODE), - Matcher(SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_START, - JavaScriptModes.SINGLE_QUOTE_STRING_MODE), - Matcher(DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_START, - JavaScriptModes.DOUBLE_QUOTE_STRING_MODE), - Matcher(REGEX, Type.REGEX), - - # Next we check for start blocks appearing outside any of the items above. - Matcher(START_BLOCK, Type.START_BLOCK), - Matcher(END_BLOCK, Type.END_BLOCK), - - # Then we search for function declarations. - Matcher(FUNCTION_DECLARATION, Type.FUNCTION_DECLARATION, - JavaScriptModes.FUNCTION_MODE), - - # Next, we convert non-function related parens to tokens. - Matcher(OPENING_PAREN, Type.START_PAREN), - Matcher(CLOSING_PAREN, Type.END_PAREN), - - # Next, we convert brackets to tokens. - Matcher(OPENING_BRACKET, Type.START_BRACKET), - Matcher(CLOSING_BRACKET, Type.END_BRACKET), - - # Find numbers. This has to happen before operators because scientific - # notation numbers can have + and - in them. - Matcher(NUMBER, Type.NUMBER), - - # Find operators and simple assignments - Matcher(SIMPLE_LVALUE, Type.SIMPLE_LVALUE), - Matcher(OPERATOR, Type.OPERATOR), - - # Find key words and whitespace - Matcher(KEYWORD, Type.KEYWORD), - Matcher(WHITESPACE, Type.WHITESPACE), - - # Find identifiers - Matcher(IDENTIFIER, Type.IDENTIFIER), - - # Finally, we convert semicolons to tokens. - Matcher(SEMICOLON, Type.SEMICOLON)], - - - # Matchers for single quote strings. - JavaScriptModes.SINGLE_QUOTE_STRING_MODE: [ - Matcher(SINGLE_QUOTE_TEXT, Type.STRING_TEXT), - Matcher(SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_END, - JavaScriptModes.TEXT_MODE)], - - - # Matchers for double quote strings. - JavaScriptModes.DOUBLE_QUOTE_STRING_MODE: [ - Matcher(DOUBLE_QUOTE_TEXT, Type.STRING_TEXT), - Matcher(DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_END, - JavaScriptModes.TEXT_MODE)], - - - # Matchers for block comments. - JavaScriptModes.BLOCK_COMMENT_MODE: [ - # First we check for exiting a block comment. - Matcher(END_BLOCK_COMMENT, Type.END_BLOCK_COMMENT, - JavaScriptModes.TEXT_MODE), - - # Match non-comment-ending text.. - Matcher(BLOCK_COMMENT_TEXT, Type.COMMENT)], - - - # Matchers for doc comments. - JavaScriptModes.DOC_COMMENT_MODE: COMMON_DOC_MATCHERS + [ - Matcher(DOC_COMMENT_TEXT, Type.COMMENT)], - JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: COMMON_DOC_MATCHERS + [ - Matcher(WHITESPACE, Type.COMMENT), - Matcher(DOC_COMMENT_NO_SPACES_TEXT, Type.COMMENT)], + # And some more to parse types. + Matcher(DOC_TYPE_BLOCK_START, Type.DOC_TYPE_START_BLOCK), + Matcher(DOC_TYPE_BLOCK_END, Type.DOC_TYPE_END_BLOCK), - # Matchers for single line comments. - JavaScriptModes.LINE_COMMENT_MODE: [ - # We greedy match until the end of the line in line comment mode. - Matcher(ANYTHING, Type.COMMENT, JavaScriptModes.TEXT_MODE)], - - - # Matchers for code after the function keyword. - JavaScriptModes.FUNCTION_MODE: [ - # Must match open paren before anything else and move into parameter mode, - # otherwise everything inside the parameter list is parsed incorrectly. - Matcher(OPENING_PAREN, Type.START_PARAMETERS, - JavaScriptModes.PARAMETER_MODE), - Matcher(WHITESPACE, Type.WHITESPACE), - Matcher(IDENTIFIER, Type.FUNCTION_NAME)], - - - # Matchers for function parameters - JavaScriptModes.PARAMETER_MODE: [ - # When in function parameter mode, a closing paren is treated specially. - # Everything else is treated as lines of parameters. - Matcher(CLOSING_PAREN_WITH_SPACE, Type.END_PARAMETERS, - JavaScriptModes.TEXT_MODE), - Matcher(PARAMETERS, Type.PARAMETERS, JavaScriptModes.PARAMETER_MODE)]} + Matcher(DOC_TYPE_MODIFIERS, Type.DOC_TYPE_MODIFIER), + Matcher(DOC_COMMENT_TYPE_TEXT, Type.COMMENT), + Matcher(DOC_PREFIX, Type.DOC_PREFIX, None, True)] # When text is not matched, it is given this default type based on mode. # If unspecified in this map, the default default is Type.NORMAL. JAVASCRIPT_DEFAULT_TYPES = { - JavaScriptModes.DOC_COMMENT_MODE: Type.COMMENT, - JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: Type.COMMENT + JavaScriptModes.DOC_COMMENT_MODE: Type.COMMENT, + JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: Type.COMMENT } - def __init__(self, parse_js_doc = True): + @classmethod + def BuildMatchers(cls): + """Builds the token matcher group. + + The token matcher groups work as follows: it is a list of Matcher objects. + The matchers will be tried in this order, and the first to match will be + returned. Hence the order is important because the matchers that come first + overrule the matchers that come later. + + Returns: + The completed token matcher group. + """ + # Match a keyword string followed by a non-identifier character in order to + # not match something like doSomething as do + Something. + keyword = re.compile('(%s)((?=[^%s])|$)' % ( + '|'.join(cls.KEYWORD_LIST), cls.IDENTIFIER_CHAR)) + return { + + # Matchers for basic text mode. + JavaScriptModes.TEXT_MODE: [ + # Check a big group - strings, starting comments, and regexes - all + # of which could be intertwined. 'string with /regex/', + # /regex with 'string'/, /* comment with /regex/ and string */ (and + # so on) + Matcher(cls.START_DOC_COMMENT, Type.START_DOC_COMMENT, + JavaScriptModes.DOC_COMMENT_MODE), + Matcher(cls.START_BLOCK_COMMENT, Type.START_BLOCK_COMMENT, + JavaScriptModes.BLOCK_COMMENT_MODE), + Matcher(cls.END_OF_LINE_SINGLE_LINE_COMMENT, + Type.START_SINGLE_LINE_COMMENT), + Matcher(cls.START_SINGLE_LINE_COMMENT, + Type.START_SINGLE_LINE_COMMENT, + JavaScriptModes.LINE_COMMENT_MODE), + Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_START, + JavaScriptModes.SINGLE_QUOTE_STRING_MODE), + Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_START, + JavaScriptModes.DOUBLE_QUOTE_STRING_MODE), + Matcher(cls.REGEX, Type.REGEX), + + # Next we check for start blocks appearing outside any of the items + # above. + Matcher(cls.START_BLOCK, Type.START_BLOCK), + Matcher(cls.END_BLOCK, Type.END_BLOCK), + + # Then we search for function declarations. + Matcher(cls.FUNCTION_DECLARATION, Type.FUNCTION_DECLARATION, + JavaScriptModes.FUNCTION_MODE), + + # Next, we convert non-function related parens to tokens. + Matcher(cls.OPENING_PAREN, Type.START_PAREN), + Matcher(cls.CLOSING_PAREN, Type.END_PAREN), + + # Next, we convert brackets to tokens. + Matcher(cls.OPENING_BRACKET, Type.START_BRACKET), + Matcher(cls.CLOSING_BRACKET, Type.END_BRACKET), + + # Find numbers. This has to happen before operators because + # scientific notation numbers can have + and - in them. + Matcher(cls.NUMBER, Type.NUMBER), + + # Find operators and simple assignments + Matcher(cls.SIMPLE_LVALUE, Type.SIMPLE_LVALUE), + Matcher(cls.OPERATOR, Type.OPERATOR), + + # Find key words and whitespace. + Matcher(keyword, Type.KEYWORD), + Matcher(cls.WHITESPACE, Type.WHITESPACE), + + # Find identifiers. + Matcher(cls.IDENTIFIER, Type.IDENTIFIER), + + # Finally, we convert semicolons to tokens. + Matcher(cls.SEMICOLON, Type.SEMICOLON)], + + # Matchers for single quote strings. + JavaScriptModes.SINGLE_QUOTE_STRING_MODE: [ + Matcher(cls.SINGLE_QUOTE_TEXT, Type.STRING_TEXT), + Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_END, + JavaScriptModes.TEXT_MODE)], + + # Matchers for double quote strings. + JavaScriptModes.DOUBLE_QUOTE_STRING_MODE: [ + Matcher(cls.DOUBLE_QUOTE_TEXT, Type.STRING_TEXT), + Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_END, + JavaScriptModes.TEXT_MODE)], + + # Matchers for block comments. + JavaScriptModes.BLOCK_COMMENT_MODE: [ + # First we check for exiting a block comment. + Matcher(cls.END_BLOCK_COMMENT, Type.END_BLOCK_COMMENT, + JavaScriptModes.TEXT_MODE), + + # Match non-comment-ending text.. + Matcher(cls.BLOCK_COMMENT_TEXT, Type.COMMENT)], + + # Matchers for doc comments. + JavaScriptModes.DOC_COMMENT_MODE: cls.COMMON_DOC_MATCHERS + [ + Matcher(cls.DOC_COMMENT_TEXT, Type.COMMENT)], + + JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: cls.COMMON_DOC_MATCHERS + [ + Matcher(cls.WHITESPACE, Type.COMMENT), + Matcher(cls.DOC_COMMENT_NO_SPACES_TEXT, Type.COMMENT)], + + # Matchers for single line comments. + JavaScriptModes.LINE_COMMENT_MODE: [ + # We greedy match until the end of the line in line comment mode. + Matcher(cls.ANYTHING, Type.COMMENT, JavaScriptModes.TEXT_MODE)], + + # Matchers for code after the function keyword. + JavaScriptModes.FUNCTION_MODE: [ + # Must match open paren before anything else and move into parameter + # mode, otherwise everything inside the parameter list is parsed + # incorrectly. + Matcher(cls.OPENING_PAREN, Type.START_PARAMETERS, + JavaScriptModes.PARAMETER_MODE), + Matcher(cls.WHITESPACE, Type.WHITESPACE), + Matcher(cls.IDENTIFIER, Type.FUNCTION_NAME)], + + # Matchers for function parameters + JavaScriptModes.PARAMETER_MODE: [ + # When in function parameter mode, a closing paren is treated + # specially. Everything else is treated as lines of parameters. + Matcher(cls.CLOSING_PAREN_WITH_SPACE, Type.END_PARAMETERS, + JavaScriptModes.TEXT_MODE), + Matcher(cls.PARAMETERS, Type.PARAMETERS, + JavaScriptModes.PARAMETER_MODE)]} + + def __init__(self, parse_js_doc=True): """Create a tokenizer object. Args: parse_js_doc: Whether to do detailed parsing of javascript doc comments, or simply treat them as normal comments. Defaults to parsing JsDoc. """ - matchers = self.JAVASCRIPT_MATCHERS + matchers = self.BuildMatchers() if not parse_js_doc: # Make a copy so the original doesn't get modified. matchers = copy.deepcopy(matchers) @@ -362,4 +460,4 @@ def _CreateToken(self, string, token_type, line, line_number, values=None): name of the function. """ return javascripttokens.JavaScriptToken(string, token_type, line, - line_number, values) + line_number, values, line_number) diff --git a/tools/closure_linter/closure_linter/javascripttokens.py b/tools/closure_linter/closure_linter/javascripttokens.py index f46d4e17bc8d4d..f5815d2bf86119 100755 --- a/tools/closure_linter/closure_linter/javascripttokens.py +++ b/tools/closure_linter/closure_linter/javascripttokens.py @@ -53,6 +53,9 @@ class JavaScriptTokenType(tokens.TokenType): DOC_START_BRACE = 'doc {' DOC_END_BRACE = 'doc }' DOC_PREFIX = 'comment prefix: * ' + DOC_TYPE_START_BLOCK = 'Type <' + DOC_TYPE_END_BLOCK = 'Type >' + DOC_TYPE_MODIFIER = 'modifier' SIMPLE_LVALUE = 'lvalue=' KEYWORD = 'keyword' OPERATOR = 'operator' @@ -62,14 +65,17 @@ class JavaScriptTokenType(tokens.TokenType): SINGLE_QUOTE_STRING_START, SINGLE_QUOTE_STRING_END, DOUBLE_QUOTE_STRING_START, DOUBLE_QUOTE_STRING_END, STRING_TEXT]) - COMMENT_TYPES = frozenset([START_SINGLE_LINE_COMMENT, COMMENT, + COMMENT_TYPES = frozenset([ + START_SINGLE_LINE_COMMENT, COMMENT, START_BLOCK_COMMENT, START_DOC_COMMENT, END_BLOCK_COMMENT, END_DOC_COMMENT, DOC_START_BRACE, DOC_END_BRACE, - DOC_FLAG, DOC_INLINE_FLAG, DOC_PREFIX]) + DOC_FLAG, DOC_INLINE_FLAG, DOC_PREFIX, + DOC_TYPE_START_BLOCK, DOC_TYPE_END_BLOCK, DOC_TYPE_MODIFIER]) FLAG_DESCRIPTION_TYPES = frozenset([ - DOC_INLINE_FLAG, COMMENT, DOC_START_BRACE, DOC_END_BRACE]) + DOC_INLINE_FLAG, COMMENT, DOC_START_BRACE, DOC_END_BRACE, + DOC_TYPE_START_BLOCK, DOC_TYPE_END_BLOCK, DOC_TYPE_MODIFIER]) FLAG_ENDING_TYPES = frozenset([DOC_FLAG, END_DOC_COMMENT]) diff --git a/tools/closure_linter/closure_linter/not_strict_test.py b/tools/closure_linter/closure_linter/not_strict_test.py new file mode 100755 index 00000000000000..c92c13ee031e1b --- /dev/null +++ b/tools/closure_linter/closure_linter/not_strict_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for gjslint --nostrict. + +Tests errors that can be thrown by gjslint when not in strict mode. +""" + + + +import os +import sys +import unittest + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import filetestcase + +_RESOURCE_PREFIX = 'closure_linter/testdata' + +flags.FLAGS.strict = False +flags.FLAGS.custom_jsdoc_tags = ('customtag', 'requires') +flags.FLAGS.closurized_namespaces = ('goog', 'dummy') +flags.FLAGS.limited_doc_files = ('externs.js', 'dummy.js', + 'limited_doc_checks.js') + + +# List of files under testdata to test. +# We need to list files explicitly since pyglib can't list directories. +_TEST_FILES = [ + 'not_strict.js' + ] + + +class GJsLintTestSuite(unittest.TestSuite): + """Test suite to run a GJsLintTest for each of several files. + + If sys.argv[1:] is non-empty, it is interpreted as a list of filenames in + testdata to test. Otherwise, _TEST_FILES is used. + """ + + def __init__(self, tests=()): + unittest.TestSuite.__init__(self, tests) + + argv = sys.argv and sys.argv[1:] or [] + if argv: + test_files = argv + else: + test_files = _TEST_FILES + for test_file in test_files: + resource_path = os.path.join(_RESOURCE_PREFIX, test_file) + self.addTest(filetestcase.AnnotatedFileTestCase(resource_path, + runner.Run, + errors.ByName)) + +if __name__ == '__main__': + # Don't let main parse args; it happens in the TestSuite. + googletest.main(argv=sys.argv[0:1], defaultTest='GJsLintTestSuite') diff --git a/tools/closure_linter/closure_linter/requireprovidesorter.py b/tools/closure_linter/closure_linter/requireprovidesorter.py new file mode 100755 index 00000000000000..e7e08a13c2946f --- /dev/null +++ b/tools/closure_linter/closure_linter/requireprovidesorter.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python +# +# Copyright 2011 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Contains logic for sorting goog.provide and goog.require statements. + +Closurized JavaScript files use goog.provide and goog.require statements at the +top of the file to manage dependencies. These statements should be sorted +alphabetically, however, it is common for them to be accompanied by inline +comments or suppression annotations. In order to sort these statements without +disrupting their comments and annotations, the association between statements +and comments/annotations must be maintained while sorting. + + RequireProvideSorter: Handles checking/fixing of provide/require statements. +""" + + + +from closure_linter import javascripttokens +from closure_linter import tokenutil + +# Shorthand +Type = javascripttokens.JavaScriptTokenType + + +class RequireProvideSorter(object): + """Checks for and fixes alphabetization of provide and require statements. + + When alphabetizing, comments on the same line or comments directly above a + goog.provide or goog.require statement are associated with that statement and + stay with the statement as it gets sorted. + """ + + def CheckProvides(self, token): + """Checks alphabetization of goog.provide statements. + + Iterates over tokens in given token stream, identifies goog.provide tokens, + and checks that they occur in alphabetical order by the object being + provided. + + Args: + token: A token in the token stream before any goog.provide tokens. + + Returns: + The first provide token in the token stream. + + None is returned if all goog.provide statements are already sorted. + """ + provide_tokens = self._GetRequireOrProvideTokens(token, 'goog.provide') + provide_strings = self._GetRequireOrProvideTokenStrings(provide_tokens) + sorted_provide_strings = sorted(provide_strings) + if provide_strings != sorted_provide_strings: + return provide_tokens[0] + return None + + def CheckRequires(self, token): + """Checks alphabetization of goog.require statements. + + Iterates over tokens in given token stream, identifies goog.require tokens, + and checks that they occur in alphabetical order by the dependency being + required. + + Args: + token: A token in the token stream before any goog.require tokens. + + Returns: + The first require token in the token stream. + + None is returned if all goog.require statements are already sorted. + """ + require_tokens = self._GetRequireOrProvideTokens(token, 'goog.require') + require_strings = self._GetRequireOrProvideTokenStrings(require_tokens) + sorted_require_strings = sorted(require_strings) + if require_strings != sorted_require_strings: + return require_tokens[0] + return None + + def FixProvides(self, token): + """Sorts goog.provide statements in the given token stream alphabetically. + + Args: + token: The first token in the token stream. + """ + self._FixProvidesOrRequires( + self._GetRequireOrProvideTokens(token, 'goog.provide')) + + def FixRequires(self, token): + """Sorts goog.require statements in the given token stream alphabetically. + + Args: + token: The first token in the token stream. + """ + self._FixProvidesOrRequires( + self._GetRequireOrProvideTokens(token, 'goog.require')) + + def _FixProvidesOrRequires(self, tokens): + """Sorts goog.provide or goog.require statements. + + Args: + tokens: A list of goog.provide or goog.require tokens in the order they + appear in the token stream. i.e. the first token in this list must + be the first goog.provide or goog.require token. + """ + strings = self._GetRequireOrProvideTokenStrings(tokens) + sorted_strings = sorted(strings) + + # Make a separate pass to remove any blank lines between goog.require/ + # goog.provide tokens. + first_token = tokens[0] + last_token = tokens[-1] + i = last_token + while i != first_token and i is not None: + if i.type is Type.BLANK_LINE: + tokenutil.DeleteToken(i) + i = i.previous + + # A map from required/provided object name to tokens that make up the line + # it was on, including any comments immediately before it or after it on the + # same line. + tokens_map = self._GetTokensMap(tokens) + + # Iterate over the map removing all tokens. + for name in tokens_map: + tokens_to_delete = tokens_map[name] + for i in tokens_to_delete: + tokenutil.DeleteToken(i) + + # Save token to rest of file. Sorted token will be inserted before this. + rest_of_file = tokens_map[strings[-1]][-1].next + + # Re-add all tokens in the map in alphabetical order. + insert_after = tokens[0].previous + for string in sorted_strings: + for i in tokens_map[string]: + if rest_of_file: + tokenutil.InsertTokenBefore(i, rest_of_file) + else: + tokenutil.InsertTokenAfter(i, insert_after) + insert_after = i + + def _GetRequireOrProvideTokens(self, token, token_string): + """Gets all goog.provide or goog.require tokens in the given token stream. + + Args: + token: The first token in the token stream. + token_string: One of 'goog.provide' or 'goog.require' to indicate which + tokens to find. + + Returns: + A list of goog.provide or goog.require tokens in the order they appear in + the token stream. + """ + tokens = [] + while token: + if token.type == Type.IDENTIFIER: + if token.string == token_string: + tokens.append(token) + elif token.string not in [ + 'goog.provide', 'goog.require', 'goog.setTestOnly']: + # These 3 identifiers are at the top of the file. So if any other + # identifier is encountered, return. + # TODO(user): Once it's decided what ordering goog.require + # should use, add 'goog.module' to the list above and implement the + # decision. + break + token = token.next + + return tokens + + def _GetRequireOrProvideTokenStrings(self, tokens): + """Gets a list of strings corresponding to the given list of tokens. + + The string will be the next string in the token stream after each token in + tokens. This is used to find the object being provided/required by a given + goog.provide or goog.require token. + + Args: + tokens: A list of goog.provide or goog.require tokens. + + Returns: + A list of object names that are being provided or required by the given + list of tokens. For example: + + ['object.a', 'object.c', 'object.b'] + """ + token_strings = [] + for token in tokens: + if not token.is_deleted: + name = tokenutil.GetStringAfterToken(token) + token_strings.append(name) + return token_strings + + def _GetTokensMap(self, tokens): + """Gets a map from object name to tokens associated with that object. + + Starting from the goog.provide/goog.require token, searches backwards in the + token stream for any lines that start with a comment. These lines are + associated with the goog.provide/goog.require token. Also associates any + tokens on the same line as the goog.provide/goog.require token with that + token. + + Args: + tokens: A list of goog.provide or goog.require tokens. + + Returns: + A dictionary that maps object names to the tokens associated with the + goog.provide or goog.require of that object name. For example: + + { + 'object.a': [JavaScriptToken, JavaScriptToken, ...], + 'object.b': [...] + } + + The list of tokens includes any comment lines above the goog.provide or + goog.require statement and everything after the statement on the same + line. For example, all of the following would be associated with + 'object.a': + + /** @suppress {extraRequire} */ + goog.require('object.a'); // Some comment. + """ + tokens_map = {} + for token in tokens: + object_name = tokenutil.GetStringAfterToken(token) + # If the previous line starts with a comment, presume that the comment + # relates to the goog.require or goog.provide and keep them together when + # sorting. + first_token = token + previous_first_token = tokenutil.GetFirstTokenInPreviousLine(first_token) + while (previous_first_token and + previous_first_token.IsAnyType(Type.COMMENT_TYPES)): + first_token = previous_first_token + previous_first_token = tokenutil.GetFirstTokenInPreviousLine( + first_token) + + # Find the last token on the line. + last_token = tokenutil.GetLastTokenInSameLine(token) + + all_tokens = self._GetTokenList(first_token, last_token) + tokens_map[object_name] = all_tokens + return tokens_map + + def _GetTokenList(self, first_token, last_token): + """Gets a list of all tokens from first_token to last_token, inclusive. + + Args: + first_token: The first token to get. + last_token: The last token to get. + + Returns: + A list of all tokens between first_token and last_token, including both + first_token and last_token. + + Raises: + Exception: If the token stream ends before last_token is reached. + """ + token_list = [] + token = first_token + while token != last_token: + if not token: + raise Exception('ran out of tokens') + token_list.append(token) + token = token.next + token_list.append(last_token) + + return token_list + + def GetFixedRequireString(self, token): + """Get fixed/sorted order of goog.require statements. + + Args: + token: The first token in the token stream. + + Returns: + A string for correct sorted order of goog.require. + """ + return self._GetFixedRequireOrProvideString( + self._GetRequireOrProvideTokens(token, 'goog.require')) + + def GetFixedProvideString(self, token): + """Get fixed/sorted order of goog.provide statements. + + Args: + token: The first token in the token stream. + + Returns: + A string for correct sorted order of goog.provide. + """ + return self._GetFixedRequireOrProvideString( + self._GetRequireOrProvideTokens(token, 'goog.provide')) + + def _GetFixedRequireOrProvideString(self, tokens): + """Sorts goog.provide or goog.require statements. + + Args: + tokens: A list of goog.provide or goog.require tokens in the order they + appear in the token stream. i.e. the first token in this list must + be the first goog.provide or goog.require token. + + Returns: + A string for sorted goog.require or goog.provide statements + """ + + # A map from required/provided object name to tokens that make up the line + # it was on, including any comments immediately before it or after it on the + # same line. + tokens_map = self._GetTokensMap(tokens) + sorted_strings = sorted(tokens_map.keys()) + + new_order = '' + for string in sorted_strings: + for i in tokens_map[string]: + new_order += i.string + if i.IsLastInLine(): + new_order += '\n' + + return new_order diff --git a/tools/closure_linter/closure_linter/requireprovidesorter_test.py b/tools/closure_linter/closure_linter/requireprovidesorter_test.py new file mode 100644 index 00000000000000..fecb6d04dad9ce --- /dev/null +++ b/tools/closure_linter/closure_linter/requireprovidesorter_test.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for RequireProvideSorter.""" + + + +import unittest as googletest +from closure_linter import javascripttokens +from closure_linter import requireprovidesorter +from closure_linter import testutil + +# pylint: disable=g-bad-name +TokenType = javascripttokens.JavaScriptTokenType + + +class RequireProvideSorterTest(googletest.TestCase): + """Tests for RequireProvideSorter.""" + + def testGetFixedProvideString(self): + """Tests that fixed string constains proper comments also.""" + input_lines = [ + 'goog.provide(\'package.xyz\');', + '/** @suppress {extraprovide} **/', + 'goog.provide(\'package.abcd\');' + ] + + expected_lines = [ + '/** @suppress {extraprovide} **/', + 'goog.provide(\'package.abcd\');', + 'goog.provide(\'package.xyz\');' + ] + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + fixed_provide_string = sorter.GetFixedProvideString(token) + + self.assertEquals(expected_lines, fixed_provide_string.splitlines()) + + def testGetFixedRequireString(self): + """Tests that fixed string constains proper comments also.""" + input_lines = [ + 'goog.require(\'package.xyz\');', + '/** This is needed for scope. **/', + 'goog.require(\'package.abcd\');' + ] + + expected_lines = [ + '/** This is needed for scope. **/', + 'goog.require(\'package.abcd\');', + 'goog.require(\'package.xyz\');' + ] + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + fixed_require_string = sorter.GetFixedRequireString(token) + + self.assertEquals(expected_lines, fixed_require_string.splitlines()) + + def testFixRequires_removeBlankLines(self): + """Tests that blank lines are omitted in sorted goog.require statements.""" + input_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassB\');', + '', + 'goog.require(\'package.subpackage.ClassA\');' + ] + expected_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassA\');', + 'goog.require(\'package.subpackage.ClassB\');' + ] + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(token) + + self.assertEquals(expected_lines, self._GetLines(token)) + + def fixRequiresTest_withTestOnly(self, position): + """Regression-tests sorting even with a goog.setTestOnly statement. + + Args: + position: The position in the list where to insert the goog.setTestOnly + statement. Will be used to test all possible combinations for + this test. + """ + input_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassB\');', + 'goog.require(\'package.subpackage.ClassA\');' + ] + expected_lines = [ + 'goog.provide(\'package.subpackage.Whatever\');', + '', + 'goog.require(\'package.subpackage.ClassA\');', + 'goog.require(\'package.subpackage.ClassB\');' + ] + input_lines.insert(position, 'goog.setTestOnly();') + expected_lines.insert(position, 'goog.setTestOnly();') + + token = testutil.TokenizeSourceAndRunEcmaPass(input_lines) + + sorter = requireprovidesorter.RequireProvideSorter() + sorter.FixRequires(token) + + self.assertEquals(expected_lines, self._GetLines(token)) + + def testFixRequires_withTestOnly(self): + """Regression-tests sorting even after a goog.setTestOnly statement.""" + + # goog.setTestOnly at first line. + self.fixRequiresTest_withTestOnly(position=0) + + # goog.setTestOnly after goog.provide. + self.fixRequiresTest_withTestOnly(position=1) + + # goog.setTestOnly before goog.require. + self.fixRequiresTest_withTestOnly(position=2) + + # goog.setTestOnly after goog.require. + self.fixRequiresTest_withTestOnly(position=4) + + def _GetLines(self, token): + """Returns an array of lines based on the specified token stream.""" + lines = [] + line = '' + while token: + line += token.string + if token.IsLastInLine(): + lines.append(line) + line = '' + token = token.next + return lines + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/runner.py b/tools/closure_linter/closure_linter/runner.py new file mode 100644 index 00000000000000..04e7fa4ac87a1c --- /dev/null +++ b/tools/closure_linter/closure_linter/runner.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Main lint function. Tokenizes file, runs passes, and feeds to checker.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = 'nnaze@google.com (Nathan Naze)' + +import traceback + +import gflags as flags + +from closure_linter import checker +from closure_linter import ecmalintrules +from closure_linter import ecmametadatapass +from closure_linter import error_check +from closure_linter import errors +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokenizer + +from closure_linter.common import error +from closure_linter.common import htmlutil +from closure_linter.common import tokens + +flags.DEFINE_list('limited_doc_files', ['dummy.js', 'externs.js'], + 'List of files with relaxed documentation checks. Will not ' + 'report errors for missing documentation, some missing ' + 'descriptions, or methods whose @return tags don\'t have a ' + 'matching return statement.') +flags.DEFINE_boolean('error_trace', False, + 'Whether to show error exceptions.') +flags.ADOPT_module_key_flags(checker) +flags.ADOPT_module_key_flags(ecmalintrules) +flags.ADOPT_module_key_flags(error_check) + + +def _GetLastNonWhiteSpaceToken(start_token): + """Get the last non-whitespace token in a token stream.""" + ret_token = None + + whitespace_tokens = frozenset([ + tokens.TokenType.WHITESPACE, tokens.TokenType.BLANK_LINE]) + for t in start_token: + if t.type not in whitespace_tokens: + ret_token = t + + return ret_token + + +def _IsHtml(filename): + return filename.endswith('.html') or filename.endswith('.htm') + + +def _Tokenize(fileobj): + """Tokenize a file. + + Args: + fileobj: file-like object (or iterable lines) with the source. + + Returns: + The first token in the token stream and the ending mode of the tokenizer. + """ + tokenizer = javascripttokenizer.JavaScriptTokenizer() + start_token = tokenizer.TokenizeFile(fileobj) + return start_token, tokenizer.mode + + +def _IsLimitedDocCheck(filename, limited_doc_files): + """Whether this this a limited-doc file. + + Args: + filename: The filename. + limited_doc_files: Iterable of strings. Suffixes of filenames that should + be limited doc check. + + Returns: + Whether the file should be limited check. + """ + for limited_doc_filename in limited_doc_files: + if filename.endswith(limited_doc_filename): + return True + return False + + +def Run(filename, error_handler, source=None): + """Tokenize, run passes, and check the given file. + + Args: + filename: The path of the file to check + error_handler: The error handler to report errors to. + source: A file-like object with the file source. If omitted, the file will + be read from the filename path. + """ + if not source: + try: + source = open(filename) + except IOError: + error_handler.HandleFile(filename, None) + error_handler.HandleError( + error.Error(errors.FILE_NOT_FOUND, 'File not found')) + error_handler.FinishFile() + return + + if _IsHtml(filename): + source_file = htmlutil.GetScriptLines(source) + else: + source_file = source + + token, tokenizer_mode = _Tokenize(source_file) + + error_handler.HandleFile(filename, token) + + # If we did not end in the basic mode, this a failed parse. + if tokenizer_mode is not javascripttokenizer.JavaScriptModes.TEXT_MODE: + error_handler.HandleError( + error.Error(errors.FILE_IN_BLOCK, + 'File ended in mode "%s".' % tokenizer_mode, + _GetLastNonWhiteSpaceToken(token))) + + # Run the ECMA pass + error_token = None + + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + error_token = RunMetaDataPass(token, ecma_pass, error_handler, filename) + + is_limited_doc_check = ( + _IsLimitedDocCheck(filename, flags.FLAGS.limited_doc_files)) + + _RunChecker(token, error_handler, + is_limited_doc_check, + is_html=_IsHtml(filename), + stop_token=error_token) + + error_handler.FinishFile() + + +def RunMetaDataPass(start_token, metadata_pass, error_handler, filename=''): + """Run a metadata pass over a token stream. + + Args: + start_token: The first token in a token stream. + metadata_pass: Metadata pass to run. + error_handler: The error handler to report errors to. + filename: Filename of the source. + + Returns: + The token where the error occurred (if any). + """ + + try: + metadata_pass.Process(start_token) + except ecmametadatapass.ParseError, parse_err: + if flags.FLAGS.error_trace: + traceback.print_exc() + error_token = parse_err.token + error_msg = str(parse_err) + error_handler.HandleError( + error.Error(errors.FILE_DOES_NOT_PARSE, + ('Error parsing file at token "%s". Unable to ' + 'check the rest of file.' + '\nError "%s"' % (error_token, error_msg)), error_token)) + return error_token + except Exception: # pylint: disable=broad-except + traceback.print_exc() + error_handler.HandleError( + error.Error( + errors.FILE_DOES_NOT_PARSE, + 'Internal error in %s' % filename)) + + +def _RunChecker(start_token, error_handler, + limited_doc_checks, is_html, + stop_token=None): + + state_tracker = javascriptstatetracker.JavaScriptStateTracker() + + style_checker = checker.JavaScriptStyleChecker( + state_tracker=state_tracker, + error_handler=error_handler) + + style_checker.Check(start_token, + is_html=is_html, + limited_doc_checks=limited_doc_checks, + stop_token=stop_token) diff --git a/tools/closure_linter/closure_linter/runner_test.py b/tools/closure_linter/closure_linter/runner_test.py new file mode 100644 index 00000000000000..da5857d30950f6 --- /dev/null +++ b/tools/closure_linter/closure_linter/runner_test.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# +# Copyright 2008 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the runner module.""" + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import StringIO + + +import mox + + +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import error +from closure_linter.common import errorhandler +from closure_linter.common import tokens + + +class LimitedDocTest(googletest.TestCase): + + def testIsLimitedDocCheck(self): + self.assertTrue(runner._IsLimitedDocCheck('foo_test.js', ['_test.js'])) + self.assertFalse(runner._IsLimitedDocCheck('foo_bar.js', ['_test.js'])) + + self.assertTrue(runner._IsLimitedDocCheck( + 'foo_moo.js', ['moo.js', 'quack.js'])) + self.assertFalse(runner._IsLimitedDocCheck( + 'foo_moo.js', ['woof.js', 'quack.js'])) + + +class RunnerTest(googletest.TestCase): + + def setUp(self): + self.mox = mox.Mox() + + def testRunOnMissingFile(self): + mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) + + def ValidateError(err): + return (isinstance(err, error.Error) and + err.code is errors.FILE_NOT_FOUND and + err.token is None) + + mock_error_handler.HandleFile('does_not_exist.js', None) + mock_error_handler.HandleError(mox.Func(ValidateError)) + mock_error_handler.FinishFile() + + self.mox.ReplayAll() + + runner.Run('does_not_exist.js', mock_error_handler) + + self.mox.VerifyAll() + + def testBadTokenization(self): + mock_error_handler = self.mox.CreateMock(errorhandler.ErrorHandler) + + def ValidateError(err): + return (isinstance(err, error.Error) and + err.code is errors.FILE_IN_BLOCK and + err.token.string == '}') + + mock_error_handler.HandleFile('foo.js', mox.IsA(tokens.Token)) + mock_error_handler.HandleError(mox.Func(ValidateError)) + mock_error_handler.HandleError(mox.IsA(error.Error)) + mock_error_handler.FinishFile() + + self.mox.ReplayAll() + + source = StringIO.StringIO(_BAD_TOKENIZATION_SCRIPT) + runner.Run('foo.js', mock_error_handler, source) + + self.mox.VerifyAll() + + +_BAD_TOKENIZATION_SCRIPT = """ +function foo () { + var a = 3; + var b = 2; + return b + a; /* Comment not closed +} +""" + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/scopeutil.py b/tools/closure_linter/closure_linter/scopeutil.py new file mode 100644 index 00000000000000..a7ca9b630a470c --- /dev/null +++ b/tools/closure_linter/closure_linter/scopeutil.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tools to match goog.scope alias statements.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import itertools + +from closure_linter import ecmametadatapass +from closure_linter import tokenutil +from closure_linter.javascripttokens import JavaScriptTokenType + + + +def IsGoogScopeBlock(context): + """Whether the given context is a goog.scope block. + + This function only checks that the block is a function block inside + a goog.scope() call. + + TODO(nnaze): Implement goog.scope checks that verify the call is + in the root context and contains only a single function literal. + + Args: + context: An EcmaContext of type block. + + Returns: + Whether the context is a goog.scope block. + """ + + if context.type != ecmametadatapass.EcmaContext.BLOCK: + return False + + if not _IsFunctionLiteralBlock(context): + return False + + # Check that this function is contained by a group + # of form "goog.scope(...)". + parent = context.parent + if parent and parent.type is ecmametadatapass.EcmaContext.GROUP: + + last_code_token = parent.start_token.metadata.last_code + + if (last_code_token and + last_code_token.type is JavaScriptTokenType.IDENTIFIER and + last_code_token.string == 'goog.scope'): + return True + + return False + + +def _IsFunctionLiteralBlock(block_context): + """Check if a context is a function literal block (without parameters). + + Example function literal block: 'function() {}' + + Args: + block_context: An EcmaContext of type block. + + Returns: + Whether this context is a function literal block. + """ + + previous_code_tokens_iter = itertools.ifilter( + lambda token: token not in JavaScriptTokenType.NON_CODE_TYPES, + reversed(block_context.start_token)) + + # Ignore the current token + next(previous_code_tokens_iter, None) + + # Grab the previous three tokens and put them in correct order. + previous_code_tokens = list(itertools.islice(previous_code_tokens_iter, 3)) + previous_code_tokens.reverse() + + # There aren't three previous tokens. + if len(previous_code_tokens) is not 3: + return False + + # Check that the previous three code tokens are "function ()" + previous_code_token_types = [token.type for token in previous_code_tokens] + if (previous_code_token_types == [ + JavaScriptTokenType.FUNCTION_DECLARATION, + JavaScriptTokenType.START_PARAMETERS, + JavaScriptTokenType.END_PARAMETERS]): + return True + + return False + + +def IsInClosurizedNamespace(symbol, closurized_namespaces): + """Match a goog.scope alias. + + Args: + symbol: An identifier like 'goog.events.Event'. + closurized_namespaces: Iterable of valid Closurized namespaces (strings). + + Returns: + True if symbol is an identifier in a Closurized namespace, otherwise False. + """ + for ns in closurized_namespaces: + if symbol.startswith(ns + '.'): + return True + + return False + + +def _GetVarAssignmentTokens(context): + """Returns the tokens from context if it is a var assignment. + + Args: + context: An EcmaContext. + + Returns: + If a var assignment, the tokens contained within it w/o the trailing + semicolon. + """ + if context.type != ecmametadatapass.EcmaContext.VAR: + return + + # Get the tokens in this statement. + if context.start_token and context.end_token: + statement_tokens = tokenutil.GetTokenRange(context.start_token, + context.end_token) + else: + return + + # And now just those tokens that are actually code. + is_non_code_type = lambda t: t.type not in JavaScriptTokenType.NON_CODE_TYPES + code_tokens = filter(is_non_code_type, statement_tokens) + + # Pop off the semicolon if present. + if code_tokens and code_tokens[-1].IsType(JavaScriptTokenType.SEMICOLON): + code_tokens.pop() + + if len(code_tokens) < 4: + return + + if (code_tokens[0].IsKeyword('var') and + code_tokens[1].IsType(JavaScriptTokenType.SIMPLE_LVALUE) and + code_tokens[2].IsOperator('=')): + return code_tokens + + +def MatchAlias(context): + """Match an alias statement (some identifier assigned to a variable). + + Example alias: var MyClass = proj.longNamespace.MyClass. + + Args: + context: An EcmaContext of type EcmaContext.VAR. + + Returns: + If a valid alias, returns a tuple of alias and symbol, otherwise None. + """ + code_tokens = _GetVarAssignmentTokens(context) + if code_tokens is None: + return + + if all(tokenutil.IsIdentifierOrDot(t) for t in code_tokens[3:]): + # var Foo = bar.Foo; + alias, symbol = code_tokens[1], code_tokens[3] + # Mark both tokens as an alias definition to not count them as usages. + alias.metadata.is_alias_definition = True + symbol.metadata.is_alias_definition = True + return alias.string, tokenutil.GetIdentifierForToken(symbol) + + +def MatchModuleAlias(context): + """Match an alias statement in a goog.module style import. + + Example alias: var MyClass = goog.require('proj.longNamespace.MyClass'). + + Args: + context: An EcmaContext. + + Returns: + If a valid alias, returns a tuple of alias and symbol, otherwise None. + """ + code_tokens = _GetVarAssignmentTokens(context) + if code_tokens is None: + return + + if(code_tokens[3].IsType(JavaScriptTokenType.IDENTIFIER) and + code_tokens[3].string == 'goog.require'): + # var Foo = goog.require('bar.Foo'); + alias = code_tokens[1] + symbol = tokenutil.GetStringAfterToken(code_tokens[3]) + if symbol: + alias.metadata.is_alias_definition = True + return alias.string, symbol diff --git a/tools/closure_linter/closure_linter/scopeutil_test.py b/tools/closure_linter/closure_linter/scopeutil_test.py new file mode 100644 index 00000000000000..722a95390022de --- /dev/null +++ b/tools/closure_linter/closure_linter/scopeutil_test.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the scopeutil module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + + +import unittest as googletest + +from closure_linter import ecmametadatapass +from closure_linter import scopeutil +from closure_linter import testutil + + +def _FindContexts(start_token): + """Depth first search of all contexts referenced by a token stream. + + Includes contexts' parents, which might not be directly referenced + by any token in the stream. + + Args: + start_token: First token in the token stream. + + Yields: + All contexts referenced by this token stream. + """ + + seen_contexts = set() + + # For each token, yield the context if we haven't seen it before. + for token in start_token: + + token_context = token.metadata.context + contexts = [token_context] + + # Also grab all the context's ancestors. + parent = token_context.parent + while parent: + contexts.append(parent) + parent = parent.parent + + # Yield each of these contexts if we've not seen them. + for context in contexts: + if context not in seen_contexts: + yield context + + seen_contexts.add(context) + + +def _FindFirstContextOfType(token, context_type): + """Returns the first statement context.""" + for context in _FindContexts(token): + if context.type == context_type: + return context + + +def _ParseAssignment(script): + start_token = testutil.TokenizeSourceAndRunEcmaPass(script) + statement = _FindFirstContextOfType( + start_token, ecmametadatapass.EcmaContext.VAR) + return statement + + +class StatementTest(googletest.TestCase): + + def assertAlias(self, expected_match, script): + statement = _ParseAssignment(script) + match = scopeutil.MatchAlias(statement) + self.assertEquals(expected_match, match) + + def assertModuleAlias(self, expected_match, script): + statement = _ParseAssignment(script) + match = scopeutil.MatchModuleAlias(statement) + self.assertEquals(expected_match, match) + + def testSimpleAliases(self): + self.assertAlias( + ('foo', 'goog.foo'), + 'var foo = goog.foo;') + + self.assertAlias( + ('foo', 'goog.foo'), + 'var foo = goog.foo') # No semicolon + + def testAliasWithComment(self): + self.assertAlias( + ('Component', 'goog.ui.Component'), + 'var Component = /* comment */ goog.ui.Component;') + + def testMultilineAlias(self): + self.assertAlias( + ('Component', 'goog.ui.Component'), + 'var Component = \n goog.ui.\n Component;') + + def testNonSymbolAliasVarStatements(self): + self.assertAlias(None, 'var foo = 3;') + self.assertAlias(None, 'var foo = function() {};') + self.assertAlias(None, 'var foo = bar ? baz : qux;') + + def testModuleAlias(self): + self.assertModuleAlias( + ('foo', 'goog.foo'), + 'var foo = goog.require("goog.foo");') + self.assertModuleAlias( + None, + 'var foo = goog.require(notastring);') + + +class ScopeBlockTest(googletest.TestCase): + + @staticmethod + def _GetBlocks(source): + start_token = testutil.TokenizeSourceAndRunEcmaPass(source) + for context in _FindContexts(start_token): + if context.type is ecmametadatapass.EcmaContext.BLOCK: + yield context + + def assertNoBlocks(self, script): + blocks = list(self._GetBlocks(script)) + self.assertEquals([], blocks) + + def testNotBlocks(self): + # Ensure these are not considered blocks. + self.assertNoBlocks('goog.scope(if{});') + self.assertNoBlocks('goog.scope(for{});') + self.assertNoBlocks('goog.scope(switch{});') + self.assertNoBlocks('goog.scope(function foo{});') + + def testNonScopeBlocks(self): + + blocks = list(self._GetBlocks('goog.scope(try{});')) + self.assertEquals(1, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(function(a,b){});')) + self.assertEquals(1, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(try{} catch(){});')) + # Two blocks: try and catch. + self.assertEquals(2, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + blocks = list(self._GetBlocks('goog.scope(try{} catch(){} finally {});')) + self.assertEquals(3, len(blocks)) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + self.assertFalse(scopeutil.IsGoogScopeBlock(blocks.pop())) + + +class AliasTest(googletest.TestCase): + + def setUp(self): + self.start_token = testutil.TokenizeSourceAndRunEcmaPass(_TEST_SCRIPT) + + def testMatchAliasStatement(self): + matches = set() + for context in _FindContexts(self.start_token): + match = scopeutil.MatchAlias(context) + if match: + matches.add(match) + + self.assertEquals( + set([('bar', 'baz'), + ('foo', 'this.foo_'), + ('Component', 'goog.ui.Component'), + ('MyClass', 'myproject.foo.MyClass'), + ('NonClosurizedClass', 'aaa.bbb.NonClosurizedClass')]), + matches) + + def testMatchAliasStatement_withClosurizedNamespaces(self): + + closurized_namepaces = frozenset(['goog', 'myproject']) + + matches = set() + for context in _FindContexts(self.start_token): + match = scopeutil.MatchAlias(context) + if match: + unused_alias, symbol = match + if scopeutil.IsInClosurizedNamespace(symbol, closurized_namepaces): + matches.add(match) + + self.assertEquals( + set([('MyClass', 'myproject.foo.MyClass'), + ('Component', 'goog.ui.Component')]), + matches) + +_TEST_SCRIPT = """ +goog.scope(function() { + var Component = goog.ui.Component; // scope alias + var MyClass = myproject.foo.MyClass; // scope alias + + // Scope alias of non-Closurized namespace. + var NonClosurizedClass = aaa.bbb.NonClosurizedClass; + + var foo = this.foo_; // non-scope object property alias + var bar = baz; // variable alias + + var component = new Component(); +}); + +""" + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/statetracker.py b/tools/closure_linter/closure_linter/statetracker.py old mode 100755 new mode 100644 index 5630c17bd84286..52e363972f200a --- a/tools/closure_linter/closure_linter/statetracker.py +++ b/tools/closure_linter/closure_linter/statetracker.py @@ -24,6 +24,7 @@ from closure_linter import javascripttokenizer from closure_linter import javascripttokens from closure_linter import tokenutil +from closure_linter import typeannotation # Shorthand Type = javascripttokens.JavaScriptTokenType @@ -39,7 +40,8 @@ class DocFlag(object): including braces. type_end_token: The last token specifying the flag type, including braces. - type: The type spec. + type: The type spec string. + jstype: The type spec, a TypeAnnotation instance. name_token: The token specifying the flag name. name: The flag name description_start_token: The first token in the description. @@ -53,34 +55,47 @@ class DocFlag(object): STANDARD_DOC = frozenset([ 'author', 'bug', + 'classTemplate', + 'consistentIdGenerator', 'const', 'constructor', 'define', 'deprecated', + 'dict', 'enum', 'export', + 'expose', 'extends', 'externs', 'fileoverview', + 'idGenerator', 'implements', 'implicitCast', 'interface', + 'lends', 'license', + 'ngInject', # This annotation is specific to AngularJS. 'noalias', 'nocompile', 'nosideeffects', 'override', 'owner', + 'package', 'param', 'preserve', 'private', + 'protected', + 'public', 'return', 'see', + 'stableIdGenerator', + 'struct', 'supported', 'template', 'this', 'type', 'typedef', + 'unrestricted', ]) ANNOTATION = frozenset(['preserveTry', 'suppress']) @@ -89,51 +104,127 @@ class DocFlag(object): # Includes all Closure Compiler @suppress types. # Not all of these annotations are interpreted by Closure Linter. + # + # Specific cases: + # - accessControls is supported by the compiler at the expression + # and method level to suppress warnings about private/protected + # access (method level applies to all references in the method). + # The linter mimics the compiler behavior. SUPPRESS_TYPES = frozenset([ 'accessControls', + 'ambiguousFunctionDecl', + 'checkDebuggerStatement', 'checkRegExp', + 'checkStructDictInheritance', 'checkTypes', 'checkVars', + 'const', + 'constantProperty', 'deprecated', 'duplicate', + 'es5Strict', + 'externsValidation', + 'extraProvide', + 'extraRequire', 'fileoverviewTags', + 'globalThis', + 'internetExplorerChecks', 'invalidCasts', 'missingProperties', + 'missingProvide', + 'missingRequire', + 'missingReturn', 'nonStandardJsDocs', 'strictModuleDepCheck', + 'suspiciousCode', + 'tweakValidation', + 'typeInvalidation', + 'undefinedNames', 'undefinedVars', 'underscore', 'unknownDefines', + 'unnecessaryCasts', + 'unusedPrivateMembers', 'uselessCode', 'visibility', - 'with']) + 'with', + ]) HAS_DESCRIPTION = frozenset([ - 'define', 'deprecated', 'desc', 'fileoverview', 'license', 'param', - 'preserve', 'return', 'supported']) + 'define', + 'deprecated', + 'desc', + 'fileoverview', + 'license', + 'param', + 'preserve', + 'return', + 'supported', + ]) + # Docflags whose argument should be parsed using the typeannotation parser. HAS_TYPE = frozenset([ - 'define', 'enum', 'extends', 'implements', 'param', 'return', 'type', - 'suppress']) + 'const', + 'define', + 'enum', + 'extends', + 'final', + 'implements', + 'mods', + 'package', + 'param', + 'private', + 'protected', + 'public', + 'return', + 'suppress', + 'type', + 'typedef', + ]) - TYPE_ONLY = frozenset(['enum', 'extends', 'implements', 'suppress', 'type']) + # Docflags for which it's ok to omit the type (flag without an argument). + CAN_OMIT_TYPE = frozenset([ + 'const', + 'enum', + 'final', + 'package', + 'private', + 'protected', + 'public', + 'suppress', # We'll raise a separate INCORRECT_SUPPRESS_SYNTAX instead. + ]) + + # Docflags that only take a type as an argument and should not parse a + # following description. + TYPE_ONLY = frozenset([ + 'const', + 'enum', + 'extends', + 'implements', + 'package', + 'suppress', + 'type', + ]) HAS_NAME = frozenset(['param']) EMPTY_COMMENT_LINE = re.compile(r'^\s*\*?\s*$') EMPTY_STRING = re.compile(r'^\s*$') - def __init__(self, flag_token): + def __init__(self, flag_token, error_handler=None): """Creates the DocFlag object and attaches it to the given start token. Args: flag_token: The starting token of the flag. + error_handler: An optional error handler for errors occurring while + parsing the doctype. """ self.flag_token = flag_token self.flag_type = flag_token.string.strip().lstrip('@') # Extract type, if applicable. self.type = None + self.jstype = None self.type_start_token = None self.type_end_token = None if self.flag_type in self.HAS_TYPE: @@ -142,28 +233,37 @@ def __init__(self, flag_token): if brace: end_token, contents = _GetMatchingEndBraceAndContents(brace) self.type = contents + self.jstype = typeannotation.Parse(brace, end_token, + error_handler) self.type_start_token = brace self.type_end_token = end_token elif (self.flag_type in self.TYPE_ONLY and - flag_token.next.type not in Type.FLAG_ENDING_TYPES): + flag_token.next.type not in Type.FLAG_ENDING_TYPES and + flag_token.line_number == flag_token.next.line_number): + # b/10407058. If the flag is expected to be followed by a type then + # search for type in same line only. If no token after flag in same + # line then conclude that no type is specified. self.type_start_token = flag_token.next self.type_end_token, self.type = _GetEndTokenAndContents( self.type_start_token) if self.type is not None: self.type = self.type.strip() + self.jstype = typeannotation.Parse(flag_token, self.type_end_token, + error_handler) # Extract name, if applicable. self.name_token = None self.name = None if self.flag_type in self.HAS_NAME: # Handle bad case, name could be immediately after flag token. - self.name_token = _GetNextIdentifierToken(flag_token) + self.name_token = _GetNextPartialIdentifierToken(flag_token) # Handle good case, if found token is after type start, look for - # identifier after type end, since types contain identifiers. + # a identifier (substring to cover cases like [cnt] b/4197272) after + # type end, since types contain identifiers. if (self.type and self.name_token and tokenutil.Compare(self.name_token, self.type_start_token) > 0): - self.name_token = _GetNextIdentifierToken(self.type_end_token) + self.name_token = _GetNextPartialIdentifierToken(self.type_end_token) if self.name_token: self.name = self.name_token.string @@ -191,6 +291,13 @@ def __init__(self, flag_token): self.description_end_token, self.description = ( _GetEndTokenAndContents(interesting_token)) + def HasType(self): + """Returns whether this flag should have a type annotation.""" + return self.flag_type in self.HAS_TYPE + + def __repr__(self): + return '' % (self.flag_type, repr(self.jstype)) + class DocComment(object): """JavaScript doc comment object. @@ -207,14 +314,21 @@ def __init__(self, start_token): Args: start_token: The first token in the doc comment. """ - self.__params = {} - self.ordered_params = [] - self.__flags = {} + self.__flags = [] self.start_token = start_token self.end_token = None self.suppressions = {} self.invalidated = False + @property + def ordered_params(self): + """Gives the list of parameter names as a list of strings.""" + params = [] + for flag in self.__flags: + if flag.flag_type == 'param' and flag.name: + params.append(flag.name) + return params + def Invalidate(self): """Indicate that the JSDoc is well-formed but we had problems parsing it. @@ -228,28 +342,27 @@ def IsInvalidated(self): """Test whether Invalidate() has been called.""" return self.invalidated - def AddParam(self, name, param_type): - """Add a new documented parameter. - - Args: - name: The name of the parameter to document. - param_type: The parameter's declared JavaScript type. - """ - self.ordered_params.append(name) - self.__params[name] = param_type - def AddSuppression(self, token): """Add a new error suppression flag. Args: token: The suppression flag token. """ - #TODO(user): Error if no braces - brace = tokenutil.SearchUntil(token, [Type.DOC_START_BRACE], - [Type.DOC_FLAG]) - if brace: - end_token, contents = _GetMatchingEndBraceAndContents(brace) - self.suppressions[contents] = token + flag = token and token.attached_object + if flag and flag.jstype: + for suppression in flag.jstype.IterIdentifiers(): + self.suppressions[suppression] = token + + def SuppressionOnly(self): + """Returns whether this comment contains only suppression flags.""" + if not self.__flags: + return False + + for flag in self.__flags: + if flag.flag_type != 'suppress': + return False + + return True def AddFlag(self, flag): """Add a new document flag. @@ -257,7 +370,7 @@ def AddFlag(self, flag): Args: flag: DocFlag object. """ - self.__flags[flag.flag_type] = flag + self.__flags.append(flag) def InheritsDocumentation(self): """Test if the jsdoc implies documentation inheritance. @@ -265,10 +378,7 @@ def InheritsDocumentation(self): Returns: True if documentation may be pulled off the superclass. """ - return (self.HasFlag('inheritDoc') or - (self.HasFlag('override') and - not self.HasFlag('return') and - not self.HasFlag('param'))) + return self.HasFlag('inheritDoc') or self.HasFlag('override') def HasFlag(self, flag_type): """Test if the given flag has been set. @@ -279,7 +389,10 @@ def HasFlag(self, flag_type): Returns: True if the flag is set. """ - return flag_type in self.__flags + for flag in self.__flags: + if flag.flag_type == flag_type: + return True + return False def GetFlag(self, flag_type): """Gets the last flag of the given type. @@ -290,7 +403,101 @@ def GetFlag(self, flag_type): Returns: The last instance of the given flag type in this doc comment. """ - return self.__flags[flag_type] + for flag in reversed(self.__flags): + if flag.flag_type == flag_type: + return flag + + def GetDocFlags(self): + """Return the doc flags for this comment.""" + return list(self.__flags) + + def _YieldDescriptionTokens(self): + for token in self.start_token: + + if (token is self.end_token or + token.type is javascripttokens.JavaScriptTokenType.DOC_FLAG or + token.type not in javascripttokens.JavaScriptTokenType.COMMENT_TYPES): + return + + if token.type not in [ + javascripttokens.JavaScriptTokenType.START_DOC_COMMENT, + javascripttokens.JavaScriptTokenType.END_DOC_COMMENT, + javascripttokens.JavaScriptTokenType.DOC_PREFIX]: + yield token + + @property + def description(self): + return tokenutil.TokensToString( + self._YieldDescriptionTokens()) + + def GetTargetIdentifier(self): + """Returns the identifier (as a string) that this is a comment for. + + Note that this uses method uses GetIdentifierForToken to get the full + identifier, even if broken up by whitespace, newlines, or comments, + and thus could be longer than GetTargetToken().string. + + Returns: + The identifier for the token this comment is for. + """ + token = self.GetTargetToken() + if token: + return tokenutil.GetIdentifierForToken(token) + + def GetTargetToken(self): + """Get this comment's target token. + + Returns: + The token that is the target of this comment, or None if there isn't one. + """ + + # File overviews describe the file, not a token. + if self.HasFlag('fileoverview'): + return + + skip_types = frozenset([ + Type.WHITESPACE, + Type.BLANK_LINE, + Type.START_PAREN]) + + target_types = frozenset([ + Type.FUNCTION_NAME, + Type.IDENTIFIER, + Type.SIMPLE_LVALUE]) + + token = self.end_token.next + while token: + if token.type in target_types: + return token + + # Handles the case of a comment on "var foo = ...' + if token.IsKeyword('var'): + next_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES) + + if (next_code_token and + next_code_token.IsType(Type.SIMPLE_LVALUE)): + return next_code_token + + return + + # Handles the case of a comment on "function foo () {}" + if token.type is Type.FUNCTION_DECLARATION: + next_code_token = tokenutil.CustomSearch( + token, + lambda t: t.type not in Type.NON_CODE_TYPES) + + if next_code_token.IsType(Type.FUNCTION_NAME): + return next_code_token + + return + + # Skip types will end the search. + if token.type not in skip_types: + return + + token = token.next def CompareParameters(self, params): """Computes the edit distance and list from the function params to the docs. @@ -360,7 +567,8 @@ def __repr__(self): Returns: A string representation of this object. """ - return '' % (str(self.__params), str(self.__flags)) + return '' % ( + str(self.ordered_params), str(self.__flags)) # @@ -409,28 +617,25 @@ def _GetMatchingEndBraceAndContents(start_brace): return token, ''.join(contents) -def _GetNextIdentifierToken(start_token): - """Searches for and returns the first identifier at the beginning of a token. +def _GetNextPartialIdentifierToken(start_token): + """Returns the first token having identifier as substring after a token. - Searches each token after the start to see if it starts with an identifier. - If found, will split the token into at most 3 piecies: leading whitespace, - identifier, rest of token, returning the identifier token. If no identifier is - found returns None and changes no tokens. Search is abandoned when a - FLAG_ENDING_TYPE token is found. + Searches each token after the start to see if it contains an identifier. + If found, token is returned. If no identifier is found returns None. + Search is abandoned when a FLAG_ENDING_TYPE token is found. Args: start_token: The token to start searching after. Returns: - The identifier token is found, None otherwise. + The token found containing identifier, None otherwise. """ token = start_token.next - while token and not token.type in Type.FLAG_ENDING_TYPES: - match = javascripttokenizer.JavaScriptTokenizer.IDENTIFIER.match( + while token and token.type not in Type.FLAG_ENDING_TYPES: + match = javascripttokenizer.JavaScriptTokenizer.IDENTIFIER.search( token.string) - if (match is not None and token.type == Type.COMMENT and - len(token.string) == len(match.group(0))): + if match is not None and token.type == Type.COMMENT: return token token = token.next @@ -455,7 +660,8 @@ def _GetEndTokenAndContents(start_token): last_line = iterator.line_number last_token = None contents = '' - while not iterator.type in Type.FLAG_ENDING_TYPES: + doc_depth = 0 + while not iterator.type in Type.FLAG_ENDING_TYPES or doc_depth > 0: if (iterator.IsFirstInLine() and DocFlag.EMPTY_COMMENT_LINE.match(iterator.line)): # If we have a blank comment line, consider that an implicit @@ -470,6 +676,17 @@ def _GetEndTokenAndContents(start_token): # only a doc comment prefix or whitespace. break + # b/2983692 + # don't prematurely match against a @flag if inside a doc flag + # need to think about what is the correct behavior for unterminated + # inline doc flags + if (iterator.type == Type.DOC_START_BRACE and + iterator.next.type == Type.DOC_INLINE_FLAG): + doc_depth += 1 + elif (iterator.type == Type.DOC_END_BRACE and + doc_depth > 0): + doc_depth -= 1 + if iterator.type in Type.FLAG_DESCRIPTION_TYPES: contents += iterator.string last_token = iterator @@ -501,6 +718,9 @@ class Function(object): is_constructor: If the function is a constructor. name: The name of the function, whether given in the function keyword or as the lvalue the function is assigned to. + start_token: First token of the function (the function' keyword token). + end_token: Last token of the function (the closing '}' token). + parameters: List of parameter names. """ def __init__(self, block_depth, is_assigned, doc, name): @@ -509,9 +729,13 @@ def __init__(self, block_depth, is_assigned, doc, name): self.is_constructor = doc and doc.HasFlag('constructor') self.is_interface = doc and doc.HasFlag('interface') self.has_return = False + self.has_throw = False self.has_this = False self.name = name self.doc = doc + self.start_token = None + self.end_token = None + self.parameters = None class StateTracker(object): @@ -538,7 +762,7 @@ def Reset(self): self._block_depth = 0 self._is_block_close = False self._paren_depth = 0 - self._functions = [] + self._function_stack = [] self._functions_by_name = {} self._last_comment = None self._doc_comment = None @@ -548,6 +772,24 @@ def Reset(self): self._last_line = None self._first_token = None self._documented_identifiers = set() + self._variables_in_scope = [] + + def DocFlagPass(self, start_token, error_handler): + """Parses doc flags. + + This pass needs to be executed before the aliaspass and we don't want to do + a full-blown statetracker dry run for these. + + Args: + start_token: The token at which to start iterating + error_handler: An error handler for error reporting. + """ + if not start_token: + return + doc_flag_types = (Type.DOC_FLAG, Type.DOC_INLINE_FLAG) + for token in start_token: + if token.type in doc_flag_types: + token.attached_object = self._doc_flag(token, error_handler) def InFunction(self): """Returns true if the current token is within a function. @@ -555,7 +797,7 @@ def InFunction(self): Returns: True if the current token is within a function. """ - return bool(self._functions) + return bool(self._function_stack) def InConstructor(self): """Returns true if the current token is within a constructor. @@ -563,7 +805,7 @@ def InConstructor(self): Returns: True if the current token is within a constructor. """ - return self.InFunction() and self._functions[-1].is_constructor + return self.InFunction() and self._function_stack[-1].is_constructor def InInterfaceMethod(self): """Returns true if the current token is within an interface method. @@ -572,10 +814,10 @@ def InInterfaceMethod(self): True if the current token is within an interface method. """ if self.InFunction(): - if self._functions[-1].is_interface: + if self._function_stack[-1].is_interface: return True else: - name = self._functions[-1].name + name = self._function_stack[-1].name prototype_index = name.find('.prototype.') if prototype_index != -1: class_function_name = name[0:prototype_index] @@ -591,7 +833,7 @@ def InTopLevelFunction(self): Returns: True if the current token is within a top level function. """ - return len(self._functions) == 1 and self.InTopLevel() + return len(self._function_stack) == 1 and self.InTopLevel() def InAssignedFunction(self): """Returns true if the current token is within a function variable. @@ -599,7 +841,7 @@ def InAssignedFunction(self): Returns: True if if the current token is within a function variable """ - return self.InFunction() and self._functions[-1].is_assigned + return self.InFunction() and self._function_stack[-1].is_assigned def IsFunctionOpen(self): """Returns true if the current token is a function block open. @@ -607,8 +849,8 @@ def IsFunctionOpen(self): Returns: True if the current token is a function block open. """ - return (self._functions and - self._functions[-1].block_depth == self._block_depth - 1) + return (self._function_stack and + self._function_stack[-1].block_depth == self._block_depth - 1) def IsFunctionClose(self): """Returns true if the current token is a function block close. @@ -616,8 +858,8 @@ def IsFunctionClose(self): Returns: True if the current token is a function block close. """ - return (self._functions and - self._functions[-1].block_depth == self._block_depth) + return (self._function_stack and + self._function_stack[-1].block_depth == self._block_depth) def InBlock(self): """Returns true if the current token is within a block. @@ -659,6 +901,30 @@ def InParentheses(self): """ return bool(self._paren_depth) + def ParenthesesDepth(self): + """Returns the number of parens surrounding the token. + + Returns: + The number of parenthesis surrounding the token. + """ + return self._paren_depth + + def BlockDepth(self): + """Returns the number of blocks in which the token is nested. + + Returns: + The number of blocks in which the token is nested. + """ + return self._block_depth + + def FunctionDepth(self): + """Returns the number of functions in which the token is nested. + + Returns: + The number of functions in which the token is nested. + """ + return len(self._function_stack) + def InTopLevel(self): """Whether we are at the top level in the class. @@ -752,7 +1018,8 @@ def IsTypeToken(self, t): Type.DOC_FLAG, Type.DOC_INLINE_FLAG, Type.DOC_PREFIX): f = tokenutil.SearchUntil(t, [Type.DOC_FLAG], [Type.START_DOC_COMMENT], None, True) - if f and f.attached_object.type_start_token is not None: + if (f and f.attached_object.type_start_token is not None and + f.attached_object.type_end_token is not None): return (tokenutil.Compare(t, f.attached_object.type_start_token) > 0 and tokenutil.Compare(t, f.attached_object.type_end_token) < 0) return False @@ -763,8 +1030,8 @@ def GetFunction(self): Returns: The current Function object. """ - if self._functions: - return self._functions[-1] + if self._function_stack: + return self._function_stack[-1] def GetBlockDepth(self): """Return the block depth. @@ -786,6 +1053,29 @@ def GetFirstToken(self): """Return the very first token in the file.""" return self._first_token + def IsVariableInScope(self, token_string): + """Checks if string is variable in current scope. + + For given string it checks whether the string is a defined variable + (including function param) in current state. + + E.g. if variables defined (variables in current scope) is docs + then docs, docs.length etc will be considered as variable in current + scope. This will help in avoding extra goog.require for variables. + + Args: + token_string: String to check if its is a variable in current scope. + + Returns: + true if given string is a variable in current scope. + """ + for variable in self._variables_in_scope: + if (token_string == variable + or token_string.startswith(variable + '.')): + return True + + return False + def HandleToken(self, token, last_non_space_token): """Handles the given token and updates state. @@ -808,6 +1098,12 @@ def HandleToken(self, token, last_non_space_token): # by language. self._block_types.append(self.GetBlockType(token)) + # When entering a function body, record its parameters. + if self.InFunction(): + function = self._function_stack[-1] + if self._block_depth == function.block_depth + 1: + function.parameters = self.GetParams() + # Track block depth. elif type == Type.END_BLOCK: self._is_block_close = not self.InObjectLiteral() @@ -833,21 +1129,23 @@ def HandleToken(self, token, last_non_space_token): self._doc_comment.end_token = token elif type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG): - flag = self._doc_flag(token) - token.attached_object = flag + # Don't overwrite flags if they were already parsed in a previous pass. + if token.attached_object is None: + flag = self._doc_flag(token) + token.attached_object = flag + else: + flag = token.attached_object self._doc_comment.AddFlag(flag) - if flag.flag_type == 'param' and flag.name: - self._doc_comment.AddParam(flag.name, flag.type) - elif flag.flag_type == 'suppress': + if flag.flag_type == 'suppress': self._doc_comment.AddSuppression(token) elif type == Type.FUNCTION_DECLARATION: last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None, True) doc = None - # Only functions outside of parens are eligible for documentation. - if not self._paren_depth: + # Only top-level functions are eligible for documentation. + if self.InTopLevel(): doc = self._doc_comment name = '' @@ -861,8 +1159,7 @@ def HandleToken(self, token, last_non_space_token): # my.function.foo. # bar = function() ... identifier = tokenutil.Search(last_code, Type.SIMPLE_LVALUE, None, True) - while identifier and identifier.type in ( - Type.IDENTIFIER, Type.SIMPLE_LVALUE): + while identifier and tokenutil.IsIdentifierOrDot(identifier): name = identifier.string + name # Traverse behind us, skipping whitespace and comments. while True: @@ -877,14 +1174,22 @@ def HandleToken(self, token, last_non_space_token): next_token = tokenutil.Search(next_token, Type.FUNCTION_NAME, 2) function = Function(self._block_depth, is_assigned, doc, name) - self._functions.append(function) + function.start_token = token + + self._function_stack.append(function) self._functions_by_name[name] = function + # Add a delimiter in stack for scope variables to define start of + # function. This helps in popping variables of this function when + # function declaration ends. + self._variables_in_scope.append('') + elif type == Type.START_PARAMETERS: self._cumulative_params = '' elif type == Type.PARAMETERS: self._cumulative_params += token.string + self._variables_in_scope.extend(self.GetParams()) elif type == Type.KEYWORD and token.string == 'return': next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) @@ -893,6 +1198,22 @@ def HandleToken(self, token, last_non_space_token): if function: function.has_return = True + elif type == Type.KEYWORD and token.string == 'throw': + function = self.GetFunction() + if function: + function.has_throw = True + + elif type == Type.KEYWORD and token.string == 'var': + function = self.GetFunction() + next_token = tokenutil.Search(token, [Type.IDENTIFIER, + Type.SIMPLE_LVALUE]) + + if next_token: + if next_token.type == Type.SIMPLE_LVALUE: + self._variables_in_scope.append(next_token.values['identifier']) + else: + self._variables_in_scope.append(next_token.string) + elif type == Type.SIMPLE_LVALUE: identifier = token.values['identifier'] jsdoc = self.GetDocComment() @@ -906,7 +1227,7 @@ def HandleToken(self, token, last_non_space_token): # Detect documented non-assignments. next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES) - if next_token.IsType(Type.SEMICOLON): + if next_token and next_token.IsType(Type.SEMICOLON): if (self._last_non_space_token and self._last_non_space_token.IsType(Type.END_DOC_COMMENT)): self._documented_identifiers.add(token.string) @@ -926,7 +1247,6 @@ def _HandleIdentifier(self, identifier, is_assignment): if function: function.has_this = True - def HandleAfterToken(self, token): """Handle updating state after a token has been checked. @@ -952,7 +1272,17 @@ def HandleAfterToken(self, token): if self.InFunction() and self.IsFunctionClose(): # TODO(robbyw): Detect the function's name for better errors. - self._functions.pop() + function = self._function_stack.pop() + function.end_token = token + + # Pop all variables till delimiter ('') those were defined in the + # function being closed so make them out of scope. + while self._variables_in_scope and self._variables_in_scope[-1]: + self._variables_in_scope.pop() + + # Pop delimiter + if self._variables_in_scope: + self._variables_in_scope.pop() elif type == Type.END_PARAMETERS and self._doc_comment: self._doc_comment = None diff --git a/tools/closure_linter/closure_linter/statetracker_test.py b/tools/closure_linter/closure_linter/statetracker_test.py new file mode 100755 index 00000000000000..494dc642fc5bde --- /dev/null +++ b/tools/closure_linter/closure_linter/statetracker_test.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the statetracker module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + + + +import unittest as googletest + +from closure_linter import javascripttokens +from closure_linter import statetracker +from closure_linter import testutil + + +class _FakeDocFlag(object): + + def __repr__(self): + return '@%s %s' % (self.flag_type, self.name) + + +class IdentifierTest(googletest.TestCase): + + def testJustIdentifier(self): + a = javascripttokens.JavaScriptToken( + 'abc', javascripttokens.JavaScriptTokenType.IDENTIFIER, 'abc', 1) + + st = statetracker.StateTracker() + st.HandleToken(a, None) + + +class DocCommentTest(googletest.TestCase): + + @staticmethod + def _MakeDocFlagFake(flag_type, name=None): + flag = _FakeDocFlag() + flag.flag_type = flag_type + flag.name = name + return flag + + def testDocFlags(self): + comment = statetracker.DocComment(None) + + a = self._MakeDocFlagFake('param', 'foo') + comment.AddFlag(a) + + b = self._MakeDocFlagFake('param', '') + comment.AddFlag(b) + + c = self._MakeDocFlagFake('param', 'bar') + comment.AddFlag(c) + + self.assertEquals( + ['foo', 'bar'], + comment.ordered_params) + + self.assertEquals( + [a, b, c], + comment.GetDocFlags()) + + def testInvalidate(self): + comment = statetracker.DocComment(None) + + self.assertFalse(comment.invalidated) + self.assertFalse(comment.IsInvalidated()) + + comment.Invalidate() + + self.assertTrue(comment.invalidated) + self.assertTrue(comment.IsInvalidated()) + + def testSuppressionOnly(self): + comment = statetracker.DocComment(None) + + self.assertFalse(comment.SuppressionOnly()) + comment.AddFlag(self._MakeDocFlagFake('suppress')) + self.assertTrue(comment.SuppressionOnly()) + comment.AddFlag(self._MakeDocFlagFake('foo')) + self.assertFalse(comment.SuppressionOnly()) + + def testRepr(self): + comment = statetracker.DocComment(None) + comment.AddFlag(self._MakeDocFlagFake('param', 'foo')) + comment.AddFlag(self._MakeDocFlagFake('param', 'bar')) + + self.assertEquals( + '', + repr(comment)) + + def testDocFlagParam(self): + comment = self._ParseComment(""" + /** + * @param {string} [name] Name of customer. + */""") + flag = comment.GetFlag('param') + self.assertEquals('string', flag.type) + self.assertEquals('string', flag.jstype.ToString()) + self.assertEquals('[name]', flag.name) + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + _, comments = testutil.ParseFunctionsAndComments(script) + self.assertEquals(1, len(comments)) + return comments[0] + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/strict_test.py b/tools/closure_linter/closure_linter/strict_test.py new file mode 100755 index 00000000000000..2634456874f1d2 --- /dev/null +++ b/tools/closure_linter/closure_linter/strict_test.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# Copyright 2013 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Tests for gjslint --strict. + +Tests errors that can be thrown by gjslint when in strict mode. +""" + + + +import unittest + +import gflags as flags +import unittest as googletest + +from closure_linter import errors +from closure_linter import runner +from closure_linter.common import erroraccumulator + +flags.FLAGS.strict = True + + +class StrictTest(unittest.TestCase): + """Tests scenarios where strict generates warnings.""" + + def testUnclosedString(self): + """Tests warnings are reported when nothing is disabled. + + b/11450054. + """ + original = [ + 'bug = function() {', + ' (\'foo\'\');', + '};', + '', + ] + + expected = [errors.FILE_DOES_NOT_PARSE, errors.MULTI_LINE_STRING, + errors.FILE_IN_BLOCK] + self._AssertErrors(original, expected) + + def _AssertErrors(self, original, expected_errors): + """Asserts that the error fixer corrects original to expected.""" + + # Trap gjslint's output parse it to get messages added. + error_accumulator = erroraccumulator.ErrorAccumulator() + runner.Run('testing.js', error_accumulator, source=original) + error_nums = [e.code for e in error_accumulator.GetErrors()] + + error_nums.sort() + expected_errors.sort() + self.assertListEqual(error_nums, expected_errors) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/testdata/all_js_wrapped.js b/tools/closure_linter/closure_linter/testdata/all_js_wrapped.js new file mode 100644 index 00000000000000..6eb3b38f529257 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/all_js_wrapped.js @@ -0,0 +1,5 @@ +(function($) { + // My code goes here. + // linter should not throw random exceptions because the file starts with + // an open paren. Regression test for bug 2966755. +})(jQuery); diff --git a/tools/closure_linter/closure_linter/testdata/blank_lines.js b/tools/closure_linter/closure_linter/testdata/blank_lines.js new file mode 100644 index 00000000000000..1dc3da29053a0b --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/blank_lines.js @@ -0,0 +1,104 @@ +/** + * @fileoverview This is a file overview with no lines above it, at the top of + * the file (GOOD). + */ +/** // WRONG_BLANK_LINE_COUNT + * @fileoverview This is a file overview with no lines above it (BAD). + */ + +/** + * @fileoverview This is a file overview with one line above it (GOOD). + */ + + +/** + * @fileoverview This is a file overview with two lines above it (GOOD). + */ + +/** // WRONG_BLANK_LINE_COUNT + * A constructor with 1 line above it (BAD). + * @constructor + */ +function someFunction() {} + + +/** // WRONG_BLANK_LINE_COUNT + * A constructor with 2 lines above it (BAD). + * @constructor + */ +function someFunction() {} + + + +/** + * A constructor with 3 lines above it (GOOD). + * @constructor + */ +function someFunction() {} + + + + +/** // WRONG_BLANK_LINE_COUNT + * A constructor with 4 lines above it (BAD). + * @constructor + */ +function someFunction() {} + +/** // WRONG_BLANK_LINE_COUNT + * Top level block with 1 line above it (BAD). + */ +function someFunction() {} + + +/** + * Top level block with 2 lines above it (GOOD). + */ +function someFunction() {} + + + +/** // WRONG_BLANK_LINE_COUNT + * Top level block with 3 lines above it (BAD). + */ +function someFunction() {} + + +// -1: EXTRA_SPACE +/** + * Top level block with 2 lines above it, one contains whitespace (GOOD). + */ +function someFunction() {} + + +// This comment should be ignored. +/** + * Top level block with 2 lines above it (GOOD). + */ +function someFunction() {} + +// Should not check jsdocs which are inside a block. +var x = { + /** + * @constructor + */ +}; + +/** + * This jsdoc-style comment should not be required to have two lines above it + * since it does not immediately precede any code. + */ +// This is a comment. + +/** + * This jsdoc-style comment should not be required to have two lines above it + * since it does not immediately precede any code. + */ +/** + * This is a comment. + */ + +/** + * This jsdoc-style comment should not be required to have two lines above it + * since it does not immediately precede any code. + */ diff --git a/tools/closure_linter/closure_linter/testdata/bugs.js b/tools/closure_linter/closure_linter/testdata/bugs.js new file mode 100644 index 00000000000000..735200545db11e --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/bugs.js @@ -0,0 +1,43 @@ +// Copyright 2007 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// A file full of known bugs - this file serves only as a reference and is not +// tested in any way. + +/** + * @param {{foo} x This is a bad record type. + * @param {{foo}} y This is a good record type with bad spacing. + * @param {{foo}} This is a good record type with no parameter name. + */ +function f(x, y, z) { +} + + +// Should report extra space errors. +var magicProps = { renderRow: 0 }; + +// No error reported here for missing space before {. +if (x){ +} + +// Should have a "brace on wrong line" error. +if (x) +{ +} + +// We could consider not reporting it when wrapping makes it necessary, as in: +if (aLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongCondition) + { + // Code here. +} diff --git a/tools/closure_linter/closure_linter/testdata/empty_file.js b/tools/closure_linter/closure_linter/testdata/empty_file.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/closure_linter/closure_linter/testdata/ends_with_block.js b/tools/closure_linter/closure_linter/testdata/ends_with_block.js new file mode 100644 index 00000000000000..40aa872e30a9e9 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/ends_with_block.js @@ -0,0 +1,19 @@ +// Copyright 2009 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Regression test for an old crasher. + +if (x) { + alert('Hello world'); +} diff --git a/tools/closure_linter/closure_linter/testdata/externs.js b/tools/closure_linter/closure_linter/testdata/externs.js new file mode 100644 index 00000000000000..94e2ad38a4f2a4 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/externs.js @@ -0,0 +1,34 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * Externs files are treated specially. We don't require documentation or + * return statements in functions when they are documented. + * + * @externs + */ + + +function VXMLBaseElement() {} + + +/** + * Should not complain about return tag with no return statement in + * externs.js file. + * @param {string} attrName The name of the attribute. + * @return {string} + */ +VXMLBaseElement.prototype.getAttribute = function(attrName) {}; + +VXMLBaseElement.prototype.undocumentedMethod = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/externs_jsdoc.js b/tools/closure_linter/closure_linter/testdata/externs_jsdoc.js new file mode 100644 index 00000000000000..926593f7c40207 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/externs_jsdoc.js @@ -0,0 +1,37 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Tests that the externs tag within a fileoverview comment is + * sufficient to identify an externs file. + * @externs + * + * Externs files are treated specially. We don't require documentation or + * return statements in functions when they are documented. + * + */ + + +function VXMLBaseElement() {} + + +/** + * Should not complain about return tag with no return statement in + * an externs file. + * @param {string} attrName The name of the attribute. + * @return {string} + */ +VXMLBaseElement.prototype.getAttribute = function(attrName) {}; + +VXMLBaseElement.prototype.undocumentedMethod = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/file_level_comment.js b/tools/closure_linter/closure_linter/testdata/file_level_comment.js new file mode 100644 index 00000000000000..86581155a0e6c9 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/file_level_comment.js @@ -0,0 +1,13 @@ +/** + * File level comment as the first thing in a file (GOOD). + * @license Copyright 2009 SomeThirdParty. + */ +/** // WRONG_BLANK_LINE_COUNT + * Comment block that is not the first thing in a file (BAD). + * @license Copyright 2009 SomeThirdParty. + */ + +/** // WRONG_BLANK_LINE_COUNT + * Top level comment with a single line above it (BAD). + * @license Copyright 2009 SomeThirdParty. + */ diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.in.html b/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.in.html new file mode 100644 index 00000000000000..c341bb9a394afb --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.in.html @@ -0,0 +1,52 @@ + + + + + +Tests + + + + + + + + + + + diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.out.html b/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.out.html new file mode 100644 index 00000000000000..bb9a16f003d989 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.html.out.html @@ -0,0 +1,51 @@ + + + + + +Tests + + + + + + + + + + + diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.in.js b/tools/closure_linter/closure_linter/testdata/fixjsstyle.in.js new file mode 100644 index 00000000000000..3a1ccb1f1f7c4f --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.in.js @@ -0,0 +1,293 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +/** + * @fileoverview Autofix test script. + * + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com(Robby Walker) + * @author robbyw@google.com + * @author robbyw@google.com Robby + */ + +goog.provide('w'); +goog.provide('Y'); +goog.provide('X'); +goog.provide('Z'); + +// Some comment about why this is suppressed top. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedTop'); // Comment top. +goog.require('dummy.Bb'); +/** @suppress {extraRequire} */ +// Some comment about why this is suppressed different. +goog.require('dummy.NotUsedDifferentComment'); +goog.require('dummy.Cc'); +// Some comment about why this is suppressed middle. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedMiddle'); // Comment middle. +goog.require('dummy.Dd'); +goog.require('dummy.aa'); +// Some comment about why this is suppressed bottom. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedBottom'); // Comment bottom. + +var x = new dummy.Bb(); +dummy.Cc.someMethod(); +dummy.aa.someMethod(); + + +/** + * @param {number|null} badTypeWithExtraSpace |null -> ?. + * @returns {number} returns -> return. + */ +x.y = function( badTypeWithExtraSpace) { +} + + +/** @type {function():null|Array.} only 2nd |null -> ? */ +x.badType; + + +/** @type {Array.|null} only 2nd |null -> ? */ +x.wickedType; + + +/** @type { string | null } null -> ? */ +x.nullWithSpace; + +spaceBeforeSemicolon = 10 ; +spaceBeforeParen = 10 +(5 * 2); +arrayNoSpace =[10]; +arrayExtraSpace [10] = 10; +spaceBeforeClose = ([10 ] ); +spaceAfterStart = ( [ 10]); +extraSpaceAfterPlus = 10 + 20; +extraSpaceBeforeOperator = x ++; +extraSpaceBeforeOperator = x --; +extraSpaceBeforeComma = x(y , z); +missingSpaceBeforeOperator = x+ y; +missingSpaceAfterOperator = x +y; +missingBothSpaces = x+y; +equalsSpacing= 10; +equalsSpacing =10; +equalsSpacing=10; +equalsSpacing=[10]; +reallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName=1000; + +"string should be single quotes"; + +// Regression test for interaction between space fixing and semicolon fixing - +// previously the fix for the missing space caused the function to be seen as +// a non-assigned function and then its semicolon was being stripped. +x=function() { +}; + +/** + * Missing a newline. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +};goog.inherits(x.y.z, a.b.c); + +/** + * Extra blank line. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; + +goog.inherits(x.y.z, a.b.c); + +/** + * Perfect! + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; +goog.inherits(x.y.z, a.b.c); + +// Whitespace at end of comment. +var removeWhiteSpaceAtEndOfLine; + +/** + * Whitespace at EOL (here and the line of code and the one below it). + * @type {string} + * @param {string} Description with whitespace at EOL. + */ +x = 10; + +/** + * @type number + */ +foo.bar = 3; + +/** + * @enum {boolean + */ +bar.baz = true; + +/** + * @extends Object} + */ +bar.foo = x; + +/** + * @type function(string, boolean) : void + */ +baz.bar = goog.nullFunction; + +/** {@inheritDoc} */ +baz.baz = function() { +}; + +TR_Node.splitDomTreeAt(splitNode, clone, /** @type Node */ (quoteNode)); + +x = [1, 2, 3,]; +x = { + a: 1, +}; + +if (x) { +}; + +for (i = 0;i < 10; i++) { +} +for (i = 0; i < 10;i++) { +} +for ( i = 0; i < 10; i++) { +} +for (i = 0 ; i < 10; i++) { +} +for (i = 0; i < 10 ; i++) { +} +for (i = 0; i < 10; i++ ) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0 ;i < 10; i++) { +} + +var x = 10 +var y = 100; + + +/** + * This is to test the ability to add or remove a = in type to mark optional + * parameters. + * @param {number=} firstArg Incorrect the name should start with opt_. Don't + * handle the fix (yet). + * @param {function(string=):number} opt_function This should end with a =. + * @param {function(number)} opt_otherFunc This should end with a =. + * @param {string} opt_otherArg Incorrect this should be string=. + * @param {{string, number}} opt_recordArg Incorrect this should + * be {string, number}=. + */ +function someFunction(firstArg, opt_function, opt_otherFunc, opt_otherArg, + opt_recordArg) { +} + + +/** + * This is to test the ability to add '...' in type with variable arguments. + * @param {number} firstArg First argument. + * @param {string} var_args This should start with '...'. + */ +function varArgFunction(firstArg, var_args) { +} + + +/** + * This is to test the ability to add '...' in type with variable arguments. + * @param {number} firstArg First argument. + * @param {{a, b}} var_args This should start with '...'. + */ +function varArgRecordTypeFunction(firstArg, var_args) { +} + +var indent = 'correct'; + indent = 'too far'; +if (indent) { +indent = 'too short'; +} +indent = function() { + return a + + b; +}; + + +/** + * Regression test, must insert whitespace before the 'b' when fixing + * indentation. Its different from below case of bug 3473113 as has spaces + * before parameter which was not working in part of the bug fix. + */ +indentWrongSpaces = function( + b) { +}; + + +/** + * Regression test, must insert whitespace before the 'b' when fixing + * indentation. + * @bug 3473113 + */ +indent = function( +b) { +}; + + + +/** + * This is to test the ability to remove multiple extra lines before a top-level + * block. + */ +function someFunction() {} +/** + * This is to test the ability to add multiple extra lines before a top-level + * block. + */ +function someFunction() {} + + +// This is a comment. +/** + * This is to test that blank lines removed before a top level block skips any + * comments above the block. + */ +function someFunction() {} +// This is a comment. +/** + * This is to test that blank lines added before a top level block skips any + * comments above the block. + */ +function someFunction() {} + + +/** + * Parameters don't have proper spaces. + * @param {number} a + * @param {number} b + * @param {number} d + * @param {number} e + * @param {number} f + */ +function someFunction(a, b,d, e, f) { +} + +// File does not end with newline \ No newline at end of file diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.indentation.out.js b/tools/closure_linter/closure_linter/testdata/fixjsstyle.indentation.out.js new file mode 100644 index 00000000000000..4d7c3853c8db5e --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.indentation.out.js @@ -0,0 +1,465 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Test file for indentation. + * @author robbyw@google.com (Robert Walker) + */ + +goog.provide('goog.editor.SeamlessField'); +goog.provide('goog.something'); + +goog.require('goog.events.KeyCodes'); +goog.require('goog.userAgent'); + +// Some good indentation examples. + +var x = 10; +var y = 'some really really really really really really really long string', + z = 14; +if (x == 10) { + x = 12; +} +if (x == 10 || + x == 12) { + x = 14; +} +if (x == 14) { + if (z >= x) { + y = 'test'; + } +} +x = x + + 10 + ( + 14 + ); +something = + 5; +var arr = [ + 1, 2, 3]; +var arr2 = [ + 1, + 2, + 3]; +var obj = { + a: 10, + b: 20 +}; +callAFunction(10, [100, 200], + 300); +callAFunction([ + 100, + 200 +], +300); +callAFunction('abc' + + 'def' + + 'ghi'); + +x.reallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName + .someMember = 10; + + +// confused on allowed indentation in continued function assignments vs overlong +// wrapped function calls. +some.sample() // LINE_ENDS_WITH_DOT + .then(function(response) { + return 1; + }); + + +/** + * Some function. + * @return {number} The number ten. + */ +goog.something.x = function() { + return 10 + + 20; +}; + + +/** + * Some function. + * @param {number} longParameterName1 Some number. + * @param {number} longParameterName2 Some number. + * @param {number} longParameterName3 Some number. + * @return {number} Sum number. + */ +goog.something.y = function(longParameterName1, longParameterName2, + longParameterName3) { + return longParameterName1 + longParameterName2 + longParameterName3; +}; + + +/** + * Some function. + * @param {number} longParameterName1 Some number. + * @param {number} longParameterName2 Some number. + * @param {number} longParameterName3 Some number. + * @return {number} Sum number. + */ +goog.something.z = function(longParameterName1, longParameterName2, + longParameterName3) { + return longParameterName1 + longParameterName2 + longParameterName3; +}; + +if (opt_rootTagName) { + doc.appendChild(doc.createNode(3, + opt_rootTagName, + opt_namespaceUri || '')); +} + + +/** + * For a while this errored because the function call parens were overriding + * the other opening paren. + */ +goog.something.q = function() { + goog.something.x(a.getStartNode(), + a.getStartOffset(), a.getEndNode(), a.getEndOffset()); +}; + +function doSomething() { + var titleElement = goog.something(x, // UNUSED_LOCAL_VARIABLE + y); +} + +switch (x) { + case 10: + y = 100; + break; + + // This should be allowed. + case 20: + if (y) { + z = 0; + } + break; + + // This should be allowed, + // even with mutliple lines. + case 30: + if (y) { + z = 0; + } + break; + + case SadThatYouSwitch + .onSomethingLikeThis: + z = 10; + + case 40: + z = 20; + + default: + break; +} + +// Description of if case. +if (x) { + +// Description of else case should be allowed at this indent. +// Multiple lines is ok. +} else { + +} + + +/** @inheritDoc */ +goog.editor.SeamlessField.prototype.setupMutationEventHandlersGecko = + function() { + var x = 10; + x++; +}; + + +// Regression test for '.' at the end confusing the indentation checker if it is +// not considered to be part of the identifier. +/** @inheritDoc */ +goog.editor.SeamlessField.prototype + .setupMutationEventHandlersGecko = function() { + // -2: LINE_ENDS_WITH_DOT + var x = 10; + x++; +}; + +var someReallyReallyLongVariableName = + y ? /veryVeryVeryVeryVeryVeryVeryVeryLongRegex1/gi : + /slightlyLessLongRegex2/gi; + +var somethingOrOther = z ? + a : + b; + +var z = x ? y : + 'bar'; + +var z = x ? + y : + a; + +var z = z ? + a ? b : c : + d ? e : f; + +var z = z ? + a ? b : + c : + d ? e : f; + +var z = z ? + a ? + b : + c : + d ? e : f; + +var z = z ? + a ? b : c : + d ? e : + f ? g : h; + +var z = z ? + a + + i ? + b + + j : c : + d ? e : + f ? g : h; + + +if (x) { + var block = + // some comment + // and some more comment + (e.keyCode == goog.events.KeyCodes.TAB && !this.dispatchBeforeTab_(e)) || + // #2: to block a Firefox-specific bug where Macs try to navigate + // back a page when you hit command+left arrow or comamnd-right arrow. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=341886 + // get Firefox to fix this. + (goog.userAgent.GECKO && e.metaKey && + (e.keyCode == goog.events.KeyCodes.LEFT || + e.keyCode == goog.events.KeyCodes.RIGHT)); +} + +if (x) { +} + +var somethingElse = { + HAS_W3C_RANGES: goog.userAgent.GECKO || goog.userAgent.WEBKIT || + goog.userAgent.OPERA, + + // A reasonably placed comment. + SOME_KEY: goog.userAgent.IE +}; + +var x = { + ySomethingReallyReallyLong: + 'foo', + z: 'bar' +}; + +// Some bad indentation. + +var a = 10; // WRONG_INDENTATION +var b = 10, + c = 12; // WRONG_INDENTATION +x = x + + 10; // WRONG_INDENTATION +if (x == 14) { + x = 15; // WRONG_INDENTATION + x = 16; // WRONG_INDENTATION +} + +var longFunctionName = function(opt_element) { + return opt_element ? + new z(q(opt_element)) : 100; + // -1: WRONG_INDENTATION +}; + +longFunctionName(a, b, c, + d, e, f); // WRONG_INDENTATION +longFunctionName(a, b, + c, // WRONG_INDENTATION + d); // WRONG_INDENTATION + +x = a ? b : + c; // WRONG_INDENTATION +y = a ? + b : c; // WRONG_INDENTATION + +switch (x) { + case 10: + break; // WRONG_INDENTATION + case 20: // WRONG_INDENTATION + break; + default: // WRONG_INDENTATION + break; +} + +while (true) { + x = 10; // WRONG_INDENTATION + break; // WRONG_INDENTATION +} + +function foo() { + return entryUrlTemplate + .replace( + '${authorResourceId}', + this.sanitizer_.sanitize(authorResourceId)); +} + +return [new x( + 10)]; +return [ + new x(10)]; + +return [new x( + 10)]; // WRONG_INDENTATION +return [new x( + 10)]; // WRONG_INDENTATION + +return {x: y( + z)}; +return { + x: y(z) +}; + +return {x: y( + z)}; // WRONG_INDENTATION +return {x: y( + z)}; // WRONG_INDENTATION + +return /** @type {Window} */ (x( + 'javascript:"' + encodeURI(loadingMessage) + '"')); // WRONG_INDENTATION + +x = { + y: function() {} +}; + +x = { + y: foo, + z: bar + + baz // WRONG_INDENTATION +}; + +x({ + a: b +}, +10); + +z = function(arr, f, val, opt_obj) { + x(arr, function(val, index) { + rval = f.call(opt_obj, rval, val, index, arr); + }); +}; + +var xyz = [100, + 200, + 300]; + +var def = [100, + 200]; // WRONG_INDENTATION + +var ghi = [100, + 200]; // WRONG_INDENTATION + +var abcdefg = ('a' + + 'b'); + +var x9 = z('7: ' + + x(x)); // WRONG_INDENTATION + +function abc() { + var z = d('div', // UNUSED_LOCAL_VARIABLE + { + a: 'b' + }); +} + +abcdefg('p', {x: 10}, + 'Para 1'); + +function bar1() { + return 3 + + 4; // WRONG_INDENTATION +} + +function bar2() { + return 3 + // WRONG_INDENTATION + 4; // WRONG_INDENTATION +} + +function bar3() { + return 3 + // WRONG_INDENTATION + 4; +} + +// Regression test for unfiled bug. Wrongly going into implied block after else +// when there was an explicit block (was an else if) caused false positive +// indentation errors. +if (true) { +} else if (doc.foo( + doc.getBar(baz))) { + var x = 3; +} + +// Regression tests for function indent + 4. +// (The first example is from the styleguide.) +if (veryLongFunctionNameA( + veryLongArgumentName) || + veryLongFunctionNameB( + veryLongArgumentName)) { + veryLongFunctionNameC(veryLongFunctionNameD( + veryLongFunctioNameE( + veryLongFunctionNameF))); +} + +if (outer(middle( + inner(first)))) {} +if (outer(middle( + inner(second)), + outer_second)) {} +if (nested.outer( + first)) {} +if (nested.outer(nested.middle( + first))) {} +if (nested + .outer(nested.middle( + first))) {} +if (nested.outer(first + .middle( + second), + third)) {} + +// goog.scope should not increase indentation. +goog.scope(function() { +var x = 5; +while (x > 0) { + --x; +} +}); // goog.scope + + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +// +1: UNUSED_LOCAL_VARIABLE +var x = 5; // WRONG_INDENTATION +}); // goog.scope + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +var x = 5; // UNUSED_LOCAL_VARIABLE +}); // goog.scope + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +var x = 5; // UNUSED_LOCAL_VARIABLE +}); // goog.scope diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.in.js b/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.in.js new file mode 100644 index 00000000000000..974af915d364ba --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.in.js @@ -0,0 +1,21 @@ +// Correct dot placement: +var x = window.some() + .method() + .calls(); + +// Wrong dots: +window. + some(). + // With a comment in between. + method(). + calls(); + +// Wrong plus operator: +var y = 'hello' + + 'world' + // With a comment in between. + + '!'; + +// Correct plus operator (untouched): +var y = 'hello' + + 'world'; diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.out.js b/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.out.js new file mode 100644 index 00000000000000..c03e11730abc09 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.oplineend.out.js @@ -0,0 +1,21 @@ +// Correct dot placement: +var x = window.some() + .method() + .calls(); + +// Wrong dots: +window + .some() + // With a comment in between. + .method() + .calls(); + +// Wrong plus operator: +var y = 'hello' + + 'world' + + // With a comment in between. + '!'; + +// Correct plus operator (untouched): +var y = 'hello' + + 'world'; diff --git a/tools/closure_linter/closure_linter/testdata/fixjsstyle.out.js b/tools/closure_linter/closure_linter/testdata/fixjsstyle.out.js new file mode 100644 index 00000000000000..37fe2b8b3c7bd5 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/fixjsstyle.out.js @@ -0,0 +1,310 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Autofix test script. + * + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com (Robby Walker) + * @author robbyw@google.com (Robby) + * @author robbyw@google.com + * @author robbyw@google.com Robby + */ + +goog.provide('X'); +goog.provide('Y'); +goog.provide('Z'); +goog.provide('w'); + +goog.require('dummy.Bb'); +goog.require('dummy.Cc'); +// Some comment about why this is suppressed bottom. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedBottom'); // Comment bottom. +/** @suppress {extraRequire} */ +// Some comment about why this is suppressed different. +goog.require('dummy.NotUsedDifferentComment'); +// Some comment about why this is suppressed middle. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedMiddle'); // Comment middle. +// Some comment about why this is suppressed top. +/** @suppress {extraRequire} */ +goog.require('dummy.NotUsedTop'); // Comment top. +goog.require('dummy.aa'); + +var x = new dummy.Bb(); +dummy.Cc.someMethod(); +dummy.aa.someMethod(); + + +/** + * @param {?number} badTypeWithExtraSpace |null -> ?. + * @return {number} returns -> return. + */ +x.y = function(badTypeWithExtraSpace) { +}; + + +/** @type {function():null|Array.} only 2nd |null -> ? */ +x.badType; + + +/** @type {?Array.} only 2nd |null -> ? */ +x.wickedType; + + +/** @type {? string } null -> ? */ +x.nullWithSpace; + +spaceBeforeSemicolon = 10; +spaceBeforeParen = 10 + (5 * 2); +arrayNoSpace = [10]; +arrayExtraSpace[10] = 10; +spaceBeforeClose = ([10]); +spaceAfterStart = ([10]); +extraSpaceAfterPlus = 10 + 20; +extraSpaceBeforeOperator = x++; +extraSpaceBeforeOperator = x--; +extraSpaceBeforeComma = x(y, z); +missingSpaceBeforeOperator = x + y; +missingSpaceAfterOperator = x + y; +missingBothSpaces = x + y; +equalsSpacing = 10; +equalsSpacing = 10; +equalsSpacing = 10; +equalsSpacing = [10]; +reallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName = 1000; + +'string should be single quotes'; + +// Regression test for interaction between space fixing and semicolon fixing - +// previously the fix for the missing space caused the function to be seen as +// a non-assigned function and then its semicolon was being stripped. +x = function() { +}; + + + +/** + * Missing a newline. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; +goog.inherits(x.y.z, a.b.c); + + + +/** + * Extra blank line. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; +goog.inherits(x.y.z, a.b.c); + + + +/** + * Perfect! + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; +goog.inherits(x.y.z, a.b.c); + +// Whitespace at end of comment. +var removeWhiteSpaceAtEndOfLine; + + +/** + * Whitespace at EOL (here and the line of code and the one below it). + * @type {string} + * @param {string} Description with whitespace at EOL. + */ +x = 10; + + +/** + * @type {number} + */ +foo.bar = 3; + + +/** + * @enum {boolean} + */ +bar.baz = true; + + +/** + * @extends {Object} + */ +bar.foo = x; + + +/** + * @type {function(string, boolean) : void} + */ +baz.bar = goog.nullFunction; + + +/** @inheritDoc */ +baz.baz = function() { +}; + +TR_Node.splitDomTreeAt(splitNode, clone, /** @type {Node} */ (quoteNode)); + +x = [1, 2, 3,]; +x = { + a: 1, +}; + +if (x) { +} + +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} +for (i = 0; i < 10; i++) { +} + +var x = 10; +var y = 100; + + +/** + * This is to test the ability to add or remove a = in type to mark optional + * parameters. + * @param {number=} firstArg Incorrect the name should start with opt_. Don't + * handle the fix (yet). + * @param {function(string=):number=} opt_function This should end with a =. + * @param {function(number)=} opt_otherFunc This should end with a =. + * @param {string=} opt_otherArg Incorrect this should be string=. + * @param {{string, number}=} opt_recordArg Incorrect this should + * be {string, number}=. + */ +function someFunction(firstArg, opt_function, opt_otherFunc, opt_otherArg, + opt_recordArg) { +} + + +/** + * This is to test the ability to add '...' in type with variable arguments. + * @param {number} firstArg First argument. + * @param {...string} var_args This should start with '...'. + */ +function varArgFunction(firstArg, var_args) { +} + + +/** + * This is to test the ability to add '...' in type with variable arguments. + * @param {number} firstArg First argument. + * @param {...{a, b}} var_args This should start with '...'. + */ +function varArgRecordTypeFunction(firstArg, var_args) { +} + +var indent = 'correct'; +indent = 'too far'; +if (indent) { + indent = 'too short'; +} +indent = function() { + return a + + b; +}; + + +/** + * Regression test, must insert whitespace before the 'b' when fixing + * indentation. Its different from below case of bug 3473113 as has spaces + * before parameter which was not working in part of the bug fix. + */ +indentWrongSpaces = function( + b) { +}; + + +/** + * Regression test, must insert whitespace before the 'b' when fixing + * indentation. + * @bug 3473113 + */ +indent = function( + b) { +}; + + +/** + * This is to test the ability to remove multiple extra lines before a top-level + * block. + */ +function someFunction() {} + + +/** + * This is to test the ability to add multiple extra lines before a top-level + * block. + */ +function someFunction() {} + + +// This is a comment. +/** + * This is to test that blank lines removed before a top level block skips any + * comments above the block. + */ +function someFunction() {} + + +// This is a comment. +/** + * This is to test that blank lines added before a top level block skips any + * comments above the block. + */ +function someFunction() {} + + +/** + * Parameters don't have proper spaces. + * @param {number} a + * @param {number} b + * @param {number} d + * @param {number} e + * @param {number} f + */ +function someFunction(a, b, d, e, f) { +} + +// File does not end with newline diff --git a/tools/closure_linter/closure_linter/testdata/goog_scope.js b/tools/closure_linter/closure_linter/testdata/goog_scope.js new file mode 100644 index 00000000000000..aa655d8e6dfb02 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/goog_scope.js @@ -0,0 +1,63 @@ +// Copyright 2011 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Tests provides/requires in the presence of goog.scope. + * There should be no errors for missing provides or requires. + * + * @author nicksantos@google.com (Nick Santos) + */ + +goog.provide('goog.something.Something'); + +goog.require('goog.util.Else'); + +goog.scope(function() { +var Else = goog.util.Else; +var something = goog.something; + +/** // WRONG_BLANK_LINE_COUNT + * This is a something. + * @constructor + */ +something.Something = function() { + /** + * This is an else. + * @type {Else} + */ + this.myElse = new Else(); + + /** @type {boolean} */ + this.private_ = false; // MISSING_PRIVATE, UNUSED_PRIVATE_MEMBER +}; + +/** // WRONG_BLANK_LINE_COUNT + * // +3: MISSING_PRIVATE + * Missing private. + */ +something.withTrailingUnderscore_ = 'should be declared @private'; + +/** // WRONG_BLANK_LINE_COUNT + * Does nothing. + */ +something.Something.prototype.noOp = function() {}; + + +/** + * Does something. + * Tests for included semicolon in function expression in goog.scope. + */ +something.Something.prototype.someOp = function() { +} // MISSING_SEMICOLON_AFTER_FUNCTION +}); // goog.scope diff --git a/tools/closure_linter/closure_linter/testdata/html_parse_error.html b/tools/closure_linter/closure_linter/testdata/html_parse_error.html new file mode 100644 index 00000000000000..df61da10c7f6f2 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/html_parse_error.html @@ -0,0 +1,32 @@ + + + + + GJsLint HTML JavaScript extraction tests + + + Text outside the script tag should not be linted as JavaScript. + Stray closing brace: } + +
        Some more non-JavaScript text with missing whitespace: (a+b).
        + + diff --git a/tools/closure_linter/closure_linter/testdata/indentation.js b/tools/closure_linter/closure_linter/testdata/indentation.js new file mode 100644 index 00000000000000..10d2ad0174d5ff --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/indentation.js @@ -0,0 +1,465 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Test file for indentation. + * @author robbyw@google.com (Robert Walker) + */ + +goog.provide('goog.editor.SeamlessField'); +goog.provide('goog.something'); + +goog.require('goog.events.KeyCodes'); +goog.require('goog.userAgent'); + +// Some good indentation examples. + +var x = 10; +var y = 'some really really really really really really really long string', + z = 14; +if (x == 10) { + x = 12; +} +if (x == 10 || + x == 12) { + x = 14; +} +if (x == 14) { + if (z >= x) { + y = 'test'; + } +} +x = x + + 10 + ( + 14 + ); +something = + 5; +var arr = [ + 1, 2, 3]; +var arr2 = [ + 1, + 2, + 3]; +var obj = { + a: 10, + b: 20 +}; +callAFunction(10, [100, 200], + 300); +callAFunction([ + 100, + 200 +], +300); +callAFunction('abc' + + 'def' + + 'ghi'); + +x.reallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongName + .someMember = 10; + + +// confused on allowed indentation in continued function assignments vs overlong +// wrapped function calls. +some.sample(). // LINE_ENDS_WITH_DOT + then(function(response) { + return 1; + }); + + +/** + * Some function. + * @return {number} The number ten. + */ +goog.something.x = function() { + return 10 + + 20; +}; + + +/** + * Some function. + * @param {number} longParameterName1 Some number. + * @param {number} longParameterName2 Some number. + * @param {number} longParameterName3 Some number. + * @return {number} Sum number. + */ +goog.something.y = function(longParameterName1, longParameterName2, + longParameterName3) { + return longParameterName1 + longParameterName2 + longParameterName3; +}; + + +/** + * Some function. + * @param {number} longParameterName1 Some number. + * @param {number} longParameterName2 Some number. + * @param {number} longParameterName3 Some number. + * @return {number} Sum number. + */ +goog.something.z = function(longParameterName1, longParameterName2, + longParameterName3) { + return longParameterName1 + longParameterName2 + longParameterName3; +}; + +if (opt_rootTagName) { + doc.appendChild(doc.createNode(3, + opt_rootTagName, + opt_namespaceUri || '')); +} + + +/** + * For a while this errored because the function call parens were overriding + * the other opening paren. + */ +goog.something.q = function() { + goog.something.x(a.getStartNode(), + a.getStartOffset(), a.getEndNode(), a.getEndOffset()); +}; + +function doSomething() { + var titleElement = goog.something(x, // UNUSED_LOCAL_VARIABLE + y); +} + +switch (x) { + case 10: + y = 100; + break; + + // This should be allowed. + case 20: + if (y) { + z = 0; + } + break; + + // This should be allowed, + // even with mutliple lines. + case 30: + if (y) { + z = 0; + } + break; + + case SadThatYouSwitch + .onSomethingLikeThis: + z = 10; + + case 40: + z = 20; + + default: + break; +} + +// Description of if case. +if (x) { + +// Description of else case should be allowed at this indent. +// Multiple lines is ok. +} else { + +} + + +/** @inheritDoc */ +goog.editor.SeamlessField.prototype.setupMutationEventHandlersGecko = + function() { + var x = 10; + x++; +}; + + +// Regression test for '.' at the end confusing the indentation checker if it is +// not considered to be part of the identifier. +/** @inheritDoc */ +goog.editor.SeamlessField.prototype. + setupMutationEventHandlersGecko = function() { + // -2: LINE_ENDS_WITH_DOT + var x = 10; + x++; +}; + +var someReallyReallyLongVariableName = + y ? /veryVeryVeryVeryVeryVeryVeryVeryLongRegex1/gi : + /slightlyLessLongRegex2/gi; + +var somethingOrOther = z ? + a : + b; + +var z = x ? y : + 'bar'; + +var z = x ? + y : + a; + +var z = z ? + a ? b : c : + d ? e : f; + +var z = z ? + a ? b : + c : + d ? e : f; + +var z = z ? + a ? + b : + c : + d ? e : f; + +var z = z ? + a ? b : c : + d ? e : + f ? g : h; + +var z = z ? + a + + i ? + b + + j : c : + d ? e : + f ? g : h; + + +if (x) { + var block = + // some comment + // and some more comment + (e.keyCode == goog.events.KeyCodes.TAB && !this.dispatchBeforeTab_(e)) || + // #2: to block a Firefox-specific bug where Macs try to navigate + // back a page when you hit command+left arrow or comamnd-right arrow. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=341886 + // get Firefox to fix this. + (goog.userAgent.GECKO && e.metaKey && + (e.keyCode == goog.events.KeyCodes.LEFT || + e.keyCode == goog.events.KeyCodes.RIGHT)); +} + +if (x) { +} + +var somethingElse = { + HAS_W3C_RANGES: goog.userAgent.GECKO || goog.userAgent.WEBKIT || + goog.userAgent.OPERA, + + // A reasonably placed comment. + SOME_KEY: goog.userAgent.IE +}; + +var x = { + ySomethingReallyReallyLong: + 'foo', + z: 'bar' +}; + +// Some bad indentation. + + var a = 10; // WRONG_INDENTATION +var b = 10, + c = 12; // WRONG_INDENTATION +x = x + + 10; // WRONG_INDENTATION +if (x == 14) { + x = 15; // WRONG_INDENTATION + x = 16; // WRONG_INDENTATION +} + +var longFunctionName = function(opt_element) { + return opt_element ? + new z(q(opt_element)) : 100; + // -1: WRONG_INDENTATION +}; + +longFunctionName(a, b, c, + d, e, f); // WRONG_INDENTATION +longFunctionName(a, b, + c, // WRONG_INDENTATION + d); // WRONG_INDENTATION + +x = a ? b : + c; // WRONG_INDENTATION +y = a ? + b : c; // WRONG_INDENTATION + +switch (x) { + case 10: + break; // WRONG_INDENTATION + case 20: // WRONG_INDENTATION + break; +default: // WRONG_INDENTATION + break; +} + +while (true) { + x = 10; // WRONG_INDENTATION + break; // WRONG_INDENTATION +} + +function foo() { + return entryUrlTemplate + .replace( + '${authorResourceId}', + this.sanitizer_.sanitize(authorResourceId)); +} + +return [new x( + 10)]; +return [ + new x(10)]; + +return [new x( + 10)]; // WRONG_INDENTATION +return [new x( + 10)]; // WRONG_INDENTATION + +return {x: y( + z)}; +return { + x: y(z) +}; + +return {x: y( + z)}; // WRONG_INDENTATION +return {x: y( + z)}; // WRONG_INDENTATION + +return /** @type {Window} */ (x( +'javascript:"' + encodeURI(loadingMessage) + '"')); // WRONG_INDENTATION + +x = { + y: function() {} +}; + +x = { + y: foo, + z: bar + + baz // WRONG_INDENTATION +}; + +x({ + a: b +}, +10); + +z = function(arr, f, val, opt_obj) { + x(arr, function(val, index) { + rval = f.call(opt_obj, rval, val, index, arr); + }); +}; + +var xyz = [100, + 200, + 300]; + +var def = [100, + 200]; // WRONG_INDENTATION + +var ghi = [100, + 200]; // WRONG_INDENTATION + +var abcdefg = ('a' + + 'b'); + +var x9 = z('7: ' + +x(x)); // WRONG_INDENTATION + +function abc() { + var z = d('div', // UNUSED_LOCAL_VARIABLE + { + a: 'b' + }); +} + +abcdefg('p', {x: 10}, + 'Para 1'); + +function bar1() { + return 3 + + 4; // WRONG_INDENTATION +} + +function bar2() { + return 3 + // WRONG_INDENTATION + 4; // WRONG_INDENTATION +} + +function bar3() { + return 3 + // WRONG_INDENTATION + 4; +} + +// Regression test for unfiled bug. Wrongly going into implied block after else +// when there was an explicit block (was an else if) caused false positive +// indentation errors. +if (true) { +} else if (doc.foo( + doc.getBar(baz))) { + var x = 3; +} + +// Regression tests for function indent + 4. +// (The first example is from the styleguide.) +if (veryLongFunctionNameA( + veryLongArgumentName) || + veryLongFunctionNameB( + veryLongArgumentName)) { + veryLongFunctionNameC(veryLongFunctionNameD( + veryLongFunctioNameE( + veryLongFunctionNameF))); +} + +if (outer(middle( + inner(first)))) {} +if (outer(middle( + inner(second)), + outer_second)) {} +if (nested.outer( + first)) {} +if (nested.outer(nested.middle( + first))) {} +if (nested + .outer(nested.middle( + first))) {} +if (nested.outer(first + .middle( + second), + third)) {} + +// goog.scope should not increase indentation. +goog.scope(function() { +var x = 5; +while (x > 0) { + --x; +} +}); // goog.scope + + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +// +1: UNUSED_LOCAL_VARIABLE + var x = 5; // WRONG_INDENTATION +}); // goog.scope + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +var x = 5; // UNUSED_LOCAL_VARIABLE +}); // MISSING_END_OF_SCOPE_COMMENT + +goog.scope(function() { // EXTRA_GOOG_SCOPE_USAGE +var x = 5; // UNUSED_LOCAL_VARIABLE +}); // malformed goog.scope comment // MALFORMED_END_OF_SCOPE_COMMENT diff --git a/tools/closure_linter/closure_linter/testdata/interface.js b/tools/closure_linter/closure_linter/testdata/interface.js new file mode 100644 index 00000000000000..7daeee3ca8bbca --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/interface.js @@ -0,0 +1,89 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Test file for interfaces. + * @author robbyw@google.com (Robert Walker) + */ + +goog.provide('sample.BadInterface'); +goog.provide('sample.GoodInterface'); + + + +/** + * Sample interface to demonstrate correct style. + * @interface + */ +sample.GoodInterface = function() { +}; + + +/** + * Legal methods can take parameters and have a return type. + * @param {string} param1 First parameter. + * @param {Object} param2 Second parameter. + * @return {number} Some return value. + */ +sample.GoodInterface.prototype.legalMethod = function(param1, param2) { +}; + + +/** + * Legal methods can also take no parameters and return nothing. + */ +sample.GoodInterface.prototype.legalMethod2 = function() { + // Comments should be allowed. +}; + + +/** + * Legal methods can also be omitted, even with params and return values. + * @param {string} param1 First parameter. + * @param {Object} param2 Second parameter. + * @return {number} Some return value. + */ +sample.GoodInterface.prototype.legalMethod3; + + +/** + * Legal methods can also be set to abstract, even with params and return + * values. + * @param {string} param1 First parameter. + * @param {Object} param2 Second parameter. + * @return {number} Some return value. + */ +sample.GoodInterface.prototype.legalMethod4 = goog.abstractMethod; + + + +/** + * Sample interface to demonstrate style errors. + * @param {string} a This is illegal. + * @interface + */ +sample.BadInterface = function(a) { // INTERFACE_CONSTRUCTOR_CANNOT_HAVE_PARAMS + this.x = a; // INTERFACE_METHOD_CANNOT_HAVE_CODE +}; + + +/** + * It is illegal to include code in an interface method. + * @param {string} param1 First parameter. + * @param {Object} param2 Second parameter. + * @return {number} Some return value. + */ +sample.BadInterface.prototype.illegalMethod = function(param1, param2) { + return 10; // INTERFACE_METHOD_CANNOT_HAVE_CODE +}; diff --git a/tools/closure_linter/closure_linter/testdata/jsdoc.js b/tools/closure_linter/closure_linter/testdata/jsdoc.js new file mode 100644 index 00000000000000..d62fd3c5fcb717 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/jsdoc.js @@ -0,0 +1,1455 @@ +// Copyright 2007 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Errors related to JsDoc. + * + * @author robbyw@google.com (Robby Walker) + * + * @author robbyw@google.com (Robby Walker) // EXTRA_SPACE, EXTRA_SPACE + * @author robbyw@google.com(Robby Walker) // MISSING_SPACE + * + * @author robbyw@google.com () // INVALID_AUTHOR_TAG_DESCRIPTION + * @author robbyw@google.com // INVALID_AUTHOR_TAG_DESCRIPTION + * + * @owner ajp@google.com (Andy Perelson) + * @badtag // INVALID_JSDOC_TAG + * @customtag This tag is passed as a flag in full_test.py + * @requires anotherCustomTagPassedInFromFullTestThatShouldAllowASingleWordLongerThan80Lines + * @requires firstWord, secondWordWhichShouldMakeThisLineTooLongSinceThereIsAFirstWord + * @wizmodule + * @wizModule // INVALID_JSDOC_TAG + */ +// -4: LINE_TOO_LONG + +goog.provide('MyClass'); +goog.provide('goog.NumberLike'); +goog.provide('goog.math.Vec2.sum'); + +goog.require('goog.array'); +goog.require('goog.color'); +goog.require('goog.dom.Range'); +goog.require('goog.math.Matrix'); +goog.require('goog.math.Vec2'); + + +/** + * Test the "no compilation should be done after annotation processing" tag. + * @nocompile + */ + + +/** + * @returns // INVALID_JSDOC_TAG + * @params // INVALID_JSDOC_TAG + * @defines // INVALID_JSDOC_TAG + * @nginject // INVALID_JSDOC_TAG + * @wizAction // INVALID_JSDOC_TAG + */ +function badTags() { +} + + +// +4: MISSING_JSDOC_TAG_DESCRIPTION +/** + * @license Description. + * @preserve Good tag, missing punctuation + * @preserve + */ +function goodTags() { + /** @preserveTry */ + try { + hexColor = goog.color.parse(value).hex; + } catch (ext) { + // Regression test. The preserveTry tag was incorrectly causing a warning + // for a missing period at the end of tag description. Parsed as + // flag: preserve, description: Try. + } +} + + +/** + * Some documentation goes here. + * + * @param {Object} object Good docs. + * @ngInject + * @wizaction + */ +function good(object) { +} + + +/** + * Some documentation goes here. + * @param {function(string, string) : string} f A function. + */ +function setConcatFunc(f) { +} + + +/** + * Some docs. + */ +function missingParam(object) { // MISSING_PARAMETER_DOCUMENTATION +} + + +/** + * @return {number} Hiya. + * @override + */ +function missingParamButInherit(object) { + return 3; +} + + +/** + * @inheritDoc + */ +function missingParamButInherit(object) { +} + + +/** + * @override + */ +function missingParamButOverride(object) { +} + + +// +2: UNNECESSARY_BRACES_AROUND_INHERIT_DOC +/** + * {@inheritDoc} + */ +function missingParamButInherit(object) { +} + + +/** + * Some docs. + * + * @param {Object} object Docs. + */ +function mismatchedParam(elem) { // WRONG_PARAMETER_DOCUMENTATION + /** @param {number} otherElem */ + function nestedFunction(elem) { // WRONG_PARAMETER_DOCUMENTATION + }; +} + + +/** + * @return {boolean} A boolean primitive. + */ +function goodReturn() { + return something; +} + + +/** + * @return {some.long.type.that.will.make.the.description.start.on.next.line} + * An object. + */ +function anotherGoodReturn() { + return something; +} + + +// +2: MISSING_JSDOC_TAG_TYPE +/** + * @return false. + */ +function missingReturnType() { + return something; +} + + +// +2: MISSING_SPACE +/** + * @return{type} + */ +function missingSpaceOnReturnType() { + return something; +} + + +// +2: MISSING_JSDOC_TAG_TYPE +/** + * @return + */ +function missingReturnType() { + return something; +} + +class.missingDocs = function() { // MISSING_MEMBER_DOCUMENTATION +}; + + +/** + * No return doc needed. + */ +function okMissingReturnDoc() { + return; +} + + +// +2: UNNECESSARY_RETURN_DOCUMENTATION +/** + * @return {number} Unnecessary return doc. + */ +function unnecessaryMissingReturnDoc() { +} + + +/** + * The "suppress" causes the compiler to ignore the 'debugger' statement. + * @suppress {checkDebuggerStatement} + */ +function checkDebuggerStatementWithSuppress() { + debugger; +} + + +/** + * Return doc is present, but the function doesn't have a 'return' statement. + * The "suppress" causes the compiler to ignore the error. + * @suppress {missingReturn} + * @return {string} + */ +function unnecessaryMissingReturnDocWithSuppress() { + if (false) { + return ''; + } else { + // Missing return statement in this branch. + } +} + + +// +3: MISSING_JSDOC_TAG_TYPE +// +2: UNNECESSARY_RETURN_DOCUMENTATION +/** + * @return + */ +function unnecessaryMissingReturnNoType() { +} + + +/** + * @return {undefined} Ok unnecessary return doc. + */ +function okUnnecessaryMissingReturnDoc() { +} + + +/** + * @return {*} Ok unnecessary return doc. + */ +function okUnnecessaryMissingReturnDoc2() { +} + + +/** + * @return {void} Ok unnecessary return doc. + */ +function okUnnecessaryMissingReturnDoc3() { +} + + +/** + * This function doesn't return anything, but it does contain the string return. + */ +function makeSureReturnTokenizesRight() { + fn(returnIsNotSomethingHappeningHere); +} + + +/** + * @return {number|undefined} Ok unnecessary return doc. + */ +function okUnnecessaryMissingReturnDoc3() { +} + + +/** + * @return {number} Ok unnecessary return doc. + */ +function okUnnecessaryReturnWithThrow() { + throw 'foo'; +} + + +/** @inheritDoc */ +function okNoReturnWithInheritDoc() { + return 10; +} + + +/** @override */ +function okNoReturnWithOverride() { + return 10; +} + + +/** + * No return doc. + */ // MISSING_RETURN_DOCUMENTATION +function badMissingReturnDoc() { + return 10; +} + + + +/** + * Constructor so we should not have a return jsdoc tag. + * @constructor + */ +function OkNoReturnWithConstructor() { + return this; +} + + +/** + * Type of array is known, so the cast is unnecessary. + * @suppress {unnecessaryCasts} + */ +function unnecessaryCastWithSuppress() { + var numberArray = /** @type {!Array.} */ ([]); + /** @type {number} */ (goog.array.peek(numberArray)); +} + + + +/** + * Make sure the 'unrestricted' annotation is accepted. + * @constructor @unrestricted + */ +function UnrestrictedClass() {} + + + +/** + * Check definition of fields in constructors. + * @constructor + */ +function AConstructor() { + /** + * A field. + * @type {string} + * @private + */ + this.isOk_ = 'ok'; + + // +5: MISSING_PRIVATE + /** + * Another field. + * @type {string} + */ + this.isBad_ = 'missing private'; + + /** + * This is ok, but a little weird. + * @type {number} + * @private + */ + var x = this.x_ = 10; + + // At first, this block mis-attributed the first typecast as a member doc, + // and therefore expected it to contain @private. + if (goog.math.Matrix.isValidArray(/** @type {Array} */ (m))) { + this.array_ = goog.array.clone(/** @type {Array.>} */ (m)); + } + + // Use the private and local variables we've defined so they don't generate a + // warning. + var y = [ + this.isOk_, + this.isBad_, + this.array_, + this.x_, + y, + x + ]; +} + + +/** + * @desc This message description is allowed. + */ +var MSG_YADDA_YADDA_YADDA = 'A great message!'; + + +/** + * @desc So is this one. + * @hidden + * @meaning Some unusual meaning. + */ +x.y.z.MSG_YADDA_YADDA_YADDA = 'A great message!'; + + +/** + * @desc But desc can only apply to messages. + */ +var x = 10; // INVALID_USE_OF_DESC_TAG + + +/** + * Same with hidden. + * @hidden + */ +var x = 10; // INVALID_USE_OF_DESC_TAG + + +/** + * Same with meaning. + * @meaning Some unusual meaning. + */ +var x = 10; // INVALID_USE_OF_DESC_TAG + + +// +9: MISSING_SPACE +// +9: MISSING_JSDOC_TAG_TYPE +// +10: OUT_OF_ORDER_JSDOC_TAG_TYPE +// +10: MISSING_JSDOC_TAG_TYPE, MISSING_SPACE +/** + * Lots of problems in this documentation. + * + * @param {Object} q params b & d are missing descriptions. + * @param {Object} a param d is missing a type (oh my). + * @param {Object}b + * @param d + * @param {Object} x param desc. + * @param z {type} Out of order type. + * @param{} y Empty type and missing space. + * @param {Object} omega mis-matched param. + */ +function manyProblems(a, b, c, d, x, z, y, alpha) { + // -1: MISSING_PARAMETER_DOCUMENTATION, EXTRA_PARAMETER_DOCUMENTATION + // -2: WRONG_PARAMETER_DOCUMENTATION +} + + +/** + * Good docs + * + * @param {really.really.really.really.really.really.really.long.type} good + * My param description. + * @param {really.really.really.really.really.really.really.really.long.type} + * okay My param description. + * @param + * {really.really.really.really.really.really.really.really.really.really.long.type} + * fine Wow that's a lot of wrapping. + */ +function wrappedParams(good, okay, fine) { +} + + +// +4: MISSING_JSDOC_TAG_TYPE +// +3: MISSING_JSDOC_PARAM_NAME +/** + * Really bad + * @param + */ +function reallyBadParam(a) { // MISSING_PARAMETER_DOCUMENTATION +} + + +/** + * Some docs. + * + * @private + */ +class.goodPrivate_ = function() { +}; + + +/** + * Some docs. + */ +class.missingPrivate_ = function() { // MISSING_PRIVATE +}; + + +/** + * Some docs. + * + * @private + */ +class.extraPrivate = function() { // EXTRA_PRIVATE +}; + + +/** + * Anything ending with two underscores is not treated as private. + */ +class.__iterator__ = function() { +}; + + +/** + * Some docs. + * @package + */ +class.goodPackage = function() { +}; + + +/** + * Some docs. + * @package + */ +class.badPackage_ = function() { // MISSING_PRIVATE +}; + + +/** + * Some docs. + * @protected + */ +class.goodProtected = function() { +}; + + +/** + * Some docs. + * @protected + */ +class.badProtected_ = function() { // MISSING_PRIVATE +}; + + +/** + * Example of a legacy name. + * @protected + * @suppress {underscore} + */ +class.dom_ = function() { + /** @suppress {with} */ + with ({}) {} +}; + + +/** + * Legacy names must be protected. + * @suppress {underscore} + */ +class.dom_ = function() { +}; + + +/** + * Allow compound suppression. + * @private + */ +class.dom_ = function() { + /** @suppress {visibility|with} */ + with ({}) {} +}; + + +/** + * Allow compound suppression. + * @private + */ +class.dom_ = function() { + /** @suppress {visibility,with} */ + with ({}) {} +}; + + +// +4: UNNECESSARY_SUPPRESS +/** + * Some docs. + * @private + * @suppress {underscore} + */ +class.unnecessarySuppress_ = function() { +}; + + +/** + * Some docs. + * @public + */ +class.goodProtected = function() { +}; + + +/** + * Some docs. + * @public + */ +class.badProtected_ = function() { // MISSING_PRIVATE +}; + + +/** + * Example of a legacy name. + * @public + * @suppress {underscore} + */ +class.dom_ = function() { +}; + + +// +5: JSDOC_PREFER_QUESTION_TO_PIPE_NULL +// +7: JSDOC_PREFER_QUESTION_TO_PIPE_NULL +/** + * Check JsDoc type annotations. + * @param {Object?} good A good one. + * @param {Object|null} bad A bad one. + * @param {Object|Element?} ok1 This is acceptable. + * @param {Object|Element|null} right The right way to do the above. + * @param {null|Object} bad2 Another bad one. + * @param {Object?|Element} ok2 Not good but acceptable. + * @param {Array.?} complicated A good one that was reported as + * bad. See bug 1154506. + */ +class.sampleFunction = function(good, bad, ok1, right, bad2, ok2, + complicated) { +}; + + +/** + * @return {Object?} A good return. + */ +class.goodReturn = function() { + return something; +}; + + +/** @type {Array.} // JSDOC_PREFER_QUESTION_TO_PIPE_NULL */ +class.badType; + + +/** + * For template types, the ?TYPE notation is not parsed correctly by the + * compiler, so don't warn here. + * @type {Array.} + * @template TYPE + */ +class.goodTemplateType; + + +// As the syntax may look ambivalent: The function returns just null. +/** @type {function():null|Object} */ +class.goodType; + + +/** @type {function():(null|Object)} // JSDOC_PREFER_QUESTION_TO_PIPE_NULL */ +class.badType; + + +// As the syntax may look ambivalent: The function returns just Object. +/** @type {function():Object|null} // JSDOC_PREFER_QUESTION_TO_PIPE_NULL */ +class.badType; + + +/** @type {(function():Object)|null} // JSDOC_PREFER_QUESTION_TO_PIPE_NULL */ +class.badType; + + +/** @type {function(null,Object)} */ +class.goodType; + + +/** @type {{a:null,b:Object}} */ +class.goodType; + + +// +2: JSDOC_PREFER_QUESTION_TO_PIPE_NULL +/** + * @return {Object|null} A bad return. + */ +class.badReturn = function() { + return something; +}; + + +/** + * @return {Object|Element?} An not so pretty return, but acceptable. + */ +class.uglyReturn = function() { + return something; +}; + + +/** + * @return {Object|Element|null} The right way to do the above. + */ +class.okReturn = function() { + return something; +}; + + +// +2: MISSING_SPACE, MISSING_SPACE +/** + * @return{mytype}Something. + */ +class.missingSpacesReturn = function() { + return something; +}; + + +/** + * A good type in the new notation. + * @type {Object?} + */ +class.otherGoodType = null; + + +/** + * A complex type that should allow both ? and |. + * @bug 1570763 + * @type {function(number?, Object|undefined):void} + */ +class.complexGoodType = goog.nullFunction; + + +/** + * A complex bad type that we can catch, though there are many we can't. + * Its acceptable. + * @type {Array.|string?} + */ +class.complexBadType = x || 'foo'; + + +/** + * A strange good type that caught a bad version of type checking from + * other.js, so I added it here too just because. + * @type {number|string|Object|Element|Array.|null} + */ +class.aStrangeGoodType = null; + + +/** + * A type that includes spaces. + * @type {function() : void} + */ +class.assignedFunc = goog.nullFunction; + + +// +4: JSDOC_PREFER_QUESTION_TO_PIPE_NULL +// +3: MISSING_BRACES_AROUND_TYPE +/** + * A bad type. + * @type Object|null + */ +class.badType = null; + + +// +3: JSDOC_PREFER_QUESTION_TO_PIPE_NULL +/** + * A bad type, in the new notation. + * @type {Object|null} + */ +class.badType = null; + + +/** + * An not pretty type, but acceptable. + * @type {Object|Element?} + */ +class.uglyType = null; + + +/** + * The right way to do the above. + * @type {Object|Element|null} + */ +class.okType = null; + + +/** + * @type {boolean} Is it okay to have a description here? + */ +class.maybeOkType = null; + + +/** + * A property whose type will be infered from the right hand side since it is + * constant. + * @const + */ +class.okWithoutType = 'stout'; + + +/** + * Const property without type and text in next line. b/10407058. + * @const + * TODO(user): Nothing to do, just for scenario. + */ +class.okWithoutType = 'string'; + + +/** + * Another constant property, but we should use the type tag if the type can't + * be inferred. + * @type {string} + * @const + */ +class.useTypeWithConst = functionWithUntypedReturnValue(); + + +/** + * Another constant property, but using type with const if the type can't + * be inferred. + * @const {string} + */ +class.useTypeWithConst = functionWithUntypedReturnValue(); + + +// +3: MISSING_BRACES_AROUND_TYPE +/** + * Constant property without proper type. + * @const string + */ +class.useImproperTypeWithConst = functionWithUntypedReturnValue(); + + +/** + * @define {boolean} A define. + */ +var COMPILED = false; + + +// +2: MISSING_JSDOC_TAG_TYPE +/** + * @define A define without type info. + */ +var UNTYPED_DEFINE = false; + + +// +4: MISSING_JSDOC_TAG_DESCRIPTION, MISSING_SPACE +/** + * A define without a description and missing a space. + * + * @define{boolean} + */ +var UNDESCRIBED_DEFINE = false; + + +// Test where to check for docs. +/** + * Docs for member object. + * @type {Object} + */ +x.objectContainingFunctionNeedsNoDocs = { + x: function(params, params) {} +}; + +if (test) { + x.functionInIfBlockNeedsDocs = function() { // MISSING_MEMBER_DOCUMENTATION + x.functionInFunctionNeedsNoDocs = function() { + }; + }; +} else { + x.functionInElseBlockNeedsDocs = function() { // MISSING_MEMBER_DOCUMENTATION + x.functionInFunctionNeedsNoDocs = function() { + }; + }; +} + + +/** + * Regression test. + * @param {goog.math.Vec2} a + * @param {goog.math.Vec2} b + * @return {goog.math.Vec2} The sum vector. + */ +goog.math.Vec2.sum = function(a, b) { + return new goog.math.Vec2(a.x + b.x, a.y + b.y); +}; + + +// +6: JSDOC_MISSING_OPTIONAL_PREFIX +// +8: JSDOC_MISSING_OPTIONAL_PREFIX +// +8: JSDOC_MISSING_OPTIONAL_TYPE +// +8: JSDOC_MISSING_OPTIONAL_TYPE +/** + * Optional parameters test. + * @param {number=} numberOptional The name should be prefixed by opt_. + * @param {function(number=)} funcOk Ok. + * @param {number} numberOk The type is ok. + * @param {function(string=):number=} funcOpt Param name need opt_ prefix. + * @param {string} opt_stringMissing The type miss an ending =. + * @param {function(number=)} opt_func The type miss an ending =. + * @param {string=} opt_ok The type is ok. + * @param {function(string=):number=} opt_funcOk Type is ok. + */ +goog.math.Vec2.aFunction = function( + numberOptional, funcOk, numberOk, funcOpt, opt_stringMissing, opt_func, + opt_ok, opt_funcOk) { +}; + + +/** + * Good documentation! + * + * @override + */ +class.goodOverrideDocs = function() { +}; + + +/** + * Test that flags embedded in docs don't trigger ends with invalid character + * error. + * @bug 2983692 + * @deprecated Please use the {@code @hidden} annotation. + */ +function goodEndChar() { +} + + +/** + * Test that previous case handles unballanced doc tags. + * @param {boolean} a Whether we should honor '{' characters in the string. + */ +function goodEndChar2(a) { +} + + +/** + * Regression test for braces in description invalidly being matched as types. + * This caused a false error for missing punctuation because the bad token + * caused us to incorrectly calculate the full description. + * @bug 1406513 + * @return {Object|undefined} A hash containing the attributes for the found url + * as in: {url: "page1.html", title: "First page"} + * or undefined if no match was found. + */ +x.z.a = function() { + return a; +}; + + +/** + * @bug 1492606 HTML parse error for JSDoc descriptions grashed gjslint. + * @param {string} description a long email or common name, e.g., + * "John Doe " or "Birthdays Calendar" + */ +function calendar(description) { +} + + +/** + * @bug 1492606 HTML parse error for JSDoc descriptions grashed gjslint. + * @param {string} description a long email or common name, e.g., + * "John Doe " or "Birthdays Calendar". + */ +function calendar(description) { +} + + +/** + * Regression test for invoked functions, this code used to report missing + * param and missing return errors. + * @type {number} + */ +x.y.z = (function(x) { + return x + 1; +})(); + + +/** + * Test for invoked function as part of an expression. It should not return + * an error for missing docs for x. + */ +goog.currentTime = something.Else || (function(x) { + //... +})(10); + + +/** + * @type boolean //MISSING_BRACES_AROUND_TYPE + */ +foo.bar = true; + + +/** + * @enum {null //MISSING_BRACES_AROUND_TYPE + */ +bar.foo = null; + + +/** + * @extends Object} //MISSING_BRACES_AROUND_TYPE + */ // JSDOC_DOES_NOT_PARSE +bar.baz = x; + + +/** @inheritDoc */ // INVALID_INHERIT_DOC_PRIVATE +x.privateFoo_ = function() { // MISSING_PRIVATE +}; + + +/** + * Does bar. + * @override // INVALID_OVERRIDE_PRIVATE + */ +x.privateBar_ = function() { // MISSING_PRIVATE +}; + + +/** + * Inherits private baz_ method (evil, wrong behavior, but we have no choice). + * @override + * @suppress {accessControls} + */ +x.prototype.privateBaz_ = function() { +}; + + +/** + * This looks like a function but it's a function call. + * @type {number} + */ +test.x = function() { + return 3; +}(); + + +/** + * Invalid reference to this. + */ // MISSING_JSDOC_TAG_THIS +test.x.y = function() { + var x = this.x; // UNUSED_LOCAL_VARIABLE +}; + + +/** + * Invalid write to this. + */ // MISSING_JSDOC_TAG_THIS +test.x.y = function() { + this.x = 10; +}; + + +/** + * Invalid standalone this. + */ // MISSING_JSDOC_TAG_THIS +test.x.y = function() { + some.func.call(this); +}; + + +/** + * Invalid reference to this. + */ // MISSING_JSDOC_TAG_THIS +function a() { + var x = this.x; // UNUSED_LOCAL_VARIABLE +} + + +/** + * Invalid write to this. + */ // MISSING_JSDOC_TAG_THIS +function b() { + this.x = 10; +} + + +/** + * Invalid standalone this. + */ // MISSING_JSDOC_TAG_THIS +function c() { + some.func.call(this); +} + + +/** + * Ok to do any in a prototype. + */ +test.prototype.x = function() { + var x = this.x; + this.y = x; + some.func.call(this); +}; + + +/** + * Ok to do any in a prototype that ends in a hex-like number. + */ +test.prototype.getColorX2 = function() { + var x = this.x; + this.y = x; + some.func.call(this); +}; + + +/** + * Ok to do any in a function with documented this usage. + * @this {test.x.y} Object bound to this via goog.bind. + */ +function a() { + var x = this.x; + this.y = x; + some.func.call(this); +} + + +/** + * Ok to do any in a function with documented this usage. + * @this {test.x.y} Object bound to this via goog.bind. + */ +test.x.y = function() { + var x = this.x; + this.y = x; + some.func.call(this); +}; + + +/** + * Regression test for bug 1220601. Wrapped function declarations shouldn't + * cause need for an (at)this flag, which I can't write out or it would get + * parsed as being here. + * @param {Event} e The event. + */ +detroit.commands.ChangeOwnerCommand + .prototype.handleDocumentStoreCompleteEvent = function(e) { + this.x = e.target; +}; + + + +/** + * Ok to do any in a constructor. + * @constructor + */ +test.x.y = function() { + this.y = x; + var x = this.y; // UNUSED_LOCAL_VARIABLE + some.func.call(this); +}; + +// Test that anonymous function doesn't throw an error. +window.setTimeout(function() { + var x = 10; // UNUSED_LOCAL_VARIABLE +}, 0); + + +/** + * @bug 1234567 + */ +function testGoodBug() { +} + + +/** + * @bug 1234567 Descriptions are allowed. + */ +function testGoodBugWithDescription() { +} + + +// +2: NO_BUG_NUMBER_AFTER_BUG_TAG +/** + * @bug Wrong + */ +function testBadBugNumber() { +} + + +// +2: NO_BUG_NUMBER_AFTER_BUG_TAG +/** + * @bug Wrong + */ +function testMissingBugNumber() { +} + + + +/** + * @interface + */ +function testInterface() { +} + + + +/** + * @implements {testInterface} + * @constructor + */ +function testImplements() { +} + + +/** + * Function that has an export jsdoc tag. + * @export + */ +function testExport() { +} + + +/** + * Declare and doc this member here, without assigning to it. + * @bug 1473402 + * @type {number} + */ +x.declareOnly; + +if (!someCondition) { + x.declareOnly = 10; +} + + +/** + * JsDoc describing array x.y as an array of function(arg). The missing + * semicolon caused the original bug. + * @type {Array.} + */ +x.y = [] // MISSING_SEMICOLON +x.y[0] = function(arg) {}; +x.y[1] = function(arg) {}; + + +/** + * Regression test for unfiled bug where descriptions didn't properly exclude + * the star-slash that must end doc comments. + * @return {Function} A factory method. + */ +x.y.foo = function() { + /** @return {goog.dom.Range} A range. */ + return function() { + return goog.dom.Range.createRangeFromNothing(); + }; +}; + + +// +4: INCORRECT_SUPPRESS_SYNTAX +// +4: INVALID_SUPPRESS_TYPE +/** + * Docs... + * @suppress + * @suppress {fake} + */ +class.x = 10; + + +/** + * These docs are OK. They used to not parse the identifier due to the use of + * array indices. + * @bug 1640846 + * @private + */ +window['goog']['forms']['Validation'].prototype.form_ = null; + + +/** + * Check JsDoc multiline type annotations. + * @param {string| + * number} multiline description. + */ +function testMultiline(multiline) { +} + + +/** + * Check JsDoc nosideeffects annotations. + * @nosideeffects + */ +function testNoSideEffects() { +} + + +/** + * @enum {google.visualization.DateFormat|google.visualization.NumberFormat| + * google.visualization.PatternFormat} + */ +MultiLineEnumTypeTest = { + FOO: 1, + BAR: 2, + BAZ: 3 +}; + + +/** + * @enum {google.visualization.DateFormat|google.visualization.NumberFormat|google.visualization.PatternFormat} + */ +AllowedLongLineEnum = { + CAT: 1, + DOG: 2, + RAT: 3 +}; + + +/** + * Typeless enum test + * @enum + */ +TypelessEnumTest = { + OK: 0, + CHECKING: 1, + DOWNLOADING: 2, + FAILURE: 3 +}; + +// Regression test for bug 1880803, shouldn't need to document assignments to +// prototype. +x.prototype = {}; + +y + .prototype = {}; + +x.y + .z.prototype = {}; + +x.myprototype = {}; // MISSING_MEMBER_DOCUMENTATION + +x.prototype.y = 5; // MISSING_MEMBER_DOCUMENTATION + +x.prototype + .y.z = {}; // MISSING_MEMBER_DOCUMENTATION + + +/** @typedef {(string|number)} */ +goog.NumberLike; + + +/** + * Something from the html5 externs file. + * @type {string} + * @implicitCast + */ +CanvasRenderingContext2D.prototype.fillStyle; + + + +/** + * Regression test. + * @bug 2994247 + * @inheritDoc + * @extends {Bar} + * @constructor + * @private + */ +Foo_ = function() { +}; + + +/** + * @param {function(this:T,...)} fn The function. + * @param {T} obj The object. + * @template T + */ +function bind(fn, obj) { +} + + + +/** + * @constructor + * @classTemplate T + */ +function MyClass() { +} + + +foo(/** @lends {T} */ ({foo: 'bar'})); + + + +/** + * @param {*} x . + * @constructor + * @struct + */ +function StructMaker(x) { this.x = x; } + +var structObjLit = /** @struct */ { x: 123 }; + + + +/** + * @param {*} x . + * @constructor + * @dict + */ +function DictMaker(x) { this['x'] = x; } + +var dictObjLit = /** @dict */ { x: 123 }; + + +/** + * @idGenerator + * @param {string} x . + * @return {string} . + */ +function makeId(x) { + return ''; +} + + +/** + * @consistentIdGenerator + * @param {string} x . + * @return {string} . + */ +function makeConsistentId(x) { + return ''; +} + + +/** + * @stableIdGenerator + * @param {string} x . + * @return {string} . + */ +function makeStableId(x) { + return ''; +} + + +/** + * Test to make sure defining object with object literal doest not produce + * doc warning for @this. + * Regression test for b/4073735. + */ +var Foo = function(); +Foo.prototype = { + /** + * @return {number} Never. + */ + method: function() { + return this.method(); + } +}; + +/** Regression tests for annotation types with spaces. */ + + +/** @enum {goog.events.Event} */ +var Bar; + + + +/** + * @constructor + * @implements {goog.dom.Range} + */ +var Foo = function() { + /** @final {goog.events.Event} */ + this.bar = null; +}; + +/* Regression tests for not ending block comments. Keep at end of file! **/ +/** + * When there are multiple asteriks. In the failure case we would get an + * error that the file ended mid comment, with no end comment token***/ +/** + * Was a separate bug 2950646 when the closing bit was on it's own line + * because the ending star was being put into a different token type: DOC_PREFIX + * rather than DOC_COMMENT. + **/ diff --git a/tools/closure_linter/closure_linter/testdata/limited_doc_checks.js b/tools/closure_linter/closure_linter/testdata/limited_doc_checks.js new file mode 100644 index 00000000000000..701cce9892be20 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/limited_doc_checks.js @@ -0,0 +1,29 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Test file for limited doc checks. + */ + + +/** + * Don't require documentation of parameters. + * @param {boolean} + * @param {boolean} c + * @param {boolean} d No check for punctuation + * @bug 3259564 + */ +x.y = function(a, b, c, d) { + return a; +}; diff --git a/tools/closure_linter/closure_linter/testdata/minimal.js b/tools/closure_linter/closure_linter/testdata/minimal.js new file mode 100644 index 00000000000000..6dbe7333f41d39 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/minimal.js @@ -0,0 +1 @@ +function f(x) {} // Regression test for old parsing bug. diff --git a/tools/closure_linter/closure_linter/testdata/not_strict.js b/tools/closure_linter/closure_linter/testdata/not_strict.js new file mode 100644 index 00000000000000..f8ede3dc1d3e31 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/not_strict.js @@ -0,0 +1,42 @@ +/** // _WRONG_BLANK_LINE_COUNT + * @fileoverview This file has errors that could trigger both in strict and non + * strict mode. The errors beginning with _ should not be triggered when strict + * flag is false. + * // -1: _INVALID_AUTHOR_TAG_DESCRIPTION + */ + +/** // _WRONG_BLANK_LINE_COUNT + * A constructor with 1 line above it (BAD). + * // +1: MISSING_JSDOC_TAG_TYPE + * @param a A parameter. + * @privtae // INVALID_JSDOC_TAG + * @constructor + */ +function someFunction(a) { + /** +1: _MISSING_BRACES_AROUND_TYPE + * @type number + */ + this.a = 0; + someReallyReallyReallyReallyReallyReallyReallyReallyLongiName = quiteBigValue; // LINE_TOO_LONG + if (this.a == 0) { + // _WRONG_INDENTATION + return // MISSING_SEMICOLON + } +}; // ILLEGAL_SEMICOLON_AFTER_FUNCTION + + +// +1: _UNNECESSARY_BRACES_AROUND_INHERIT_DOC +/** {@inheritDoc} */ +function someFunction.prototype.toString() { +} + + +/** + * When not strict, there is no problem with optional markers in types. + * @param {string=} a A string. + * @param {string} aOk An other string. + * @param {number} opt_b An optional number. + * @param {number=} opt_bOk An other optional number. + */ +someFunction.optionalParams = function(a, aOk, opt_b, opt_bOk) { +}; diff --git a/tools/closure_linter/closure_linter/testdata/other.js b/tools/closure_linter/closure_linter/testdata/other.js new file mode 100644 index 00000000000000..1e424ce3f2cfa9 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/other.js @@ -0,0 +1,459 @@ +// Copyright 2007 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Miscellaneous style errors. + * + * @author robbyw@google.com (Robby Walker) + */ + +goog.provide('goog.dom'); + +goog.require('goog.events.EventHandler'); + +var this_is_a_really_long_line = 100000000000000000000000000000000000000000000000; // LINE_TOO_LONG + +// Declaration in multiple lines. +// Regression test for b/3009648 +var + a, + b = 10; + +// http://this.comment.should.be.allowed/because/it/is/a/URL/that/can't/be/broken/up + + +/** + * Types are allowed to be long even though they contain spaces. + * @type {function(ReallyReallyReallyReallyLongType, AnotherExtremelyLongType) : LongReturnType} + */ +x.z = 1000; + + +/** + * Params are also allowed to be long even though they contain spaces. + * @param {function(ReallyReallyReallyReallyLongType, AnotherExtremelyLongType) : LongReturnType} fn + * The function to call. + */ +x.z = function(fn) { +}; + + +/** + * Visibility tags are allowed to have type, therefore they allowed to be long. + * @private {function(ReallyReallyReallyReallyLongType, AnotherExtremelyLongType) : LongReturnType} + */ +x.z_ = 1000; + + +/** + * Visibility tags are allowed to have type, therefore they allowed to be long. + * @public {function(ReallyReallyReallyReallyLongType, AnotherExtremelyLongType) : LongReturnType} + */ +x.z = 1000; + + +/** + * Visibility tags are allowed to have type, therefore they allowed to be long. + * @protected {function(ReallyReallyReallyReallyLongType, AnotherExtremelyLongType) : LongReturnType} + */ +x.z = 1000; + + +/** + * Visibility tags are allowed to have type, therefore they allowed to be long. + * @package {function(ReallyReallyReallyReallyLongType,AnotherExtremelyLongType):LongReturnType} + */ +x.z = 1000; + +// +2: LINE_TOO_LONG +var x = + a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.a.b.c.d.tooLongEvenThoughNoSpaces; + +// +1: LINE_TOO_LONG +getSomeExtremelyLongNamedFunctionWowThisNameIsSoLongItIsAlmostUnbelievable().dispose(); + + +/** + * @param {number|string|Object|Element|Array.|null} aReallyReallyReallyStrangeParameter + * @param {number|string|Object|Element|goog.a.really.really.really.really.really.really.really.really.long.Type|null} shouldThisParameterWrap + * @return {goog.a.really.really.really.really.really.really.really.really.long.Type} + */ +x.y = function(aReallyReallyReallyStrangeParameter, shouldThisParameterWrap) { + return something; +}; + + +/** + * @type {goog.a.really.really.really.really.really.really.really.really.long.Type?} + */ +x.y = null; + +function doesEndWithSemicolon() { +}; // ILLEGAL_SEMICOLON_AFTER_FUNCTION + +function doesNotEndWithSemicolon() { +} + +doesEndWithSemicolon = function() { + // +1: UNUSED_LOCAL_VARIABLE + var shouldEndWithSemicolon = function() { + } // MISSING_SEMICOLON_AFTER_FUNCTION +}; + +doesNotEndWithSemicolon = function() { +} // MISSING_SEMICOLON_AFTER_FUNCTION + +doesEndWithSemicolon['100'] = function() { +}; + +doesNotEndWithSemicolon['100'] = function() { +} // MISSING_SEMICOLON_AFTER_FUNCTION + +if (some_flag) { + function doesEndWithSemicolon() { + }; // ILLEGAL_SEMICOLON_AFTER_FUNCTION + + function doesNotEndWithSemicolon() { + } + + doesEndWithSemicolon = function() { + }; + + doesNotEndWithSemicolon = function() { + } // MISSING_SEMICOLON_AFTER_FUNCTION +} + +// No semicolon for expressions that are immediately called. +var immediatelyCalledFunctionReturnValue = function() { +}(); + + +/** + * Regression test for function expressions treating semicolons wrong. + * @bug 1044052 + */ +goog.now = Date.now || function() { + //... +}; + + +/** + * Regression test for function expressions treating semicolons wrong. + * @bug 1044052 + */ +goog.now = Date.now || function() { + //... +} // MISSING_SEMICOLON_AFTER_FUNCTION + + +/** + * Function defined in ternary operator + * @bug 1413743 + * @param {string} id The ID of the element. + * @return {Element} The matching element. + */ +goog.dom.$ = document.getElementById ? + function(id) { + return document.getElementById(id); + } : + function(id) { + return document.all[id]; + }; + + +/** + * Test function in object literal needs no semicolon. + * @type {Object} + */ +x.y = { + /** + * @return {number} Doc the inner function too. + */ + a: function() { + return 10; + } +}; + +// Semicolon required at end of object literal. +var throwObjectLiteral = function() { + throw { + x: 0, + y: 1 + } // MISSING_SEMICOLON +}; + +var testRegex = /(\([^\)]*\))|(\[[^\]]*\])|({[^}]*})|(<[^&]*>)/g; +var testRegex2 = /abc/gimsx; + +var x = 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + + 20; // LINE_STARTS_WITH_OPERATOR + +var x = 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + 100 + + -20; // unary minus is ok + +var x = z++ + + 20; // LINE_STARTS_WITH_OPERATOR + +var x = z. // LINE_ENDS_WITH_DOT + y(); + +// Regression test: This line was incorrectly not reporting an error +var marginHeight = x.layout.getSpacing_(elem, 'marginTop') + + x.layout.getSpacing_(elem, 'marginBottom'); +// -1: LINE_STARTS_WITH_OPERATOR + +// Regression test: This line was correctly reporting an error +x.layout.setHeight(elem, totalHeight - paddingHeight - borderHeight + - marginHeight); // LINE_STARTS_WITH_OPERATOR + +// Regression test: This line was incorrectly reporting spacing and binary +// operator errors +if (i == index) { +} +++i; + +var twoSemicolons = 10;; // REDUNDANT_SEMICOLON + +if (i == index) { +} else; // REDUNDANT_SEMICOLON +i++; + +do; // REDUNDANT_SEMICOLON +{ +} while (i == index); + +twoSemicolons = 10; +// A more interesting example of two semicolons + ; // EXTRA_SPACE, WRONG_INDENTATION, REDUNDANT_SEMICOLON + + +/** @bug 1598895 */ +for (;;) { + // Do nothing. +} + +for (var x = 0, foo = blah(), bar = {};; x = update(x)) { + // A ridiculous case that should probably never happen, but I suppose is + // valid. +} + +var x = "allow'd double quoted string"; +var x = "unnecessary double quotes string"; // UNNECESSARY_DOUBLE_QUOTED_STRING +// +1: MULTI_LINE_STRING, UNNECESSARY_DOUBLE_QUOTED_STRING, +var x = "multi-line unnecessary double quoted \ + string."; + + +// Regression test: incorrectly reported missing doc for variable used in global +// scope. +/** + * Whether the "Your browser isn't fully supported..." warning should be shown + * to the user; defaults to false. + * @type {boolean} + * @private + */ +init.browserWarning_ = false; + +init.browserWarning_ = true; + +if (someCondition) { + delete this.foo_[bar]; +} + +// Commas at the end of literals used to be forbidden. +x = [1, 2, 3,]; +x = [1, 2, 3, /* A comment */]; +x = [ + 1, + 2, + 3, +]; +x = { + a: 1, +}; + +// Make sure we don't screw up typing for Lvalues and think b:c is a type value +// pair. +x = a ? b : c = 34; +x = a ? b:c; // MISSING_SPACE, MISSING_SPACE +x = (a ? b:c = 34); // MISSING_SPACE, MISSING_SPACE + +if (x) { + x += 10; +}; // REDUNDANT_SEMICOLON + + +/** + * Bad assignment of array to prototype. + * @type {Array} + */ +x.prototype.badArray = []; // ILLEGAL_PROTOTYPE_MEMBER_VALUE + + +/** + * Bad assignment of object to prototype. + * @type {Object} + */ +x.prototype.badObject = {}; // ILLEGAL_PROTOTYPE_MEMBER_VALUE + + +/** + * Bad assignment of class instance to prototype. + * @type {goog.events.EventHandler} + */ +x.prototype.badInstance = new goog.events.EventHandler(); +// -1: ILLEGAL_PROTOTYPE_MEMBER_VALUE + +// Check that some basic structures cause no errors. +x = function() { + try { + } finally { + y = 10; + } +}; + +switch (x) { + case 10: + break; + case 20: + // Fallthrough. + case 30: + break; + case 40: { + break; + } + default: + break; +} + +do { + x += 10; +} while (x < 100); + +do { + x += 10; +} while (x < 100) // MISSING_SEMICOLON + +// Missing semicolon checks. +x = 10 // MISSING_SEMICOLON +x = someOtherVariable // MISSING_SEMICOLON +x = fnCall() // MISSING_SEMICOLON +x = {a: 10, b: 20} // MISSING_SEMICOLON +x = [10, 20, 30] // MISSING_SEMICOLON +x = (1 + 2) // MISSING_SEMICOLON +x = { + a: [ + 10, 20, (30 + + 40) + ] +} // MISSING_SEMICOLON +x = a + .b + .c(). // LINE_ENDS_WITH_DOT + d; + +// Test that blocks without braces don't generate incorrect semicolon and +// indentation errors. TODO: consider disallowing blocks without braces. +if (x) + y = 10; + +if (x) + y = 8 // MISSING_SEMICOLON + +// Regression test for bug 2973408, bad missing semi-colon error when else +// is not followed by an opening brace. +if (x) + y = 3; +else + z = 4; + +// We used to erroneously report a missing semicolon error. +if (x) +{ +} + +while (x) + y = 10; + +for (x = 0; x < 10; x++) + y += 10; + z += 10; // WRONG_INDENTATION + +var x = 100 // MISSING_SEMICOLON + +// Also regression test for bug 2973407 Parse error on nested ternary statments. +foo = bar ? baz ? 1 : 2 : 3 // MISSING_SEMICOLON +foo = bar ? 1 : baz ? 2 : 3; +bar ? 1 : baz ? 2 : bat ? 3 : 4; +bar ? 1 : baz ? bat ? 3 : 4 : baq ? 5 : 6; +foo = bar ? 1 : 2; + +foo = { + str: bar ? baz ? blah ? 1 : 2 : 3 : 4 +} // MISSING_SEMICOLON + + +// Regression tests for bug 2969408 GJsLint doesn't like labeled statements. +mainLoop: while (!y) { +} + +myLabel1: myLabel2: var x; + +for (var i = 0; i < n; i++) { + myLabel3: + while (true) { + break myLabel3; + } +} + +myLabelA : myLabelB : x > y ? 0 : 1; // EXTRA_SPACE, EXTRA_SPACE, EXTRA_SPACE + +// Regression test for bug 4269466. +var a = new Scheme({default: 0}); +switch (foo) { + default: + var a = new Scheme({default: 0}); + break; +} + + +/** @private Some text is allowed after tag */ +x.y_ = function() { +}; + + +/** @private Some text is allowed after tag but not the long oneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.*/ // LINE_TOO_LONG +x.y_ = function() { +}; + + +/** @private {number} Some text is allowed after tag */ +x.z_ = 200; + + +/** @private {number} Some text is allowed after tag but not the long oneeeeeeeeeeeeeeee. */ // LINE_TOO_LONG +x.z_ = 200; + +// Regression tests for b/16298424. +var z = function() {}.bind(); +window.alert(function() {}.bind()); +function() { +}.bind(); +var y = function() { +}.bind(); +var y = function() { + } + .bind(); + +/* comment not closed // FILE_MISSING_NEWLINE, FILE_IN_BLOCK \ No newline at end of file diff --git a/tools/closure_linter/closure_linter/testdata/provide_blank.js b/tools/closure_linter/closure_linter/testdata/provide_blank.js new file mode 100644 index 00000000000000..a4e0716419e4af --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/provide_blank.js @@ -0,0 +1,29 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks that missing provides are reported at the first require + * when there are no other provides in the file. + */ + +goog.require('dummy.package.ClassName'); // MISSING_GOOG_PROVIDE + + + +/** + * @constructor + */ +dummy.Something = function() {}; + +var x = new dummy.package.ClassName(); diff --git a/tools/closure_linter/closure_linter/testdata/provide_extra.js b/tools/closure_linter/closure_linter/testdata/provide_extra.js new file mode 100644 index 00000000000000..3370950e3b2c41 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/provide_extra.js @@ -0,0 +1,39 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed 2to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks for extra goog.provides. + * + */ + +goog.provide(''); // EXTRA_GOOG_PROVIDE + +goog.provide('dummy.AnotherThingTest'); // ok since mentioned in setTestOnly +goog.provide('dummy.AnotherTrulyLongNamespaceToMakeItExceedEightyCharactersThingTest'); + +goog.provide('dummy.Something'); +goog.provide('dummy.Something'); // EXTRA_GOOG_PROVIDE +goog.provide('dummy.SomethingElse'); // EXTRA_GOOG_PROVIDE + +goog.provide('dummy.YetAnotherThingTest'); // EXTRA_GOOG_PROVIDE + +goog.setTestOnly('dummy.AnotherThingTest'); +goog.setTestOnly('dummy.AnotherTrulyLongNamespaceToMakeItExceedEightyCharactersThingTest'); + + + +/** + * @constructor + */ +dummy.Something = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/provide_missing.js b/tools/closure_linter/closure_linter/testdata/provide_missing.js new file mode 100644 index 00000000000000..42de489671113c --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/provide_missing.js @@ -0,0 +1,40 @@ +// Copyright 2011 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// We are missing a provide of goog.something.Else. +// -15: MISSING_GOOG_PROVIDE + +/** + * @fileoverview Tests missing provides and the usage of the missing provide + * suppression annotation. + * + */ + + + +/** + * Constructor for Something. + * @constructor + * @suppress {missingProvide} + */ +goog.something.Something = function() {}; + + + +/** + * Constructor for Else. We should get an error about providing this, but not + * about the constructor for Something. + * @constructor + */ +goog.something.Else = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/require_alias.js b/tools/closure_linter/closure_linter/testdata/require_alias.js new file mode 100644 index 00000000000000..804b2ed1428684 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_alias.js @@ -0,0 +1,14 @@ +// We are missing a require of goog.sample.UsedType +goog.provide('goog.something.Else'); // +1: MISSING_GOOG_REQUIRE + + +goog.scope(function() { +var unused = goog.events.unused; // UNUSED_LOCAL_VARIABLE +var used = goog.events.used; // ALIAS_STMT_NEEDS_GOOG_REQUIRE +var UsedType = goog.sample.UsedType; +var other = goog.sample.other; + + +/** @type {used.UsedAlias|other.UsedAlias} */ +goog.something.Else = UsedType.create(); +}); // goog.scope diff --git a/tools/closure_linter/closure_linter/testdata/require_all_caps.js b/tools/closure_linter/closure_linter/testdata/require_all_caps.js new file mode 100644 index 00000000000000..49344f2c18b267 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_all_caps.js @@ -0,0 +1,30 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview A should come before B. + * + */ + +goog.provide('XX'); // GOOG_PROVIDES_NOT_ALPHABETIZED +goog.provide('ZZ'); +goog.provide('YY'); + +goog.require('dummy.AA'); // GOOG_REQUIRES_NOT_ALPHABETIZED +goog.require('dummy.CC'); +goog.require('dummy.BB'); + +dummy.AA(); +dummy.CC(); +dummy.BB(); diff --git a/tools/closure_linter/closure_linter/testdata/require_blank.js b/tools/closure_linter/closure_linter/testdata/require_blank.js new file mode 100644 index 00000000000000..060781ce7ca322 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_blank.js @@ -0,0 +1,29 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks that missing requires are reported just after the last + * provide when there are no other requires in the file. + */ + +goog.provide('dummy.Something'); // +1: MISSING_GOOG_REQUIRE + + + +/** + * @constructor + */ +dummy.Something = function() {}; + +var x = new dummy.package.ClassName(); diff --git a/tools/closure_linter/closure_linter/testdata/require_extra.js b/tools/closure_linter/closure_linter/testdata/require_extra.js new file mode 100644 index 00000000000000..3ee39c73a8a53a --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_extra.js @@ -0,0 +1,35 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks for extra goog.requires. + * + */ + +goog.require(''); // EXTRA_GOOG_REQUIRE +goog.require('dummy.Aa'); +goog.require('dummy.Aa.CONSTANT'); // EXTRA_GOOG_REQUIRE +goog.require('dummy.Aa.Enum'); // EXTRA_GOOG_REQUIRE +goog.require('dummy.Bb'); +goog.require('dummy.Ff'); // EXTRA_GOOG_REQUIRE +goog.require('dummy.Gg'); // EXTRA_GOOG_REQUIRE +goog.require('dummy.cc'); +goog.require('dummy.cc'); // EXTRA_GOOG_REQUIRE +goog.require('dummy.hh'); // EXTRA_GOOG_REQUIRE + +new dummy.Aa(); +dummy.Bb.someMethod(); +dummy.cc(); +var x = dummy.Aa.Enum.VALUE; +var y = dummy.Aa.CONSTANT; diff --git a/tools/closure_linter/closure_linter/testdata/require_function.js b/tools/closure_linter/closure_linter/testdata/require_function.js new file mode 100644 index 00000000000000..532bb67103157c --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_function.js @@ -0,0 +1,22 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Description of this file. + */ + +goog.require('goog.mobile.paging.getPage'); + + +goog.mobile.paging.getPage(); diff --git a/tools/closure_linter/closure_linter/testdata/require_function_missing.js b/tools/closure_linter/closure_linter/testdata/require_function_missing.js new file mode 100644 index 00000000000000..33bec21eab15c3 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_function_missing.js @@ -0,0 +1,24 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// -14: MISSING_GOOG_REQUIRE + +/** + * @fileoverview Description of this file. + */ + + + +goog.mobile.paging.getPage(); +goog.mobile.paging.getOtherPage(); diff --git a/tools/closure_linter/closure_linter/testdata/require_function_through_both.js b/tools/closure_linter/closure_linter/testdata/require_function_through_both.js new file mode 100644 index 00000000000000..d9525ec4e1467a --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_function_through_both.js @@ -0,0 +1,23 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Description of this file. + */ + +goog.require('goog.mobile.paging'); +goog.require('goog.mobile.paging.getPage'); + + +goog.mobile.paging.getPage(); diff --git a/tools/closure_linter/closure_linter/testdata/require_function_through_namespace.js b/tools/closure_linter/closure_linter/testdata/require_function_through_namespace.js new file mode 100644 index 00000000000000..55628fccfb34fd --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_function_through_namespace.js @@ -0,0 +1,22 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Description of this file. + */ + +goog.require('goog.mobile.paging'); + + +goog.mobile.paging.getPage(); diff --git a/tools/closure_linter/closure_linter/testdata/require_interface.js b/tools/closure_linter/closure_linter/testdata/require_interface.js new file mode 100644 index 00000000000000..d6e83024b4b7ac --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_interface.js @@ -0,0 +1,31 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Contains a test to verify that interfaces implemented in a file + * are goog.require'd. + * + */ + +// We're missing a goog.require of goog.something.SomeInterface. +goog.provide('goog.something.SomeClass'); // +1: MISSING_GOOG_REQUIRE + + + +/** + * Constructor for SomeClass. + * @constructor + * @implements {goog.something.SomeInterface} + */ +goog.something.SomeClass = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/require_interface_alias.js b/tools/closure_linter/closure_linter/testdata/require_interface_alias.js new file mode 100644 index 00000000000000..c71b29ca3c8d2f --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_interface_alias.js @@ -0,0 +1,34 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Contains a test to verify that aliased interfaces + * are goog.require'd. + */ + +// We're missing a goog.require of goog.something.SomeInterface. +goog.provide('goog.something.SomeClass'); // +1: MISSING_GOOG_REQUIRE + +goog.scope(function() { +var something = goog.something; + + + +/** + * Constructor for SomeClass. + * @constructor + * @implements {something.SomeInterface} + */ +something.SomeClass = function() {}; +}); // goog.scope diff --git a/tools/closure_linter/closure_linter/testdata/require_interface_base.js b/tools/closure_linter/closure_linter/testdata/require_interface_base.js new file mode 100644 index 00000000000000..c8bb1f67a5ee8b --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_interface_base.js @@ -0,0 +1,31 @@ +// Copyright 2011 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Contains a test to verify that parent interfaces + * implemented are goog.require'd. + * + */ + +// We're missing a goog.require of goog.something.BaseInterface. +goog.provide('goog.something.SomeInterface'); // +1: MISSING_GOOG_REQUIRE + + + +/** + * Constructor for SomeInterface. + * @interface + * @extends {goog.something.BaseInterface} + */ +goog.something.SomeInterface = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/require_lower_case.js b/tools/closure_linter/closure_linter/testdata/require_lower_case.js new file mode 100644 index 00000000000000..c1fff4a3eda79c --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_lower_case.js @@ -0,0 +1,30 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview The B should come before the b. + * + */ + +goog.provide('x'); // GOOG_PROVIDES_NOT_ALPHABETIZED +goog.provide('X'); +goog.provide('Y'); + +goog.require('dummy.bb'); // GOOG_REQUIRES_NOT_ALPHABETIZED +goog.require('dummy.Bb'); +goog.require('dummy.Cc'); + +var x = dummy.bb.a(); +var y = dummy.Bb.a(); +var z = dummy.Cc.a(); diff --git a/tools/closure_linter/closure_linter/testdata/require_missing.js b/tools/closure_linter/closure_linter/testdata/require_missing.js new file mode 100644 index 00000000000000..3539c9489d65dc --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_missing.js @@ -0,0 +1,40 @@ +// Copyright 2011 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Tests missing requires around the usage of the require + * suppression annotation. + * + */ + +// We are missing a require of goog.foo. +goog.provide('goog.something.Else'); // +1: MISSING_GOOG_REQUIRE + + + +/** + * Constructor for Else. + * @constructor + */ +goog.something.Else = function() { + /** @suppress {missingRequire} */ + this.control.createConstructorMock( + goog.foo.bar, 'Baz'); + + // Previous suppress should only be scoped to that statement. + this.control.createConstructorMock( + goog.foo.bar, 'Baz'); + + this.control.invoke(goog.foo.bar, 'Test'); +}; diff --git a/tools/closure_linter/closure_linter/testdata/require_numeric.js b/tools/closure_linter/closure_linter/testdata/require_numeric.js new file mode 100644 index 00000000000000..29d8377afaf566 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_numeric.js @@ -0,0 +1,30 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Numbers should come before letters. + * + */ + +goog.provide('xa'); // GOOG_PROVIDES_NOT_ALPHABETIZED +goog.provide('x1'); +goog.provide('xb'); + +goog.require('dummy.aa'); // GOOG_REQUIRES_NOT_ALPHABETIZED +goog.require('dummy.a1'); +goog.require('dummy.ab'); + +dummy.aa.a; +dummy.a1.a; +dummy.ab.a; diff --git a/tools/closure_linter/closure_linter/testdata/require_provide_blank.js b/tools/closure_linter/closure_linter/testdata/require_provide_blank.js new file mode 100644 index 00000000000000..0e0c188ca54270 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_provide_blank.js @@ -0,0 +1,31 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// -14: MISSING_GOOG_PROVIDE +// -15: MISSING_GOOG_REQUIRE + +/** + * @fileoverview Checks that missing requires and provides are reported at the + * top of the file when there are no existing goog.requires or provides in the + * file. + */ + + + +/** + * @constructor + */ +dummy.Something = function() {}; + +var x = new dummy.package.ClassName(); diff --git a/tools/closure_linter/closure_linter/testdata/require_provide_missing.js b/tools/closure_linter/closure_linter/testdata/require_provide_missing.js new file mode 100644 index 00000000000000..a56f4d00070819 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_provide_missing.js @@ -0,0 +1,76 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview The same code as require_provide_ok, but missing a provide + * and a require call. + * + */ + +goog.provide('goog.something'); // +1: MISSING_GOOG_PROVIDE +// Missing provide of goog.something.Else and goog.something.SomeTypeDef. + +goog.require('goog.Class'); +goog.require('goog.package'); // +1: MISSING_GOOG_REQUIRE +// Missing requires of goog.Class.Enum and goog.otherThing.Class.Enum. + + +var x = new goog.Class(); +goog.package.staticFunction(); + +var y = goog.Class.Enum.VALUE; + + +/** + * @typedef {string} + */ +goog.something.SomeTypeDef; + + +/** + * Private variable. + * @type {number} + * @private + */ +goog.something.private_ = 10; + + +/** + * Use private variables defined in this file so they don't cause a warning. + */ +goog.something.usePrivateVariables = function() { + var x = [ + goog.something.private_, + x + ]; +}; + + +/** + * Static function. + */ +goog.something.staticFunction = function() { +}; + + + +/** + * Constructor for Else. + * @constructor + */ +goog.something.Else = function() { + // Bug 1801608: Provide goog.otherThing.Class.Enum isn't missing. + var enum = goog.otherThing.Class.Enum; + goog.otherThing.Class.Enum = enum; +}; diff --git a/tools/closure_linter/closure_linter/testdata/require_provide_ok.js b/tools/closure_linter/closure_linter/testdata/require_provide_ok.js new file mode 100644 index 00000000000000..01ddafe490d977 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/require_provide_ok.js @@ -0,0 +1,214 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview There is nothing wrong w/ this javascript. + * + */ +goog.module('goog.super.long.DependencyNameThatForcesMethodDefinitionToSpanMultipleLinesFooBar'); +goog.provide('goog.something'); +goog.provide('goog.something.Else'); +goog.provide('goog.something.Else.Enum'); +/** @suppress {extraProvide} */ +goog.provide('goog.something.Extra'); +goog.provide('goog.something.SomeTypeDef'); +goog.provide('goog.somethingelse.someMethod'); +goog.provide('goog.super.long.DependencyNameThatForcesTheLineToBeOverEightyCharacters'); +goog.provide('notInClosurizedNamespacesSoNotExtra'); + +goog.require('dummy.foo'); +goog.require('dummy.foo.someSpecificallyRequiredMethod'); +goog.require('goog.Class'); +/** @suppress {extraRequire} */ +goog.require('goog.extra.require'); +goog.require('goog.package'); +goog.require('goog.package.ClassName'); +goog.require('goog.package.OtherClassName'); +/** @suppress {extraRequire} Legacy dependency on enum */ +goog.require('goog.package.OuterClassName.InnerClassName'); +goog.require('goog.super.long.DependencyNameThatForcesMethodDefinitionToSpanMultipleLinesFooBar'); +goog.require('goog.super.long.DependencyNameThatForcesTheLineToBeOverEightyCharacters2'); +goog.require('goog.super.long.DependencyNameThatForcesTheLineToBeOverEightyCharacters3'); +goog.require('notInClosurizedNamespacesSoNotExtra'); + +dummy.foo.someMethod(); +dummy.foo.someSpecificallyRequiredMethod(); + + +// Regression test for bug 3473189. Both of these 'goog.provide' tokens should +// be completely ignored by alphabetization checks. +if (typeof goog != 'undefined' && typeof goog.provide == 'function') { + goog.provide('goog.something.SomethingElse'); +} + + +var x = new goog.Class(); +goog.package.staticFunction(); + +var y = goog.Class.Enum.VALUE; + + +// This should not trigger a goog.require. +var somethingPrivate = goog.somethingPrivate.PrivateEnum_.VALUE; + + +/** + * This method is provided directly, instead of its namespace. + */ +goog.somethingelse.someMethod = function() {}; + + +/** + * Defining a private property on a required namespace should not trigger a + * provide of that namespace. Yes, people actually do this. + * @private + */ +goog.Class.privateProperty_ = 1; + + +/** + * @typedef {string} + */ +goog.something.SomeTypeDef; + + +/** + * @typedef {string} + * @private + */ +goog.something.SomePrivateTypeDef_; + + +/** + * Some variable that is declared but not initialized. + * @type {string|undefined} + * @private + */ +goog.something.somePrivateVariable_; + + +/** + * Private variable. + * @type {number} + * @private + */ +goog.something.private_ = 10; + + +/** + * Use private variables defined in this file so they don't cause a warning. + */ +goog.something.usePrivateVariables = function() { + var x = [ + goog.something.private_, + goog.Class.privateProperty_, + x + ]; +}; + + + +/** + * A really long class name to provide and usage of a really long class name to + * be required. + * @constructor + */ +goog.super.long.DependencyNameThatForcesTheLineToBeOverEightyCharacters = + function() { + var x = new goog.super.long. // LINE_ENDS_WITH_DOT + DependencyNameThatForcesTheLineToBeOverEightyCharacters2(); + var x = new goog.super.long + .DependencyNameThatForcesTheLineToBeOverEightyCharacters3(); + // Use x to avoid a warning. + var x = [x]; +}; + + +/** + * A really long class name to to force a method definition to be greater than + * 80 lines. We should be grabbing the whole identifier regardless of how many + * lines it is on. + */ +goog.super.long + .DependencyNameThatForcesMethodDefinitionToSpanMultipleLinesFooBar + .prototype.someMethod = function() { +}; + + +/** + * Static function. + */ +goog.something.staticFunction = function() { + // Tests that namespace usages are identified using 'namespace.' not just + // 'namespace'. + googSomething.property; + dummySomething.property; + goog.package.ClassName // A comment in between the identifier pieces. + .IDENTIFIER_SPLIT_OVER_MULTIPLE_LINES; + goog.package.OtherClassName.property = 1; + + // Test case where inner class needs to be required explicitly. + new goog.package.OuterClassName.InnerClassName(); + + // Don't just use goog.bar for missing namespace, hard coded to never require + // goog since it's never provided. + control.createConstructorMock( + /** @suppress {missingRequire} */ goog.foo.bar, 'Baz'); + + goog.require('goog.shouldBeIgnored'); +}; + + + +/** + * Constructor for Else. + * @constructor + */ +goog.something.Else = function() { + /** @suppress {missingRequire} */ + this.control.createConstructorMock(goog.foo.bar, 'Baz'); +}; + + +/** + * Enum attached to Else. Should not need to be provided explicitly, but + * should not generate an extra require warning either. + * @enum {number} + */ +goog.something.Else.Enum = { + 'key': 1 +}; + + +/** + * Sample of a typedef. This should not need a provide as it is an inner + * element like an enum. + * + * @typedef {{val1: string, val2: boolean, val3: number}} + */ +goog.something.Else.Typedef; + + + +/** + * Constructor for SomethingElse. + * @constructor + */ +goog.something.SomethingElse = function() {}; + + +/** + * @suppress {missingProvide} + */ +goog.suppress.someMethod = function() {}; diff --git a/tools/closure_linter/closure_linter/testdata/semicolon_missing.js b/tools/closure_linter/closure_linter/testdata/semicolon_missing.js new file mode 100644 index 00000000000000..5601db8decf289 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/semicolon_missing.js @@ -0,0 +1,18 @@ +/** + * @fileoverview This is for regression testing of scenario where semicolon is + * missing at EOF. b/10801776. + */ + +goog.provide('dummy.foo.DATA'); + +/** + * @type {string} + * @const + * + * For repeating the bug blank comment line above this is needed. + */ + +// +3: MISSING_SEMICOLON +dummy.foo.DATA = + 'SFSDFSDdfgdfgdftreterterterterterggsdfsrrwerwerwsfwerwerwere55454ss' + + 'SFSDFSDdfgdfgdftretertertertertergg' diff --git a/tools/closure_linter/closure_linter/testdata/simple.html b/tools/closure_linter/closure_linter/testdata/simple.html new file mode 100644 index 00000000000000..42ebab97d0f575 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/simple.html @@ -0,0 +1,33 @@ + + + + + GJsLint HTML JavaScript extraction tests + + + + + + + diff --git a/tools/closure_linter/closure_linter/testdata/spaces.js b/tools/closure_linter/closure_linter/testdata/spaces.js new file mode 100644 index 00000000000000..85a36e53bfe6d2 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/spaces.js @@ -0,0 +1,354 @@ +// Copyright 2007 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Errors relating to whitespace. + * + * @author robbyw@google.com (Robby Walker) + */ + +if(needs_space) { // MISSING_SPACE +} + +if ( too_much_space) { // EXTRA_SPACE +} + +if (different_extra_space ) { // EXTRA_SPACE +} + +switch(needs_space) { // MISSING_SPACE +} + +var x = 'if(not_an_error)'; + +var y = afjkljkl + ajklasdflj + ajkadfjkasdfklj + aadskfasdjklf + jkasdfa + ( + kasdfkjlasdfjkl / jklasdfjklasdfjkl); + +x = 5+ 8; // MISSING_SPACE +x = 5 +8; // MISSING_SPACE +x= 5; // MISSING_SPACE +x = 6; // EXTRA_SPACE +x = 7; // EXTRA_SPACE +x = 6 + 2; // EXTRA_SPACE +x += 10; + +throw Error('Selector not supported yet('+ opt_selector + ')'); // MISSING_SPACE +throw Error('Selector not supported yet(' +opt_selector + ')'); // MISSING_SPACE +throw Error( + 'Selector not supported yet' + + '(' +(opt_selector ? 'foo' : 'bar') + ')'); // MISSING_SPACE + +x++; +x ++; // EXTRA_SPACE +x++ ; // EXTRA_SPACE +y = a + ++b; +for (var i = 0; i < 10; ++i) { +} + +// We omit the update section of the for loop to test that a space is allowed +// in this special case. +for (var part; part = parts.shift(); ) { +} + +if (x == y) { +} + +x = 10; // no error here +x = -1; +x++; +++x; + +x = bool ? -1 : -1; + +x = {a: 10}; +x = {a:10}; // MISSING_SPACE + +x = !!y; + +x >>= 0; +x <<= 10; + +x[100] = 10; +x[ 100] = 10; // EXTRA_SPACE +x[100 ] = 10; // EXTRA_SPACE +x [100] = 10; // EXTRA_SPACE +x[10]= 5; // MISSING_SPACE +var x = []; +x = [[]]; +x = [[x]]; +x = [[[x, y]]]; +var craziness = ([1, 2, 3])[1]; +var crazinessError = ([1, 2, 3]) [1]; // EXTRA_SPACE +var multiArray = x[1][2][3][4]; +var multiArrayError = x[1] [2][3][4]; // EXTRA_SPACE + +array[aReallyLooooooooooooooooooooooooooooongIndex1][ + anotherVeryLoooooooooooooooooooooooooooooooooooongIndex +] = 10; + +if (x) { + array[aReallyLooooooooooooooooooooooooooooongIndex1][ + anotherVeryLoooooooooooooooooooooooooooooooooooongIndex + ] = 10; +} + + +/** + * Docs. + * @param {Number} x desc. + * @return {boolean} Some boolean value. + */ +function functionName( x) { // EXTRA_SPACE + return !!x; +} + + +/** + * Docs. + * @param {Number} x desc. + */ +function functionName(x ) { // EXTRA_SPACE + return; +} + + +/** + * Docs. + * @param {Number} x desc. + * @param {Number} y desc. + */ +function functionName(x,y) { // MISSING_SPACE +} + + +/** + * Docs. + * @param {Number} x desc. + * @param {Number} y desc. + */ +function functionName(x, y) { +} + + +/** + * Docs. + */ +function functionName() { // EXTRA_SPACE +} + + +/** + * Docs. + */ +function functionName(){ // MISSING_SPACE +} + +functionName (); // EXTRA_SPACE + + +/** + * Docs. + */ +function functionName () { // EXTRA_SPACE +} + + +/** + * Docs. + */ +var foo = function () { // EXTRA_SPACE +}; + + + +/** + * Missing a newline. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +};goog.inherits(x.y.z, a.b.c); // MISSING_LINE + + + +/** + * Extra space. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; + goog.inherits(x.y.z, a.b.c); // WRONG_INDENTATION + + + +/** + * Extra blank line. + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; + +goog.inherits(x.y.z, a.b.c); // -1: EXTRA_LINE + + + +/** + * Perfect! + * @constructor + * @extends {a.b.c} + */ +x.y.z = function() { +}; +goog.inherits(x.y.z, a.b.c); + +if (flag) { + /** + * Also ok! + * @constructor + * @extends {a.b.c} + */ + x.y.z = function() { + }; + goog.inherits(x.y.z, a.b.c); +} + + +/** + * Docs. + */ +x.finally = function() { +}; + +x.finally(); +x + .finally(); +x.finally (); // EXTRA_SPACE +x + .finally (); // EXTRA_SPACE +try { +} finally (e) { +} +try { +} finally(e) { // MISSING_SPACE +} + +functionName(x , y); // EXTRA_SPACE +functionName(x,y); // MISSING_SPACE +functionName(x, y); + +var really_really_really_really_really_really_really_really_really_long_name = + 2; + +var current = arr[cursorRead++]; + +var x = -(y + z); + +// Tab before + +var foo + 3; // ILLEGAL_TAB +if (something) { + var x = 4; // ILLEGAL_TAB +} + +// +1: ILLEGAL_TAB +// Tab <-- in a comment. + + +// +3: ILLEGAL_TAB +// +3: ILLEGAL_TAB +/** + * An inline flag with a tab {@code asdfasd}. + * @return {string} Illegal <-- tab in a doc description. + */ +function x() { + return ''; +} + + +// +2: ILLEGAL_TAB +/** + * @type {tabBeforeMe} + */ + +// +1: EXTRA_SPACE +var whitespaceAtEndOfLine; + +// +1: EXTRA_SPACE +// Whitespace at end of comment. + + +// +4: EXTRA_SPACE +// +4: EXTRA_SPACE +// +4: EXTRA_SPACE +// +4: EXTRA_SPACE +/* + * Whitespace at EOL. + * @type {string} + * @param {string} Description with whitespace at EOL. + */ +x = 10; + + +/** + * @param {?{foo, bar: number}} x This is a valid annotation. + * @return {{baz}} This is also a valid annotation. + */ +function recordTypeFunction(x) { + return x; +} + +if (y) { + // Colons are difficult. + y = x ? 1 : 2; + y = x ? 1: 2; // MISSING_SPACE + + x = { + b: 'Good', + d : 'Space before colon is bad', // EXTRA_SPACE + f: abc ? def : ghi // These colons should be treated differently + }; + + x = {language: langCode}; // EXTRA_SPACE +} + +// 1094445 - should produce missing space error before +. +// +1: MISSING_SPACE +throw Error('Selector not supported yet ('+ opt_selector + ')'); + +// This code is ok. +for (i = 0; i < len; ++i) { +} + +for (i = 0;i < 10; i++) { // MISSING_SPACE +} +for (i = 0; i < 10;i++) { // MISSING_SPACE +} +for ( i = 0; i < 10; i++) { // EXTRA_SPACE +} +for (i = 0 ; i < 10; i++) { // EXTRA_SPACE +} +for (i = 0; i < 10 ; i++) { // EXTRA_SPACE +} +for (i = 0; i < 10; i++ ) { // EXTRA_SPACE +} +for (i = 0; i < 10; i++) { // EXTRA_SPACE +} +for (i = 0; i < 10; i++) { // EXTRA_SPACE +} +for (i = 0 ;i < 10; i++) { // EXTRA_SPACE, MISSING_SPACE +} + +// Regression test for bug 3508480, parse error when tab as last token. +// +1: ILLEGAL_TAB, EXTRA_SPACE diff --git a/tools/closure_linter/closure_linter/testdata/tokenizer.js b/tools/closure_linter/closure_linter/testdata/tokenizer.js new file mode 100644 index 00000000000000..1fbcf4bd410a2a --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/tokenizer.js @@ -0,0 +1,78 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Errors relating to tokenizing. + * + * @author robbyw@google.com (Robby Walker) + */ + +// Regression test: if regular expressions parse incorrectly this will emit an +// error such as: Missing space after '/' +x = /[^\']/; // and all the other chars + +// Regression test: if regular expressions parse incorrectly this will emit an +// error such as: Missing space before + +var regExp = fromStart ? / ^[\t\r\n]+/ : /[ \t\r\n]+$/; + +// Regression test for bug 1032312: test for correct parsing of multiline +// strings +// +2: MULTI_LINE_STRING +var RG_MONTH_EVENT_TEMPLATE_SINGLE_QUOTE = new Template( + '\ +
        >>' and '>>>=' that weren't +// recognized as operators. +a -= b; a -= c; a ^= c >>> 13; a >>>= 1; + +// Regression test as xor was not allowed on the end of a line. +x = 1000 ^ + 45; + +// Regression test for proper number parsing. If parsed incorrectly, some of +// these notations can lead to missing spaces errors. +var x = 1e-6 + 1e+6 + 0. + .5 + 0.5 + 0.e-6 + .5e-6 + 0.5e-6 + 0x123abc + + 0X1Ab3 + 1E7; + +// Regression test for keyword parsing - making sure the fact that the "do" +// keyword is a part of the identifier below doesn't break anything. +this.undoRedoManager_.undo(); + +// Regression test for regex as object value not matching. +x = {x: /./}; + +// Regression test for regex as last array element not matching. +x = [/./]; + +// Syntax tests for ES6: +x = x => x; diff --git a/tools/closure_linter/closure_linter/testdata/unparseable.js b/tools/closure_linter/closure_linter/testdata/unparseable.js new file mode 100644 index 00000000000000..e8426142869810 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/unparseable.js @@ -0,0 +1,44 @@ +// Copyright 2008 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * Constructs and initializes a new good object. + * @constructor + */ +goog.good = function() { +}; + + +/** + * Makes this good object go bad. + * @param {number} badnessLevel How bad this object is going. + */ +goog.good.prototype.goBad = function() { // EXTRA_PARAMETER_DOCUMENTATION +}; + +if (x) + // Cannot parse ending block because beginning block is missing. +} // FILE_DOES_NOT_PARSE + + +/** + * Unecessary return documentation error is not reported because file checking + * stopped at token causing parse error. + * + * @return {boolean} Whether reform was sucessful. + */ +goog.good.prototype.reform = function() { +}; diff --git a/tools/closure_linter/closure_linter/testdata/unused_local_variables.js b/tools/closure_linter/closure_linter/testdata/unused_local_variables.js new file mode 100644 index 00000000000000..e9e51a1164d92d --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/unused_local_variables.js @@ -0,0 +1,88 @@ +// Copyright 2013 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks that unused local variables result in an error. + */ + +goog.provide('dummy.Something'); + + + +/** + * @constructor + */ +dummy.Something = function() { + // This variable isn't really used, but we can't tell for sure. + var usedVariable = []; + usedVariable.length = 1; + + var variableUsedInAClosure = []; + var functionUsedByInvoking = function() { + variableUsedInAClosure[1] = 'abc'; + }; + functionUsedByInvoking(); + + var variableUsedTwoLevelsDeep = []; + var firstLevelFunction = function() { + function() { + variableUsedTwoLevelsDeep.append(1); + } + }; + firstLevelFunction(); + + // This variable isn't being declared so is unchecked. + undeclaredLocal = 1; + + var unusedVariable; + + // Check that using a variable as member name doesn't trigger + // usage. + this.unusedVariable = 0; + this.unusedVariable = this.unusedVariable + 1; + + // Check that declaring a variable twice doesn't trigger + // usage. + var unusedVariable; // UNUSED_LOCAL_VARIABLE + + var unusedVariableWithReassignment = []; // UNUSED_LOCAL_VARIABLE + unusedVariableWithReassignment = 'a'; + + var unusedFunction = function() {}; // UNUSED_LOCAL_VARIABLE + + var unusedHiddenVariable = 1; // UNUSED_LOCAL_VARIABLE + firstLevelFunction = function() { + // This variable is actually used in the function below, but hides the outer + // variable with the same name. + var unusedHiddenVariable = 1; + function() { + delete unusedHiddenVariable; + } + }; +}; + + +goog.scope(function() { +var unusedAlias = dummy.Something; // UNUSED_LOCAL_VARIABLE +var UsedTypeAlias = dummy.Something; +var AnotherUsedTypeAlias = dummy.Something; + + +/** @protected {AnotherUsedTypeAlias.Something|UsedTypeAlias} */ +var usedAlias = dummy.Something; +new usedAlias(); +}); // goog.scope + +// Unused top level variables are not checked. +var unusedTopLevelVariable; diff --git a/tools/closure_linter/closure_linter/testdata/unused_private_members.js b/tools/closure_linter/closure_linter/testdata/unused_private_members.js new file mode 100644 index 00000000000000..76c0865bcc5540 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/unused_private_members.js @@ -0,0 +1,205 @@ +// Copyright 2010 The Closure Linter Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Checks that an unused private members result in an error. + */ + +goog.provide('dummy.Something'); + + + +/** + * @constructor + */ +dummy.Something = function() { + /** + * @type {number} + * @private + */ + this.normalVariable_ = 1; + + // +5: UNUSED_PRIVATE_MEMBER + /** + * @type {number} + * @private + */ + this.unusedVariable_ = 1; + + /** + * @type {number} + * @private + * @suppress {unusedPrivateMembers} + */ + this.suppressedUnusedVariable_ = 1; +}; + + +/** + * @type {number} + * @private + */ +dummy.Something.NORMAL_CONSTANT_ = 1; + + +// +5: UNUSED_PRIVATE_MEMBER +/** + * @type {number} + * @private + */ +dummy.Something.UNUSED_CONSTANT_ = 1; + + +/** + * @type {number} + * @private + * @suppress {unusedPrivateMembers} + */ +dummy.Something.SUPPRESSED_UNUSED_CONSTANT_ = 1; + + +/** + * @type {number} + * @private + */ +dummy.Something.normalStaticVariable_ = 1; + + +// +5: UNUSED_PRIVATE_MEMBER +/** + * @type {number} + * @private + */ +dummy.Something.unusedStaticVariable_ = 1; + + +/** + * @type {number} + * @private + * @suppress {unusedPrivateMembers} + */ +dummy.Something.suppressedUnusedStaticVariable_ = 1; + + +/** + * @type {number} + * @private + */ +dummy.Something.prototype.normalVariableOnPrototype_ = 1; + + +// +5: UNUSED_PRIVATE_MEMBER +/** + * @type {number} + * @private + */ +dummy.Something.prototype.unusedVariableOnPrototype_ = 1; + + +/** + * @type {number} + * @private + * @suppress {unusedPrivateMembers} + */ +dummy.Something.prototype.suppressedUnusedVariableOnPrototype_ = 1; + + +/** + * Check edge cases that should not be reported. + */ +dummy.Something.prototype.checkFalsePositives = function() { + this.__iterator__ = 1; + this.normalVariable_.unknownChainedVariable_ = 1; + othernamespace.unusedVariable_ = 1; + + this.element_ = 1; + this.element_.modifyPublicMember = 1; + + /** @suppress {underscore} */ + this.suppressedUnderscore_ = true; +}; + + +/** + * Use all the normal variables. + */ +dummy.Something.prototype.useAllTheThings = function() { + var x = [ + dummy.Something.NORMAL_CONSTANT_, + this.normalStaticVariable_, + this.normalVariable_, + this.normalVariableOnPrototype_, + dummy.Something.normalStaticMethod_(), + this.normalMethod_(), + x + ]; +}; + + +// +5: UNUSED_PRIVATE_MEMBER +/** + * Unused static method. + * @private + */ +dummy.Something.unusedStaticMethod_ = function() { + // Do nothing. +}; + + +/** + * Unused static method. + * @private + * @suppress {unusedPrivateMembers} + */ +dummy.Something.suppressedUnusedStaticMethod_ = function() { + // Do nothing. +}; + + +/** + * Normal static method. + * @private + */ +dummy.Something.normalStaticMethod_ = function() { + // Do nothing. +}; + + +// +5: UNUSED_PRIVATE_MEMBER +/** + * Unused non-static method. + * @private + */ +dummy.Something.prototype.unusedMethod_ = function() { + // Do nothing. +}; + + +/** + * Unused non-static method that is suppressed. + * @private + * @suppress {unusedPrivateMembers} + */ +dummy.Something.prototype.suppressedUnusedMethod_ = function() { + // Do nothing. +}; + + +/** + * Normal non-static method. + * @private + */ +dummy.Something.prototype.normalMethod_ = function() { + // Do nothing. +}; diff --git a/tools/closure_linter/closure_linter/testdata/utf8.html b/tools/closure_linter/closure_linter/testdata/utf8.html new file mode 100644 index 00000000000000..29517d09416422 --- /dev/null +++ b/tools/closure_linter/closure_linter/testdata/utf8.html @@ -0,0 +1,26 @@ + + + + + + diff --git a/tools/closure_linter/closure_linter/testutil.py b/tools/closure_linter/closure_linter/testutil.py new file mode 100644 index 00000000000000..f7084ee37b0683 --- /dev/null +++ b/tools/closure_linter/closure_linter/testutil.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Utility functions for testing gjslint components.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import StringIO + +from closure_linter import ecmametadatapass +from closure_linter import javascriptstatetracker +from closure_linter import javascripttokenizer + + +def TokenizeSource(source): + """Convert a source into a string of tokens. + + Args: + source: A source file as a string or file-like object (iterates lines). + + Returns: + The first token of the resulting token stream. + """ + + if isinstance(source, basestring): + source = StringIO.StringIO(source) + + tokenizer = javascripttokenizer.JavaScriptTokenizer() + return tokenizer.TokenizeFile(source) + + +def TokenizeSourceAndRunEcmaPass(source): + """Tokenize a source and run the EcmaMetaDataPass on it. + + Args: + source: A source file as a string or file-like object (iterates lines). + + Returns: + The first token of the resulting token stream. + """ + start_token = TokenizeSource(source) + ecma_pass = ecmametadatapass.EcmaMetaDataPass() + ecma_pass.Process(start_token) + return start_token + + +def ParseFunctionsAndComments(source, error_handler=None): + """Run the tokenizer and tracker and return comments and functions found. + + Args: + source: A source file as a string or file-like object (iterates lines). + error_handler: An error handler. + + Returns: + The functions and comments as a tuple. + """ + start_token = TokenizeSourceAndRunEcmaPass(source) + + tracker = javascriptstatetracker.JavaScriptStateTracker() + if error_handler is not None: + tracker.DocFlagPass(start_token, error_handler) + + functions = [] + comments = [] + for token in start_token: + tracker.HandleToken(token, tracker.GetLastNonSpaceToken()) + + function = tracker.GetFunction() + if function and function not in functions: + functions.append(function) + + comment = tracker.GetDocComment() + if comment and comment not in comments: + comments.append(comment) + + tracker.HandleAfterToken(token) + + return functions, comments diff --git a/tools/closure_linter/closure_linter/tokenutil.py b/tools/closure_linter/closure_linter/tokenutil.py index 6ed5f7f81cdb8f..11e3ccc68bbe06 100755 --- a/tools/closure_linter/closure_linter/tokenutil.py +++ b/tools/closure_linter/closure_linter/tokenutil.py @@ -19,15 +19,17 @@ __author__ = ('robbyw@google.com (Robert Walker)', 'ajp@google.com (Andy Perelson)') -from closure_linter.common import tokens -from closure_linter import javascripttokens - import copy +import StringIO + +from closure_linter.common import tokens +from closure_linter.javascripttokens import JavaScriptToken +from closure_linter.javascripttokens import JavaScriptTokenType # Shorthand -JavaScriptToken = javascripttokens.JavaScriptToken Type = tokens.TokenType + def GetFirstTokenInSameLine(token): """Returns the first token in the same line as token. @@ -42,6 +44,58 @@ def GetFirstTokenInSameLine(token): return token +def GetFirstTokenInPreviousLine(token): + """Returns the first token in the previous line as token. + + Args: + token: Any token in the line. + + Returns: + The first token in the previous line as token, or None if token is on the + first line. + """ + first_in_line = GetFirstTokenInSameLine(token) + if first_in_line.previous: + return GetFirstTokenInSameLine(first_in_line.previous) + + return None + + +def GetLastTokenInSameLine(token): + """Returns the last token in the same line as token. + + Args: + token: Any token in the line. + + Returns: + The last token in the same line as token. + """ + while not token.IsLastInLine(): + token = token.next + return token + + +def GetAllTokensInSameLine(token): + """Returns all tokens in the same line as the given token. + + Args: + token: Any token in the line. + + Returns: + All tokens on the same line as the given token. + """ + first_token = GetFirstTokenInSameLine(token) + last_token = GetLastTokenInSameLine(token) + + tokens_in_line = [] + while first_token != last_token: + tokens_in_line.append(first_token) + first_token = first_token.next + tokens_in_line.append(last_token) + + return tokens_in_line + + def CustomSearch(start_token, func, end_func=None, distance=None, reverse=False): """Returns the first token where func is True within distance of this token. @@ -77,14 +131,14 @@ def CustomSearch(start_token, func, end_func=None, distance=None, else: while token and (distance is None or distance > 0): - next = token.next - if next: - if func(next): - return next - if end_func and end_func(next): + next_token = token.next + if next_token: + if func(next_token): + return next_token + if end_func and end_func(next_token): return None - token = next + token = next_token if distance is not None: distance -= 1 @@ -123,7 +177,6 @@ def SearchExcept(start_token, token_types, distance=None, reverse=False): reverse: When true, search the tokens before this one instead of the tokens after it - Returns: The first token of any type in token_types within distance of this token, or None if no such token is found. @@ -162,6 +215,13 @@ def DeleteToken(token): Args: token: The token to delete """ + # When deleting a token, we do not update the deleted token itself to make + # sure the previous and next pointers are still pointing to tokens which are + # not deleted. Also it is very hard to keep track of all previously deleted + # tokens to update them when their pointers become invalid. So we add this + # flag that any token linked list iteration logic can skip deleted node safely + # when its current token is deleted. + token.is_deleted = True if token.previous: token.previous.next = token.next @@ -173,19 +233,62 @@ def DeleteToken(token): following_token.metadata.last_code = token.metadata.last_code following_token = following_token.next -def DeleteTokens(token, tokenCount): + +def DeleteTokens(token, token_count): """Deletes the given number of tokens starting with the given token. Args: token: The token to start deleting at. - tokenCount: The total number of tokens to delete. + token_count: The total number of tokens to delete. """ - for i in xrange(1, tokenCount): + for i in xrange(1, token_count): DeleteToken(token.next) DeleteToken(token) + +def InsertTokenBefore(new_token, token): + """Insert new_token before token. + + Args: + new_token: A token to be added to the stream + token: A token already in the stream + """ + new_token.next = token + new_token.previous = token.previous + + new_token.metadata = copy.copy(token.metadata) + + if new_token.IsCode(): + old_last_code = token.metadata.last_code + following_token = token + while (following_token and + following_token.metadata.last_code == old_last_code): + following_token.metadata.last_code = new_token + following_token = following_token.next + + token.previous = new_token + if new_token.previous: + new_token.previous.next = new_token + + if new_token.start_index is None: + if new_token.line_number == token.line_number: + new_token.start_index = token.start_index + else: + previous_token = new_token.previous + if previous_token: + new_token.start_index = (previous_token.start_index + + len(previous_token.string)) + else: + new_token.start_index = 0 + + iterator = new_token.next + while iterator and iterator.line_number == new_token.line_number: + iterator.start_index += len(new_token.string) + iterator = iterator.next + + def InsertTokenAfter(new_token, token): - """Insert new_token after token + """Insert new_token after token. Args: new_token: A token to be added to the stream @@ -221,6 +324,21 @@ def InsertTokenAfter(new_token, token): iterator = iterator.next +def InsertTokensAfter(new_tokens, token): + """Insert multiple tokens after token. + + Args: + new_tokens: An array of tokens to be added to the stream + token: A token already in the stream + """ + # TODO(user): It would be nicer to have InsertTokenAfter defer to here + # instead of vice-versa. + current_token = token + for new_token in new_tokens: + InsertTokenAfter(new_token, current_token) + current_token = new_token + + def InsertSpaceTokenAfter(token): """Inserts a space token after the given token. @@ -228,28 +346,44 @@ def InsertSpaceTokenAfter(token): token: The token to insert a space token after Returns: - A single space token""" + A single space token + """ space_token = JavaScriptToken(' ', Type.WHITESPACE, token.line, token.line_number) InsertTokenAfter(space_token, token) -def InsertLineAfter(token): +def InsertBlankLineAfter(token): """Inserts a blank line after the given token. Args: token: The token to insert a blank line after Returns: - A single space token""" + A single space token + """ blank_token = JavaScriptToken('', Type.BLANK_LINE, '', token.line_number + 1) - InsertTokenAfter(blank_token, token) - # Update all subsequent ine numbers. - blank_token = blank_token.next - while blank_token: - blank_token.line_number += 1 - blank_token = blank_token.next + InsertLineAfter(token, [blank_token]) + + +def InsertLineAfter(token, new_tokens): + """Inserts a new line consisting of new_tokens after the given token. + + Args: + token: The token to insert after. + new_tokens: The tokens that will make up the new line. + """ + insert_location = token + for new_token in new_tokens: + InsertTokenAfter(new_token, insert_location) + insert_location = new_token + + # Update all subsequent line numbers. + next_token = new_tokens[-1].next + while next_token: + next_token.line_number += 1 + next_token = next_token.next def SplitToken(token, position): @@ -275,6 +409,10 @@ def SplitToken(token, position): def Compare(token1, token2): """Compares two tokens and determines their relative order. + Args: + token1: The first token to compare. + token2: The second token to compare. + Returns: A negative integer, zero, or a positive integer as the first token is before, equal, or after the second in the token stream. @@ -283,3 +421,277 @@ def Compare(token1, token2): return token1.line_number - token2.line_number else: return token1.start_index - token2.start_index + + +def GoogScopeOrNoneFromStartBlock(token): + """Determines if the given START_BLOCK is part of a goog.scope statement. + + Args: + token: A token of type START_BLOCK. + + Returns: + The goog.scope function call token, or None if such call doesn't exist. + """ + if token.type != JavaScriptTokenType.START_BLOCK: + return None + + # Search for a goog.scope statement, which will be 5 tokens before the + # block. Illustration of the tokens found prior to the start block: + # goog.scope(function() { + # 5 4 3 21 ^ + + maybe_goog_scope = token + for unused_i in xrange(5): + maybe_goog_scope = (maybe_goog_scope.previous if maybe_goog_scope and + maybe_goog_scope.previous else None) + if maybe_goog_scope and maybe_goog_scope.string == 'goog.scope': + return maybe_goog_scope + + +def GetTokenRange(start_token, end_token): + """Returns a list of tokens between the two given, inclusive. + + Args: + start_token: Start token in the range. + end_token: End token in the range. + + Returns: + A list of tokens, in order, from start_token to end_token (including start + and end). Returns none if the tokens do not describe a valid range. + """ + + token_range = [] + token = start_token + + while token: + token_range.append(token) + + if token == end_token: + return token_range + + token = token.next + + +def TokensToString(token_iterable): + """Convert a number of tokens into a string. + + Newlines will be inserted whenever the line_number of two neighboring + strings differ. + + Args: + token_iterable: The tokens to turn to a string. + + Returns: + A string representation of the given tokens. + """ + + buf = StringIO.StringIO() + token_list = list(token_iterable) + if not token_list: + return '' + + line_number = token_list[0].line_number + + for token in token_list: + + while line_number < token.line_number: + line_number += 1 + buf.write('\n') + + if line_number > token.line_number: + line_number = token.line_number + buf.write('\n') + + buf.write(token.string) + + return buf.getvalue() + + +def GetPreviousCodeToken(token): + """Returns the code token before the specified token. + + Args: + token: A token. + + Returns: + The code token before the specified token or None if no such token + exists. + """ + + return CustomSearch( + token, + lambda t: t and t.type not in JavaScriptTokenType.NON_CODE_TYPES, + reverse=True) + + +def GetNextCodeToken(token): + """Returns the next code token after the specified token. + + Args: + token: A token. + + Returns: + The next code token after the specified token or None if no such token + exists. + """ + + return CustomSearch( + token, + lambda t: t and t.type not in JavaScriptTokenType.NON_CODE_TYPES, + reverse=False) + + +def GetIdentifierStart(token): + """Returns the first token in an identifier. + + Given a token which is part of an identifier, returns the token at the start + of the identifier. + + Args: + token: A token which is part of an identifier. + + Returns: + The token at the start of the identifier or None if the identifier was not + of the form 'a.b.c' (e.g. "['a']['b'].c"). + """ + + start_token = token + previous_code_token = GetPreviousCodeToken(token) + + while (previous_code_token and ( + previous_code_token.IsType(JavaScriptTokenType.IDENTIFIER) or + IsDot(previous_code_token))): + start_token = previous_code_token + previous_code_token = GetPreviousCodeToken(previous_code_token) + + if IsDot(start_token): + return None + + return start_token + + +def GetIdentifierForToken(token): + """Get the symbol specified by a token. + + Given a token, this function additionally concatenates any parts of an + identifying symbol being identified that are split by whitespace or a + newline. + + The function will return None if the token is not the first token of an + identifier. + + Args: + token: The first token of a symbol. + + Returns: + The whole symbol, as a string. + """ + + # Search backward to determine if this token is the first token of the + # identifier. If it is not the first token, return None to signal that this + # token should be ignored. + prev_token = token.previous + while prev_token: + if (prev_token.IsType(JavaScriptTokenType.IDENTIFIER) or + IsDot(prev_token)): + return None + + if (prev_token.IsType(tokens.TokenType.WHITESPACE) or + prev_token.IsAnyType(JavaScriptTokenType.COMMENT_TYPES)): + prev_token = prev_token.previous + else: + break + + # A "function foo()" declaration. + if token.type is JavaScriptTokenType.FUNCTION_NAME: + return token.string + + # A "var foo" declaration (if the previous token is 'var') + previous_code_token = GetPreviousCodeToken(token) + + if previous_code_token and previous_code_token.IsKeyword('var'): + return token.string + + # Otherwise, this is potentially a namespaced (goog.foo.bar) identifier that + # could span multiple lines or be broken up by whitespace. We need + # to concatenate. + identifier_types = set([ + JavaScriptTokenType.IDENTIFIER, + JavaScriptTokenType.SIMPLE_LVALUE + ]) + + assert token.type in identifier_types + + # Start with the first token + symbol_tokens = [token] + + if token.next: + for t in token.next: + last_symbol_token = symbol_tokens[-1] + + # A dot is part of the previous symbol. + if IsDot(t): + symbol_tokens.append(t) + continue + + # An identifier is part of the previous symbol if the previous one was a + # dot. + if t.type in identifier_types: + if IsDot(last_symbol_token): + symbol_tokens.append(t) + continue + else: + break + + # Skip any whitespace + if t.type in JavaScriptTokenType.NON_CODE_TYPES: + continue + + # This is the end of the identifier. Stop iterating. + break + + if symbol_tokens: + return ''.join([t.string for t in symbol_tokens]) + + +def GetStringAfterToken(token): + """Get string after token. + + Args: + token: Search will be done after this token. + + Returns: + String if found after token else None (empty string will also + return None). + + Search until end of string as in case of empty string Type.STRING_TEXT is not + present/found and don't want to return next string. + E.g. + a = ''; + b = 'test'; + When searching for string after 'a' if search is not limited by end of string + then it will return 'test' which is not desirable as there is a empty string + before that. + + This will return None for cases where string is empty or no string found + as in both cases there is no Type.STRING_TEXT. + """ + string_token = SearchUntil(token, JavaScriptTokenType.STRING_TEXT, + [JavaScriptTokenType.SINGLE_QUOTE_STRING_END, + JavaScriptTokenType.DOUBLE_QUOTE_STRING_END]) + if string_token: + return string_token.string + else: + return None + + +def IsDot(token): + """Whether the token represents a "dot" operator (foo.bar).""" + return token.type is JavaScriptTokenType.OPERATOR and token.string == '.' + + +def IsIdentifierOrDot(token): + """Whether the token is either an identifier or a '.'.""" + return (token.type in [JavaScriptTokenType.IDENTIFIER, + JavaScriptTokenType.SIMPLE_LVALUE] or + IsDot(token)) diff --git a/tools/closure_linter/closure_linter/tokenutil_test.py b/tools/closure_linter/closure_linter/tokenutil_test.py new file mode 100644 index 00000000000000..c7d3854776bd48 --- /dev/null +++ b/tools/closure_linter/closure_linter/tokenutil_test.py @@ -0,0 +1,297 @@ +#!/usr/bin/env python +# +# Copyright 2012 The Closure Linter Authors. All Rights Reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for the scopeutil module.""" + +# Allow non-Google copyright +# pylint: disable=g-bad-file-header + +__author__ = ('nnaze@google.com (Nathan Naze)') + +import unittest as googletest + +from closure_linter import ecmametadatapass +from closure_linter import javascripttokens +from closure_linter import testutil +from closure_linter import tokenutil + + +class FakeToken(object): + pass + + +class TokenUtilTest(googletest.TestCase): + + def testGetTokenRange(self): + + a = FakeToken() + b = FakeToken() + c = FakeToken() + d = FakeToken() + e = FakeToken() + + a.next = b + b.next = c + c.next = d + + self.assertEquals([a, b, c, d], tokenutil.GetTokenRange(a, d)) + + # This is an error as e does not come after a in the token chain. + self.assertRaises(Exception, lambda: tokenutil.GetTokenRange(a, e)) + + def testTokensToString(self): + + a = FakeToken() + b = FakeToken() + c = FakeToken() + d = FakeToken() + e = FakeToken() + + a.string = 'aaa' + b.string = 'bbb' + c.string = 'ccc' + d.string = 'ddd' + e.string = 'eee' + + a.line_number = 5 + b.line_number = 6 + c.line_number = 6 + d.line_number = 10 + e.line_number = 11 + + self.assertEquals( + 'aaa\nbbbccc\n\n\n\nddd\neee', + tokenutil.TokensToString([a, b, c, d, e])) + + self.assertEquals( + 'ddd\neee\naaa\nbbbccc', + tokenutil.TokensToString([d, e, a, b, c]), + 'Neighboring tokens not in line_number order should have a newline ' + 'between them.') + + def testGetPreviousCodeToken(self): + + tokens = testutil.TokenizeSource(""" +start1. // comment + /* another comment */ + end1 +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + None, + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('start1'))) + + self.assertEquals( + '.', + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('end1')).string) + + self.assertEquals( + 'start1', + tokenutil.GetPreviousCodeToken(_GetTokenStartingWith('.')).string) + + def testGetNextCodeToken(self): + + tokens = testutil.TokenizeSource(""" +start1. // comment + /* another comment */ + end1 +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + '.', + tokenutil.GetNextCodeToken(_GetTokenStartingWith('start1')).string) + + self.assertEquals( + 'end1', + tokenutil.GetNextCodeToken(_GetTokenStartingWith('.')).string) + + self.assertEquals( + None, + tokenutil.GetNextCodeToken(_GetTokenStartingWith('end1'))) + + def testGetIdentifierStart(self): + + tokens = testutil.TokenizeSource(""" +start1 . // comment + prototype. /* another comment */ + end1 + +['edge'][case].prototype. + end2 = function() {} +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + 'start1', + tokenutil.GetIdentifierStart(_GetTokenStartingWith('end1')).string) + + self.assertEquals( + 'start1', + tokenutil.GetIdentifierStart(_GetTokenStartingWith('start1')).string) + + self.assertEquals( + None, + tokenutil.GetIdentifierStart(_GetTokenStartingWith('end2'))) + + def testInsertTokenBefore(self): + + self.AssertInsertTokenAfterBefore(False) + + def testInsertTokenAfter(self): + + self.AssertInsertTokenAfterBefore(True) + + def AssertInsertTokenAfterBefore(self, after): + + new_token = javascripttokens.JavaScriptToken( + 'a', javascripttokens.JavaScriptTokenType.IDENTIFIER, 1, 1) + + existing_token1 = javascripttokens.JavaScriptToken( + 'var', javascripttokens.JavaScriptTokenType.KEYWORD, 1, 1) + existing_token1.start_index = 0 + existing_token1.metadata = ecmametadatapass.EcmaMetaData() + + existing_token2 = javascripttokens.JavaScriptToken( + ' ', javascripttokens.JavaScriptTokenType.WHITESPACE, 1, 1) + existing_token2.start_index = 3 + existing_token2.metadata = ecmametadatapass.EcmaMetaData() + existing_token2.metadata.last_code = existing_token1 + + existing_token1.next = existing_token2 + existing_token2.previous = existing_token1 + + if after: + tokenutil.InsertTokenAfter(new_token, existing_token1) + else: + tokenutil.InsertTokenBefore(new_token, existing_token2) + + self.assertEquals(existing_token1, new_token.previous) + self.assertEquals(existing_token2, new_token.next) + + self.assertEquals(new_token, existing_token1.next) + self.assertEquals(new_token, existing_token2.previous) + + self.assertEquals(existing_token1, new_token.metadata.last_code) + self.assertEquals(new_token, existing_token2.metadata.last_code) + + self.assertEquals(0, existing_token1.start_index) + self.assertEquals(3, new_token.start_index) + self.assertEquals(4, existing_token2.start_index) + + def testGetIdentifierForToken(self): + + tokens = testutil.TokenizeSource(""" +start1.abc.def.prototype. + onContinuedLine + +(start2.abc.def + .hij.klm + .nop) + +start3.abc.def + .hij = function() {}; + +// An absurd multi-liner. +start4.abc.def. + hij. + klm = function() {}; + +start5 . aaa . bbb . ccc + shouldntBePartOfThePreviousSymbol + +start6.abc.def ghi.shouldntBePartOfThePreviousSymbol + +var start7 = 42; + +function start8() { + +} + +start9.abc. // why is there a comment here? + def /* another comment */ + shouldntBePart + +start10.abc // why is there a comment here? + .def /* another comment */ + shouldntBePart + +start11.abc. middle1.shouldNotBeIdentifier +""") + + def _GetTokenStartingWith(token_starts_with): + for t in tokens: + if t.string.startswith(token_starts_with): + return t + + self.assertEquals( + 'start1.abc.def.prototype.onContinuedLine', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start1'))) + + self.assertEquals( + 'start2.abc.def.hij.klm.nop', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start2'))) + + self.assertEquals( + 'start3.abc.def.hij', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start3'))) + + self.assertEquals( + 'start4.abc.def.hij.klm', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start4'))) + + self.assertEquals( + 'start5.aaa.bbb.ccc', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start5'))) + + self.assertEquals( + 'start6.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start6'))) + + self.assertEquals( + 'start7', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start7'))) + + self.assertEquals( + 'start8', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start8'))) + + self.assertEquals( + 'start9.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start9'))) + + self.assertEquals( + 'start10.abc.def', + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('start10'))) + + self.assertIsNone( + tokenutil.GetIdentifierForToken(_GetTokenStartingWith('middle1'))) + + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/closure_linter/typeannotation.py b/tools/closure_linter/closure_linter/typeannotation.py new file mode 100644 index 00000000000000..00604c13a7b31b --- /dev/null +++ b/tools/closure_linter/closure_linter/typeannotation.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python +#*-* coding: utf-8 +"""Closure typeannotation parsing and utilities.""" + + + +from closure_linter import errors +from closure_linter import javascripttokens +from closure_linter.common import error + +# Shorthand +TYPE = javascripttokens.JavaScriptTokenType + + +class TypeAnnotation(object): + """Represents a structured view of a closure type annotation. + + Attribute: + identifier: The name of the type. + key_type: The name part before a colon. + sub_types: The list of sub_types used e.g. for Array.<…> + or_null: The '?' annotation + not_null: The '!' annotation + type_group: If this a a grouping (a|b), but does not include function(a). + return_type: The return type of a function definition. + alias: The actual type set by closurizednamespaceinfo if the identifier uses + an alias to shorten the name. + tokens: An ordered list of tokens used for this type. May contain + TypeAnnotation instances for sub_types, key_type or return_type. + """ + + IMPLICIT_TYPE_GROUP = 2 + + NULLABILITY_UNKNOWN = 2 + + # Frequently used known non-nullable types. + NON_NULLABLE = frozenset([ + 'boolean', 'function', 'number', 'string', 'undefined']) + # Frequently used known nullable types. + NULLABLE_TYPE_WHITELIST = frozenset([ + 'Array', 'Document', 'Element', 'Function', 'Node', 'NodeList', + 'Object']) + + def __init__(self): + self.identifier = '' + self.sub_types = [] + self.or_null = False + self.not_null = False + self.type_group = False + self.alias = None + self.key_type = None + self.record_type = False + self.opt_arg = False + self.return_type = None + self.tokens = [] + + def IsFunction(self): + """Determines whether this is a function definition.""" + return self.identifier == 'function' + + def IsConstructor(self): + """Determines whether this is a function definition for a constructor.""" + key_type = self.sub_types and self.sub_types[0].key_type + return self.IsFunction() and key_type.identifier == 'new' + + def IsRecordType(self): + """Returns True if this type is a record type.""" + return (self.record_type or + bool([t for t in self.sub_types if t.IsRecordType()])) + + def IsVarArgsType(self): + """Determines if the type is a var_args type, i.e. starts with '...'.""" + return self.identifier.startswith('...') or ( + self.type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP and + self.sub_types[0].identifier.startswith('...')) + + def IsEmpty(self): + """Returns True if the type is empty.""" + return not self.tokens + + def IsUnknownType(self): + """Returns True if this is the unknown type {?}.""" + return (self.or_null + and not self.identifier + and not self.sub_types + and not self.return_type) + + def Append(self, item): + """Adds a sub_type to this type and finalizes it. + + Args: + item: The TypeAnnotation item to append. + """ + # item is a TypeAnnotation instance, so pylint: disable=protected-access + self.sub_types.append(item._Finalize(self)) + + def __repr__(self): + """Reconstructs the type definition.""" + append = '' + if self.sub_types: + separator = (',' if not self.type_group else '|') + if self.identifier == 'function': + surround = '(%s)' + else: + surround = {False: '{%s}' if self.record_type else '<%s>', + True: '(%s)', + self.IMPLICIT_TYPE_GROUP: '%s'}[self.type_group] + append = surround % separator.join([repr(t) for t in self.sub_types]) + if self.return_type: + append += ':%s' % repr(self.return_type) + append += '=' if self.opt_arg else '' + prefix = '' + ('?' if self.or_null else '') + ('!' if self.not_null else '') + keyword = '%s:' % repr(self.key_type) if self.key_type else '' + return keyword + prefix + '%s' % (self.alias or self.identifier) + append + + def ToString(self): + """Concats the type's tokens to form a string again.""" + ret = [] + for token in self.tokens: + if not isinstance(token, TypeAnnotation): + ret.append(token.string) + else: + ret.append(token.ToString()) + return ''.join(ret) + + def Dump(self, indent=''): + """Dumps this type's structure for debugging purposes.""" + result = [] + for t in self.tokens: + if isinstance(t, TypeAnnotation): + result.append(indent + str(t) + ' =>\n' + t.Dump(indent + ' ')) + else: + result.append(indent + str(t)) + return '\n'.join(result) + + def IterIdentifiers(self): + """Iterates over all identifiers in this type and its subtypes.""" + if self.identifier: + yield self.identifier + for subtype in self.IterTypes(): + for identifier in subtype.IterIdentifiers(): + yield identifier + + def IterTypeGroup(self): + """Iterates over all types in the type group including self. + + Yields: + If this is a implicit or manual type-group: all sub_types. + Otherwise: self + E.g. for @type {Foo.} this will yield only Foo., + for @type {Foo|(Bar|Sample)} this will yield Foo, Bar and Sample. + + """ + if self.type_group: + for sub_type in self.sub_types: + for sub_type in sub_type.IterTypeGroup(): + yield sub_type + else: + yield self + + def IterTypes(self): + """Iterates over each subtype as well as return and key types.""" + if self.return_type: + yield self.return_type + + if self.key_type: + yield self.key_type + + for sub_type in self.sub_types: + yield sub_type + + def GetNullability(self, modifiers=True): + """Computes whether the type may be null. + + Args: + modifiers: Whether the modifiers ? and ! should be considered in the + evaluation. + Returns: + True if the type allows null, False if the type is strictly non nullable + and NULLABILITY_UNKNOWN if the nullability cannot be determined. + """ + + # Explicitly marked nullable types or 'null' are nullable. + if (modifiers and self.or_null) or self.identifier == 'null': + return True + + # Explicitly marked non-nullable types or non-nullable base types: + if ((modifiers and self.not_null) or self.record_type + or self.identifier in self.NON_NULLABLE): + return False + + # A type group is nullable if any of its elements are nullable. + if self.type_group: + maybe_nullable = False + for sub_type in self.sub_types: + nullability = sub_type.GetNullability() + if nullability == self.NULLABILITY_UNKNOWN: + maybe_nullable = nullability + elif nullability: + return True + return maybe_nullable + + # Whitelisted types are nullable. + if self.identifier.rstrip('.') in self.NULLABLE_TYPE_WHITELIST: + return True + + # All other types are unknown (most should be nullable, but + # enums are not and typedefs might not be). + return self.NULLABILITY_UNKNOWN + + def WillAlwaysBeNullable(self): + """Computes whether the ! flag is illegal for this type. + + This is the case if this type or any of the subtypes is marked as + explicitly nullable. + + Returns: + True if the ! flag would be illegal. + """ + if self.or_null or self.identifier == 'null': + return True + + if self.type_group: + return bool([t for t in self.sub_types if t.WillAlwaysBeNullable()]) + + return False + + def _Finalize(self, parent): + """Fixes some parsing issues once the TypeAnnotation is complete.""" + + # Normalize functions whose definition ended up in the key type because + # they defined a return type after a colon. + if self.key_type and self.key_type.identifier == 'function': + current = self.key_type + current.return_type = self + self.key_type = None + # opt_arg never refers to the return type but to the function itself. + current.opt_arg = self.opt_arg + self.opt_arg = False + return current + + # If a typedef just specified the key, it will not end up in the key type. + if parent.record_type and not self.key_type: + current = TypeAnnotation() + current.key_type = self + current.tokens.append(self) + return current + return self + + def FirstToken(self): + """Returns the first token used in this type or any of its subtypes.""" + first = self.tokens[0] + return first.FirstToken() if isinstance(first, TypeAnnotation) else first + + +def Parse(token, token_end, error_handler): + """Parses a type annotation and returns a TypeAnnotation object.""" + return TypeAnnotationParser(error_handler).Parse(token.next, token_end) + + +class TypeAnnotationParser(object): + """A parser for type annotations constructing the TypeAnnotation object.""" + + def __init__(self, error_handler): + self._stack = [] + self._error_handler = error_handler + self._closing_error = False + + def Parse(self, token, token_end): + """Parses a type annotation and returns a TypeAnnotation object.""" + root = TypeAnnotation() + self._stack.append(root) + current = TypeAnnotation() + root.tokens.append(current) + + while token and token != token_end: + if token.type in (TYPE.DOC_TYPE_START_BLOCK, TYPE.DOC_START_BRACE): + if token.string == '(': + if (current.identifier and + current.identifier not in ['function', '...']): + self.Error(token, + 'Invalid identifier for (): "%s"' % current.identifier) + current.type_group = current.identifier != 'function' + elif token.string == '{': + current.record_type = True + current.tokens.append(token) + self._stack.append(current) + current = TypeAnnotation() + self._stack[-1].tokens.append(current) + + elif token.type in (TYPE.DOC_TYPE_END_BLOCK, TYPE.DOC_END_BRACE): + prev = self._stack.pop() + prev.Append(current) + current = prev + + # If an implicit type group was created, close it as well. + if prev.type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP: + prev = self._stack.pop() + prev.Append(current) + current = prev + current.tokens.append(token) + + elif token.type == TYPE.DOC_TYPE_MODIFIER: + if token.string == '!': + current.tokens.append(token) + current.not_null = True + elif token.string == '?': + current.tokens.append(token) + current.or_null = True + elif token.string == ':': + current.tokens.append(token) + prev = current + current = TypeAnnotation() + prev.tokens.append(current) + current.key_type = prev + elif token.string == '=': + # For implicit type groups the '=' refers to the parent. + try: + if self._stack[-1].type_group == TypeAnnotation.IMPLICIT_TYPE_GROUP: + self._stack[-1].tokens.append(token) + self._stack[-1].opt_arg = True + else: + current.tokens.append(token) + current.opt_arg = True + except IndexError: + self.ClosingError(token) + elif token.string == '|': + # If a type group has explicitly been opened do a normal append. + # Otherwise we have to open the type group and move the current + # type into it, before appending + if not self._stack[-1].type_group: + type_group = TypeAnnotation() + if current.key_type and current.key_type.identifier != 'function': + type_group.key_type = current.key_type + current.key_type = None + type_group.type_group = TypeAnnotation.IMPLICIT_TYPE_GROUP + # Fix the token order + prev = self._stack[-1].tokens.pop() + self._stack[-1].tokens.append(type_group) + type_group.tokens.append(prev) + self._stack.append(type_group) + self._stack[-1].tokens.append(token) + self.Append(current, error_token=token) + current = TypeAnnotation() + self._stack[-1].tokens.append(current) + elif token.string == ',': + self.Append(current, error_token=token) + current = TypeAnnotation() + self._stack[-1].tokens.append(token) + self._stack[-1].tokens.append(current) + else: + current.tokens.append(token) + self.Error(token, 'Invalid token') + + elif token.type == TYPE.COMMENT: + current.tokens.append(token) + current.identifier += token.string.strip() + + elif token.type in [TYPE.DOC_PREFIX, TYPE.WHITESPACE]: + current.tokens.append(token) + + else: + current.tokens.append(token) + self.Error(token, 'Unexpected token') + + token = token.next + + self.Append(current, error_token=token) + try: + ret = self._stack.pop() + except IndexError: + self.ClosingError(token) + # The type is screwed up, but let's return something. + return current + + if self._stack and (len(self._stack) != 1 or + ret.type_group != TypeAnnotation.IMPLICIT_TYPE_GROUP): + self.Error(token, 'Too many opening items.') + + return ret if len(ret.sub_types) > 1 else ret.sub_types[0] + + def Append(self, type_obj, error_token): + """Appends a new TypeAnnotation object to the current parent.""" + if self._stack: + self._stack[-1].Append(type_obj) + else: + self.ClosingError(error_token) + + def ClosingError(self, token): + """Reports an error about too many closing items, but only once.""" + if not self._closing_error: + self._closing_error = True + self.Error(token, 'Too many closing items.') + + def Error(self, token, message): + """Calls the error_handler to post an error message.""" + if self._error_handler: + self._error_handler.HandleError(error.Error( + errors.JSDOC_DOES_NOT_PARSE, + 'Error parsing jsdoc type at token "%s" (column: %d): %s' % + (token.string, token.start_index, message), token)) diff --git a/tools/closure_linter/closure_linter/typeannotation_test.py b/tools/closure_linter/closure_linter/typeannotation_test.py new file mode 100755 index 00000000000000..da9dfa369f0bc8 --- /dev/null +++ b/tools/closure_linter/closure_linter/typeannotation_test.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +"""Unit tests for the typeannotation module.""" + + + + +import unittest as googletest + +from closure_linter import testutil +from closure_linter.common import erroraccumulator + +CRAZY_TYPE = ('Array.))>') + + +class TypeErrorException(Exception): + """Exception for TypeErrors.""" + + def __init__(self, errors): + super(TypeErrorException, self).__init__() + self.errors = errors + + +class TypeParserTest(googletest.TestCase): + """Tests for typeannotation parsing.""" + + def _ParseComment(self, script): + """Parse a script that contains one comment and return it.""" + accumulator = erroraccumulator.ErrorAccumulator() + _, comments = testutil.ParseFunctionsAndComments(script, accumulator) + if accumulator.GetErrors(): + raise TypeErrorException(accumulator.GetErrors()) + self.assertEquals(1, len(comments)) + return comments[0] + + def _ParseType(self, type_str): + """Creates a comment to parse and returns the parsed type.""" + comment = self._ParseComment('/** @type {%s} **/' % type_str) + return comment.GetDocFlags()[0].jstype + + def assertProperReconstruction(self, type_str, matching_str=None): + """Parses the type and asserts the its repr matches the type. + + If matching_str is specified, it will assert that the repr matches this + string instead. + + Args: + type_str: The type string to parse. + matching_str: A string the __repr__ of the parsed type should match. + Returns: + The parsed js_type. + """ + parsed_type = self._ParseType(type_str) + # Use listEqual assertion to more easily identify the difference + self.assertListEqual(list(matching_str or type_str), + list(repr(parsed_type))) + self.assertEquals(matching_str or type_str, repr(parsed_type)) + + # Newlines will be inserted by the file writer. + self.assertEquals(type_str.replace('\n', ''), parsed_type.ToString()) + return parsed_type + + def assertNullable(self, type_str, nullable=True): + parsed_type = self.assertProperReconstruction(type_str) + self.assertEquals(nullable, parsed_type.GetNullability(), + '"%s" should %sbe nullable' % + (type_str, 'not ' if nullable else '')) + + def assertNotNullable(self, type_str): + return self.assertNullable(type_str, nullable=False) + + def testReconstruction(self): + self.assertProperReconstruction('*') + self.assertProperReconstruction('number') + self.assertProperReconstruction('(((number)))') + self.assertProperReconstruction('!number') + self.assertProperReconstruction('?!number') + self.assertProperReconstruction('number=') + self.assertProperReconstruction('number=!?', '?!number=') + self.assertProperReconstruction('number|?string') + self.assertProperReconstruction('(number|string)') + self.assertProperReconstruction('?(number|string)') + self.assertProperReconstruction('Object.') + self.assertProperReconstruction('function(new:Object)') + self.assertProperReconstruction('function(new:Object):number') + self.assertProperReconstruction('function(new:Object,Element):number') + self.assertProperReconstruction('function(this:T,...)') + self.assertProperReconstruction('{a:?number}') + self.assertProperReconstruction('{a:?number,b:(number|string)}') + self.assertProperReconstruction('{c:{nested_element:*}|undefined}') + self.assertProperReconstruction('{handleEvent:function(?):?}') + self.assertProperReconstruction('function():?|null') + self.assertProperReconstruction('null|function():?|bar') + + def testOptargs(self): + self.assertProperReconstruction('number=') + self.assertProperReconstruction('number|string=') + self.assertProperReconstruction('(number|string)=') + self.assertProperReconstruction('(number|string=)') + self.assertProperReconstruction('(number=|string)') + self.assertProperReconstruction('function(...):number=') + + def testIndepth(self): + # Do an deeper check of the crazy identifier + crazy = self.assertProperReconstruction(CRAZY_TYPE) + self.assertEquals('Array.', crazy.identifier) + self.assertEquals(1, len(crazy.sub_types)) + func1 = crazy.sub_types[0] + func2 = func1.return_type + self.assertEquals('function', func1.identifier) + self.assertEquals('function', func2.identifier) + self.assertEquals(3, len(func1.sub_types)) + self.assertEquals(1, len(func2.sub_types)) + self.assertEquals('Object.', func2.sub_types[0].sub_types[0].identifier) + + def testIterIdentifiers(self): + nested_identifiers = self._ParseType('(a|{b:(c|function(new:d):e)})') + for identifier in ('a', 'b', 'c', 'd', 'e'): + self.assertIn(identifier, nested_identifiers.IterIdentifiers()) + + def testIsEmpty(self): + self.assertTrue(self._ParseType('').IsEmpty()) + self.assertFalse(self._ParseType('?').IsEmpty()) + self.assertFalse(self._ParseType('!').IsEmpty()) + self.assertFalse(self._ParseType('').IsEmpty()) + + def testIsConstructor(self): + self.assertFalse(self._ParseType('').IsConstructor()) + self.assertFalse(self._ParseType('Array.').IsConstructor()) + self.assertTrue(self._ParseType('function(new:T)').IsConstructor()) + + def testIsVarArgsType(self): + self.assertTrue(self._ParseType('...number').IsVarArgsType()) + self.assertTrue(self._ParseType('...Object|Array').IsVarArgsType()) + self.assertTrue(self._ParseType('...(Object|Array)').IsVarArgsType()) + self.assertFalse(self._ParseType('Object|...Array').IsVarArgsType()) + self.assertFalse(self._ParseType('(...Object|Array)').IsVarArgsType()) + + def testIsUnknownType(self): + self.assertTrue(self._ParseType('?').IsUnknownType()) + self.assertTrue(self._ParseType('Foo.').sub_types[0].IsUnknownType()) + self.assertFalse(self._ParseType('?|!').IsUnknownType()) + self.assertTrue(self._ParseType('?|!').sub_types[0].IsUnknownType()) + self.assertFalse(self._ParseType('!').IsUnknownType()) + + long_type = 'function():?|{handleEvent:function(?=):?,sample:?}|?=' + record = self._ParseType(long_type) + # First check that there's not just one type with 3 return types, but three + # top-level types. + self.assertEquals(3, len(record.sub_types)) + + # Now extract all unknown type instances and verify that they really are. + handle_event, sample = record.sub_types[1].sub_types + for i, sub_type in enumerate([ + record.sub_types[0].return_type, + handle_event.return_type, + handle_event.sub_types[0], + sample, + record.sub_types[2]]): + self.assertTrue(sub_type.IsUnknownType(), + 'Type %d should be the unknown type: %s\n%s' % ( + i, sub_type.tokens, record.Dump())) + + def testTypedefNames(self): + easy = self._ParseType('{a}') + self.assertTrue(easy.record_type) + + easy = self.assertProperReconstruction('{a}', '{a:}').sub_types[0] + self.assertEquals('a', easy.key_type.identifier) + self.assertEquals('', easy.identifier) + + easy = self.assertProperReconstruction('{a:b}').sub_types[0] + self.assertEquals('a', easy.key_type.identifier) + self.assertEquals('b', easy.identifier) + + def assertTypeError(self, type_str): + """Asserts that parsing the given type raises a linter error.""" + self.assertRaises(TypeErrorException, self._ParseType, type_str) + + def testParseBadTypes(self): + """Tests that several errors in types don't break the parser.""" + self.assertTypeError('<') + self.assertTypeError('>') + self.assertTypeError('Foo.=') + self.assertTypeError('Foo.>=') + self.assertTypeError('(') + self.assertTypeError(')') + self.assertTypeError('Foo.') + self._ParseType(':') + self._ParseType(':foo') + self.assertTypeError(':)foo') + self.assertTypeError('(a|{b:(c|function(new:d):e') + + def testNullable(self): + self.assertNullable('null') + self.assertNullable('Object') + self.assertNullable('?string') + self.assertNullable('?number') + + self.assertNotNullable('string') + self.assertNotNullable('number') + self.assertNotNullable('boolean') + self.assertNotNullable('function(Object)') + self.assertNotNullable('function(Object):Object') + self.assertNotNullable('function(?Object):?Object') + self.assertNotNullable('!Object') + + self.assertNotNullable('boolean|string') + self.assertNotNullable('(boolean|string)') + + self.assertNullable('(boolean|string|null)') + self.assertNullable('(?boolean)') + self.assertNullable('?(boolean)') + + self.assertNullable('(boolean|Object)') + self.assertNotNullable('(boolean|(string|{a:}))') + + def testSpaces(self): + """Tests that spaces don't change the outcome.""" + type_str = (' A < b | ( c | ? ! d e f ) > | ' + 'function ( x : . . . ) : { y : z = } ') + two_spaces = type_str.replace(' ', ' ') + no_spaces = type_str.replace(' ', '') + newlines = type_str.replace(' ', '\n * ') + self.assertProperReconstruction(no_spaces) + self.assertProperReconstruction(type_str, no_spaces) + self.assertProperReconstruction(two_spaces, no_spaces) + self.assertProperReconstruction(newlines, no_spaces) + +if __name__ == '__main__': + googletest.main() diff --git a/tools/closure_linter/dist/closure_linter-2.3.17-py2.7.egg b/tools/closure_linter/dist/closure_linter-2.3.17-py2.7.egg new file mode 100644 index 00000000000000..e9a847ca28b842 Binary files /dev/null and b/tools/closure_linter/dist/closure_linter-2.3.17-py2.7.egg differ diff --git a/tools/closure_linter/setup.py b/tools/closure_linter/setup.py index 1d1764f2c9d235..d320b65d1791fd 100755 --- a/tools/closure_linter/setup.py +++ b/tools/closure_linter/setup.py @@ -20,7 +20,7 @@ from distutils.core import setup setup(name='closure_linter', - version='2.2.6', + version='2.3.17', description='Closure Linter', license='Apache', author='The Closure Linter Authors', diff --git a/tools/configure.d/nodedownload.py b/tools/configure.d/nodedownload.py new file mode 100644 index 00000000000000..e24efd865f3049 --- /dev/null +++ b/tools/configure.d/nodedownload.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python +# Moved some utilities here from ../../configure + +import urllib +import hashlib +import sys +import zipfile +import tarfile +import fpformat +import contextlib + +def formatSize(amt): + """Format a size as a string in MB""" + return fpformat.fix(amt / 1024000., 1) + +def spin(c): + """print out an ASCII 'spinner' based on the value of counter 'c'""" + spin = ".:|'" + return (spin[c % len(spin)]) + +class ConfigOpener(urllib.FancyURLopener): + """fancy opener used by retrievefile. Set a UA""" + # append to existing version (UA) + version = '%s node.js/configure' % urllib.URLopener.version + +def reporthook(count, size, total): + """internal hook used by retrievefile""" + sys.stdout.write(' Fetch: %c %sMB total, %sMB downloaded \r' % + (spin(count), + formatSize(total), + formatSize(count*size))) + +def retrievefile(url, targetfile): + """fetch file 'url' as 'targetfile'. Return targetfile or throw.""" + try: + sys.stdout.write(' <%s>\nConnecting...\r' % url) + sys.stdout.flush() + msg = ConfigOpener().retrieve(url, targetfile, reporthook=reporthook) + print '' # clear the line + return targetfile + except: + print ' ** Error occurred while downloading\n <%s>' % url + raise + +def md5sum(targetfile): + """md5sum a file. Return the hex digest.""" + digest = hashlib.md5() + with open(targetfile, 'rb') as f: + chunk = f.read(1024) + while chunk != "": + digest.update(chunk) + chunk = f.read(1024) + return digest.hexdigest() + +def unpack(packedfile, parent_path): + """Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path""" + if zipfile.is_zipfile(packedfile): + with contextlib.closing(zipfile.ZipFile(packedfile, 'r')) as icuzip: + print ' Extracting zipfile: %s' % packedfile + icuzip.extractall(parent_path) + return parent_path + elif tarfile.is_tarfile(packedfile): + with tarfile.TarFile.open(packedfile, 'r') as icuzip: + print ' Extracting tarfile: %s' % packedfile + icuzip.extractall(parent_path) + return parent_path + else: + packedsuffix = packedfile.lower().split('.')[-1] # .zip, .tgz etc + raise Exception('Error: Don\'t know how to unpack %s with extension %s' % (packedfile, packedsuffix)) + +# List of possible "--download=" types. +download_types = set(['icu']) + +# Default options for --download. +download_default = "none" + +def help(): + """This function calculates the '--help' text for '--download'.""" + return """Select which packages may be auto-downloaded. +valid values are: none, all, %s. (default is "%s").""" % (", ".join(download_types), download_default) + +def set2dict(keys, value=None): + """Convert some keys (iterable) to a dict.""" + return dict((key, value) for (key) in keys) + +def parse(opt): + """This function parses the options to --download and returns a set such as { icu: true }, etc. """ + if not opt: + opt = download_default + + theOpts = set(opt.split(',')) + + if 'all' in theOpts: + # all on + return set2dict(download_types, True) + elif 'none' in theOpts: + # all off + return set2dict(download_types, False) + + # OK. Now, process each of the opts. + theRet = set2dict(download_types, False) + for anOpt in opt.split(','): + if not anOpt or anOpt == "": + # ignore stray commas, etc. + continue + elif anOpt is 'all': + # all on + theRet = dict((key, True) for (key) in download_types) + else: + # turn this one on + if anOpt in download_types: + theRet[anOpt] = True + else: + # future proof: ignore unknown types + print 'Warning: ignoring unknown --download= type "%s"' % anOpt + # all done + return theRet + +def candownload(auto_downloads, package): + if not (package in auto_downloads.keys()): + raise Exception('Internal error: "%s" is not in the --downloads list. Check nodedownload.py' % package) + if auto_downloads[package]: + return True + else: + print """Warning: Not downloading package "%s". You could pass "--download=all" + (Windows: "download-all") to try auto-downloading it.""" % package + return False diff --git a/tools/cpplint.py b/tools/cpplint.py index 603c4aba9741dd..5ab156124a2db6 100644 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -210,7 +210,7 @@ # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # All entries here should start with a '-' or '+', as in the --filter= flag. -_DEFAULT_FILTERS = [ '-build/include_alpha' ] +_DEFAULT_FILTERS = [ '-build/include_alpha', '-legal/copyright' ] # We used to check for high-bit characters, but after much discussion we # decided those were OK, as long as they were in UTF-8 and didn't represent diff --git a/tools/doc/generate.js b/tools/doc/generate.js old mode 100755 new mode 100644 index 2bab2f3ef3ede2..5dfcc5372fe75e --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -1,25 +1,6 @@ -#!/usr/bin/env node -// 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 processIncludes = require('./preprocess.js'); var marked = require('marked'); var fs = require('fs'); var path = require('path'); @@ -52,48 +33,10 @@ console.error('Input file = %s', inputFile); fs.readFile(inputFile, 'utf8', function(er, input) { if (er) throw er; // process the input for @include lines - processIncludes(input, next); + processIncludes(inputFile, input, next); }); -var includeExpr = /^@include\s+([A-Za-z0-9-_]+)(?:\.)?([a-zA-Z]*)$/gmi; -var includeData = {}; -function processIncludes(input, cb) { - var includes = input.match(includeExpr); - if (includes === null) return cb(null, input); - var errState = null; - console.error(includes); - var incCount = includes.length; - if (incCount === 0) cb(null, input); - includes.forEach(function(include) { - var fname = include.replace(/^@include\s+/, ''); - if (!fname.match(/\.markdown$/)) fname += '.markdown'; - - if (includeData.hasOwnProperty(fname)) { - input = input.split(include).join(includeData[fname]); - incCount--; - if (incCount === 0) { - return cb(null, input); - } - } - - var fullFname = path.resolve(path.dirname(inputFile), fname); - fs.readFile(fullFname, 'utf8', function(er, inc) { - if (errState) return; - if (er) return cb(errState = er); - processIncludes(inc, function(er, inc) { - if (errState) return; - if (er) return cb(errState = er); - incCount--; - includeData[fname] = inc; - input = input.split(include+'\n').join(includeData[fname]+'\n'); - if (incCount === 0) { - return cb(null, input); - } - }); - }); - }); -} function next(er, input) { diff --git a/tools/doc/html.js b/tools/doc/html.js index 088eb4490dcf59..9877fb4d3cd4f7 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -1,38 +1,63 @@ -// 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 fs = require('fs'); var marked = require('marked'); var path = require('path'); +var preprocess = require('./preprocess.js'); module.exports = toHTML; +// TODO(chrisdickinson): never stop vomitting / fix this. +var gtocPath = path.resolve(path.join(__dirname, '..', '..', 'doc', 'api', '_toc.markdown')); +var gtocLoading = null; +var gtocData = null; + function toHTML(input, filename, template, cb) { - var lexed = marked.lexer(input); - fs.readFile(template, 'utf8', function(er, template) { - if (er) return cb(er); - render(lexed, filename, template, cb); + if (gtocData) { + return onGtocLoaded(); + } + + if (gtocLoading === null) { + gtocLoading = [onGtocLoaded]; + return loadGtoc(function(err, data) { + if (err) throw err; + gtocData = data; + gtocLoading.forEach(function(xs) { + xs(); + }); + }); + } + + if (gtocLoading) { + return gtocLoading.push(onGtocLoaded); + } + + function onGtocLoaded() { + var lexed = marked.lexer(input); + fs.readFile(template, 'utf8', function(er, template) { + if (er) return cb(er); + render(lexed, filename, template, cb); + }); + } +} + +function loadGtoc(cb) { + fs.readFile(gtocPath, 'utf8', function(err, data) { + if (err) return cb(err); + + preprocess(gtocPath, data, function(err, data) { + if (err) return cb(err); + + data = marked(data).replace(/ + + * python-gflags: version 2.0 + * No changes from version 1.8. + +Wed Jan 18 11:54:03 2012 Google Inc. + + * python-gflags: version 1.8 + * Don't raise DuplicateFlag when re-importing a module (mmcdonald) + * Changed the 'official' python-gflags email in setup.py/etc + * Changed copyright text to reflect Google's relinquished ownership + +Tue Dec 20 17:10:41 2011 Google Inc. + + * python-gflags: version 1.7 + * Prepare gflags for python 3.x, keeping 2.4 compatibility (twouters) + * If output is a tty, use terminal's width to wrap help-text (wiesmann) + * PORTING: Fix ImportError for non-Unix platforms (kdeus) + * PORTING: Run correctly when termios isn't available (shines) + * Add unicode support to flags (csilvers) + +Fri Jul 29 12:24:08 2011 Google Inc. + + * python-gflags: version 1.6 + * Document FlagValues.UseGnuGetOpt (garymm) + * replace fchmod with chmod to work on python 2.4 (mshields) + * Fix bug in flag decl reporting for dup flags (craigcitro) + * Add multi_float, and tests for multi_float/int (simonf) + * Make flagfiles expand in place, to follow docs (dmlynch) + * Raise exception if --flagfile can't be read (tlim) + +Wed Jan 26 13:50:46 2011 Google Inc. + + * python-gflags: version 1.5.1 + * Fix manifest and setup.py to include new files + +Mon Jan 24 16:58:10 2011 Google Inc. + + * python-gflags: version 1.5 + * Add support for flag validators (olexiy) + * Better reporting on UnrecognizedFlagError (sorenj) + * Cache ArgumentParser, to save space (tmarek) + +Wed Oct 13 17:40:12 2010 Google Inc. + + * python-gflags: version 1.4 + * Unregister per-command flags after running the command (dnr) + * Allow key-flags to work with special flags (salcianu) + * Allow printing flags of a specific module (mikecurtis) + * BUGFIX: Fix an error message for float flags (olexiy) + * BUGFIX: Can now import while defining flags (salcianu) + * BUGFIX: Fix flagfile parsing in python (chronos) + * DOC: Better explain the format of --helpxml output (salcianu) + * DOC: Better error message on parse failure (tstromberg) + * Better test coverage under python 2.2 (mshields) + * Added a Makefile for building the packages. + +Mon Jan 4 18:46:29 2010 Tim 'mithro' Ansell + + * python-gflags: version 1.3 + * Fork from the C++ package (google-gflags 1.3) + * Add debian packaging diff --git a/tools/gflags/MANIFEST.in b/tools/gflags/MANIFEST.in new file mode 100644 index 00000000000000..17851bfa77e9fd --- /dev/null +++ b/tools/gflags/MANIFEST.in @@ -0,0 +1,19 @@ +include AUTHORS +include COPYING +include ChangeLog +include MANIFEST.in +include Makefile +include NEWS +include README +include debian/README +include debian/changelog +include debian/compat +include debian/control +include debian/copyright +include debian/docs +include debian/rules +include gflags.py +include gflags2man.py +include gflags_validators.py +include setup.py +recursive-include tests *.py diff --git a/tools/gflags/Makefile b/tools/gflags/Makefile new file mode 100644 index 00000000000000..6627c32a5e8cb7 --- /dev/null +++ b/tools/gflags/Makefile @@ -0,0 +1,69 @@ + +prep: + @echo + # Install needed packages + sudo apt-get install subversion fakeroot python-setuptools python-subversion + # + @echo + # Check that the person has .pypirc + @if [ ! -e ~/.pypirc ]; then \ + echo "Please create a ~/.pypirc with the following contents:"; \ + echo "[server-login]"; \ + echo "username:google_opensource"; \ + echo "password:"; \ + fi + # + @echo + # FIXME(tansell): Check that the person has .dputrc for PPA + +clean: + # Clean up any build files. + python setup.py clean --all + # + # Clean up the debian stuff + fakeroot ./debian/rules clean + # + # Clean up everything else + rm MANIFEST || true + rm -rf build-* + # + # Clean up the egg files + rm -rf *egg* + # + # Remove dist + rm -rf dist + +dist: + # Generate the tarball based on MANIFEST.in + python setup.py sdist + # + # Build the debian packages + fakeroot ./debian/rules binary + mv ../python-gflags*.deb ./dist/ + # + # Build the python Egg + python setup.py bdist_egg + # + @echo + @echo "Files to upload:" + @echo "--------------------------" + @ls -l ./dist/ + +push: + # Send the updates to svn + # Upload the source package to code.google.com + - /home/build/opensource/tools/googlecode_upload.py \ + -p python-gflags ./dist/* + # + # Upload the package to PyPi + - python setup.py sdist upload + - python setup.py bdist_egg upload + # + # Upload the package to the ppa + # FIXME(tansell): dput should run here + +check: + # Run all the tests. + for test in tests/*.py; do PYTHONPATH=. python $$test || exit 1; done + +.PHONY: prep dist clean push check diff --git a/tools/gflags/NEWS b/tools/gflags/NEWS new file mode 100644 index 00000000000000..0142abc5fd296c --- /dev/null +++ b/tools/gflags/NEWS @@ -0,0 +1,77 @@ +== 18 January 2012 == + +[Prependum:] I just realized I should have named the new version 2.0, +to reflect the new ownership and status as a community run project. +Not too late, I guess. I've just released python-gflags 2.0, which is +identical to python-gflags 1.8 except for the version number. + +I've just released python-gflags 1.8. This fixes a bug, allowing +modules defining flags to be re-imported without raising duplicate +flag errors. + +Administrative note: In the coming weeks, I'll be stepping down as +maintainer for the python-gflags project, and as part of that Google +is relinquishing ownership of the project; it will now be entirely +community run. The remaining +[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.8/ChangeLog changes] +in this release reflect that shift. + + +=== 20 December 2011 === + +I've just released python-gflags 1.7. The major change here is +improved unicode support, in both flag default values and +help-strings. We've also made big steps toward making gflags work +with python 3.x (while keeping 2.4 compatibility), and improving +--help output in the common case where output is a tty. + +For a full list of changes since last release, see the +[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.7/ChangeLog ChangeLog]. + +=== 29 July 2011 === + +I've just released python-gflags 1.6. This release has only minor +changes, including support for multi_float flags. The full list of +changes is in the +[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.6/ChangeLog ChangeLog]. + +The major change with this release is procedural: I've changed the +internal tools used to integrate Google-supplied patches for gflags +into the opensource release. These new tools should result in more +frequent updates with better change descriptions. They will also +result in future `ChangeLog` entries being much more verbose (for +better or for worse). + +=== 26 January 2011 === + +I've just released python-gflags 1.5.1. I had improperly packaged +python-gflags 1.5, so it probably doesn't work. All users who have +updated to python-gflags 1.5 are encouraged to update again to 1.5.1. + +=== 24 January 2011 === + +I've just released python-gflags 1.5. This release adds support for +flag verifiers: small functions you can associate with flags, that are +called whenever the flag value is set or modified, and can verify that +the new value is legal. It also has other, minor changes, described +in the +[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.5/ChangeLog ChangeLog]. + +=== 11 October 2010 === + +I've just released python-gflags 1.4. This release has only minor +changes from 1.3, including support for printing flags of a specific +module, allowing key-flags to work with special flags, somewhat better +error messaging, and +[http://python-gflags.googlecode.com/svn/tags/python-gflags-1.4/ChangeLog so forth]. +If 1.3 is working well for you, there's no particular reason to upgrade. + +=== 4 January 2010 === + +I just released python-gflags 1.3. This is the first python-gflags +release; it is version 1.3 because this code is forked from the 1.3 +release of google-gflags. + +I don't have a tarball or .deb file up quite yet, so for now you will +have to get the source files by browsing under the 'source' +tag. Downloadable files will be available soon. diff --git a/tools/gflags/PKG-INFO b/tools/gflags/PKG-INFO new file mode 100644 index 00000000000000..faab7198f2608a --- /dev/null +++ b/tools/gflags/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: python-gflags +Version: 2.0 +Summary: Google Commandline Flags Module +Home-page: http://code.google.com/p/python-gflags +Author: Google Inc. and others +Author-email: google-gflags@googlegroups.com +License: BSD +Description: UNKNOWN +Platform: UNKNOWN diff --git a/tools/gflags/README b/tools/gflags/README new file mode 100644 index 00000000000000..81daa7ab49aaf6 --- /dev/null +++ b/tools/gflags/README @@ -0,0 +1,23 @@ +This repository contains a python implementation of the Google commandline +flags module. + + GFlags defines a *distributed* command line system, replacing systems like + getopt(), optparse and manual argument processing. Rather than an application + having to define all flags in or near main(), each python module defines flags + that are useful to it. When one python module imports another, it gains + access to the other's flags. + + It includes the ability to define flag types (boolean, float, interger, list), + autogeneration of help (in both human and machine readable format) and reading + arguments from a file. It also includes the ability to automatically generate + man pages from the help flags. + +Documentation for implementation is at the top of gflags.py file. + +To install the python module, run + python ./setup.py install + +When you install this library, you also get a helper application, +gflags2man.py, installed into /usr/local/bin. You can run gflags2man.py to +create an instant man page, with all the commandline flags and their docs, for +any C++ or python program you've written using the gflags library. diff --git a/tools/gflags/debian/README b/tools/gflags/debian/README new file mode 100644 index 00000000000000..57becfda757e1c --- /dev/null +++ b/tools/gflags/debian/README @@ -0,0 +1,7 @@ +The list of files here isn't complete. For a step-by-step guide on +how to set this package up correctly, check out + http://www.debian.org/doc/maint-guide/ + +Most of the files that are in this directory are boilerplate. +However, you may need to change the list of binary-arch dependencies +in 'rules'. diff --git a/tools/gflags/debian/changelog b/tools/gflags/debian/changelog new file mode 100644 index 00000000000000..5e6457e2d7a7b4 --- /dev/null +++ b/tools/gflags/debian/changelog @@ -0,0 +1,54 @@ +python-gflags (2.0-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Wed, 18 Jan 2012 13:57:39 -0800 + +python-gflags (1.8-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Wed, 18 Jan 2012 11:54:03 -0800 + +python-gflags (1.7-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Tue, 20 Dec 2011 17:10:41 -0800 + +python-gflags (1.6-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Fri, 29 Jul 2011 12:24:08 -0700 + +python-gflags (1.5.1-1) unstable; urgency=low + + * New upstream release (fixes manifest and setup.py files) + + -- Google Inc. Wed, 26 Jan 2011 13:50:46 -0800 + +python-gflags (1.5-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Mon, 24 Jan 2011 16:58:10 -0800 + +python-gflags (1.4-1) unstable; urgency=low + + * New upstream release. + + -- Google Inc. Wed, 13 Oct 2010 17:40:12 -0700 + +python-gflags (1.3-2) unstable; urgency=low + + * Fixed man-page generation. + + -- Tim 'mithro' Ansell Mon, 07 Jan 2010 13:46:10 +1100 + +python-gflags (1.3-1) unstable; urgency=low + + * Initial release. + * Packaging based on gflags 1.3 + + -- Tim 'mithro' Ansell Mon, 04 Jan 2010 18:46:10 -0800 diff --git a/tools/gflags/debian/compat b/tools/gflags/debian/compat new file mode 100644 index 00000000000000..7ed6ff82de6bcc --- /dev/null +++ b/tools/gflags/debian/compat @@ -0,0 +1 @@ +5 diff --git a/tools/gflags/debian/control b/tools/gflags/debian/control new file mode 100644 index 00000000000000..65ca8604e20917 --- /dev/null +++ b/tools/gflags/debian/control @@ -0,0 +1,25 @@ +Source: python-gflags +Section: python +XS-Python-Version: all +Priority: optional +Maintainer: Craig Silverstein +Build-Depends-Indep: python-central (>= 0.5.6), python-setuptools (>= 0.6b3-1), python-all +Build-Depends: debhelper (>= 5.0.38) +Standards-Version: 3.7.2 + +Package: python-gflags +Architecture: all +Depends: ${python:Depends} +XB-Python-Version: ${python:Versions} +Description: A Python implementation of the Google commandline flags module + . + GFlags defines a *distributed* command line system, replacing systems like + getopt(), optparse and manual argument processing. Rather than an application + having to define all flags in or near main(), each Python module defines flags + that are useful to it. When one Python module imports another, it gains + access to the other's flags. + . + It includes the ability to define flag types (boolean, float, interger, list), + autogeneration of help (in both human and machine readable format) and reading + arguments from a file. It also includes the ability to automatically generate + man pages from the help flags. diff --git a/tools/gflags/debian/copyright b/tools/gflags/debian/copyright new file mode 100644 index 00000000000000..532790017f8d10 --- /dev/null +++ b/tools/gflags/debian/copyright @@ -0,0 +1,41 @@ +This package was debianized by Craig Silverstein on +Wed, 18 Jan 2012 13:57:39 -0800. + +It was downloaded from http://code.google.com/p/python-gflags/downloads/list + +Upstream Author: Google Inc. and others +Copyright: Google Inc. and others + +License: + +Copyright (c) 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The Debian packaging is (C) 2011, Tim 'mithro' Ansell and +is licensed under the above. diff --git a/tools/gflags/debian/docs b/tools/gflags/debian/docs new file mode 100644 index 00000000000000..6f12db50845a5d --- /dev/null +++ b/tools/gflags/debian/docs @@ -0,0 +1,2 @@ +AUTHORS +README diff --git a/tools/gflags/debian/rules b/tools/gflags/debian/rules new file mode 100755 index 00000000000000..0840b5ef8c89b8 --- /dev/null +++ b/tools/gflags/debian/rules @@ -0,0 +1,62 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +PYTHON := /usr/bin/python +#PYVER := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]') +PYVERS = $(shell pyversions -vr) + +build: $(PYVERS:%=build-python%) + touch $@ + +build-python%: + dh_testdir + python$* setup.py build + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-python* + rm -rf build + -find . -name '*.py[co]' | xargs rm -f + dh_clean + +install: build $(PYVERS:%=install-python%) + +install-python%: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + python$* setup.py install --root=$(CURDIR)/debian/python-gflags --prefix=/usr + # Scripts should not have a .py on the end of them + mv $(CURDIR)/debian/python-gflags/usr/bin/gflags2man.py $(CURDIR)/debian/python-gflags/usr/bin/gflags2man + # Generate a man file for gflags2man + mkdir -p $(CURDIR)/debian/python-gflags/usr/share/man/man1 + PYTHONPATH=$(CURDIR)/debian/.. python$* gflags2man.py --dest_dir $(CURDIR)/debian/python-gflags/usr/share/man/man1 $(CURDIR)/debian/python-gflags/usr/bin/gflags2man + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs -k ChangeLog + dh_installdocs + dh_pycentral + dh_compress -X.py + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/tools/closure_linter/gflags.py b/tools/gflags/gflags.py similarity index 81% rename from tools/closure_linter/gflags.py rename to tools/gflags/gflags.py index 21aa88e761fc51..822256a6f8a1ec 100644 --- a/tools/closure_linter/gflags.py +++ b/tools/gflags/gflags.py @@ -1,6 +1,6 @@ #!/usr/bin/env python - -# Copyright (c) 2007, Google Inc. +# +# Copyright (c) 2002, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -58,8 +58,8 @@ available as attributes of the 'FlagValues' object. Code can access the flag through a FlagValues object, for instance -gflags.FLAGS.myflag. Typically, the __main__ module passes the -command line arguments to gflags.FLAGS for parsing. +gflags.FLAGS.myflag. Typically, the __main__ module passes the command +line arguments to gflags.FLAGS for parsing. At bottom, this module calls getopt(), so getopt functionality is supported, including short- and long-style flags, and the use of -- to @@ -128,6 +128,47 @@ -- as in getopt(), terminates flag-processing +FLAGS VALIDATORS: If your program: + - requires flag X to be specified + - needs flag Y to match a regular expression + - or requires any more general constraint to be satisfied +then validators are for you! + +Each validator represents a constraint over one flag, which is enforced +starting from the initial parsing of the flags and until the program +terminates. + +Also, lower_bound and upper_bound for numerical flags are enforced using flag +validators. + +Howto: +If you want to enforce a constraint over one flag, use + +gflags.RegisterValidator(flag_name, + checker, + message='Flag validation failed', + flag_values=FLAGS) + +After flag values are initially parsed, and after any change to the specified +flag, method checker(flag_value) will be executed. If constraint is not +satisfied, an IllegalFlagValue exception will be raised. See +RegisterValidator's docstring for a detailed explanation on how to construct +your own checker. + + +EXAMPLE USAGE: + +FLAGS = gflags.FLAGS + +gflags.DEFINE_integer('my_version', 0, 'Version number.') +gflags.DEFINE_string('filename', None, 'Input file name', short_name='f') + +gflags.RegisterValidator('my_version', + lambda value: value % 2 == 0, + message='--my_version must be divisible by 2') +gflags.MarkFlagAsRequired('filename') + + NOTE ON --flagfile: Flags may be loaded from text files in addition to being specified on @@ -161,7 +202,7 @@ EXAMPLE USAGE: - import gflags + FLAGS = gflags.FLAGS # Flag names are globally defined! So in general, we need to be @@ -181,7 +222,7 @@ def main(argv): if FLAGS.debug: print 'non-flag arguments:', argv print 'Happy Birthday', FLAGS.name if FLAGS.age is not None: - print 'You are a %s, who is %d years old' % (FLAGS.gender, FLAGS.age) + print 'You are a %d year old %s' % (FLAGS.age, FLAGS.gender) if __name__ == '__main__': main(sys.argv) @@ -244,7 +285,7 @@ def main(argv): EXAMPLE USAGE 2 (WITH KEY FLAGS): Consider an application that contains the following three files (two -auxiliary modules and a main module): +auxiliary modules and a main module) File libfoo.py: @@ -260,11 +301,11 @@ def main(argv): import gflags gflags.DEFINE_string('bar_gfs_path', '/gfs/path', - 'Path to the GFS files for libbar.') + 'Path to the GFS files for libbar.') gflags.DEFINE_string('email_for_bar_errors', 'bar-team@google.com', - 'Email address for bug reports about module libbar.') + 'Email address for bug reports about module libbar.') gflags.DEFINE_boolean('bar_risky_hack', False, - 'Turn on an experimental and buggy optimization.') + 'Turn on an experimental and buggy optimization.') ... some code ... @@ -288,8 +329,7 @@ def main(argv): When myscript is invoked with the flag --helpshort, the resulted help message lists information about all the key flags for myscript: ---num_iterations, --num_replicas, --rpc2, and --bar_gfs_path (in -addition to the special flags --help and --helpshort). +--num_iterations, --num_replicas, --rpc2, and --bar_gfs_path. Of course, myscript uses all the flags declared by it (in this case, just --num_replicas) or by any of the modules it transitively imports @@ -343,6 +383,8 @@ def main(argv): a list of values, separated by a special token). 6. We do not provide any example here: please use --helpxml instead. + +This module requires at least python 2.2.1 to run. """ import cgi @@ -350,34 +392,29 @@ def main(argv): import os import re import string +import struct import sys - -# Are we running at least python 2.2? +# pylint: disable-msg=C6204 try: - if tuple(sys.version_info[:3]) < (2,2,0): - raise NotImplementedError("requires python 2.2.0 or later") -except AttributeError: # a very old python, that lacks sys.version_info - raise NotImplementedError("requires python 2.2.0 or later") - -# If we're not running at least python 2.2.1, define True, False, and bool. -# Thanks, Guido, for the code. + import fcntl +except ImportError: + fcntl = None try: - True, False, bool -except NameError: - False = 0 - True = 1 - def bool(x): - if x: - return True - else: - return False + # Importing termios will fail on non-unix platforms. + import termios +except ImportError: + termios = None + +import gflags_validators +# pylint: enable-msg=C6204 + # Are we running under pychecker? _RUNNING_PYCHECKER = 'pychecker.python' in sys.modules -def _GetCallingModule(): - """Returns the name of the module that's calling into this module. +def _GetCallingModuleObjectAndName(): + """Returns the module that's calling into this module. We generally use this function to get the name of the module calling a DEFINE_foo... function. @@ -386,12 +423,17 @@ def _GetCallingModule(): for depth in range(1, sys.getrecursionlimit()): if not sys._getframe(depth).f_globals is globals(): globals_for_frame = sys._getframe(depth).f_globals - module_name = _GetModuleObjectAndName(globals_for_frame)[1] + module, module_name = _GetModuleObjectAndName(globals_for_frame) if module_name is not None: - return module_name + return module, module_name raise AssertionError("No module was found") +def _GetCallingModule(): + """Returns the name of the module that's calling into this module.""" + return _GetCallingModuleObjectAndName()[1] + + def _GetThisModuleObjectAndName(): """Returns: (module object, module name) for this module.""" return _GetModuleObjectAndName(globals()) @@ -407,6 +449,10 @@ class DuplicateFlag(FlagsError): """Raised if there is a flag naming conflict.""" pass +class CantOpenFlagFileError(FlagsError): + """Raised if flagfile fails to open: doesn't exist, wrong permissions, etc.""" + pass + class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): """Special case of DuplicateFlag -- SWIG flag value can't be set to None. @@ -419,22 +465,39 @@ class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): pass -# A DuplicateFlagError conveys more information than a -# DuplicateFlag. Since there are external modules that create -# DuplicateFlags, the interface to DuplicateFlag shouldn't change. class DuplicateFlagError(DuplicateFlag): + """A DuplicateFlag whose message cites the conflicting definitions. - def __init__(self, flagname, flag_values): + A DuplicateFlagError conveys more information than a DuplicateFlag, + namely the modules where the conflicting definitions occur. This + class was created to avoid breaking external modules which depend on + the existing DuplicateFlags interface. + """ + + def __init__(self, flagname, flag_values, other_flag_values=None): + """Create a DuplicateFlagError. + + Args: + flagname: Name of the flag being redefined. + flag_values: FlagValues object containing the first definition of + flagname. + other_flag_values: If this argument is not None, it should be the + FlagValues object where the second definition of flagname occurs. + If it is None, we assume that we're being called when attempting + to create the flag a second time, and we use the module calling + this one as the source of the second definition. + """ self.flagname = flagname - message = "The flag '%s' is defined twice." % self.flagname - flags_by_module = flag_values.FlagsByModuleDict() - for module in flags_by_module: - for flag in flags_by_module[module]: - if flag.name == flagname or flag.short_name == flagname: - message = message + " First from " + module + "," - break - message = message + " Second from " + _GetCallingModule() - DuplicateFlag.__init__(self, message) + first_module = flag_values.FindModuleDefiningFlag( + flagname, default='') + if other_flag_values is None: + second_module = _GetCallingModule() + else: + second_module = other_flag_values.FindModuleDefiningFlag( + flagname, default='') + msg = "The flag '%s' is defined twice. First from %s, Second from %s" % ( + self.flagname, first_module, second_module) + DuplicateFlag.__init__(self, msg) class IllegalFlagValue(FlagsError): @@ -447,16 +510,20 @@ class UnrecognizedFlag(FlagsError): pass -# An UnrecognizedFlagError conveys more information than an -# UnrecognizedFlag. Since there are external modules that create -# DuplicateFlags, the interface to DuplicateFlag shouldn't change. +# An UnrecognizedFlagError conveys more information than an UnrecognizedFlag. +# Since there are external modules that create DuplicateFlags, the interface to +# DuplicateFlag shouldn't change. The flagvalue will be assigned the full value +# of the flag and its argument, if any, allowing handling of unrecognized flags +# in an exception handler. +# If flagvalue is the empty string, then this exception is an due to a +# reference to a flag that was not already defined. class UnrecognizedFlagError(UnrecognizedFlag): - def __init__(self, flagname): + def __init__(self, flagname, flagvalue=''): self.flagname = flagname + self.flagvalue = flagvalue UnrecognizedFlag.__init__( self, "Unknown command line flag '%s'" % flagname) - # Global variable used by expvar _exported_flags = {} _help_width = 80 # width of help output @@ -464,7 +531,20 @@ def __init__(self, flagname): def GetHelpWidth(): """Returns: an integer, the width of help lines that is used in TextWrap.""" - return _help_width + if (not sys.stdout.isatty()) or (termios is None) or (fcntl is None): + return _help_width + try: + data = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, '1234') + columns = struct.unpack('hh', data)[1] + # Emacs mode returns 0. + # Here we assume that any value below 40 is unreasonable + if columns >= 40: + return columns + # Returning an int as default is fine, int(int) just return the int. + return int(os.getenv('COLUMNS', _help_width)) + + except (TypeError, IOError, struct.error): + return _help_width def CutCommonSpacePrefix(text): @@ -475,8 +555,8 @@ def CutCommonSpacePrefix(text): for. That means the first line will stay untouched. This is especially useful to turn doc strings into help texts. This is because some people prefer to have the doc comment start already after the - apostrophy and then align the following lines while others have the - apostrophies on a seperately line. + apostrophe and then align the following lines while others have the + apostrophes on a separate line. The function also drops trailing empty lines and ignores empty lines following the initial content line while calculating the initial @@ -498,7 +578,7 @@ def CutCommonSpacePrefix(text): text_first_line = [] else: text_first_line = [text_lines.pop(0)] - # Calculate length of common leading whitesppace (only over content lines) + # Calculate length of common leading whitespace (only over content lines) common_prefix = os.path.commonprefix([line for line in text_lines if line]) space_prefix_len = len(common_prefix) - len(common_prefix.lstrip()) # If we have a common space prefix, drop it from all lines @@ -513,7 +593,7 @@ def CutCommonSpacePrefix(text): def TextWrap(text, length=None, indent='', firstline_indent=None, tabs=' '): """Wraps a given text to a maximum line length and returns it. - We turn lines that only contain whitespaces into empty lines. We keep + We turn lines that only contain whitespace into empty lines. We keep new lines and tabs (e.g., we do not treat tabs as spaces). Args: @@ -547,7 +627,7 @@ def TextWrap(text, length=None, indent='', firstline_indent=None, tabs=' '): else: line = firstline_indent if len(firstline_indent) >= length: - raise FlagsError('First iline indent must be shorter than length') + raise FlagsError('First line indent must be shorter than length') # If the callee does not care about tabs we simply convert them to # spaces If callee wanted tabs to be single space then we do that @@ -601,7 +681,7 @@ def TextWrap(text, length=None, indent='', firstline_indent=None, tabs=' '): line += ' ' # Add word and shorten it up to allowed line length. Restart next # line with indent and repeat, or add a space if we're done (word - # finished) This deals with words that caanot fit on one line + # finished) This deals with words that cannot fit on one line # (e.g. indent + word longer than allowed line length). while len(line) + len(word) >= length: line += word @@ -613,7 +693,7 @@ def TextWrap(text, length=None, indent='', firstline_indent=None, tabs=' '): line += word + ' ' # End of input line. If we have content we finish the line. If the # current line is just the indent but we had content in during this - # original line then we need to add an emoty line. + # original line then we need to add an empty line. if (result and line != indent) or (not result and line != firstline_indent): result.append(line.rstrip()) elif len(result) == old_result_len: @@ -675,13 +755,26 @@ def _GetModuleObjectAndName(globals_dict): def _GetMainModule(): - """Returns the name of the module from which execution started.""" - for depth in range(1, sys.getrecursionlimit()): - try: - globals_of_main = sys._getframe(depth).f_globals - except ValueError: - return _GetModuleObjectAndName(globals_of_main)[1] - raise AssertionError("No module was found") + """Returns: string, name of the module from which execution started.""" + # First, try to use the same logic used by _GetCallingModuleObjectAndName(), + # i.e., call _GetModuleObjectAndName(). For that we first need to + # find the dictionary that the main module uses to store the + # globals. + # + # That's (normally) the same dictionary object that the deepest + # (oldest) stack frame is using for globals. + deepest_frame = sys._getframe(0) + while deepest_frame.f_back is not None: + deepest_frame = deepest_frame.f_back + globals_for_main_module = deepest_frame.f_globals + main_module_name = _GetModuleObjectAndName(globals_for_main_module)[1] + # The above strategy fails in some cases (e.g., tools that compute + # code coverage by redefining, among other things, the main module). + # If so, just use sys.argv[0]. We can probably always do this, but + # it's safest to try to use the same logic as _GetCallingModuleObjectAndName() + if main_module_name is None: + main_module_name = sys.argv[0] + return main_module_name class FlagValues: @@ -726,6 +819,9 @@ def __init__(self): # Dictionary: module name (string) -> list of Flag objects that are defined # by that module. self.__dict__['__flags_by_module'] = {} + # Dictionary: module id (int) -> list of Flag objects that are defined by + # that module. + self.__dict__['__flags_by_module_id'] = {} # Dictionary: module name (string) -> list of Flag objects that are # key for that module. self.__dict__['__key_flags_by_module'] = {} @@ -735,6 +831,13 @@ def __init__(self): self.UseGnuGetOpt(False) def UseGnuGetOpt(self, use_gnu_getopt=True): + """Use GNU-style scanning. Allows mixing of flag and non-flag arguments. + + See http://docs.python.org/library/getopt.html#getopt.gnu_getopt + + Args: + use_gnu_getopt: wether or not to use GNU style scanning. + """ self.__dict__['__use_gnu_getopt'] = use_gnu_getopt def IsGnuGetOpt(self): @@ -752,6 +855,15 @@ def FlagsByModuleDict(self): """ return self.__dict__['__flags_by_module'] + def FlagsByModuleIdDict(self): + """Returns the dictionary of module_id -> list of defined flags. + + Returns: + A dictionary. Its keys are module IDs (ints). Its values + are lists of Flag objects. + """ + return self.__dict__['__flags_by_module_id'] + def KeyFlagsByModuleDict(self): """Returns the dictionary of module_name -> list of key flags. @@ -774,6 +886,16 @@ def _RegisterFlagByModule(self, module_name, flag): flags_by_module = self.FlagsByModuleDict() flags_by_module.setdefault(module_name, []).append(flag) + def _RegisterFlagByModuleId(self, module_id, flag): + """Records the module that defines a specific flag. + + Args: + module_id: An int, the ID of the Python module. + flag: A Flag object, a flag that is key to the module. + """ + flags_by_module_id = self.FlagsByModuleIdDict() + flags_by_module_id.setdefault(module_id, []).append(flag) + def _RegisterKeyFlagForModule(self, module_name, flag): """Specifies that a flag is a key flag for a module. @@ -829,6 +951,44 @@ def _GetKeyFlagsForModule(self, module): key_flags.append(flag) return key_flags + def FindModuleDefiningFlag(self, flagname, default=None): + """Return the name of the module defining this flag, or default. + + Args: + flagname: Name of the flag to lookup. + default: Value to return if flagname is not defined. Defaults + to None. + + Returns: + The name of the module which registered the flag with this name. + If no such module exists (i.e. no flag with this name exists), + we return default. + """ + for module, flags in self.FlagsByModuleDict().iteritems(): + for flag in flags: + if flag.name == flagname or flag.short_name == flagname: + return module + return default + + def FindModuleIdDefiningFlag(self, flagname, default=None): + """Return the ID of the module defining this flag, or default. + + Args: + flagname: Name of the flag to lookup. + default: Value to return if flagname is not defined. Defaults + to None. + + Returns: + The ID of the module which registered the flag with this name. + If no such module exists (i.e. no flag with this name exists), + we return default. + """ + for module_id, flags in self.FlagsByModuleIdDict().iteritems(): + for flag in flags: + if flag.name == flagname or flag.short_name == flagname: + return module_id + return default + def AppendFlagValues(self, flag_values): """Appends flags registered in another FlagValues instance. @@ -842,7 +1002,11 @@ def AppendFlagValues(self, flag_values): # perform a check to make sure that the entry we're looking at is # for its normal name. if flag_name == flag.name: - self[flag_name] = flag + try: + self[flag_name] = flag + except DuplicateFlagError: + raise DuplicateFlagError(flag_name, self, + other_flag_values=flag_values) def RemoveFlagValues(self, flag_values): """Remove flags that were previously appended from another FlagValues. @@ -864,12 +1028,19 @@ def __setitem__(self, name, flag): raise FlagsError("Flag name cannot be empty") # If running under pychecker, duplicate keys are likely to be # defined. Disable check for duplicate keys when pycheck'ing. - if (fl.has_key(name) and not flag.allow_override and + if (name in fl and not flag.allow_override and not fl[name].allow_override and not _RUNNING_PYCHECKER): + module, module_name = _GetCallingModuleObjectAndName() + if (self.FindModuleDefiningFlag(name) == module_name and + id(module) != self.FindModuleIdDefiningFlag(name)): + # If the flag has already been defined by a module with the same name, + # but a different ID, we can stop here because it indicates that the + # module is simply being imported a subsequent time. + return raise DuplicateFlagError(name, self) short_name = flag.short_name if short_name is not None: - if (fl.has_key(short_name) and not flag.allow_override and + if (short_name in fl and not flag.allow_override and not fl[short_name].allow_override and not _RUNNING_PYCHECKER): raise DuplicateFlagError(short_name, self) fl[short_name] = flag @@ -884,7 +1055,7 @@ def __getitem__(self, name): def __getattr__(self, name): """Retrieves the 'value' attribute of the flag --name.""" fl = self.FlagDict() - if not fl.has_key(name): + if name not in fl: raise AttributeError(name) return fl[name].value @@ -892,8 +1063,35 @@ def __setattr__(self, name, value): """Sets the 'value' attribute of the flag --name.""" fl = self.FlagDict() fl[name].value = value + self._AssertValidators(fl[name].validators) return value + def _AssertAllValidators(self): + all_validators = set() + for flag in self.FlagDict().itervalues(): + for validator in flag.validators: + all_validators.add(validator) + self._AssertValidators(all_validators) + + def _AssertValidators(self, validators): + """Assert if all validators in the list are satisfied. + + Asserts validators in the order they were created. + Args: + validators: Iterable(gflags_validators.Validator), validators to be + verified + Raises: + AttributeError: if validators work with a non-existing flag. + IllegalFlagValue: if validation fails for at least one validator + """ + for validator in sorted( + validators, key=lambda validator: validator.insertion_index): + try: + validator.Verify(self) + except gflags_validators.Error, e: + message = validator.PrintFlagsWithValues(self) + raise IllegalFlagValue('%s: %s' % (message, str(e))) + def _FlagIsRegistered(self, flag_obj): """Checks whether a Flag object is registered under some name. @@ -932,8 +1130,8 @@ def __delattr__(self, flag_name): E.g., - flags.DEFINE_integer('foo', 1, 'Integer flag.') - del flags.FLAGS.foo + gflags.DEFINE_integer('foo', 1, 'Integer flag.') + del gflags.FLAGS.foo Args: flag_name: A string, the name of the flag to be deleted. @@ -951,9 +1149,10 @@ def __delattr__(self, flag_name): if not self._FlagIsRegistered(flag_obj): # If the Flag object indicated by flag_name is no longer # registered (please see the docstring of _FlagIsRegistered), then - # we delete the occurences of the flag object in all our internal + # we delete the occurrences of the flag object in all our internal # dictionaries. self.__RemoveFlagFromDictByModule(self.FlagsByModuleDict(), flag_obj) + self.__RemoveFlagFromDictByModule(self.FlagsByModuleIdDict(), flag_obj) self.__RemoveFlagFromDictByModule(self.KeyFlagsByModuleDict(), flag_obj) def __RemoveFlagFromDictByModule(self, flags_by_module_dict, flag_obj): @@ -965,7 +1164,7 @@ def __RemoveFlagFromDictByModule(self, flags_by_module_dict, flag_obj): flag_obj: A flag object. """ for unused_module, flags_in_module in flags_by_module_dict.iteritems(): - # while (as opposed to if) takes care of multiple occurences of a + # while (as opposed to if) takes care of multiple occurrences of a # flag in the list for the same module. while flag_obj in flags_in_module: flags_in_module.remove(flag_obj) @@ -973,9 +1172,10 @@ def __RemoveFlagFromDictByModule(self, flags_by_module_dict, flag_obj): def SetDefault(self, name, value): """Changes the default value of the named flag object.""" fl = self.FlagDict() - if not fl.has_key(name): + if name not in fl: raise AttributeError(name) fl[name].SetDefault(value) + self._AssertValidators(fl[name].validators) def __contains__(self, name): """Returns True if name is a value (flag) in the dict.""" @@ -984,7 +1184,7 @@ def __contains__(self, name): has_key = __contains__ # a synonym for __contains__() def __iter__(self): - return self.FlagDict().iterkeys() + return iter(self.FlagDict()) def __call__(self, argv): """Parses flags from argv; stores parsed flags into this FlagValues object. @@ -1032,7 +1232,7 @@ def __call__(self, argv): prefix = shortest_matches[name] no_prefix = shortest_matches[no_name] - # Replace all occurences of this boolean with extended forms + # Replace all occurrences of this boolean with extended forms for arg_idx in range(1, len(argv)): arg = argv[arg_idx] if arg.find('=') >= 0: continue @@ -1069,15 +1269,14 @@ def __call__(self, argv): break except getopt.GetoptError, e: if not e.opt or e.opt in fl: - # Not an unrecognized option, reraise the exception as a FlagsError + # Not an unrecognized option, re-raise the exception as a FlagsError raise FlagsError(e) - # Handle an unrecognized option. - unrecognized_opts.append(e.opt) # Remove offender from args and try again for arg_index in range(len(args)): if ((args[arg_index] == '--' + e.opt) or (args[arg_index] == '-' + e.opt) or - args[arg_index].startswith('--' + e.opt + '=')): + (args[arg_index].startswith('--' + e.opt + '='))): + unrecognized_opts.append((e.opt, args[arg_index])) args = args[0:arg_index] + args[arg_index+1:] break else: @@ -1108,28 +1307,31 @@ def __call__(self, argv): # short option name = name[1:] short_option = 1 - if fl.has_key(name): + if name in fl: flag = fl[name] if flag.boolean and short_option: arg = 1 flag.Parse(arg) # If there were unrecognized options, raise an exception unless # the options were named via --undefok. - for opt in unrecognized_opts: + for opt, value in unrecognized_opts: if opt not in undefok_flags: - raise UnrecognizedFlagError(opt) + raise UnrecognizedFlagError(opt, value) if unparsed_args: if self.__dict__['__use_gnu_getopt']: # if using gnu_getopt just return the program name + remainder of argv. - return argv[:1] + unparsed_args + ret_val = argv[:1] + unparsed_args else: # unparsed_args becomes the first non-flag detected by getopt to # the end of argv. Because argv may have been modified above, # return original_argv for this region. - return argv[:1] + original_argv[-len(unparsed_args):] + ret_val = argv[:1] + original_argv[-len(unparsed_args):] else: - return argv[:1] + ret_val = argv[:1] + + self._AssertAllValidators() + return ret_val def Reset(self): """Resets the values to the point before FLAGS(argv) was called.""" @@ -1138,7 +1340,7 @@ def Reset(self): def RegisteredFlags(self): """Returns: a list of the names and short names of all registered flags.""" - return self.FlagDict().keys() + return list(self.FlagDict()) def FlagValuesDict(self): """Returns: a dictionary that maps flag names to flag values.""" @@ -1161,8 +1363,7 @@ def GetHelp(self, prefix=''): flags_by_module = self.FlagsByModuleDict() if flags_by_module: - modules = flags_by_module.keys() - modules.sort() + modules = sorted(flags_by_module) # Print the help for the main module first, if possible. main_module = _GetMainModule() @@ -1246,7 +1447,7 @@ def __RenderFlagList(self, flaglist, output_lines, prefix=" "): # a different flag is using this name now continue # only print help once - if flagset.has_key(flag): continue + if flag in flagset: continue flagset[flag] = 1 flaghelp = "" if flag.short_name: flaghelp += "-%s," % flag.short_name @@ -1370,9 +1571,7 @@ def __GetFlagFileLines(self, filename, parsed_file_list): try: file_obj = open(filename, 'r') except IOError, e_msg: - print e_msg - print 'ERROR:: Unable to open flagfile: %s' % (filename) - return flag_line_list + raise CantOpenFlagFileError('ERROR:: Unable to open flagfile: %s' % e_msg) line_list = file_obj.readlines() file_obj.close() @@ -1395,17 +1594,18 @@ def __GetFlagFileLines(self, filename, parsed_file_list): parsed_file_list) flag_line_list.extend(included_flags) else: # Case of hitting a circularly included file. - print >>sys.stderr, ('Warning: Hit circular flagfile dependency: %s' - % sub_filename) + sys.stderr.write('Warning: Hit circular flagfile dependency: %s\n' % + (sub_filename,)) else: # Any line that's not a comment or a nested flagfile should get - # copied into 2nd position. This leaves earlier arguements + # copied into 2nd position. This leaves earlier arguments # further back in the list, thus giving them higher priority. flag_line_list.append(line.strip()) return flag_line_list def ReadFlagsFromFiles(self, argv, force_gnu=True): """Processes command line args, but also allow args to be read from file. + Args: argv: A list of strings, usually sys.argv[1:], which may contain one or more flagfile directives of the form --flagfile="./filename". @@ -1455,7 +1655,8 @@ def ReadFlagsFromFiles(self, argv, force_gnu=True): else: # This handles the case of (-)-flagfile=foo. flag_filename = self.ExtractFilename(current_arg) - new_argv[0:0] = self.__GetFlagFileLines(flag_filename, parsed_file_list) + new_argv.extend( + self.__GetFlagFileLines(flag_filename, parsed_file_list)) else: new_argv.append(current_arg) # Stop parsing after '--', like getopt and gnu_getopt. @@ -1477,8 +1678,8 @@ def FlagsIntoString(self): This function ignores flags whose value is None. Each flag assignment is separated by a newline. - NOTE: MUST mirror the behavior of the C++ function - CommandlineFlagsIntoString from google3/base/commandlineflags.cc. + NOTE: MUST mirror the behavior of the C++ CommandlineFlagsIntoString + from http://code.google.com/p/google-gflags """ s = '' for flag in self.FlagDict().values(): @@ -1491,8 +1692,8 @@ def AppendFlagsIntoFile(self, filename): Output will be in the format of a flagfile. - NOTE: MUST mirror the behavior of the C++ version of - AppendFlagsIntoFile from google3/base/commandlineflags.cc. + NOTE: MUST mirror the behavior of the C++ AppendFlagsIntoFile + from http://code.google.com/p/google-gflags """ out_file = open(filename, 'a') out_file.write(self.FlagsIntoString()) @@ -1503,10 +1704,10 @@ def WriteHelpInXMLFormat(self, outfile=None): NOTE: We use element names that are consistent with those used by the C++ command-line flag library, from - google3/base/commandlineflags_reporting.cc. We also use a few new - elements (e.g., ), but we do not interfere / overlap with - existing XML elements used by the C++ library. Please maintain this - consistency. + http://code.google.com/p/google-gflags + We also use a few new elements (e.g., ), but we do not + interfere / overlap with existing XML elements used by the C++ + library. Please maintain this consistency. Args: outfile: File object we write to. Default None means sys.stdout. @@ -1543,6 +1744,19 @@ def WriteHelpInXMLFormat(self, outfile=None): outfile.write('\n') outfile.flush() + + def AddValidator(self, validator): + """Register new flags validator to be checked. + + Args: + validator: gflags_validators.Validator + Raises: + AttributeError: if validators work with a non-existing flag. + """ + for flag_name in validator.GetFlagsNames(): + flag = self.FlagDict()[flag_name] + flag.validators.append(validator) + # end of FlagValues definition @@ -1550,6 +1764,14 @@ def WriteHelpInXMLFormat(self, outfile=None): FLAGS = FlagValues() +def _StrOrUnicode(value): + """Converts value to a python string or, if necessary, unicode-string.""" + try: + return str(value) + except UnicodeEncodeError: + return unicode(value) + + def _MakeXMLSafe(s): """Escapes <, >, and & from s, and removes XML 1.0-illegal chars.""" s = cgi.escape(s) # Escape <, >, and & @@ -1559,6 +1781,8 @@ def _MakeXMLSafe(s): # NOTE: if there are problems with current solution, one may move to # XML 1.1, which allows such chars, if they're entity-escaped (&#xHH;). s = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f]', '', s) + # Convert non-ascii characters to entities. Note: requires python >=2.3 + s = s.encode('ascii', 'xmlcharrefreplace') # u'\xce\x88' -> 'uΈ' return s @@ -1572,12 +1796,12 @@ def _WriteSimpleXMLElement(outfile, name, value, indent): as the value of the XML element. indent: A string, prepended to each line of generated output. """ - value_str = str(value) + value_str = _StrOrUnicode(value) if isinstance(value, bool): # Display boolean values as the C++ flag library does: no caps. value_str = value_str.lower() - outfile.write('%s<%s>%s\n' % - (indent, name, _MakeXMLSafe(value_str), name)) + safe_value_str = _MakeXMLSafe(value_str) + outfile.write('%s<%s>%s\n' % (indent, name, safe_value_str, name)) class Flag: @@ -1629,9 +1853,21 @@ def __init__(self, parser, serializer, name, default, help_string, self.serializer = serializer self.allow_override = allow_override self.value = None + self.validators = [] self.SetDefault(default) + def __hash__(self): + return hash(id(self)) + + def __eq__(self, other): + return self is other + + def __lt__(self, other): + if isinstance(other, Flag): + return id(self) < id(other) + return NotImplemented + def __GetParsedValueAsString(self, value): if value is None: return None @@ -1642,7 +1878,7 @@ def __GetParsedValueAsString(self, value): return repr('true') else: return repr('false') - return repr(str(value)) + return repr(_StrOrUnicode(value)) def Parse(self, argument): try: @@ -1678,6 +1914,12 @@ def SetDefault(self, value): # cowardly bail out until someone fixes the semantics of trying to # pass None to a C++ flag. See swig_flags.Init() for details on # this behavior. + # TODO(olexiy): Users can directly call this method, bypassing all flags + # validators (we don't have FlagValues here, so we can not check + # validators). + # The simplest solution I see is to make this method private. + # Another approach would be to store reference to the corresponding + # FlagValues with each flag, but this seems to be an overkill. if value is None and self.allow_override: raise DuplicateFlagCannotPropagateNoneToSwig(self.name) @@ -1748,7 +1990,47 @@ def _WriteCustomInfoInXMLFormat(self, outfile, indent): # End of Flag definition -class ArgumentParser: +class _ArgumentParserCache(type): + """Metaclass used to cache and share argument parsers among flags.""" + + _instances = {} + + def __call__(mcs, *args, **kwargs): + """Returns an instance of the argument parser cls. + + This method overrides behavior of the __new__ methods in + all subclasses of ArgumentParser (inclusive). If an instance + for mcs with the same set of arguments exists, this instance is + returned, otherwise a new instance is created. + + If any keyword arguments are defined, or the values in args + are not hashable, this method always returns a new instance of + cls. + + Args: + args: Positional initializer arguments. + kwargs: Initializer keyword arguments. + + Returns: + An instance of cls, shared or new. + """ + if kwargs: + return type.__call__(mcs, *args, **kwargs) + else: + instances = mcs._instances + key = (mcs,) + tuple(args) + try: + return instances[key] + except KeyError: + # No cache entry for key exists, create a new one. + return instances.setdefault(key, type.__call__(mcs, *args)) + except TypeError: + # An object in args cannot be hashed, always return + # a new instance. + return type.__call__(mcs, *args) + + +class ArgumentParser(object): """Base class used to parse and convert arguments. The Parse() method checks to make sure that the string argument is a @@ -1758,7 +2040,13 @@ class ArgumentParser: Subclasses should also define a syntactic_help string which may be presented to the user to describe the form of the legal values. + + Argument parser classes must be stateless, since instances are cached + and shared between flags. Initializer arguments are allowed, but all + member variables must be derived from initializer arguments only. """ + __metaclass__ = _ArgumentParserCache + syntactic_help = "" def Parse(self, argument): @@ -1776,7 +2064,7 @@ class ArgumentSerializer: """Base class for generating string representations of a flag value.""" def Serialize(self, value): - return str(value) + return _StrOrUnicode(value) class ListSerializer(ArgumentSerializer): @@ -1785,7 +2073,79 @@ def __init__(self, list_sep): self.list_sep = list_sep def Serialize(self, value): - return self.list_sep.join([str(x) for x in value]) + return self.list_sep.join([_StrOrUnicode(x) for x in value]) + + +# Flags validators + + +def RegisterValidator(flag_name, + checker, + message='Flag validation failed', + flag_values=FLAGS): + """Adds a constraint, which will be enforced during program execution. + + The constraint is validated when flags are initially parsed, and after each + change of the corresponding flag's value. + Args: + flag_name: string, name of the flag to be checked. + checker: method to validate the flag. + input - value of the corresponding flag (string, boolean, etc. + This value will be passed to checker by the library). See file's + docstring for examples. + output - Boolean. + Must return True if validator constraint is satisfied. + If constraint is not satisfied, it should either return False or + raise gflags_validators.Error(desired_error_message). + message: error text to be shown to the user if checker returns False. + If checker raises gflags_validators.Error, message from the raised + Error will be shown. + flag_values: FlagValues + Raises: + AttributeError: if flag_name is not registered as a valid flag name. + """ + flag_values.AddValidator(gflags_validators.SimpleValidator(flag_name, + checker, + message)) + + +def MarkFlagAsRequired(flag_name, flag_values=FLAGS): + """Ensure that flag is not None during program execution. + + Registers a flag validator, which will follow usual validator + rules. + Args: + flag_name: string, name of the flag + flag_values: FlagValues + Raises: + AttributeError: if flag_name is not registered as a valid flag name. + """ + RegisterValidator(flag_name, + lambda value: value is not None, + message='Flag --%s must be specified.' % flag_name, + flag_values=flag_values) + + +def _RegisterBoundsValidatorIfNeeded(parser, name, flag_values): + """Enforce lower and upper bounds for numeric flags. + + Args: + parser: NumericParser (either FloatParser or IntegerParser). Provides lower + and upper bounds, and help text to display. + name: string, name of the flag + flag_values: FlagValues + """ + if parser.lower_bound is not None or parser.upper_bound is not None: + + def Checker(value): + if value is not None and parser.IsOutsideBounds(value): + message = '%s is not %s' % (value, parser.syntactic_help) + raise gflags_validators.Error(message) + return True + + RegisterValidator(name, + Checker, + flag_values=flag_values) # The DEFINE functions are explained in mode details in the module doc string. @@ -1836,7 +2196,9 @@ def DEFINE_flag(flag, flag_values=FLAGS): # FLAGS test here) and redefine flags with the same name (e.g., # debug). To avoid breaking their code, we perform the # registration only if flag_values is a real FlagValues object. - flag_values._RegisterFlagByModule(_GetCallingModule(), flag) + module, module_name = _GetCallingModuleObjectAndName() + flag_values._RegisterFlagByModule(module_name, flag) + flag_values._RegisterFlagByModuleId(id(module), flag) def _InternalDeclareKeyFlags(flag_names, @@ -1884,7 +2246,7 @@ def DECLARE_key_flag(flag_name, flag_values=FLAGS): Sample usage: - flags.DECLARED_key_flag('flag_1') + gflags.DECLARED_key_flag('flag_1') Args: flag_name: A string, the name of an already declared flag. @@ -1929,8 +2291,8 @@ def ADOPT_module_key_flags(module, flag_values=FLAGS): # If module is this flag module, take _SPECIAL_FLAGS into account. if module == _GetThisModuleObjectAndName()[0]: _InternalDeclareKeyFlags( - # As we associate flags with _GetCallingModule(), the special - # flags defined in this module are incorrectly registered with + # As we associate flags with _GetCallingModuleObjectAndName(), the + # special flags defined in this module are incorrectly registered with # a different module. So, we can't use _GetKeyFlagsForModule. # Instead, we take all flags from _SPECIAL_FLAGS (a private # FlagValues, where no other module should register flags). @@ -1954,7 +2316,7 @@ def DEFINE_string(name, default, help, flag_values=FLAGS, **args): # # BOOLEAN FLAGS # -# and the special HELP flags. + class BooleanParser(ArgumentParser): """Parser of boolean values.""" @@ -2015,9 +2377,11 @@ def DEFINE_boolean(name, default, help, flag_values=FLAGS, **args): """ DEFINE_flag(BooleanFlag(name, default, help, **args), flag_values) + # Match C++ API to unconfuse C++ people. DEFINE_bool = DEFINE_boolean + class HelpFlag(BooleanFlag): """ HelpFlag is a special boolean flag that prints usage information and @@ -2037,22 +2401,16 @@ def Parse(self, arg): print "flags:" print flags sys.exit(1) - - class HelpXMLFlag(BooleanFlag): """Similar to HelpFlag, but generates output in XML format.""" - def __init__(self): BooleanFlag.__init__(self, 'helpxml', False, 'like --help, but generates XML output', allow_override=1) - def Parse(self, arg): if arg: FLAGS.WriteHelpInXMLFormat(sys.stdout) sys.exit(1) - - class HelpshortFlag(BooleanFlag): """ HelpshortFlag is a special boolean flag that prints usage @@ -2085,10 +2443,13 @@ class NumericParser(ArgumentParser): Parsed value may be bounded to a given upper and lower bound. """ + def IsOutsideBounds(self, val): + return ((self.lower_bound is not None and val < self.lower_bound) or + (self.upper_bound is not None and val > self.upper_bound)) + def Parse(self, argument): val = self.Convert(argument) - if ((self.lower_bound is not None and val < self.lower_bound) or - (self.upper_bound is not None and val > self.upper_bound)): + if self.IsOutsideBounds(val): raise ValueError("%s is not %s" % (val, self.syntactic_help)) return val @@ -2102,12 +2463,13 @@ def Convert(self, argument): """Default implementation: always returns its argument unmodified.""" return argument -# End of Numeric Parser +# End of Numeric Parser # # FLOAT FLAGS # + class FloatParser(NumericParser): """Parser of floating point values. @@ -2118,6 +2480,7 @@ class FloatParser(NumericParser): syntactic_help = " ".join((number_article, number_name)) def __init__(self, lower_bound=None, upper_bound=None): + super(FloatParser, self).__init__() self.lower_bound = lower_bound self.upper_bound = upper_bound sh = self.syntactic_help @@ -2152,7 +2515,7 @@ def DEFINE_float(name, default, help, lower_bound=None, upper_bound=None, parser = FloatParser(lower_bound, upper_bound) serializer = ArgumentSerializer() DEFINE(parser, name, default, help, flag_values, serializer, **args) - + _RegisterBoundsValidatorIfNeeded(parser, name, flag_values=flag_values) # # INTEGER FLAGS @@ -2169,6 +2532,7 @@ class IntegerParser(NumericParser): syntactic_help = " ".join((number_article, number_name)) def __init__(self, lower_bound=None, upper_bound=None): + super(IntegerParser, self).__init__() self.lower_bound = lower_bound self.upper_bound = upper_bound sh = self.syntactic_help @@ -2194,17 +2558,9 @@ def Convert(self, argument): base = 10 if len(argument) > 2 and argument[0] == "0" and argument[1] == "x": base = 16 - try: - return int(argument, base) - # ValueError is thrown when argument is a string, and overflows an int. - except ValueError: - return long(argument, base) + return int(argument, base) else: - try: - return int(argument) - # OverflowError is thrown when argument is numeric, and overflows an int. - except OverflowError: - return long(argument) + return int(argument) def Type(self): return 'int' @@ -2220,6 +2576,7 @@ def DEFINE_integer(name, default, help, lower_bound=None, upper_bound=None, parser = IntegerParser(lower_bound, upper_bound) serializer = ArgumentSerializer() DEFINE(parser, name, default, help, flag_values, serializer, **args) + _RegisterBoundsValidatorIfNeeded(parser, name, flag_values=flag_values) # @@ -2234,6 +2591,7 @@ class EnumParser(ArgumentParser): """ def __init__(self, enum_values=None): + super(EnumParser, self).__init__() self.enum_values = enum_values def Parse(self, argument): @@ -2288,6 +2646,7 @@ class BaseListParser(ArgumentParser): def __init__(self, token=None, name=None): assert name + super(BaseListParser, self).__init__() self._token = token self._name = name self.syntactic_help = "a %s separated list" % self._name @@ -2464,6 +2823,20 @@ def DEFINE_multi_int(name, default, help, lower_bound=None, upper_bound=None, DEFINE_multi(parser, serializer, name, default, help, flag_values, **args) +def DEFINE_multi_float(name, default, help, lower_bound=None, upper_bound=None, + flag_values=FLAGS, **args): + """Registers a flag whose value can be a list of arbitrary floats. + + Use the flag on the command line multiple times to place multiple + float values into the list. The 'default' may be a single float + (which will be converted into a single-element list) or a list of + floats. + """ + parser = FloatParser(lower_bound, upper_bound) + serializer = ArgumentSerializer() + DEFINE_multi(parser, serializer, name, default, help, flag_values, **args) + + # Now register the flags that we want to exist in all applications. # These are all defined with allow_override=1, so user-apps can use # these flagnames for their own purposes, if they want. diff --git a/tools/gflags/gflags2man.py b/tools/gflags/gflags2man.py new file mode 100755 index 00000000000000..3a50f9e19fcf0f --- /dev/null +++ b/tools/gflags/gflags2man.py @@ -0,0 +1,544 @@ +#!/usr/bin/env python + +# Copyright (c) 2006, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +"""gflags2man runs a Google flags base program and generates a man page. + +Run the program, parse the output, and then format that into a man +page. + +Usage: + gflags2man [program] ... +""" + +# TODO(csilvers): work with windows paths (\) as well as unix (/) + +# This may seem a bit of an end run, but it: doesn't bloat flags, can +# support python/java/C++, supports older executables, and can be +# extended to other document formats. +# Inspired by help2man. + + + +import os +import re +import sys +import stat +import time + +import gflags + +_VERSION = '0.1' + + +def _GetDefaultDestDir(): + home = os.environ.get('HOME', '') + homeman = os.path.join(home, 'man', 'man1') + if home and os.path.exists(homeman): + return homeman + else: + return os.environ.get('TMPDIR', '/tmp') + +FLAGS = gflags.FLAGS +gflags.DEFINE_string('dest_dir', _GetDefaultDestDir(), + 'Directory to write resulting manpage to.' + ' Specify \'-\' for stdout') +gflags.DEFINE_string('help_flag', '--help', + 'Option to pass to target program in to get help') +gflags.DEFINE_integer('v', 0, 'verbosity level to use for output') + + +_MIN_VALID_USAGE_MSG = 9 # if fewer lines than this, help is suspect + + +class Logging: + """A super-simple logging class""" + def error(self, msg): print >>sys.stderr, "ERROR: ", msg + def warn(self, msg): print >>sys.stderr, "WARNING: ", msg + def info(self, msg): print msg + def debug(self, msg): self.vlog(1, msg) + def vlog(self, level, msg): + if FLAGS.v >= level: print msg +logging = Logging() +class App: + def usage(self, shorthelp=0): + print >>sys.stderr, __doc__ + print >>sys.stderr, "flags:" + print >>sys.stderr, str(FLAGS) + def run(self): + main(sys.argv) +app = App() + + +def GetRealPath(filename): + """Given an executable filename, find in the PATH or find absolute path. + Args: + filename An executable filename (string) + Returns: + Absolute version of filename. + None if filename could not be found locally, absolutely, or in PATH + """ + if os.path.isabs(filename): # already absolute + return filename + + if filename.startswith('./') or filename.startswith('../'): # relative + return os.path.abspath(filename) + + path = os.getenv('PATH', '') + for directory in path.split(':'): + tryname = os.path.join(directory, filename) + if os.path.exists(tryname): + if not os.path.isabs(directory): # relative directory + return os.path.abspath(tryname) + return tryname + if os.path.exists(filename): + return os.path.abspath(filename) + return None # could not determine + +class Flag(object): + """The information about a single flag.""" + + def __init__(self, flag_desc, help): + """Create the flag object. + Args: + flag_desc The command line forms this could take. (string) + help The help text (string) + """ + self.desc = flag_desc # the command line forms + self.help = help # the help text + self.default = '' # default value + self.tips = '' # parsing/syntax tips + + +class ProgramInfo(object): + """All the information gleaned from running a program with --help.""" + + # Match a module block start, for python scripts --help + # "goopy.logging:" + module_py_re = re.compile(r'(\S.+):$') + # match the start of a flag listing + # " -v,--verbosity: Logging verbosity" + flag_py_re = re.compile(r'\s+(-\S+):\s+(.*)$') + # " (default: '0')" + flag_default_py_re = re.compile(r'\s+\(default:\s+\'(.*)\'\)$') + # " (an integer)" + flag_tips_py_re = re.compile(r'\s+\((.*)\)$') + + # Match a module block start, for c++ programs --help + # "google/base/commandlineflags": + module_c_re = re.compile(r'\s+Flags from (\S.+):$') + # match the start of a flag listing + # " -v,--verbosity: Logging verbosity" + flag_c_re = re.compile(r'\s+(-\S+)\s+(.*)$') + + # Match a module block start, for java programs --help + # "com.google.common.flags" + module_java_re = re.compile(r'\s+Flags for (\S.+):$') + # match the start of a flag listing + # " -v,--verbosity: Logging verbosity" + flag_java_re = re.compile(r'\s+(-\S+)\s+(.*)$') + + def __init__(self, executable): + """Create object with executable. + Args: + executable Program to execute (string) + """ + self.long_name = executable + self.name = os.path.basename(executable) # name + # Get name without extension (PAR files) + (self.short_name, self.ext) = os.path.splitext(self.name) + self.executable = GetRealPath(executable) # name of the program + self.output = [] # output from the program. List of lines. + self.desc = [] # top level description. List of lines + self.modules = {} # { section_name(string), [ flags ] } + self.module_list = [] # list of module names in their original order + self.date = time.localtime(time.time()) # default date info + + def Run(self): + """Run it and collect output. + + Returns: + 1 (true) If everything went well. + 0 (false) If there were problems. + """ + if not self.executable: + logging.error('Could not locate "%s"' % self.long_name) + return 0 + + finfo = os.stat(self.executable) + self.date = time.localtime(finfo[stat.ST_MTIME]) + + logging.info('Running: %s %s &1' + % (self.executable, FLAGS.help_flag)) + # --help output is often routed to stderr, so we combine with stdout. + # Re-direct stdin to /dev/null to encourage programs that + # don't understand --help to exit. + (child_stdin, child_stdout_and_stderr) = os.popen4( + [self.executable, FLAGS.help_flag]) + child_stdin.close() # ' start_line+1 + and '' == self.output[start_line+1].rstrip()): + start_line += 2 + logging.debug('Flags start (python): %s' % line) + return (start_line, 'python') + # SWIG flags just have the module name followed by colon. + if exec_mod_start == line: + logging.debug('Flags start (swig): %s' % line) + return (start_line, 'python') + # C++ flags begin after a blank line and with a constant string + if after_blank and line.startswith(' Flags from '): + logging.debug('Flags start (c): %s' % line) + return (start_line, 'c') + # java flags begin with a constant string + if line == 'where flags are': + logging.debug('Flags start (java): %s' % line) + start_line += 2 # skip "Standard flags:" + return (start_line, 'java') + + logging.debug('Desc: %s' % line) + self.desc.append(line) + after_blank = (line == '') + else: + logging.warn('Never found the start of the flags section for "%s"!' + % self.long_name) + return (-1, '') + + def ParsePythonFlags(self, start_line=0): + """Parse python/swig style flags.""" + modname = None # name of current module + modlist = [] + flag = None + for line_num in range(start_line, len(self.output)): # collect flags + line = self.output[line_num].rstrip() + if not line: # blank + continue + + mobj = self.module_py_re.match(line) + if mobj: # start of a new module + modname = mobj.group(1) + logging.debug('Module: %s' % line) + if flag: + modlist.append(flag) + self.module_list.append(modname) + self.modules.setdefault(modname, []) + modlist = self.modules[modname] + flag = None + continue + + mobj = self.flag_py_re.match(line) + if mobj: # start of a new flag + if flag: + modlist.append(flag) + logging.debug('Flag: %s' % line) + flag = Flag(mobj.group(1), mobj.group(2)) + continue + + if not flag: # continuation of a flag + logging.error('Flag info, but no current flag "%s"' % line) + mobj = self.flag_default_py_re.match(line) + if mobj: # (default: '...') + flag.default = mobj.group(1) + logging.debug('Fdef: %s' % line) + continue + mobj = self.flag_tips_py_re.match(line) + if mobj: # (tips) + flag.tips = mobj.group(1) + logging.debug('Ftip: %s' % line) + continue + if flag and flag.help: + flag.help += line # multiflags tack on an extra line + else: + logging.info('Extra: %s' % line) + if flag: + modlist.append(flag) + + def ParseCFlags(self, start_line=0): + """Parse C style flags.""" + modname = None # name of current module + modlist = [] + flag = None + for line_num in range(start_line, len(self.output)): # collect flags + line = self.output[line_num].rstrip() + if not line: # blank lines terminate flags + if flag: # save last flag + modlist.append(flag) + flag = None + continue + + mobj = self.module_c_re.match(line) + if mobj: # start of a new module + modname = mobj.group(1) + logging.debug('Module: %s' % line) + if flag: + modlist.append(flag) + self.module_list.append(modname) + self.modules.setdefault(modname, []) + modlist = self.modules[modname] + flag = None + continue + + mobj = self.flag_c_re.match(line) + if mobj: # start of a new flag + if flag: # save last flag + modlist.append(flag) + logging.debug('Flag: %s' % line) + flag = Flag(mobj.group(1), mobj.group(2)) + continue + + # append to flag help. type and default are part of the main text + if flag: + flag.help += ' ' + line.strip() + else: + logging.info('Extra: %s' % line) + if flag: + modlist.append(flag) + + def ParseJavaFlags(self, start_line=0): + """Parse Java style flags (com.google.common.flags).""" + # The java flags prints starts with a "Standard flags" "module" + # that doesn't follow the standard module syntax. + modname = 'Standard flags' # name of current module + self.module_list.append(modname) + self.modules.setdefault(modname, []) + modlist = self.modules[modname] + flag = None + + for line_num in range(start_line, len(self.output)): # collect flags + line = self.output[line_num].rstrip() + logging.vlog(2, 'Line: "%s"' % line) + if not line: # blank lines terminate module + if flag: # save last flag + modlist.append(flag) + flag = None + continue + + mobj = self.module_java_re.match(line) + if mobj: # start of a new module + modname = mobj.group(1) + logging.debug('Module: %s' % line) + if flag: + modlist.append(flag) + self.module_list.append(modname) + self.modules.setdefault(modname, []) + modlist = self.modules[modname] + flag = None + continue + + mobj = self.flag_java_re.match(line) + if mobj: # start of a new flag + if flag: # save last flag + modlist.append(flag) + logging.debug('Flag: %s' % line) + flag = Flag(mobj.group(1), mobj.group(2)) + continue + + # append to flag help. type and default are part of the main text + if flag: + flag.help += ' ' + line.strip() + else: + logging.info('Extra: %s' % line) + if flag: + modlist.append(flag) + + def Filter(self): + """Filter parsed data to create derived fields.""" + if not self.desc: + self.short_desc = '' + return + + for i in range(len(self.desc)): # replace full path with name + if self.desc[i].find(self.executable) >= 0: + self.desc[i] = self.desc[i].replace(self.executable, self.name) + + self.short_desc = self.desc[0] + word_list = self.short_desc.split(' ') + all_names = [ self.name, self.short_name, ] + # Since the short_desc is always listed right after the name, + # trim it from the short_desc + while word_list and (word_list[0] in all_names + or word_list[0].lower() in all_names): + del word_list[0] + self.short_desc = '' # signal need to reconstruct + if not self.short_desc and word_list: + self.short_desc = ' '.join(word_list) + + +class GenerateDoc(object): + """Base class to output flags information.""" + + def __init__(self, proginfo, directory='.'): + """Create base object. + Args: + proginfo A ProgramInfo object + directory Directory to write output into + """ + self.info = proginfo + self.dirname = directory + + def Output(self): + """Output all sections of the page.""" + self.Open() + self.Header() + self.Body() + self.Footer() + + def Open(self): raise NotImplementedError # define in subclass + def Header(self): raise NotImplementedError # define in subclass + def Body(self): raise NotImplementedError # define in subclass + def Footer(self): raise NotImplementedError # define in subclass + + +class GenerateMan(GenerateDoc): + """Output a man page.""" + + def __init__(self, proginfo, directory='.'): + """Create base object. + Args: + proginfo A ProgramInfo object + directory Directory to write output into + """ + GenerateDoc.__init__(self, proginfo, directory) + + def Open(self): + if self.dirname == '-': + logging.info('Writing to stdout') + self.fp = sys.stdout + else: + self.file_path = '%s.1' % os.path.join(self.dirname, self.info.name) + logging.info('Writing: %s' % self.file_path) + self.fp = open(self.file_path, 'w') + + def Header(self): + self.fp.write( + '.\\" DO NOT MODIFY THIS FILE! It was generated by gflags2man %s\n' + % _VERSION) + self.fp.write( + '.TH %s "1" "%s" "%s" "User Commands"\n' + % (self.info.name, time.strftime('%x', self.info.date), self.info.name)) + self.fp.write( + '.SH NAME\n%s \\- %s\n' % (self.info.name, self.info.short_desc)) + self.fp.write( + '.SH SYNOPSIS\n.B %s\n[\\fIFLAGS\\fR]...\n' % self.info.name) + + def Body(self): + self.fp.write( + '.SH DESCRIPTION\n.\\" Add any additional description here\n.PP\n') + for ln in self.info.desc: + self.fp.write('%s\n' % ln) + self.fp.write( + '.SH OPTIONS\n') + # This shows flags in the original order + for modname in self.info.module_list: + if modname.find(self.info.executable) >= 0: + mod = modname.replace(self.info.executable, self.info.name) + else: + mod = modname + self.fp.write('\n.P\n.I %s\n' % mod) + for flag in self.info.modules[modname]: + help_string = flag.help + if flag.default or flag.tips: + help_string += '\n.br\n' + if flag.default: + help_string += ' (default: \'%s\')' % flag.default + if flag.tips: + help_string += ' (%s)' % flag.tips + self.fp.write( + '.TP\n%s\n%s\n' % (flag.desc, help_string)) + + def Footer(self): + self.fp.write( + '.SH COPYRIGHT\nCopyright \(co %s Google.\n' + % time.strftime('%Y', self.info.date)) + self.fp.write('Gflags2man created this page from "%s %s" output.\n' + % (self.info.name, FLAGS.help_flag)) + self.fp.write('\nGflags2man was written by Dan Christian. ' + ' Note that the date on this' + ' page is the modification date of %s.\n' % self.info.name) + + +def main(argv): + argv = FLAGS(argv) # handles help as well + if len(argv) <= 1: + app.usage(shorthelp=1) + return 1 + + for arg in argv[1:]: + prog = ProgramInfo(arg) + if not prog.Run(): + continue + prog.Parse() + prog.Filter() + doc = GenerateMan(prog, FLAGS.dest_dir) + doc.Output() + return 0 + +if __name__ == '__main__': + app.run() diff --git a/tools/gflags/gflags_validators.py b/tools/gflags/gflags_validators.py new file mode 100755 index 00000000000000..d83058d50f0010 --- /dev/null +++ b/tools/gflags/gflags_validators.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python + +# Copyright (c) 2010, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Module to enforce different constraints on flags. + +A validator represents an invariant, enforced over a one or more flags. +See 'FLAGS VALIDATORS' in gflags.py's docstring for a usage manual. +""" + +__author__ = 'olexiy@google.com (Olexiy Oryeshko)' + + +class Error(Exception): + """Thrown If validator constraint is not satisfied.""" + + +class Validator(object): + """Base class for flags validators. + + Users should NOT overload these classes, and use gflags.Register... + methods instead. + """ + + # Used to assign each validator an unique insertion_index + validators_count = 0 + + def __init__(self, checker, message): + """Constructor to create all validators. + + Args: + checker: function to verify the constraint. + Input of this method varies, see SimpleValidator and + DictionaryValidator for a detailed description. + message: string, error message to be shown to the user + """ + self.checker = checker + self.message = message + Validator.validators_count += 1 + # Used to assert validators in the order they were registered (CL/18694236) + self.insertion_index = Validator.validators_count + + def Verify(self, flag_values): + """Verify that constraint is satisfied. + + flags library calls this method to verify Validator's constraint. + Args: + flag_values: gflags.FlagValues, containing all flags + Raises: + Error: if constraint is not satisfied. + """ + param = self._GetInputToCheckerFunction(flag_values) + if not self.checker(param): + raise Error(self.message) + + def GetFlagsNames(self): + """Return the names of the flags checked by this validator. + + Returns: + [string], names of the flags + """ + raise NotImplementedError('This method should be overloaded') + + def PrintFlagsWithValues(self, flag_values): + raise NotImplementedError('This method should be overloaded') + + def _GetInputToCheckerFunction(self, flag_values): + """Given flag values, construct the input to be given to checker. + + Args: + flag_values: gflags.FlagValues, containing all flags. + Returns: + Return type depends on the specific validator. + """ + raise NotImplementedError('This method should be overloaded') + + +class SimpleValidator(Validator): + """Validator behind RegisterValidator() method. + + Validates that a single flag passes its checker function. The checker function + takes the flag value and returns True (if value looks fine) or, if flag value + is not valid, either returns False or raises an Exception.""" + def __init__(self, flag_name, checker, message): + """Constructor. + + Args: + flag_name: string, name of the flag. + checker: function to verify the validator. + input - value of the corresponding flag (string, boolean, etc). + output - Boolean. Must return True if validator constraint is satisfied. + If constraint is not satisfied, it should either return False or + raise Error. + message: string, error message to be shown to the user if validator's + condition is not satisfied + """ + super(SimpleValidator, self).__init__(checker, message) + self.flag_name = flag_name + + def GetFlagsNames(self): + return [self.flag_name] + + def PrintFlagsWithValues(self, flag_values): + return 'flag --%s=%s' % (self.flag_name, flag_values[self.flag_name].value) + + def _GetInputToCheckerFunction(self, flag_values): + """Given flag values, construct the input to be given to checker. + + Args: + flag_values: gflags.FlagValues + Returns: + value of the corresponding flag. + """ + return flag_values[self.flag_name].value + + +class DictionaryValidator(Validator): + """Validator behind RegisterDictionaryValidator method. + + Validates that flag values pass their common checker function. The checker + function takes flag values and returns True (if values look fine) or, + if values are not valid, either returns False or raises an Exception. + """ + def __init__(self, flag_names, checker, message): + """Constructor. + + Args: + flag_names: [string], containing names of the flags used by checker. + checker: function to verify the validator. + input - dictionary, with keys() being flag_names, and value for each + key being the value of the corresponding flag (string, boolean, etc). + output - Boolean. Must return True if validator constraint is satisfied. + If constraint is not satisfied, it should either return False or + raise Error. + message: string, error message to be shown to the user if validator's + condition is not satisfied + """ + super(DictionaryValidator, self).__init__(checker, message) + self.flag_names = flag_names + + def _GetInputToCheckerFunction(self, flag_values): + """Given flag values, construct the input to be given to checker. + + Args: + flag_values: gflags.FlagValues + Returns: + dictionary, with keys() being self.lag_names, and value for each key + being the value of the corresponding flag (string, boolean, etc). + """ + return dict([key, flag_values[key].value] for key in self.flag_names) + + def PrintFlagsWithValues(self, flag_values): + prefix = 'flags ' + flags_with_values = [] + for key in self.flag_names: + flags_with_values.append('%s=%s' % (key, flag_values[key].value)) + return prefix + ', '.join(flags_with_values) + + def GetFlagsNames(self): + return self.flag_names diff --git a/tools/closure_linter/setup.cfg b/tools/gflags/setup.cfg similarity index 76% rename from tools/closure_linter/setup.cfg rename to tools/gflags/setup.cfg index 861a9f554263ef..7f75bb2cb15abd 100644 --- a/tools/closure_linter/setup.cfg +++ b/tools/gflags/setup.cfg @@ -1,5 +1,4 @@ [egg_info] -tag_build = +tag_build = tag_date = 0 tag_svn_revision = 0 - diff --git a/tools/gflags/setup.py b/tools/gflags/setup.py new file mode 100755 index 00000000000000..573db2d410c8dc --- /dev/null +++ b/tools/gflags/setup.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +# Copyright (c) 2007, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from setuptools import setup + +setup(name='python-gflags', + version='2.0', + description='Google Commandline Flags Module', + license='BSD', + author='Google Inc. and others', + author_email='google-gflags@googlegroups.com', + url='http://code.google.com/p/python-gflags', + py_modules=["gflags", "gflags_validators"], + data_files=[("bin", ["gflags2man.py"])], + include_package_data=True, + ) diff --git a/tools/icu/icu-generic.gyp b/tools/icu/icu-generic.gyp index 220d2c16a664c2..bb2b5e5e4d5ec4 100644 --- a/tools/icu/icu-generic.gyp +++ b/tools/icu/icu-generic.gyp @@ -11,6 +11,17 @@ }, 'includes': [ '../../icu_config.gypi' ], 'targets': [ + { + # a target for additional uconfig defines, target only + 'target_name': 'icu_uconfig_target', + 'type': 'none', + 'toolsets': [ 'target' ], + 'direct_dependent_settings': { + 'defines': [ + 'UCONFIG_NO_CONVERSION=1', + ] + }, + }, { # a target to hold uconfig defines. # for now these are hard coded, but could be defined. @@ -92,24 +103,74 @@ }, { 'target_name': 'icui18n', - 'type': '<(library)', - 'toolsets': [ 'target' ], - 'sources': [ - '<@(icu_src_i18n)' - ], - 'include_dirs': [ - '../../deps/icu/source/i18n', - ], - 'defines': [ - 'U_I18N_IMPLEMENTATION=1', + 'toolsets': [ 'target', 'host' ], + 'conditions' : [ + ['_toolset=="target"', { + 'type': '<(library)', + 'sources': [ + '<@(icu_src_i18n)' + ], + 'conditions': [ + [ 'icu_ver_major == 54', { 'sources!': [ + ## Strip out the following for ICU 54 only. + ## add more conditions in the future? + ## if your compiler can dead-strip, this will + ## make ZERO difference to binary size. + ## Made ICU-specific for future-proofing. + + # alphabetic index + '../../deps/icu/source/i18n/alphaindex.cpp', + # BOCSU + # misc + '../../deps/icu/source/i18n/regexcmp.cpp', + '../../deps/icu/source/i18n/regexcmp.h', + '../../deps/icu/source/i18n/regexcst.h', + '../../deps/icu/source/i18n/regeximp.cpp', + '../../deps/icu/source/i18n/regeximp.h', + '../../deps/icu/source/i18n/regexst.cpp', + '../../deps/icu/source/i18n/regexst.h', + '../../deps/icu/source/i18n/regextxt.cpp', + '../../deps/icu/source/i18n/regextxt.h', + '../../deps/icu/source/i18n/region.cpp', + '../../deps/icu/source/i18n/region_impl.h', + '../../deps/icu/source/i18n/reldatefmt.cpp', + '../../deps/icu/source/i18n/reldatefmt.h' + '../../deps/icu/source/i18n/scientificformathelper.cpp', + '../../deps/icu/source/i18n/tmunit.cpp', + '../../deps/icu/source/i18n/tmutamt.cpp', + '../../deps/icu/source/i18n/tmutfmt.cpp', + '../../deps/icu/source/i18n/uregex.cpp', + '../../deps/icu/source/i18n/uregexc.cpp', + '../../deps/icu/source/i18n/uregion.cpp', + '../../deps/icu/source/i18n/uspoof.cpp', + '../../deps/icu/source/i18n/uspoof_build.cpp', + '../../deps/icu/source/i18n/uspoof_conf.cpp', + '../../deps/icu/source/i18n/uspoof_conf.h', + '../../deps/icu/source/i18n/uspoof_impl.cpp', + '../../deps/icu/source/i18n/uspoof_impl.h', + '../../deps/icu/source/i18n/uspoof_wsconf.cpp', + '../../deps/icu/source/i18n/uspoof_wsconf.h', + ]}]], + 'include_dirs': [ + '../../deps/icu/source/i18n', + ], + 'defines': [ + 'U_I18N_IMPLEMENTATION=1', + ], + 'dependencies': [ 'icuucx', 'icu_implementation', 'icu_uconfig', 'icu_uconfig_target' ], + 'direct_dependent_settings': { + 'include_dirs': [ + '../../deps/icu/source/i18n', + ], + }, + 'export_dependent_settings': [ 'icuucx', 'icu_uconfig_target' ], + }], + ['_toolset=="host"', { + 'type': 'none', + 'dependencies': [ 'icutools' ], + 'export_dependent_settings': [ 'icutools' ], + }], ], - 'dependencies': [ 'icuucx', 'icu_implementation', 'icu_uconfig' ], - 'direct_dependent_settings': { - 'include_dirs': [ - '../../deps/icu/source/i18n', - ], - }, - 'export_dependent_settings': [ 'icuucx' ], }, # This exports actual ICU data { @@ -146,32 +207,33 @@ # trim down ICU 'action_name': 'icutrim', 'inputs': [ '<(icu_data_in)', 'icu_small.json' ], - 'outputs': [ '../../out/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ], + 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ], 'action': [ 'python', 'icutrim.py', '-P', '../../<(CONFIGURATION_NAME)', '-D', '<(icu_data_in)', '--delete-tmp', - '-T', '../../out/icutmp', + '-T', '<(SHARED_INTERMEDIATE_DIR)/icutmp', '-F', 'icu_small.json', '-O', 'icudt<(icu_ver_major)<(icu_endianness).dat', - '-v' ], + '-v', + '-L', '<(icu_locales)'], }, { # build final .dat -> .obj 'action_name': 'genccode', - 'inputs': [ '../../out/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ], - 'outputs': [ '../../out/icudt<(icu_ver_major)<(icu_endianness)_dat.obj' ], + 'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ], + 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.obj' ], 'action': [ '../../<(CONFIGURATION_NAME)/genccode', '-o', - '-d', '../../out/', + '-d', '<(SHARED_INTERMEDIATE_DIR)/', '-n', 'icudata', '-e', 'icusmdt<(icu_ver_major)', '<@(_inputs)' ], }, ], # This file contains the small ICU data. - 'sources': [ '../../out/icudt<(icu_ver_major)<(icu_endianness)_dat.obj' ], + 'sources': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.obj' ], } ] ], #end of OS==win and icu_small == true }, { # OS != win 'conditions': [ @@ -235,7 +297,8 @@ '-T', '<(SHARED_INTERMEDIATE_DIR)/icutmp', '-F', 'icu_small.json', '-O', 'icudt<(icu_ver_major)<(icu_endianness).dat', - '-v' ], + '-v', + '-L', '<(icu_locales)'], }, { # rename to get the final entrypoint name right 'action_name': 'rename', @@ -284,19 +347,51 @@ { 'target_name': 'icuuc', 'type': 'none', - 'toolsets': [ 'target' ], - 'dependencies': [ 'icuucx', 'icudata' ], - 'export_dependent_settings': [ 'icuucx', 'icudata' ], + 'toolsets': [ 'target', 'host' ], + 'conditions' : [ + ['_toolset=="host"', { + 'dependencies': [ 'icutools' ], + 'export_dependent_settings': [ 'icutools' ], + }], + ['_toolset=="target"', { + 'dependencies': [ 'icuucx', 'icudata' ], + 'export_dependent_settings': [ 'icuucx', 'icudata' ], + }], + ], }, # This is the 'real' icuuc. - # tools can depend on 'icuuc + stubdata' { 'target_name': 'icuucx', 'type': '<(library)', - 'dependencies': [ 'icu_implementation', 'icu_uconfig' ], + 'dependencies': [ 'icu_implementation', 'icu_uconfig', 'icu_uconfig_target' ], 'toolsets': [ 'target' ], 'sources': [ - '<@(icu_src_common)' + '<@(icu_src_common)', + ], + 'conditions': [ + [ 'icu_ver_major == 54', { 'sources!': [ + ## Strip out the following for ICU 54 only. + ## add more conditions in the future? + ## if your compiler can dead-strip, this will + ## make ZERO difference to binary size. + ## Made ICU-specific for future-proofing. + + # bidi- not needed (yet!) + '../../deps/icu/source/common/ubidi.c', + '../../deps/icu/source/common/ubidiimp.h', + '../../deps/icu/source/common/ubidiln.c', + '../../deps/icu/source/common/ubidiwrt.c', + #'../../deps/icu/source/common/ubidi_props.c', + #'../../deps/icu/source/common/ubidi_props.h', + #'../../deps/icu/source/common/ubidi_props_data.h', + # and the callers + '../../deps/icu/source/common/ushape.cpp', + '../../deps/icu/source/common/usprep.cpp', + '../../deps/icu/source/common/uts46.cpp', + ]}], + [ 'OS == "solaris"', { 'defines': [ + '_XOPEN_SOURCE_EXTENDED=0', + ]}], ], 'include_dirs': [ '../../deps/icu/source/common', @@ -304,7 +399,8 @@ 'defines': [ 'U_COMMON_IMPLEMENTATION=1', ], - 'export_dependent_settings': [ 'icu_uconfig' ], + 'cflags_c': ['-std=c99'], + 'export_dependent_settings': [ 'icu_uconfig', 'icu_uconfig_target' ], 'direct_dependent_settings': { 'include_dirs': [ '../../deps/icu/source/common', @@ -331,6 +427,12 @@ '<@(icu_src_io)', '<@(icu_src_stubdata)', ], + 'sources!': [ + '../../deps/icu/source/tools/toolutil/udbgutil.cpp', + '../../deps/icu/source/tools/toolutil/udbgutil.h', + '../../deps/icu/source/tools/toolutil/dbgutil.cpp', + '../../deps/icu/source/tools/toolutil/dbgutil.h', + ], 'include_dirs': [ '../../deps/icu/source/common', '../../deps/icu/source/i18n', @@ -344,6 +446,12 @@ 'U_TOOLUTIL_IMPLEMENTATION=1', #'DEBUG=0', # http://bugs.icu-project.org/trac/ticket/10977 ], + 'cflags_c': ['-std=c99'], + 'conditions': [ + ['OS == "solaris"', { + 'defines': [ '_XOPEN_SOURCE_EXTENDED=0' ] + }] + ], 'direct_dependent_settings': { 'include_dirs': [ '../../deps/icu/source/common', @@ -359,7 +467,7 @@ }], ], }, - 'export_dependent_settings': [ 'icu_implementation', 'icu_uconfig' ], + 'export_dependent_settings': [ 'icu_uconfig' ], }, # This tool is needed to rebuild .res files from .txt, # or to build index (res_index.txt) files for small-icu diff --git a/tools/icu/icu_small.json b/tools/icu/icu_small.json index ddf7d1204e814a..e434794e91c16b 100644 --- a/tools/icu/icu_small.json +++ b/tools/icu/icu_small.json @@ -1,11 +1,11 @@ { "copyright": "Copyright (c) 2014 IBM Corporation and Others. All Rights Reserved.", - "comment": "icutrim.py config: Trim down ICU to just English, needed for node.js use.", + "comment": "icutrim.py config: Trim down ICU to just a certain locale set, needed for node.js use.", "variables": { "none": { "only": [] }, - "en_only": { + "locales": { "only": [ "root", "en" @@ -15,20 +15,21 @@ } }, "trees": { - "ROOT": "en_only", + "ROOT": "locales", "brkitr": "none", - "coll": "en_only", - "curr": "en_only", + "coll": "locales", + "curr": "locales", "lang": "none", "rbnf": "none", "region": "none", - "zone": "en_only", + "zone": "locales", "converters": "none", "stringprep": "none", "translit": "none", "brkfiles": "none", "brkdict": "none", - "confusables": "none" + "confusables": "none", + "unit": "none" }, "remove": [ "cnvalias.icu", diff --git a/tools/icu/icutrim.py b/tools/icu/icutrim.py index 7f0fb3752e40e9..517bf39bad323d 100755 --- a/tools/icu/icutrim.py +++ b/tools/icu/icutrim.py @@ -65,6 +65,12 @@ action="count", default=0) +parser.add_option('-L',"--locales", + action="store", + dest="locales", + help="sets the 'locales.only' variable", + default=None) + parser.add_option('-e', '--endian', action='store', dest='endian', help='endian, big, little or host, your default is "%s".' % endian, default=endian, metavar='endianness') (options, args) = parser.parse_args() @@ -147,6 +153,13 @@ def runcmd(tool, cmd, doContinue=False): config=json.load(fi) fi.close() +if (options.locales): + if not config.has_key("variables"): + config["variables"] = {} + if not config["variables"].has_key("locales"): + config["variables"]["locales"] = {} + config["variables"]["locales"]["only"] = options.locales.split(',') + if (options.verbose > 6): print config diff --git a/tools/install.py b/tools/install.py index c99dc1579bfeb0..5cf78b52814683 100755 --- a/tools/install.py +++ b/tools/install.py @@ -108,12 +108,12 @@ def npm_files(action): if os.environ.get('PORTABLE'): # This crazy hack is necessary to make the shebang execute the copy # of node relative to the same directory as the npm script. The precompiled - # binary tarballs use a prefix of "/" which gets translated to "/bin/node" + # binary tarballs use a prefix of "/" which gets translated to "/bin/iojs" # in the regular shebang modifying logic, which is incorrect since the # precompiled bundle should be able to be extracted anywhere and "just work" - shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"' + shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/iojs" "$0" "$@"' else: - shebang = os.path.join(node_prefix or '/', 'bin/node') + shebang = os.path.join(node_prefix or '/', 'bin/iojs') update_shebang(link_path, shebang) else: assert(0) # unhandled action type @@ -127,8 +127,21 @@ def subdir_files(path, dest, action): action(files, subdir + '/') def files(action): - exeext = '.exe' if sys.platform == 'win32' else '' - action(['out/Release/node' + exeext], 'bin/node' + exeext) + is_windows = sys.platform == 'win32' + + exeext = '.exe' if is_windows else '' + action(['out/Release/iojs' + exeext], 'bin/iojs' + exeext) + + if not is_windows: + # Install iojs -> node compatibility symlink. + link_target = 'bin/node' + link_path = abspath(install_path, link_target) + if action == uninstall: + action([link_path], link_target) + elif action == install: + try_symlink('iojs', link_path) + else: + assert(0) # Unhandled action type. if 'true' == variables.get('node_use_dtrace'): action(['out/Release/node.d'], 'lib/dtrace/node.d') @@ -137,9 +150,9 @@ def files(action): action(['src/node.stp'], 'share/systemtap/tapset/') if 'freebsd' in sys.platform or 'openbsd' in sys.platform: - action(['doc/node.1'], 'man/man1/') + action(['doc/iojs.1'], 'man/man1/') else: - action(['doc/node.1'], 'share/man/man1/') + action(['doc/iojs.1'], 'share/man/man1/') if 'true' == variables.get('node_install_npm'): npm_files(action) diff --git a/tools/msvs/genfiles/node_perfctr_provider.h b/tools/msvs/genfiles/node_perfctr_provider.h index 30f0b58621adfe..19da3925e4a74c 100644 --- a/tools/msvs/genfiles/node_perfctr_provider.h +++ b/tools/msvs/genfiles/node_perfctr_provider.h @@ -1,7 +1,20 @@ -/* This file was auto-generated from src\res\node_perfctr_provider.man by ctrpp.exe */ +//------------------------------------------------------------------ +// !!! WARNING !!! +// +// This file is auto generated by ctrpp.exe utility from performance +// counters manifest: +// +// src\res\node_perfctr_provider.man +// +// It should be regenerated every time the code is built. +// Do not check it in. +//------------------------------------------------------------------- #pragma once +#include +#include + EXTERN_C DECLSPEC_SELECTANY GUID NodeCounterProviderGuid = { 0x1e2e15d7, 0x3760, 0x470e, 0x86, 0x99, 0xb9, 0xdb, 0x52, 0x48, 0xed, 0xd5 }; diff --git a/tools/msvs/genfiles/node_perfctr_provider.rc b/tools/msvs/genfiles/node_perfctr_provider.rc index c7816f5fa39dc4..5b1b2daef10a06 100644 Binary files a/tools/msvs/genfiles/node_perfctr_provider.rc and b/tools/msvs/genfiles/node_perfctr_provider.rc differ diff --git a/tools/msvs/msi/WixUI_en-us.wxl b/tools/msvs/msi/WixUI_en-us.wxl index 76ca68a1ee14f5..519024c727780d 100644 --- a/tools/msvs/msi/WixUI_en-us.wxl +++ b/tools/msvs/msi/WixUI_en-us.wxl @@ -1,4 +1,5 @@ - Choose a custom location or click Next to install + The Setup Wizard will install [ProductName] on your computer. WARNING: if you're upgrading from io.js v1.0.0 or v1.0.1, you must first uninstall these versions manually. + Choose a custom location or click Next to install. diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj index 1059bccb22d681..f2caa1bb91b2bd 100644 --- a/tools/msvs/msi/nodemsi.wixproj +++ b/tools/msvs/msi/nodemsi.wixproj @@ -6,7 +6,7 @@ 3.5 {1d808ff0-b5a9-4be9-859d-b334b6f48be2} 2.0 - node-v$(NodeVersion)-$(Platform) + iojs-v$(NodeVersion)-$(Platform) Package True $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs index 977be2ce40e086..878999f309d205 100755 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/product.wxs @@ -2,11 +2,11 @@ - - - + + + - + @@ -16,18 +16,18 @@ Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.ProductAuthor)" - UpgradeCode="1d60944c-b9ce-4a71-a7c0-0384eb884baa"> + UpgradeCode="47c07a3a-42ef-4213-a85d-8f5a59077c28"> + DowngradeErrorMessage="A later version of io.js is already installed. Setup will now exit."/> - + - + @@ -40,25 +40,33 @@ + + + + + + Description="Installs support for io.js-specific performance counters."> + Description="Installs support for event tracing (ETW) events generated by io.js."> @@ -66,28 +74,29 @@ + Description="Install npm, the recommended package manager for io.js."> + + Description="Add start menu entries that link the the online documentation for io.js $(var.ProductVersion) and the io.js website."> + Description="Add io.js, npm, and modules that were globally installed by npm to the PATH environment variable."> + Title="io.js and npm" + Description="Add io.js and npm (if installed) to the PATH environment variable."> @@ -101,18 +110,24 @@ - + - + - + + + + + + @@ -130,7 +145,7 @@ - + @@ -150,17 +165,17 @@ Type="string" Value="$(var.ProductVersion)"/> + + + + + + + + + + @@ -195,12 +220,12 @@ Value="1" KeyPath="yes"/> @@ -237,6 +262,19 @@ + + + + + $NodeAlias = 3 + + + @@ -281,7 +319,7 @@ NOT Installed 1 - + diff --git a/tools/msvs/nodevars.bat b/tools/msvs/nodevars.bat index 064f83cbc85405..2b7915662ec5c9 100644 --- a/tools/msvs/nodevars.bat +++ b/tools/msvs/nodevars.bat @@ -1,24 +1,24 @@ @echo off -rem Ensure this Node.js and npm are first in the PATH +rem Ensure this io.js and npm are first in the PATH set PATH=%APPDATA%\npm;%~dp0;%PATH% setlocal enabledelayedexpansion pushd "%~dp0" -rem Figure out the node version. -set print_version=.\node.exe -p -e "process.versions.node + ' (' + process.arch + ')'" +rem Figure out the io.js version. +set print_version=.\iojs.exe -p -e "process.versions.node + ' (' + process.arch + ')'" for /F "usebackq delims=" %%v in (`%print_version%`) do set version=%%v rem Print message. if exist npm.cmd ( - echo Your environment has been set up for using Node.js !version! and npm. + echo Your environment has been set up for using io.js !version! and npm. ) else ( - echo Your environment has been set up for using Node.js !version!. + echo Your environment has been set up for using io.js !version!. ) popd endlocal -rem If we're in the node.js directory, change to the user's home dir. +rem If we're in the io.js directory, change to the user's home dir. if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%" diff --git a/tools/osx-pkg.pmdoc/01local-contents.xml b/tools/osx-pkg.pmdoc/01local-contents.xml index bc1e5a791fd3e6..ccbb4189961b0a 100644 --- a/tools/osx-pkg.pmdoc/01local-contents.xml +++ b/tools/osx-pkg.pmdoc/01local-contents.xml @@ -1 +1 @@ - \ No newline at end of file + diff --git a/tools/osx-pkg.pmdoc/01local.xml b/tools/osx-pkg.pmdoc/01local.xml index 18fd871248de05..1d99404e492982 100644 --- a/tools/osx-pkg.pmdoc/01local.xml +++ b/tools/osx-pkg.pmdoc/01local.xml @@ -1 +1 @@ -org.nodejs.pkg1.0../out/dist-osx/usr/local//usr/localinstallTo.isRelativeTypeinstallTolocationTyperelocatableinstallFrom.pathinstallTo.isAbsoluteTypeidentifierparentinstallTo.pathinstallFrom.isRelativeType \ No newline at end of file +org.iojs.pkg1.0../out/dist-osx/usr/local//usr/localinstallTo.isRelativeTypeinstallTolocationTyperelocatableinstallFrom.pathinstallTo.isAbsoluteTypeidentifierparentinstallTo.pathinstallFrom.isRelativeType diff --git a/tools/osx-pkg.pmdoc/02npm-contents.xml b/tools/osx-pkg.pmdoc/02npm-contents.xml index bc1e5a791fd3e6..ccbb4189961b0a 100644 --- a/tools/osx-pkg.pmdoc/02npm-contents.xml +++ b/tools/osx-pkg.pmdoc/02npm-contents.xml @@ -1 +1 @@ - \ No newline at end of file + diff --git a/tools/osx-pkg.pmdoc/02npm.xml b/tools/osx-pkg.pmdoc/02npm.xml index 4f7799f11ed8a4..06360b5df9550f 100644 --- a/tools/osx-pkg.pmdoc/02npm.xml +++ b/tools/osx-pkg.pmdoc/02npm.xml @@ -1 +1 @@ -org.nodejs.node.npm.pkg1.0../deps/npm/usr/local/lib/node_modules/npminstallTo.pathinstallFrom.isRelativeTypeinstallToscripts.postinstall.isRelativeTypeparentinstallTo.isAbsoluteTypeosx-pkg-postinstall.sh \ No newline at end of file +org.iojs.npm.pkg1.0../deps/npm/usr/local/lib/node_modules/npminstallTo.pathinstallFrom.isRelativeTypeinstallToscripts.postinstall.isRelativeTypeparentinstallTo.isAbsoluteTypeosx-pkg-postinstall.sh diff --git a/tools/osx-pkg.pmdoc/index.xml b/tools/osx-pkg.pmdoc/index.xml deleted file mode 100644 index 2233f1c622ab7f..00000000000000 --- a/tools/osx-pkg.pmdoc/index.xml +++ /dev/null @@ -1,19 +0,0 @@ -Node/Users/ryan/Desktop/Node.pkgorg.nodejs../doc/mac_osx_nodejs_installer_logo.png../LICENSE01local.xml02npm.xmlproperties.titleproperties.userDomainproperties.anywhereDomainproperties.systemDomain \ No newline at end of file diff --git a/tools/osx-pkg.pmdoc/index.xml.tmpl b/tools/osx-pkg.pmdoc/index.xml.tmpl new file mode 100644 index 00000000000000..7376a9d376d5a4 --- /dev/null +++ b/tools/osx-pkg.pmdoc/index.xml.tmpl @@ -0,0 +1,21 @@ +io.js/Users/iojs/Desktop/iojs.pkgorg.iojs../doc/osx_installer_logo.png../LICENSE01local.xml02npm.xmlproperties.titleproperties.userDomainproperties.anywhereDomainproperties.systemDomain diff --git a/tools/test.py b/tools/test.py index 7241f162d7a28b..074a918f2ad002 100755 --- a/tools/test.py +++ b/tools/test.py @@ -41,6 +41,7 @@ import threading import utils import multiprocessing +import errno from os.path import join, dirname, abspath, basename, isdir, exists from datetime import datetime @@ -71,8 +72,8 @@ def __init__(self, cases, flaky_tests_mode): self.total = len(cases) self.failed = [ ] self.crashed = 0 - self.terminate = False self.lock = threading.Lock() + self.shutdown_event = threading.Event() def PrintFailureHeader(self, test): if test.IsNegative(): @@ -101,17 +102,19 @@ def Run(self, tasks): for thread in threads: # Use a timeout so that signals (ctrl-c) will be processed. thread.join(timeout=10000000) + except (KeyboardInterrupt, SystemExit), e: + self.shutdown_event.set() except Exception, e: # If there's an exception we schedule an interruption for any # remaining threads. - self.terminate = True + self.shutdown_event.set() # ...and then reraise the exception to bail out raise self.Done() return not self.failed def RunSingle(self, parallel, thread_id): - while not self.terminate: + while not self.shutdown_event.is_set(): try: test = self.parallel_queue.get_nowait() except Empty: @@ -131,9 +134,8 @@ def RunSingle(self, parallel, thread_id): output = case.Run() case.duration = (datetime.now() - start) except IOError, e: - assert self.terminate return - if self.terminate: + if self.shutdown_event.is_set(): return self.lock.acquire() if output.UnexpectedOutput(): @@ -569,11 +571,18 @@ def PrintError(str): def CheckedUnlink(name): - try: - os.unlink(name) - except OSError, e: - PrintError("os.unlink() " + str(e)) - + while True: + try: + os.unlink(name) + except OSError, e: + # On Windows unlink() fails if another process (typically a virus scanner + # or the indexing service) has the file open. Those processes keep a + # file open for a short time only, so yield and try again; it'll succeed. + if sys.platform == 'win32' and e.errno == errno.EACCES: + time.sleep(0) + continue + PrintError("os.unlink() " + str(e)) + break def Execute(args, context, timeout=None, env={}): (fd_out, outname) = tempfile.mkstemp() @@ -742,20 +751,20 @@ def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppr def GetVm(self, arch, mode): if arch == 'none': - name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node' + name = 'out/Debug/iojs' if mode == 'debug' else 'out/Release/iojs' else: - name = 'out/%s.%s/node' % (arch, mode) + name = 'out/%s.%s/iojs' % (arch, mode) # Currently GYP does not support output_dir for MSVS. # http://code.google.com/p/gyp/issues/detail?id=40 - # It will put the builds into Release/node.exe or Debug/node.exe + # It will put the builds into Release/iojs.exe or Debug/iojs.exe if utils.IsWindows(): out_dir = os.path.join(dirname(__file__), "..", "out") if not exists(out_dir): if mode == 'debug': - name = os.path.abspath('Debug/node.exe') + name = os.path.abspath('Debug/iojs.exe') else: - name = os.path.abspath('Release/node.exe') + name = os.path.abspath('Release/iojs.exe') else: name = os.path.abspath(name + '.exe') @@ -1235,8 +1244,6 @@ def BuildOptions(): result.add_option("--snapshot", help="Run the tests with snapshot turned on", default=False, action="store_true") result.add_option("--special-command", default=None) - result.add_option("--use-http1", help="Pass --use-http1 switch to node", - default=False, action="store_true") result.add_option("--valgrind", help="Run tests through valgrind", default=False, action="store_true") result.add_option("--cat", help="Print the source of the tests", @@ -1350,6 +1357,7 @@ def ExpandCommand(args): 'pummel', 'message', 'internet', + 'addons', 'gc', 'debugger', ] @@ -1397,11 +1405,6 @@ def Main(): buildspace = dirname(shell) processor = GetSpecialCommandProcessor(options.special_command) - if options.use_http1: - def wrap(processor): - return lambda args: processor(args[:1] + ['--use-http1'] + args[1:]) - processor = wrap(processor) - context = Context(workspace, buildspace, VERBOSE, diff --git a/tools/update-authors.sh b/tools/update-authors.sh new file mode 100755 index 00000000000000..f0944889b2cb4f --- /dev/null +++ b/tools/update-authors.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +git log --reverse --format='%aN <%aE>' | awk ' + +BEGIN { + print "# Authors ordered by first contribution.\n"; + + # explicit excludes + excludes[""] = 1 # chromium team +} + +{ + if ($NF !~ /@chromium.org/ && all[$NF] != 1 && excludes[$NF] != 1) { + all[$NF] = 1; + ordered[length(all)] = $0; + } +} + +END { + for (i in ordered) { + print ordered[i]; + } + + print "\n# Generated by tools/update-authors.sh"; +} + +' > AUTHORS diff --git a/vcbuild.bat b/vcbuild.bat index 8a66f7b7140c3b..3ad209534a4952 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -26,7 +26,6 @@ set test= set test_args= set msi= set licensertf= -set upload= set jslint= set buildnodeweak= set noetw= @@ -36,6 +35,7 @@ set noperfctr= set noperfctr_arg= set noperfctr_msi_arg= set i18n_arg= +set download_arg= :next-arg if "%1"=="" goto args-done @@ -61,10 +61,11 @@ if /i "%1"=="test-gc" set test=test-gc&set buildnodeweak=1&goto arg-ok if /i "%1"=="test-all" set test=test-all&set buildnodeweak=1&goto arg-ok if /i "%1"=="test" set test=test&goto arg-ok if /i "%1"=="msi" set msi=1&set licensertf=1&goto arg-ok -if /i "%1"=="upload" set upload=1&goto arg-ok if /i "%1"=="jslint" set jslint=1&goto arg-ok if /i "%1"=="small-icu" set i18n_arg=%1&goto arg-ok if /i "%1"=="full-icu" set i18n_arg=%1&goto arg-ok +if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok +if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok echo Warning: ignoring invalid command line option `%1`. @@ -74,7 +75,6 @@ shift goto next-arg :args-done -if defined upload goto upload if defined jslint goto jslint if "%config%"=="Debug" set debug_arg=--debug @@ -85,6 +85,7 @@ if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg= if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu +if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none :project-gen @rem Skip project generation if requested. @@ -95,7 +96,7 @@ if defined NIGHTLY set TAG=nightly-%NIGHTLY% @rem Generate the VS project. SETLOCAL if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat" - python configure %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% + python configure %download_arg% %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% if errorlevel 1 goto create-msvs-files-failed if not exist node.sln goto create-msvs-files-failed echo Project files generated. @@ -129,14 +130,14 @@ if errorlevel 1 goto exit @rem Skip signing if the `nosign` option was specified. if defined nosign goto licensertf -signtool sign /a /d "Node.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe +signtool sign /a /d "io.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\iojs.exe if errorlevel 1 echo Failed to sign exe&goto exit :licensertf @rem Skip license.rtf generation if not requested. if not defined licensertf goto msi -%config%\node tools\license2rtf.js < LICENSE > %config%\license.rtf +%config%\iojs tools\license2rtf.js < LICENSE > %config%\license.rtf if errorlevel 1 echo Failed to generate license.rtf&goto exit :msi @@ -148,12 +149,12 @@ if not defined NIGHTLY goto msibuild set NODE_VERSION=%NODE_VERSION%.%NIGHTLY% :msibuild -echo Building node-%NODE_VERSION% +echo Building iojs-%NODE_VERSION% msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:Platform=%msiplatform% /p:NodeVersion=%NODE_VERSION% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if defined nosign goto run -signtool sign /a /d "Node.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node-v%NODE_VERSION%-%msiplatform%.msi +signtool sign /a /d "io.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\iojs-v%NODE_VERSION%-%msiplatform%.msi if errorlevel 1 echo Failed to sign msi&goto exit :run @@ -192,25 +193,14 @@ goto exit echo Failed to create vc project files. goto exit -:upload -echo uploading .exe .msi .pdb to nodejs.org -call :getnodeversion -@echo on -ssh node@nodejs.org mkdir -p web/nodejs.org/dist/v%NODE_VERSION% -scp Release\node.msi node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%.msi -scp Release\node.exe node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.exe -scp Release\node.pdb node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.pdb -@echo off -goto exit - :jslint echo running jslint -set PYTHONPATH=tools/closure_linter/ +set PYTHONPATH=tools/closure_linter/;tools/gflags/ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign] [x86/x64] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [download-all] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build @@ -228,5 +218,5 @@ rem *************** :getnodeversion set NODE_VERSION= for /F "usebackq tokens=*" %%i in (`python "%~dp0tools\getnodeversion.py"`) do set NODE_VERSION=%%i -if not defined NODE_VERSION echo Cannot determine current version of node.js & exit /b 1 +if not defined NODE_VERSION echo Cannot determine current version of io.js & exit /b 1 goto :EOF