diff --git a/.mailmap b/.mailmap index 842d610df87b94..fd6816a5dce7d3 100644 --- a/.mailmap +++ b/.mailmap @@ -1,8 +1,10 @@ Aaron Bieber Aaron Heckmann +Aayush Ahuja aayush.a Abe Fettig Akito Ito Alejandro Oviedo Garcia Alejandro Oviedo +Alex Gilbert agilbert Alex Hultman Alex Jordan AJ Jordan Alex Kocharin @@ -19,6 +21,7 @@ Andy Bettisworth Angel Stoyanov atstojanov Anna Henningsen Anna Magdalena Kedzierska AnnaMag +Antoine Amara Antoine AMARA Aria Stewart Arlo Breault Arnaud Lefebvre BlackYoup @@ -26,6 +29,7 @@ Artem Zaytsev Artur G Vieira Artur Vieira Arnout Kazemier <3rd-Eden@users.noreply.github.com> Asaf David asafdav2 +Ashley Maceli ashleyraymaceli Atsuo Fukaya Ben Lugavere blugavere Ben Noordhuis @@ -42,30 +46,37 @@ Beth Griggs Bethany N Griggs BethGriggs Bidisha Pyne Brad Decker brad-decker +Brad Larson BradLarson Bradley Meck Bradley Farias Brandon Benvie Brandon Kobel kobelb Brendan Ashworth +Brent Pendergraft penDerGraft Brian White Brian White Caleb Boyd Calvin Metcalf Calvin Metcalf +Caralyn Reisle creisle Charles Chew Choon Keat Charles Rudolph +Chris Andrews cpandrews8 Chris Johnson +Chris Young Claudio Rodriguez Colin Ihrig Christophe Naud-Dulude Chris911 Christopher Lenz Dan Kaplun Dan Williams Dan.Williams +Daniel Abrão Daniel Abrão > Daniel Bevenius daniel.bevenius Daniel Berger Daniel Chcouri <333222@gmail.com> Daniel Gröber Daniel Gröber +Daniel Paulino dpaulino Daniel Pihlström Daniel Wang firedfox Daniel Wang firedfox @@ -84,6 +95,7 @@ Eduard Burtescu Einar Otto Stangvik Elliott Cable Eric Phetteplace +Erwin W. Ramadhan erwinwahyura Eugene Obrezkov ghaiklor EungJun Yi Evan Larkin @@ -99,14 +111,21 @@ Felix Geisendörfer Flandre Scarlet Flandre Florian Margaine Florian MARGAINE Forrest L Norvell +Franziska Hinkelmann F. Hinkelmann Friedemann Altrock Fuji Goro Gabriel de Perthuis Gareth Ellis +Geoffrey Bugaisky gbugaisky Gibson Fahnestock Gil Pedersen Graham Fairweather Xotic750 Greg Sabia Tucker +Gregor Martynus Gregor +Guy Bedford guybedford +Halil İbrahim Şener hisener +Hannah Kim heeeunkimmm +Hendrik Schwalm hschwalm Hitesh Kanwathirtha Henry Chin Herbert Vojčík @@ -122,8 +141,10 @@ Italo A. Casas Jackson Tian Jake Verbaten Jamen Marzonie Jamen Marz +James Beavers Druotic James Hartig James M Snell +James Nimlos JamesNimlos Jan Krems Jenna Vuong JeongHoon Byun Outsider @@ -139,13 +160,17 @@ Johann Hofmann John Barboza jBarz John Barboza jBarz John Gardner Alhadis +John McGuirk jmcgui05 Johnny Ray Austin Johnny Ray Jon Tippens legalcodes Jonas Pfenniger +Jonathan Gourlay mrgorbo Jonathan Ong Jonathan Persson Jonathan Rentzsch +Jose Luis Vivero jlvivero Josh Erickson +Josh Hunter jopann Joshua S. Weinstein Joyee Cheung joyeecheung Juan Soto @@ -154,6 +179,7 @@ Julien Waechter julien.waechter Junliang Yan Junshu Okamoto jun-oka +Justin Beckwith Jérémy Lal Jérémy Lal Kai Sasaki Lewuathe @@ -172,26 +198,34 @@ Lydia Kats Lydia Katsamberis Maciej Małecki Malte-Thorben Bruns Malte-Thorben Bruns skenqbx +Mandeep Singh +Manil Chowdhurian Chowdhurian Marcelo Gobelli decareano Marcin Cieślak Marcin Cieślak Marcin Zielinski marzelin Marti Martz Martial James Jefferson +Martijn Schrage Oblosys +Matheus Marchini Matt Lang matt-in-a-hat +Matt Reed matthewreed26 Matthias Bastian piepmatz Mathias Buus Mathias Pettersson Matthew Lye +Maurice Hayward maurice_hayward Michael Bernstein Michael Dawson Michael Wilber Michaël Zasso Michael-Rainabba Richardson rainabba +Michał Gołębiowski-Owczarek Micheil Smith Micleusanu Nicu Miguel Angel Asencio Hurtado maasencioh Mikael Bourges-Sevenier +Mike Kaufman Minqi Pan P.S.V.R Minwoo Jung JungMinu Miroslav Bajtoš @@ -208,8 +242,11 @@ Onne Gorter Paul Querna Pedro Lima Pedro Victor Pedro Lima Pedro lima +Peng Lyu rebornix Peter Flannery +Peter Paugh Peter Phillip Johnsen +Rachel White rachelnicole Ratikesh Misra Ravindra Barthwal Ravindra barthwal Ray Morgan @@ -220,11 +257,14 @@ Refael Ackermann Reza Akhavan jedireza Ricardo Sánchez Gregorio richnologies Rick Olson +Rob Adelmann +Rob Adelmann adelmann Rod Machen Roman Klauke Roman Reiss Ron Korving Ron Korving ronkorving +Russell Dempsey Ryan Dahl Ryan Emery Ryan Scheel Ryan Scheel @@ -245,11 +285,14 @@ Scott Blomquist Segu Riluvan Sergey Kryzhanovsky Shannen Saez +Shaopeng Zhang szhang351 Shigeki Ohtsu Shigeki Ohtsu +Shiya Luo shiya Siddharth Mahendraker Simon Willison Siobhan O'Donovan justshiv +Siyuan Gao r1cebank solebox solebox <5013box@gmail.com> Sreepurna Jasti Sreepurna Jasti sreepurnajasti @@ -261,6 +304,7 @@ Steve Mao Steven R. Loomis Stewart X Addison Stewart Addison Stewart X Addison sxa555 +Suraiya Hameed suraiyah Suramya shah ss22ever Surya Panikkal surya panikkal Surya Panikkal suryagh @@ -268,6 +312,8 @@ Taehee Kang hugnosis Tanuja-Sawant Taylor Woll taylor.woll Thomas Watson Steen Thomas Watson +Timur Shemsedinov tshemsedinov +Toby Farley tobyfarley Toby Stableford toboid Todd Kennedy TJ Holowaychuk @@ -278,6 +324,8 @@ Tarun Batra Tarun Ted Young Thomas Lee Thomas Reggi +Tierney Cyren &! (bitandbang) +Tierney Cyren bitandbang Tim Caswell Tim Price Tim Smart @@ -285,6 +333,8 @@ Tim Smart Timothy Leverett Timothy Tom Hughes Tom Hughes-Croucher +Tom Purcell tpurcell +Tomoki Okahana umatoma Travis Meisenheimer Trevor Burnham Tyler Larson @@ -295,10 +345,12 @@ vsemozhetbyt Vse Mozhet Byt Wang Xinyong Weijia Wang <381152119@qq.com> starkwang <381152119@qq.com> Willi Eggeling +Wyatt Preul geek xiaoyu <306766053@qq.com> Poker <306766053@qq.com> Yazhong Liu Yazhong Liu Yazhong Liu Yorkie Yazhong Liu Yorkie +Yazhong Liu Yorkie Liu Yoshihiro KIKUCHI Yosuke Furukawa Yuichiro MASUI diff --git a/AUTHORS b/AUTHORS index 977f3b619f4b00..8d8e74493aff0a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -710,7 +710,7 @@ Ryan Scheel Benjamin Gruenbaum Pavel Medvedev Russell Dempsey -&! (bitandbang) +Tierney Cyren h7lin Michael Dawson Ruben Verborgh @@ -791,7 +791,7 @@ Salman Aljammaz Thomas Reggi Laurent Fortin Fabio Oliveira -Michał Gołębiowski +Michał Gołębiowski-Owczarek Johann Hofmann Charles Rudolph Dave Eddy @@ -957,7 +957,7 @@ Bogdan Lobor Mihai Potra Brendon Pierson Brad Hill -Mike Kaufman +Mike Kaufman Igor Kalashnikov Amery James Reggio @@ -1194,12 +1194,12 @@ scalkpdev Ashton Kinslow Kevin Zurawel Wes Tyler -shiya +Shiya Luo Joyee Cheung Greg Valdez Bidur Adhikari Kyle Carter -adelmann +Rob Adelmann Daniel Pittman Ian White Chris Bystrek @@ -1274,7 +1274,6 @@ Sam Shull Michael-Bryant Choa CodeVana Daniel Sims -Rob Adelmann Diego Paez Paul Graham Jared Young @@ -1401,7 +1400,7 @@ James Sumners Bradley Curran chiaki-yokoo Benjamin Fleischer -maurice_hayward +Maurice Hayward Ali BARIN Nemanja Stojanovic Jeroen Mandersloot @@ -1526,11 +1525,10 @@ realwakka Gergely Nemeth Samuel Reed Anshul Guleria -Justin Beckwith +Justin Beckwith Scott McKenzie Julien Klepatch Dan Homola -Chris Young cornholio <0@mcornholio.ru> Tamás Hódi DuanPengfei <2459714173@qq.com> @@ -1618,7 +1616,7 @@ Guy Margalit Azard nishijayaraj Nick Stanish -Mandeep Singh +Mandeep Singh Prakash Palaniappan Keita Akutsu Michael Albert @@ -1667,5 +1665,376 @@ George Bezerra Benjamin Coe Tim Costa Rahul Mishra +Damien O'Reilly +Tuan Anh Tran +Alex Gresnel <31708810+agresnel@users.noreply.github.com> +Will Young +Martijn Schrage +Halil İbrahim Şener +Guy Bedford +Antoine Amara +Mani Maghsoudlou +Bartek Szczepański +Roga Pria Sembada +Jussi Räsänen +Thomas Corbière +atvoicu +Peng Lyu +Yang-Kichang +JP Wesselink +Rami Moshe +Rimas Misevičius +Jack Horton +Trivikram Kamat +Jose Luis Vivero +John-David Dalton +Pavel Pomerantsev +Daniela Borges Matos de Carvalho +Bruce Fletcher +Greg Byram +Manil Chowdhurian +Jonathan Eskew +James M. Greene +Pooya Paridel +Paul Berry +Ruxandra Fediuc +Saeed H +Rachel White +Geoffrey Bugaisky +Sam Skjonsberg +Emily Marigold Klassen +Ashley Maceli +Thomas Schorn +John Miller +rhalldearn +Annie Weng +Sean Cox +Luke Greenleaf +Alec Ferguson +Laura Cabrera +Barry Tam +Eric Pemberton +Josh Hunter +BinarySo1o +Chris Budy +Emily Platzer +jacjam +Brant Barger +Daniel Paulino +Emily Ford +Luis Del Águila +Mujtaba Al-Tameemi +Govee91 +joanne-jjb +Brad Larson +Alice Tsui +Greg Matthews +Daniel Kostro +Faisal Yaqoob +Alex McKenzie +Hannah Kim +Paul Milham +Christopher Choi +Suraiya Hameed +Charlie Duong +Joe Grace +Justin Lee +Brent Pendergraft +Gene Wu +nodexpertsdev +Rob Paton +Daniele Lisi +Sushil Tailor +Ben Michel +John McGuirk +Colin Leong +Caralyn Reisle +Savio Lucena +Rafal Leszczynski +Ivan Etchart +Robin Lungwitz +ryshep111 +gitHubTracey +tabulatedreams +Charles T Wall III +Minya Liang +Kinnan Kwok +Adil L +Seth Holladay +Chris Andrews +Matt Reed +Joe Henry +Alireza Alidousti +James Beavers +Cameron Burwell +Jakub Mrowiec - Alkagar +Oliver Luebeck +Chris Jimenez +James Hodgskiss +Guilherme Akio Sakae +Martin Michaelis +Christopher Sidebottom +Edward Andrew Robinson +Nigel Kibodeaux +Shakeel Mohamed +Tobias Kieslich +Ruy Adorno +Stefania Sharp +Pawel Golda +Steven Scott +Alex Gilbert +Siyuan Gao +Nicola Del Gobbo +Josh Lim +Feon Sua +Shawn McGinty +Jason Walton +Jonathan Gourlay +Peter Paugh +Gregor Martynus +Joel Dart +Tri Nguyen +Kasim Doctor +Steve Jenkins +AlexeyM +Nicolas Chaulet +Adarsh Honawad +Tim Ermilov +ekulnivek +Ethan Brown +Lewis Zhang +Kat Rosario +jpaulptr +Donovan Buck +Toby Farley +Suresh Srinivas +Alberto Lopez de Lara +Jem Bezooyen +Bob Clewell +Raj Parekh +Tom Boutell +Cristian Peñarrieta +Christian Murphy +Dolapo Toki +Shaopeng Zhang +Matthew Meyer +Chad Zezula +Eric Freiberg +Mabry Cervin +shaohui.liu2000@gmail.com +Chi-chi Wang +Roger Jiang +Cheyenne Arrowsmith +Tim Chon +Michael Pal +Fadi Asfour +Christina Chan +Alessandro Vergani +Ali Groening +Mike Fleming +WeiPlanet +243083df <243083df@dispostable.com> +Komivi Agbakpem +Tyler Seabrook +Bear Trickey +NiveditN +Shaun Sweet +James Nimlos +Kim Gentes +Vladimir Ilic +Randal Hanford +Jean-Baptiste Brossard +Orta +Ben Hallion +twk-b +Lam Chan +Jenna Zeigen +Lukas +tejbirsingh +Hendrik Schwalm +Jeremy Huang +Michael Rueppel +David8472 +Luke Childs +Robert Nagy +Nikki St Onge +zhangzifa +hwaisiu +Thomas Karsten +Lance Barlaan +Alvaro Cruz +Jean-Philippe Blais +Oscar Funes +Kanika Shah +Jack Wang +Braden Whitten +Omar Gonzalez +Supamic +Nikhil Komawar +Daniel Abrão +elisa lee +mog422 +André Føyn Berge +Tom Purcell +Tomoki Okahana +Aayush Ahuja +Paul Marion Camantigue +Jayson D. Henkel +Nicolas 'Pixel' Noble +Ashish Kaila +c0b <14798161+c0b@users.noreply.github.com> +Damian +Alec Perkins +Teppei Sato +Jinwoo Lee +Peter Marton +Erwin W. Ramadhan +Mark Walker +sharkfisher +nhoel +Hadis-Fard +Scott J Beck +Raphael Rheault +Iryna Yaremtso +Casie Lynch +Matthew Cantelon +Ben Halverson +cPhost <23620441+cPhost@users.noreply.github.com> +dicearr +Lucas Azzola +Ken Takagi +Ed Schouten +Andrew Stucki +Anthony Nandaa +Mithun Sasidharan +Mattias Holmlund +Mark S. Everitt +Alexey Kuzmin +gowpen <33104741+gowpen@users.noreply.github.com> +Adam Wegrzynek +Sascha Tandel +Patrick Heneise +Dumitru Glavan +Giovanni Lela +Matthias Reis +John Byrne +Octavian Ionescu +Kevin Yu +Jimi van der Woning +Dara Hayes +Maring, Damian Lion +Attila Gonda +Brian O'Connell +Sean Karson +Nicolas Morel +fjau +SonaySevik +jonask +Delapouite +Mark McNelis +mbornath +Andres Kalle +Paul Blanche +Vipin Menon +woj +Adam Jeffery +Paul Ashfield +Katie Stockton Roberts +Mamatha J V +Neil Vass +Vidya Subramanyam +Swathi Kalahastri +Tanvi Kini +Sabari Lakshmi Krishnamoorthy +Kabir Islam +subrahmanya chari p +Suryanarayana Murthy N +Chandrakala +Jayashree S Kumar +Nayana Das K +Anawesha Khuntia +Maton Anthony +saiHemak +Deepthi Sebastian +Pawan Jangid +Stephan Smith +joelostrowski +Javier Blanco +Cyril Lakech <1169286+clakech@users.noreply.github.com> +Grant Gasparyan +Klemen Kogovsek +Gus Caplan +ka3e +ChrBergert +sercan yersen +Steve Kinney +Sebastian Mayr +Vijayalakshmi Kannan +Benjamin Zaslavsky +Sebastian Silbermann +pimlie +buji +Witthawat Piwawatthanapanit +sgreylyn +Xavier Balloy +François Descamps +Guillaume Flandre +Pierre-Loic Doulcet +Fran Herrero +Francois KY +suman-mitra +Matheus Marchini +neta +Whien +Chiahao Lin +esbb48 +Roth Peng +jimliu7434 +YuLun Shih +Kyle Yu +Ivan Wei +john +Jamie Davis +Scya597 +Zack Yang +aryung chen +Larry Lu +Robert Rossmann +薛定谔的猫 +danielLin +jackyen +Kurt Hsu +sorarize@gmail.com +Jason Chung +Thomas den Hollander +Ronald Eddy Jr +Richard Littauer +pkovacs +zhengyuanjie +Andy Chen +Kcin1993 +yozian +jimmy +Leko +Aqui Tsuchida +koooge +kou-hin +Hiroaki KARASAWA +narirou +Antonio V +spring_raining +Hiromu Yoshiwara +yuza yuko +smatsu-hl +Bamieh +WhoMeNope +Junichi Kajiwara +Matthew Leon +Hativ +Tom Hallam +Hannes Magnusson +ChungNgoops +Jose M. Palacios Diaz +hmammedzadeh # Generated by tools/update-authors.sh diff --git a/BUILDING.md b/BUILDING.md index 5095a036c05f73..95d62c481cce80 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -66,6 +66,14 @@ note1 - The gcc4.8-libs package needs to be installed, because node In "Git bash" if you call the node shell alias (`node` without the `.exe` extension), `winpty` is used automatically. +The Windows Subsystem for Linux (WSL) is not directly supported, but the +GNU/Linux build process and binaries should work. The community will only +address issues that reproduce on native GNU/Linux systems. Issues that only +reproduce on WSL should be reported in the +[WSL issue tracker](https://github.com/Microsoft/WSL/issues). Running the +Windows binary (`node.exe`) in WSL is not recommended, and will not work +without adjustment (such as stdio redirection). + ### Supported toolchains Depending on host platform, the selection of toolchains may vary. @@ -83,6 +91,9 @@ Depending on host platform, the selection of toolchains may vary. ## Building Node.js on supported platforms +*Note:* All prerequisites can be easily installed by following +[this bootstrapping guide](https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md). + ### Unix / macOS Prerequisites: @@ -336,17 +347,13 @@ as `deps/icu` (You'll have: `deps/icu/source/...`) ## Building Node.js with FIPS-compliant OpenSSL -NOTE: Windows is not yet supported - -It is possible to build Node.js with -[OpenSSL FIPS module](https://www.openssl.org/docs/fipsnotes.html). +It is possible to build Node.js with the +[OpenSSL FIPS module](https://www.openssl.org/docs/fipsnotes.html) on POSIX +systems. Windows is not supported. -**Note**: building in this way does **not** allow you to claim that the -runtime is FIPS 140-2 validated. Instead you can indicate that the runtime -uses a validated module. See the -[security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) -page 60 for more details. In addition, the validation for the underlying module -is only valid if it is deployed in accordance with its +Building in this way does not mean the runtime is FIPS 140-2 validated, but +rather that the runtime uses a validated module. In addition, the validation for +the underlying module is only valid if it is deployed in accordance with its [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). If you need FIPS validated cryptography it is recommended that you read both the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60054c07787308..61a9e6675a555a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,8 @@ release. -6.12.2
+6.12.3
+6.12.2
6.12.1
6.12.0
6.11.5
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 8f84f6f9f78baa..ce43bc208f7d05 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -3,16 +3,34 @@ **Contents** * [Issues and Pull Requests](#issues-and-pull-requests) + - [Managing Issues and Pull Requests](#managing-issues-and-pull-requests) + - [Welcoming First-Time Contributiors](#welcoming-first-time-contributiors) + - [Closing Issues and Pull Requests](#closing-issues-and-pull-requests) * [Accepting Modifications](#accepting-modifications) - - [Useful CI Jobs](#useful-ci-jobs) - - [Internal vs. Public API](#internal-vs-public-api) - - [Breaking Changes](#breaking-changes) - - [Deprecations](#deprecations) - - [Involving the TSC](#involving-the-tsc) + - [Code Reviews and Consensus Seeking](#code-reviews-and-consensus-seeking) + - [Waiting for Approvals](#waiting-for-approvals) + - [Testing and CI](#testing-and-ci) + - [Useful CI Jobs](#useful-ci-jobs) + - [Internal vs. Public API](#internal-vs-public-api) + - [Breaking Changes](#breaking-changes) + - [Breaking Changes and Deprecations](#breaking-changes-and-deprecations) + - [Breaking Changes to Internal Elements](#breaking-changes-to-internal-elements) + - [When Breaking Changes Actually Break Things](#when-breaking-changes-actually-break-things) + - [Reverting commits](#reverting-commits) + - [Introducing New Modules](#introducing-new-modules) + - [Deprecations](#deprecations) + - [Involving the TSC](#involving-the-tsc) * [Landing Pull Requests](#landing-pull-requests) - - [Technical HOWTO](#technical-howto) - - [I Just Made a Mistake](#i-just-made-a-mistake) - - [Long Term Support](#long-term-support) + - [Technical HOWTO](#technical-howto) + - [Troubleshooting](#troubleshooting) + - [I Just Made a Mistake](#i-just-made-a-mistake) + - [Long Term Support](#long-term-support) + - [What is LTS?](#what-is-lts) + - [How does LTS work?](#how-does-lts-work) + - [Landing semver-minor commits in LTS](#landing-semver-minor-commits-in-lts) + - [How are LTS Branches Managed?](#how-are-lts-branches-managed) + - [How can I help?](#how-can-i-help) + - [How is an LTS release cut?](#how-is-an-lts-release-cut) This document contains information for Collaborators of the Node.js project regarding maintaining the code, documentation and issues. @@ -24,16 +42,31 @@ understand the project governance model as outlined in ## Issues and Pull Requests -Courtesy should **always** be shown to individuals submitting issues and pull -requests to the Node.js project. Be welcoming to first time contributors, -identified by the GitHub ![badge](./doc/first_timer_badge.png) badge. +### Managing Issues and Pull Requests 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 TSC. +opinions of other Collaborators and guidance of the [TSC][]. They +may also notify other qualified parties for more input on an issue +or a pull request. +[See "Who to CC in issues"](./doc/onboarding-extras.md#who-to-cc-in-issues) + +### Welcoming First-Time Contributiors + +Courtesy should always be shown to individuals submitting issues and pull +requests to the Node.js project. Be welcoming to first-time contributors, +identified by the GitHub ![badge](./doc/first_timer_badge.png) badge. -Collaborators may **close** any issue or pull request they believe is +For first-time contributors, check if the commit author is the same as the +pull request author, and ask if they have configured their git +username and email to their liking as per [this guide][git-username]. +This is to make sure they would be promoted to "contributor" once +their pull request gets landed. + +### Closing Issues and Pull Requests + +Collaborators may close any issue or pull request they believe is not relevant for the future of the Node.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 Node.js @@ -41,13 +74,14 @@ Collaborators or additional evidence that the issue has relevance, the issue may be closed. Remember that issues can always be re-opened if necessary. -[**See "Who to CC in issues"**](./doc/onboarding-extras.md#who-to-cc-in-issues) - ## Accepting Modifications All modifications to the Node.js code and documentation should be performed via GitHub pull requests, including modifications by -Collaborators and TSC members. +Collaborators and TSC members. A pull request must be reviewed, and usually +must also be tested with CI, before being landed into the codebase. + +### Code Reviews and Consensus Seeking All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the @@ -55,22 +89,17 @@ 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. +or a Github team to a pull request for review by @-mention. +[See "Who to CC in issues"](./doc/onboarding-extras.md#who-to-cc-in-issues) 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), and focused changes that affect only documentation -and/or the test suite, may be landed after a shorter delay if they have -multiple approvals. - -For first time contributors, ask the author if they have configured their git -username and email to their liking as per [this guide][git-username]. +If any Collaborator objects to a change *without giving any additional +explanation or context*, and the objecting Collaborator fails to respond to +explicit requests for explanation or context within a reasonable period of +time, the objection may be dismissed. Note that this does not apply to +objections that are explained. For non-breaking changes, if there is no disagreement amongst Collaborators, a pull request may be landed given appropriate review. @@ -80,12 +109,32 @@ elevate discussion to the TSC for resolution (see below). Breaking changes (that is, pull requests that require an increase in the major version number, known as `semver-major` changes) must be -elevated for review by the TSC. This does not necessarily mean that the -PR must be put onto the TSC meeting agenda. If multiple TSC members -approve (`LGTM`) the PR and no Collaborators oppose the PR, it can be -landed. Where there is disagreement among TSC members or objections -from one or more Collaborators, `semver-major` pull requests should be -put on the TSC meeting agenda. +[elevated for review by the TSC](#involving-the-tsc). +This does not necessarily mean that the PR must be put onto the TSC meeting +agenda. If multiple TSC members approve (`LGTM`) the PR and no Collaborators +oppose the PR, it can be landed. Where there is disagreement among TSC members +or objections from one or more Collaborators, `semver-major` pull requests +should be put on the TSC meeting agenda. + +### Waiting for Approvals + +Before landing pull requests, sufficient time should be left for input +from other Collaborators. In general, leave at least 48 hours during the +week and 72 hours over weekends to account for international time +differences and work schedules. However, certain types of pull requests +can be fast-tracked and may be landed after a shorter delay: + +* Focused changes that affect only documentation and/or the test suite. + `code-and-learn` and `good-first-issue` pull requests typically fall + into this category. +* Changes that fix regressions. + +When a pull request is deemed suitable to be fast-tracked, label it with +`fast-track`. The pull request can be landed once 2 or more Collaborators +approve both the pull request and the fast-tracking request, and the necessary +CI testing is done. + +### Testing and CI All bugfixes require a test case which demonstrates the defect. The test should *fail* before the change, and *pass* after the change. @@ -104,6 +153,10 @@ which runs the `build-ci` and `test-ci` targets on all supported platforms. only runs the linter targets, which is useful for changes that only affect comments or documentation. +* [`node-test-pull-request-lite`](https://ci.nodejs.org/job/node-test-pull-request-lite/) +only runs the linter job, as well as the tests on LinuxONE. Should only be used for +trivial changes that do not require being tested on all platforms. + * [`citgm-smoker`](https://ci.nodejs.org/job/citgm-smoker/) uses [`CitGM`](https://github.com/nodejs/citgm) to allow you to run `npm install && npm test` on a large selection of common modules. This is useful to check whether a @@ -166,33 +219,29 @@ using an API in a manner currently undocumented achieves a particular useful result, a decision will need to be made whether or not that falls within the supported scope of that API; and if it does, it should be documented. -Breaking changes to internal elements are permitted in semver-patch or -semver-minor commits but Collaborators should take significant care when -making and reviewing such changes. Before landing such commits, an effort -must be made to determine the potential impact of the change in the ecosystem -by analyzing current use and by validating such changes through ecosystem -testing using the [Canary in the Goldmine](https://github.com/nodejs/citgm) -tool. If a change cannot be made without ecosystem breakage, then TSC review is -required before landing the change as anything less than semver-major. - -If a determination is made that a particular internal API (for instance, an -underscore `_` prefixed property) is sufficiently relied upon by the ecosystem -such that any changes may break user code, then serious consideration should be -given to providing an alternative Public API for that functionality before any -breaking changes are made. +See [Breaking Changes to Internal Elements](#breaking-changes-to-internal-elements) +on how to handle those types of changes. ### Breaking Changes Backwards-incompatible changes may land on the master branch at any time after -sufficient review by collaborators and approval of at least two TSC members. +sufficient review by Collaborators and approval of at least two TSC members. -Examples of breaking changes include, but are not necessarily limited to, -removal or redefinition of existing API arguments, changing return values -(except when return values do not currently exist), removing or modifying -existing properties on an options argument, adding or removing errors, -changing error messages in any way, altering expected timing of an event (e.g. -moving from sync to async responses or vice versa), and changing the -non-internal side effects of using a particular API. +Examples of breaking changes include: + +* removal or redefinition of existing API arguments +* changing return values +* removing or modifying existing properties on an options argument +* adding or removing errors +* altering expected timing of an event +* changing the side effects of using a particular API + +Purely additive changes (e.g. adding new events to `EventEmitter` +implementations, adding new arguments to a method in a way that allows +existing code to continue working without modification, or adding new +properties to an options argument) are semver-minor changes. + +#### Breaking Changes and Deprecations With a few notable exceptions outlined below, when backwards incompatible changes to a *Public* API are necessary, the existing API *must* be deprecated @@ -210,14 +259,6 @@ Exception to this rule is given in the following cases: Such changes *must* be handled as semver-major changes but MAY be landed without a [Deprecation cycle](#deprecation-cycle). -From time-to-time, in particularly exceptional cases, the TSC may be asked to -consider and approve additional exceptions to this rule. - -Purely additive changes (e.g. adding new events to EventEmitter -implementations, adding new arguments to a method in a way that allows -existing code to continue working without modification, or adding new -properties to an options argument) are handled as semver-minor changes. - Note that errors thrown, along with behaviors and APIs implemented by dependencies of Node.js (e.g. those originating from V8) are generally not under the control of Node.js and therefore *are not directly subject to this @@ -225,7 +266,29 @@ policy*. However, care should still be taken when landing updates to dependencies when it is known or expected that breaking changes to error handling may have been made. Additional CI testing may be required. -#### When breaking changes actually break things +From time-to-time, in particularly exceptional cases, the TSC may be asked to +consider and approve additional exceptions to this rule. + +For more information, see [Deprecations](#deprecations). + +#### Breaking Changes to Internal Elements + +Breaking changes to internal elements are permitted in semver-patch or +semver-minor commits but Collaborators should take significant care when +making and reviewing such changes. Before landing such commits, an effort +must be made to determine the potential impact of the change in the ecosystem +by analyzing current use and by validating such changes through ecosystem +testing using the [Canary in the Goldmine](https://github.com/nodejs/citgm) +tool. If a change cannot be made without ecosystem breakage, then TSC review is +required before landing the change as anything less than semver-major. + +If a determination is made that a particular internal API (for instance, an +underscore `_` prefixed property) is sufficiently relied upon by the ecosystem +such that any changes may break user code, then serious consideration should be +given to providing an alternative Public API for that functionality before any +breaking changes are made. + +#### When Breaking Changes Actually Break Things Because breaking (semver-major) changes are permitted to land on the master branch at any time, at least some subset of the user ecosystem may be adversely @@ -343,12 +406,13 @@ Changes" section of the release notes. ### Involving the TSC -Collaborators may opt to elevate pull requests or issues to the TSC for -discussion by assigning the `tsc-review` label. This should be done -where a pull request: +Collaborators may opt to elevate pull requests or issues to the [TSC][] for +discussion by assigning the `tsc-review` label or @-mentioning the +`@nodejs/tsc` Github team. This should be done where a pull request: -- has a significant impact on the codebase, -- is inherently controversial; or +- is labeled `semver-major`, or +- has a significant impact on the codebase, or +- is inherently controversial, or - has failed to reach consensus amongst the Collaborators who are actively participating in the discussion. @@ -675,3 +739,4 @@ LTS working group and the Release team. [Enhancement Proposal]: https://github.com/nodejs/node-eps [git-username]: https://help.github.com/articles/setting-your-username-in-git/ [`node-core-utils`]: https://github.com/nodejs/node-core-utils +[TSC]: https://github.com/nodejs/TSC diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d60ae5c92e815..3392eb7c0ca1ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,9 +59,9 @@ In case of doubt, open an issue in the Especially do so if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with the project team. (Node.js has two IRC channels: -[#Node.js](http://webchat.freenode.net/?channels=node.js) for general help and +[#Node.js](https://webchat.freenode.net/?channels=node.js) for general help and questions, and -[#Node-dev](http://webchat.freenode.net/?channels=node-dev) for development of +[#Node-dev](https://webchat.freenode.net/?channels=node-dev) for development of Node.js core specifically). For instructions on updating the version of V8 included in the *deps/* diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 20b75bd9718be2..7b8903fa5c8bae 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -134,4 +134,4 @@ The TSC follows a [Consensus Seeking][] decision making model as described by the [TSC Charter][]. [TSC Charter]: https://github.com/nodejs/TSC/blob/master/TSC-Charter.md -[Consensus Seeking]: http://en.wikipedia.org/wiki/Consensus-seeking_decision-making +[Consensus Seeking]: https://en.wikipedia.org/wiki/Consensus-seeking_decision-making diff --git a/Makefile b/Makefile index 7f4b0fe7e2fa97..c9fed0c03b32f4 100644 --- a/Makefile +++ b/Makefile @@ -306,6 +306,7 @@ test-v8: v8 --no-presubmit \ --shell-dir=$(PWD)/deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) \ $(TAP_V8) + git clean -fdxq -- deps/v8 @echo Testing hash seed $(MAKE) test-hash-seed diff --git a/README.md b/README.md index 12f9ed93875240..7830a915824d35 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,10 @@ policies, and releases are managed under an **This project is bound by a [Code of Conduct][].** -If you need help using or installing Node.js, please use the -[nodejs/help](https://github.com/nodejs/help) issue tracker. - # Table of Contents -* [Resources for Newcomers](#resources-for-newcomers) +* [Support](#support) * [Release Types](#release-types) * [Download](#download) * [Current and LTS Releases](#current-and-lts-releases) @@ -33,38 +30,43 @@ If you need help using or installing Node.js, please use the * [API Documentation](#api-documentation) * [Verifying Binaries](#verifying-binaries) * [Building Node.js](#building-nodejs) - * [Security](#security) - * [Current Project Team Members](#current-project-team-members) - * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee) - * [Collaborators](#collaborators) - * [Release Team](#release-team) +* [Security](#security) +* [Current Project Team Members](#current-project-team-members) + * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee) + * [Collaborators](#collaborators) + * [Release Team](#release-team) +* [Contributing to Node.js](#contributing-to-nodejs) + +## Support -## Resources for Newcomers +Node.js contributors have limited availability to address general support +questions. Please make sure you are using a [currently-supported version of +Node.js](https://github.com/nodejs/Release#release-schedule). -### Official Resources +When looking for support, please first search for your question in these venues: -* [Website][] +* [Node.js Website][] * [Node.js Help][] -* [Contributing to the project][] -* IRC (node core development): [#node-dev on chat.freenode.net][] +* [Open or closed issues in the Node.js GitHub organization](https://github.com/issues?utf8=%E2%9C%93&q=sort%3Aupdated-desc+org%3Anodejs+is%3Aissue) +* [Questions tagged 'node.js' on StackOverflow][] + +If you didn't find an answer in one of the venues above, you can: -### Unofficial Resources +* Join the **unofficial** [#node.js channel on chat.freenode.net][]. See + for more information. -* IRC (general questions): [#node.js on chat.freenode.net][]. Please see - for more information regarding the `#node.js` IRC -channel. +GitHub issues are meant for tracking enhancements and bugs, not general support. -_Please note that unofficial resources are neither managed by (nor necessarily -endorsed by) the Node.js TSC. Specifically, such resources are not -currently covered by the [Node.js Moderation Policy][] and the selection and -actions of resource operators/moderators are not subject to TSC oversight._ +Remember, libre != gratis; the open source license grants you the freedom to use +and modify, but not commitments of other people's time. Please be respectful, +and set your expectations accordingly. ## Release Types The Node.js project maintains multiple types of releases: * **Current**: Released from active development branches of this repository, - versioned by [SemVer](http://semver.org/) and signed by a member of the + versioned by [SemVer](https://semver.org) and signed by a member of the [Release Team](#release-team). Code for Current releases is organized in this repository by major version number. For example: [v4.x](https://github.com/nodejs/node/tree/v4.x). @@ -88,7 +90,7 @@ The Node.js project maintains multiple types of releases: More information can be found in the [LTS README](https://github.com/nodejs/LTS/). -## Download +### Download Binaries, installers, and source tarballs are available at . @@ -363,6 +365,10 @@ For more information about the governance of the Node.js project, see **Gibson Fahnestock** <gibfahn@gmail.com> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - **Gireesh Punathil** <gpunathi@in.ibm.com> (he/him) +* [guybedford](https://github.com/guybedford) - +**Guy Bedford** <guybedford@gmail.com> (he/him) +* [hashseed](https://github.com/hashseed) - +**Yang Guo** <yangguo@chromium.org> (he/him) * [iarna](https://github.com/iarna) - **Rebecca Turner** <me@re-becca.org> * [imran-iq](https://github.com/imran-iq) - @@ -407,6 +413,8 @@ For more information about the governance of the Node.js project, see **Luigi Pinca** <luigipinca@gmail.com> (he/him) * [lucamaraschi](https://github.com/lucamaraschi) - **Luca Maraschi** <luca.maraschi@gmail.com> (he/him) +* [maclover7](https://github.com/maclover7) - +**Jon Moss** <me@jonathanmoss.me> (he/him) * [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <mattloring@google.com> * [mcollina](https://github.com/mcollina) - @@ -576,16 +584,16 @@ Previous releases may also have been signed with one of the following GPG keys: * **Timothy J Fontaine** <tjfontaine@gmail.com> `7937DFD2AB06298B2293C3187D33FF9D0246406D` -### Working Groups +## Contributing to Node.js -Information on the current Node.js Working Groups can be found in the -[TSC repository](https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md). +* [Contributing to the project][] +* [Working Groups][] [npm]: https://www.npmjs.com -[Website]: https://nodejs.org/en/ +[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md [Contributing to the project]: CONTRIBUTING.md [Node.js Help]: https://github.com/nodejs/help -[Node.js Moderation Policy]: https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md -[#node.js on chat.freenode.net]: https://webchat.freenode.net?channels=node.js&uio=d4 -[#node-dev on chat.freenode.net]: https://webchat.freenode.net?channels=node-dev&uio=d4 -[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md +[Node.js Website]: https://nodejs.org/en/ +[Questions tagged 'node.js' on StackOverflow]: https://stackoverflow.com/questions/tagged/node.js +[Working Groups]: https://github.com/nodejs/TSC/blob/master/WORKING_GROUPS.md +[#node.js channel on chat.freenode.net]: https://webchat.freenode.net?channels=node.js&uio=d4 diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index bc55e44c1a18d7..b4fc5bc1deb3cc 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -33,7 +33,7 @@ function main(conf) { throw new Error('invalid type'); } - makeFile(runTest); + makeFile(); } function runTest() { diff --git a/common.gypi b/common.gypi index 50fd3d1bd866b1..a0c00fee528fe5 100644 --- a/common.gypi +++ b/common.gypi @@ -204,8 +204,6 @@ 'DisableSpecificWarnings': ['4267'], 'WarnAsError': 'false', }, - 'VCLibrarianTool': { - }, 'VCLinkerTool': { 'conditions': [ ['target_arch=="ia32"', { diff --git a/configure b/configure index fac604a01ed251..10d46159a83923 100755 --- a/configure +++ b/configure @@ -35,21 +35,23 @@ import subprocess import shutil import string +# If not run from node/, cd to node/. +os.chdir(os.path.dirname(__file__) or '.') + # gcc and g++ as defaults matches what GYP's Makefile generator does, # except on OS X. CC = os.environ.get('CC', 'cc' if sys.platform == 'darwin' else 'gcc') CXX = os.environ.get('CXX', 'c++' if sys.platform == 'darwin' else 'g++') -root_dir = os.path.dirname(__file__) -sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp', 'pylib')) +sys.path.insert(0, os.path.join('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')) +sys.path.insert(0, os.path.join('tools', 'configure.d')) import nodedownload # imports in tools/ -sys.path.insert(0, os.path.join(root_dir, 'tools')) +sys.path.insert(0, 'tools') import getmoduleversion from gyp_node import run_gyp @@ -142,17 +144,17 @@ parser.add_option("--partly-static", parser.add_option("--enable-vtune-profiling", action="store_true", dest="enable_vtune_profiling", - help="Enable profiling support for Intel VTune profiler to profile" + help="Enable profiling support for Intel VTune profiler to profile " "JavaScript code executed in nodejs. This feature is only available " - "for x32, x86 and x64 architectures.") + "for x32, x86, and x64 architectures.") parser.add_option("--link-module", action="append", dest="linked_module", - help="Path to a JS file to be bundled in the binary as a builtin." - "This module will be referenced by path without extension." - "e.g. /root/x/y.js will be referenced via require('root/x/y')." + help="Path to a JS file to be bundled in the binary as a builtin. " + "This module will be referenced by path without extension; " + "e.g. /root/x/y.js will be referenced via require('root/x/y'). " "Can be used multiple times") parser.add_option("--openssl-no-asm", @@ -299,6 +301,11 @@ parser.add_option('--enable-d8', dest='enable_d8', help=optparse.SUPPRESS_HELP) # Unsupported, undocumented. +parser.add_option('--enable-trace-maps', + action='store_true', + dest='trace_maps', + help='Enable the --trace-maps flag in V8 (use at your own risk)') + parser.add_option('--v8-options', action='store', dest='v8_options', @@ -398,7 +405,7 @@ intl_optgroup.add_option('--download', intl_optgroup.add_option('--download-path', action='store', dest='download_path', - default=os.path.join(root_dir, 'deps'), + default='deps', help='Download directory [default: %default]') parser.add_option_group(intl_optgroup) @@ -836,7 +843,7 @@ def configure_node(o): o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling) elif options.enable_vtune_profiling: raise Exception( - 'The VTune profiler for JavaScript is only supported on x32, x86 and x64 ' + 'The VTune profiler for JavaScript is only supported on x32, x86, and x64 ' 'architectures.') else: o['variables']['node_enable_v8_vtunejit'] = 'false' @@ -964,6 +971,7 @@ def configure_v8(o): o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds. o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true' + o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0 o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform) o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8) o['variables']['force_dynamic_crt'] = 1 if options.shared else 0 @@ -985,7 +993,7 @@ def configure_openssl(o): o['defines'] += ['NODE_WITHOUT_NODE_OPTIONS'] if options.openssl_fips: o['variables']['openssl_fips'] = options.openssl_fips - fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips') + fips_dir = os.path.join('deps', 'openssl', 'fips') fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld')) # LINK is for Makefiles, LD/LDXX is for ninja o['make_fips_settings'] = [ @@ -1030,7 +1038,7 @@ def configure_static(o): def write(filename, data): - filename = os.path.join(root_dir, filename) + filename = filename print('creating %s' % filename) f = open(filename, 'w+') f.write(data) @@ -1152,7 +1160,7 @@ def configure_intl(o): return # this is just the 'deps' dir. Used for unpacking. - icu_parent_path = os.path.join(root_dir, 'deps') + icu_parent_path = 'deps' # The full path to the ICU source directory. Should not include './'. icu_full_path = 'deps/icu' diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index f5e1bcbd30bd20..8dfca512ad4a27 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 1 #define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 109 +#define V8_PATCH_LEVEL 111 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/heap/spaces.cc b/deps/v8/src/heap/spaces.cc index 8a7fd1a14fa608..e51c27b56ff447 100644 --- a/deps/v8/src/heap/spaces.cc +++ b/deps/v8/src/heap/spaces.cc @@ -2382,7 +2382,6 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { int new_node_size = 0; FreeSpace* new_node = FindNodeFor(size_in_bytes, &new_node_size); if (new_node == nullptr) return nullptr; - owner_->AllocationStep(new_node->address(), size_in_bytes); int bytes_left = new_node_size - size_in_bytes; DCHECK(bytes_left >= 0); @@ -2428,6 +2427,8 @@ HeapObject* FreeList::Allocate(int size_in_bytes) { new_node->address() + new_node_size); } + owner_->AllocationStep(new_node->address(), size_in_bytes); + return new_node; } diff --git a/deps/v8/src/profiler/sampling-heap-profiler.cc b/deps/v8/src/profiler/sampling-heap-profiler.cc index a32cae3ef9c926..282482e47ff46f 100644 --- a/deps/v8/src/profiler/sampling-heap-profiler.cc +++ b/deps/v8/src/profiler/sampling-heap-profiler.cc @@ -109,6 +109,7 @@ void SamplingHeapProfiler::SampleObject(Address soon_object, size_t size) { Sample* sample = new Sample(size, node, loc, this); samples_.insert(sample); sample->global.SetWeak(sample, OnWeakCallback, WeakCallbackType::kParameter); + sample->global.MarkIndependent(); } void SamplingHeapProfiler::OnWeakCallback( diff --git a/doc/api/assert.md b/doc/api/assert.md index 58d44272705cb5..779c6cd205ec91 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -298,13 +298,13 @@ assert.notDeepEqual(obj1, obj1); // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } assert.notDeepEqual(obj1, obj2); -// OK, obj1 and obj2 are not deeply equal +// OK: obj1 and obj2 are not deeply equal assert.notDeepEqual(obj1, obj3); // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } assert.notDeepEqual(obj1, obj4); -// OK, obj1 and obj4 are not deeply equal +// OK: obj1 and obj4 are not deeply equal ``` If the values are deeply equal, an `AssertionError` is thrown with a `message` diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 442ed6204e3fab..d8948cae9cfc8a 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -4,7 +4,7 @@ > Stability: 2 - Stable -Prior to the introduction of [`TypedArray`] in ECMAScript 2015 (ES6), the +Prior to the introduction of [`TypedArray`] in [`ECMAScript 2015`] (ES6), the JavaScript language had no mechanism for reading or manipulating streams of binary data. The `Buffer` class was introduced as part of the Node.js API to make it possible to interact with octet streams in the context of things @@ -63,8 +63,8 @@ differently based on what arguments are provided: a fast-but-uninitialized `Buffer` versus creating a slower-but-safer `Buffer`. * Passing a string, array, or `Buffer` as the first argument copies the passed object's data into the `Buffer`. -* Passing an [`ArrayBuffer`] returns a `Buffer` that shares allocated memory with - the given [`ArrayBuffer`]. +* Passing an [`ArrayBuffer`] or a [`SharedArrayBuffer`] returns a `Buffer` that + shares allocated memory with the given array buffer. Because the behavior of `new Buffer()` changes significantly based on the type of value passed as the first argument, applications that do not properly @@ -192,7 +192,7 @@ encoding may incorrectly decode the characters. ## Buffers and TypedArray `Buffer` instances are also [`Uint8Array`] instances. However, there are subtle -incompatibilities with the TypedArray specification in ECMAScript 2015. +incompatibilities with the TypedArray specification in [`ECMAScript 2015`]. For example, while [`ArrayBuffer#slice()`] creates a copy of the slice, the implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the existing `Buffer` without copying, making [`Buffer#slice()`][`buf.slice()`] far @@ -272,7 +272,7 @@ function: ## Buffers and ES6 iteration -`Buffer` instances can be iterated over using the ECMAScript 2015 (ES6) `for..of` +`Buffer` instances can be iterated over using the [`ECMAScript 2015`] (ES6) `for..of` syntax. Example: @@ -350,16 +350,16 @@ deprecated: v6.0.0 > [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`] > instead. -* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a - [`TypedArray`]. +* `arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An [`ArrayBuffer`], + [`SharedArrayBuffer`] or the `.buffer` property of a [`TypedArray`]. * `byteOffset` {integer} Index of first byte to expose. **Default:** `0` * `length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.length - byteOffset` -This creates a view of the [`ArrayBuffer`] without copying the underlying -memory. For example, when passed a reference to the `.buffer` property of a -[`TypedArray`] instance, the newly created `Buffer` will share the same -allocated memory as the [`TypedArray`]. +This creates a view of the [`ArrayBuffer`] or [`SharedArrayBuffer`] without +copying the underlying memory. For example, when passed a reference to the +`.buffer` property of a [`TypedArray`] instance, the newly created `Buffer` will +share the same allocated memory as the [`TypedArray`]. The optional `byteOffset` and `length` arguments specify a memory range within the `arrayBuffer` that will be shared by the `Buffer`. @@ -611,8 +611,8 @@ A `TypeError` will be thrown if `size` is not a number. added: v0.1.90 --> -* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer} A value to - calculate the length of. +* `string` {string|Buffer|TypedArray|DataView|ArrayBuffer|SharedArrayBuffer} A + value to calculate the length of. * `encoding` {string} If `string` is a string, this is its encoding. **Default:** `'utf8'` * Returns: {integer} The number of bytes contained within `string`. @@ -635,8 +635,8 @@ console.log(`${str}: ${str.length} characters, ` + `${Buffer.byteLength(str, 'utf8')} bytes`); ``` -When `string` is a `Buffer`/[`DataView`]/[`TypedArray`]/[`ArrayBuffer`], the -actual byte length is returned. +When `string` is a `Buffer`/[`DataView`]/[`TypedArray`]/[`ArrayBuffer`]/ +[`SharedArrayBuffer`], the actual byte length is returned. Otherwise, converts to `String` and returns the byte length of string. @@ -733,8 +733,8 @@ A `TypeError` will be thrown if `array` is not an `Array`. added: v5.10.0 --> -* `arrayBuffer` {ArrayBuffer} An [`ArrayBuffer`] or the `.buffer` property of a - [`TypedArray`]. +* `arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An [`ArrayBuffer`], + [`SharedArrayBuffer`], or the `.buffer` property of a [`TypedArray`]. * `byteOffset` {integer} Index of first byte to expose. **Default:** `0` * `length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.length - byteOffset` @@ -778,7 +778,8 @@ const buf = Buffer.from(ab, 0, 2); console.log(buf.length); ``` -A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`]. +A `TypeError` will be thrown if `arrayBuffer` is not an [`ArrayBuffer`] or a +[`SharedArrayBuffer`]. ### Class Method: Buffer.from(buffer) -Node.js has a simple module loading system. In Node.js, files and modules -are in one-to-one correspondence (each file is treated as a separate module). - -As an example, consider a file named `foo.js`: +In the Node.js module system, each file is treated as a separate module. For +example, consider a file named `foo.js`: ```js const circle = require('./circle.js'); @@ -45,9 +43,9 @@ instead of `exports`. Below, `bar.js` makes use of the `square` module, which exports a constructor: ```js -const square = require('./square.js'); -const mySquare = square(2); -console.log(`The area of my square is ${mySquare.area()}`); +const Square = require('./square.js'); +const mySquare = new Square(2); +console.log(`The area of mySquare is ${mySquare.area()}`); ``` The `square` module is defined in `square.js`: diff --git a/doc/api/net.md b/doc/api/net.md index 3308fc27f0edef..5c9c3dea6051b4 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -694,7 +694,7 @@ or [`destroy()`][] the socket. If `timeout` is 0, then the existing idle timeout is disabled. -The optional `callback` parameter will be added as a one time listener for the +The optional `callback` parameter will be added as a one-time listener for the [`'timeout'`][] event. ### socket.unref() diff --git a/doc/api/repl.md b/doc/api/repl.md index 3cac76497a0a47..69f709a1be874b 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -386,7 +386,7 @@ added: v0.1.91 * `output` {Writable} The Writable stream to which REPL output will be written. Defaults to `process.stdout`. * `terminal` {boolean} If `true`, specifies that the `output` should be - treated as a a TTY terminal, and have ANSI/VT100 escape codes written to it. + treated as a TTY terminal, and have ANSI/VT100 escape codes written to it. Defaults to checking the value of the `isTTY` property on the `output` stream upon instantiation. * `eval` {Function} The function to be used when evaluating each given line diff --git a/doc/api/stream.md b/doc/api/stream.md index 385cb2d8b4d2be..4e7e897b3dd163 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -725,7 +725,7 @@ available data. In the latter case, [`stream.read()`][stream-read] will return const fs = require('fs'); const rr = fs.createReadStream('foo.txt'); rr.on('readable', () => { - console.log('readable:', rr.read()); + console.log(`readable: ${rr.read()}`); }); rr.on('end', () => { console.log('end'); diff --git a/doc/api/tls.md b/doc/api/tls.md index 51578cab4003fd..d604ddcdadfec9 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -808,8 +808,9 @@ added: v0.11.3 * `servername`: {string} Server name for the SNI (Server Name Indication) TLS extension. * `checkServerIdentity(servername, cert)` {Function} A callback function - to be used when checking the server's hostname against the certificate. - This should throw an error if verification fails. The method should return +    to be used (instead of the builtin `tls.checkServerIdentity()` function) + when checking the server's hostname against the certificate. + This should return an {Error} if verification fails. The method should return `undefined` if the `servername` and `cert` are verified. * `session` {Buffer} A `Buffer` instance, containing TLS session. * `minDHSize` {number} Minimum size of the DH parameter in bits to accept a diff --git a/doc/api/url.md b/doc/api/url.md index 6d0911da81d899..efb0a8103ccafe 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -145,7 +145,7 @@ added: v0.1.25 The `url.format()` method returns a formatted URL string derived from `urlObject`. -If `urlObject` is not an object or a string, `url.parse()` will throw a +If `urlObject` is not an object or a string, `url.format()` will throw a [`TypeError`][]. The formatting process operates as follows: diff --git a/doc/api/vm.md b/doc/api/vm.md index 408a2f4fdfbebb..8c196f1d1a682f 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -458,7 +458,7 @@ to the `http` module passed to it. For instance: const vm = require('vm'); const code = -`(function(require) { +`((require) => { const http = require('http'); diff --git a/doc/changelogs/CHANGELOG_IOJS.md b/doc/changelogs/CHANGELOG_IOJS.md index a06e0adb5d9716..9e2e61d7f41b85 100644 --- a/doc/changelogs/CHANGELOG_IOJS.md +++ b/doc/changelogs/CHANGELOG_IOJS.md @@ -2027,7 +2027,7 @@ will be removed at a later point. (Roman Reiss) [#1363](https://github.com/nodej ### Notable changes -* **tls**: A typo introduced in the TLSWrap changes in [#840](https://github.com/nodejs/node/pull/840) only encountered as a bug on Windows was not caught by the io.js CI system due to problems with the Windows build script and the Windows CI slave configuration, see Known Issues below. Fixed in [#994](https://github.com/nodejs/node/pull/994) & [#1004](https://github.com/nodejs/node/pull/1004). (Fedor Indutny) +* **tls**: A typo introduced in the TLSWrap changes in [#840](https://github.com/nodejs/node/pull/840) only encountered as a bug on Windows was not caught by the io.js CI system due to problems with the Windows build script and the Windows CI configuration, see Known Issues below. Fixed in [#994](https://github.com/nodejs/node/pull/994) & [#1004](https://github.com/nodejs/node/pull/1004). (Fedor Indutny) * **npm**: Upgrade npm to 2.6.1. See [npm CHANGELOG.md](https://github.com/npm/npm/blob/master/CHANGELOG.md#v260-2015-02-12) for details. Summary: * [`8b98f0e`](https://github.com/npm/npm/commit/8b98f0e709d77a8616c944aebd48ab726f726f76) [#4471](https://github.com/npm/npm/issues/4471) `npm outdated` (and only `npm @@ -2549,7 +2549,7 @@ _Note: version **1.4.0** was tagged and built but not released. A libuv bug was ## 2015-01-14, Version 1.0.1, @rvagg -Rebuild due to stale build slave git reflogs for 1.0.0 release +Rebuild due to stale build worker git reflogs for 1.0.0 release * doc: improve write style consistency (Rui Marinho) * win,msi: correct doc website link (Bert Belder) diff --git a/doc/changelogs/CHANGELOG_V6.md b/doc/changelogs/CHANGELOG_V6.md index dffe344620feee..5945bcf6d3e4db 100644 --- a/doc/changelogs/CHANGELOG_V6.md +++ b/doc/changelogs/CHANGELOG_V6.md @@ -7,6 +7,7 @@ +6.12.3
6.12.2
6.12.1
6.12.0
@@ -57,6 +58,135 @@ [Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and will be supported actively until April 2018 and maintained until April 2019. + +## 2018-01-02, Version 6.12.3 'Boron' (LTS), @MylesBorins + +This LTS release comes with 115 commits. This includes 52 which are test related, +40 which are doc related, 12 which are build / tool related and 2 commits which updating a dependency. + +### Notable Changes + +* **build**: + - configure can now be run from any directory (Gibson Fahnestock) [#17321](https://github.com/nodejs/node/pull/17321) + +### Commits + +* [[`b1b975370f`](https://github.com/nodejs/node/commit/b1b975370f)] - **benchmark,path**: remove unused variables (薛定谔的猫) [#15789](https://github.com/nodejs/node/pull/15789) +* [[`ac6f345f70`](https://github.com/nodejs/node/commit/ac6f345f70)] - **build**: allow running configure from any directory (Gibson Fahnestock) [#17321](https://github.com/nodejs/node/pull/17321) +* [[`017492eca2`](https://github.com/nodejs/node/commit/017492eca2)] - **build**: add serial commas to messages in configure script (Rich Trott) [#17464](https://github.com/nodejs/node/pull/17464) +* [[`ad9a8578ee`](https://github.com/nodejs/node/commit/ad9a8578ee)] - **build**: fix test-v8 target (Michaël Zasso) [#17269](https://github.com/nodejs/node/pull/17269) +* [[`9ba35e859f`](https://github.com/nodejs/node/commit/9ba35e859f)] - **build**: remove empty VCLibrarianTool entry (Daniel Bevenius) [#17191](https://github.com/nodejs/node/pull/17191) +* [[`3d22e81d70`](https://github.com/nodejs/node/commit/3d22e81d70)] - **build**: minor corrections to configure descriptions (Daniel Bevenius) [#17094](https://github.com/nodejs/node/pull/17094) +* [[`92f41e553a`](https://github.com/nodejs/node/commit/92f41e553a)] - **build**: allow enabling the --trace-maps flag in V8 (Evan Lucas) [#14018](https://github.com/nodejs/node/pull/14018) +* [[`b563908ff9`](https://github.com/nodejs/node/commit/b563908ff9)] - **crypto**: use SetNull instead of Set (Daniel Bevenius) [#17521](https://github.com/nodejs/node/pull/17521) +* [[`b287b9e64b`](https://github.com/nodejs/node/commit/b287b9e64b)] - **deps**: V8: cherry-pick e8e9c07 from upstream (Ali Ijaz Sheikh) +* [[`9804e7f3bb`](https://github.com/nodejs/node/commit/9804e7f3bb)] - **deps**: V8: cherry-pick 9622696 from upstream (Ali Ijaz Sheikh) +* [[`dcee5edef7`](https://github.com/nodejs/node/commit/dcee5edef7)] - **doc**: simplify and clarify FIPS text in BUILDING.md (Rich Trott) [#17538](https://github.com/nodejs/node/pull/17538) +* [[`f53b4df00e`](https://github.com/nodejs/node/commit/f53b4df00e)] - **doc**: 'constructor' implies use of new keyword (Cameron Moorehead) [#17364](https://github.com/nodejs/node/pull/17364) +* [[`67c526fbb8`](https://github.com/nodejs/node/commit/67c526fbb8)] - **doc**: improve text for Console constructor (Rich Trott) [#17519](https://github.com/nodejs/node/pull/17519) +* [[`013ef22ef8`](https://github.com/nodejs/node/commit/013ef22ef8)] - **doc**: improve readability of COLLABORATOR_GUIDE.md (Rich Trott) [#17519](https://github.com/nodejs/node/pull/17519) +* [[`ee52ce954a`](https://github.com/nodejs/node/commit/ee52ce954a)] - **doc**: mention node-test-pull-request-lite job (Jon Moss) [#17513](https://github.com/nodejs/node/pull/17513) +* [[`a44f0855b4`](https://github.com/nodejs/node/commit/a44f0855b4)] - **doc**: fix typo in repl.md (Rich Trott) [#17502](https://github.com/nodejs/node/pull/17502) +* [[`a15da3bf45`](https://github.com/nodejs/node/commit/a15da3bf45)] - **doc**: fix common typo involving one-time listeners (Rich Trott) [#17502](https://github.com/nodejs/node/pull/17502) +* [[`92d2c9aecb`](https://github.com/nodejs/node/commit/92d2c9aecb)] - **doc**: update AUTHORS list (Michaël Zasso) [#17452](https://github.com/nodejs/node/pull/17452) +* [[`c24fafa881`](https://github.com/nodejs/node/commit/c24fafa881)] - **doc**: edit module introduction (Rich Trott) [#17463](https://github.com/nodejs/node/pull/17463) +* [[`8ca12e2b6e`](https://github.com/nodejs/node/commit/8ca12e2b6e)] - **doc**: standardize preposition usage in fs.md (Rich Trott) [#17463](https://github.com/nodejs/node/pull/17463) +* [[`e8368a12d2`](https://github.com/nodejs/node/commit/e8368a12d2)] - **doc**: improve punctuation in fs.open() text (Rich Trott) [#17463](https://github.com/nodejs/node/pull/17463) +* [[`4d4337d3d3`](https://github.com/nodejs/node/commit/4d4337d3d3)] - **doc**: use colon consistently in assert.md (Rich Trott) [#17463](https://github.com/nodejs/node/pull/17463) +* [[`0fa2f39457`](https://github.com/nodejs/node/commit/0fa2f39457)] - **doc**: improve checkServerIdentity docs (Hannes Magnusson) [#17203](https://github.com/nodejs/node/pull/17203) +* [[`35316dcd10`](https://github.com/nodejs/node/commit/35316dcd10)] - **doc**: add guide to maintaining npm (Myles Borins) [#16541](https://github.com/nodejs/node/pull/16541) +* [[`90ee2ee943`](https://github.com/nodejs/node/commit/90ee2ee943)] - **doc**: clarify fast-track of reversions (Refael Ackermann) [#17332](https://github.com/nodejs/node/pull/17332) +* [[`3eab248a1f`](https://github.com/nodejs/node/commit/3eab248a1f)] - **doc**: Add link for ECMAScript 2015 (smatsu-hl) [#17317](https://github.com/nodejs/node/pull/17317) +* [[`c519287d3d`](https://github.com/nodejs/node/commit/c519287d3d)] - **doc**: replace string with template string (Leko) [#17316](https://github.com/nodejs/node/pull/17316) +* [[`b2236a3804`](https://github.com/nodejs/node/commit/b2236a3804)] - **doc**: replace function with arrow function in vm.md (narirou) [#17307](https://github.com/nodejs/node/pull/17307) +* [[`46dc2416b9`](https://github.com/nodejs/node/commit/46dc2416b9)] - **doc**: fix typo in api doc of url.format(urlObject) (pkovacs) [#17295](https://github.com/nodejs/node/pull/17295) +* [[`b13dab8b4d`](https://github.com/nodejs/node/commit/b13dab8b4d)] - **doc**: add maclover7 to collaborators (Jon Moss) [#17289](https://github.com/nodejs/node/pull/17289) +* [[`ab91fe1686`](https://github.com/nodejs/node/commit/ab91fe1686)] - **doc**: update http URLs to https in README.md (Ronald Eddy Jr) [#17264](https://github.com/nodejs/node/pull/17264) +* [[`23f21a63d8`](https://github.com/nodejs/node/commit/23f21a63d8)] - **doc**: update http URLs to https in GOVERNANCE.md (Ronald Eddy Jr) [#17262](https://github.com/nodejs/node/pull/17262) +* [[`d692f4546c`](https://github.com/nodejs/node/commit/d692f4546c)] - **doc**: update http URLs to https in CONTRIBUTING.md (Ronald Eddy Jr) [#17261](https://github.com/nodejs/node/pull/17261) +* [[`a0bd1c0b81`](https://github.com/nodejs/node/commit/a0bd1c0b81)] - **doc**: add SharedArrayBuffer to Buffer documentation (Thomas den Hollander) [#15489](https://github.com/nodejs/node/pull/15489) +* [[`5f522a18d9`](https://github.com/nodejs/node/commit/5f522a18d9)] - **doc**: use better terminology for build machines (Anna Henningsen) [#17142](https://github.com/nodejs/node/pull/17142) +* [[`3f39e47f6c`](https://github.com/nodejs/node/commit/3f39e47f6c)] - **doc**: update mgol in AUTHORS.txt, add to .mailmap (Michał Gołębiowski-Owczarek) [#17239](https://github.com/nodejs/node/pull/17239) +* [[`80c6384985`](https://github.com/nodejs/node/commit/80c6384985)] - **doc**: update release table in V8 guide (Ali Ijaz Sheikh) [#17136](https://github.com/nodejs/node/pull/17136) +* [[`d4e9a2555d`](https://github.com/nodejs/node/commit/d4e9a2555d)] - **doc**: add guybedford to collaborators (Guy Bedford) [#17197](https://github.com/nodejs/node/pull/17197) +* [[`e232e210f6`](https://github.com/nodejs/node/commit/e232e210f6)] - **doc**: update AUTHORS list (Michaël Zasso) [#16571](https://github.com/nodejs/node/pull/16571) +* [[`ca76c336d1`](https://github.com/nodejs/node/commit/ca76c336d1)] - **doc**: normalize ToC indentation with heading levels in README (Rich Trott) [#17106](https://github.com/nodejs/node/pull/17106) +* [[`1815ca5066`](https://github.com/nodejs/node/commit/1815ca5066)] - **doc**: add Contributing to Node.js to the README ToC (Rich Trott) [#17106](https://github.com/nodejs/node/pull/17106) +* [[`d8f66676e5`](https://github.com/nodejs/node/commit/d8f66676e5)] - **doc**: merge Working Groups with Contributing to Node.js in README (Rich Trott) [#17106](https://github.com/nodejs/node/pull/17106) +* [[`b064c731ff`](https://github.com/nodejs/node/commit/b064c731ff)] - **doc**: remove IRC node-dev link from README (Rich Trott) [#17106](https://github.com/nodejs/node/pull/17106) +* [[`8cae573af1`](https://github.com/nodejs/node/commit/8cae573af1)] - **doc**: add note about using cluster without networking (pimlie) [#17031](https://github.com/nodejs/node/pull/17031) +* [[`b16e6d29f1`](https://github.com/nodejs/node/commit/b16e6d29f1)] - **doc**: explicitly document highWaterMark option (Sebastian Silbermann) [#17049](https://github.com/nodejs/node/pull/17049) +* [[`ccdf4b245a`](https://github.com/nodejs/node/commit/ccdf4b245a)] - **doc**: reorganize collaborator guide (Joyee Cheung) [#17056](https://github.com/nodejs/node/pull/17056) +* [[`d44adf12a9`](https://github.com/nodejs/node/commit/d44adf12a9)] - **doc**: delete unused definition in README.md (Vse Mozhet Byt) [#17108](https://github.com/nodejs/node/pull/17108) +* [[`e03645dd6f`](https://github.com/nodejs/node/commit/e03645dd6f)] - **doc**: add Support section in README (Rich Trott) [#16533](https://github.com/nodejs/node/pull/16533) +* [[`0f94bb9aeb`](https://github.com/nodejs/node/commit/0f94bb9aeb)] - **doc**: add hashseed to collaborators (Yang Guo) +* [[`5cd89c7817`](https://github.com/nodejs/node/commit/5cd89c7817)] - **doc,win**: clarify WSL support (João Reis) [#17008](https://github.com/nodejs/node/pull/17008) +* [[`93ca2f78c6`](https://github.com/nodejs/node/commit/93ca2f78c6)] - **meta**: allow vague objections to be dismissed (James M Snell) [#15233](https://github.com/nodejs/node/pull/15233) +* [[`a12e16818f`](https://github.com/nodejs/node/commit/a12e16818f)] - **path**: remove obsolete comment (Rich Trott) [#17023](https://github.com/nodejs/node/pull/17023) +* [[`2d74af0184`](https://github.com/nodejs/node/commit/2d74af0184)] - **src**: remove unused include node_crypto_clienthello (Daniel Bevenius) [#17546](https://github.com/nodejs/node/pull/17546) +* [[`6792998f6a`](https://github.com/nodejs/node/commit/6792998f6a)] - **src**: make base64.h self-contained (Daniel Bevenius) [#17177](https://github.com/nodejs/node/pull/17177) +* [[`84a8861b62`](https://github.com/nodejs/node/commit/84a8861b62)] - **src**: remove unprofessional slang in assertions (Alexey Orlenko) [#17166](https://github.com/nodejs/node/pull/17166) +* [[`f11acca80c`](https://github.com/nodejs/node/commit/f11acca80c)] - **src**: fix size of CounterSet (Witthawat Piwawatthanapanit) [#16984](https://github.com/nodejs/node/pull/16984) +* [[`a528d573ce`](https://github.com/nodejs/node/commit/a528d573ce)] - **test**: remove hidden use of common.PORT in parallel tests (Rich Trott) [#17466](https://github.com/nodejs/node/pull/17466) +* [[`dbf5ddbc97`](https://github.com/nodejs/node/commit/dbf5ddbc97)] - **test**: refactor test-child-process-pass-fd (Rich Trott) [#17596](https://github.com/nodejs/node/pull/17596) +* [[`a50366fbf7`](https://github.com/nodejs/node/commit/a50366fbf7)] - **test**: improve assert messages in repl-reset-event (Adri Van Houdt) [#16836](https://github.com/nodejs/node/pull/16836) +* [[`bd4b97fe3d`](https://github.com/nodejs/node/commit/bd4b97fe3d)] - **test**: update test-http-should-keep-alive to use countdown (TomerOmri) [#17505](https://github.com/nodejs/node/pull/17505) +* [[`23edd08b00`](https://github.com/nodejs/node/commit/23edd08b00)] - **test**: use Countdown in http test (idandagan1) [#17506](https://github.com/nodejs/node/pull/17506) +* [[`e9cacee677`](https://github.com/nodejs/node/commit/e9cacee677)] - **test**: use Countdown in http-response-statuscode (Mandeep Singh) [#17327](https://github.com/nodejs/node/pull/17327) +* [[`68dabce07a`](https://github.com/nodejs/node/commit/68dabce07a)] - **test**: use Countdown in test-http-set-cookies (Shilo Mangam) [#17504](https://github.com/nodejs/node/pull/17504) +* [[`d4d3f50f9d`](https://github.com/nodejs/node/commit/d4d3f50f9d)] - **test**: Use common.mustCall in http test (sreepurnajasti) [#17487](https://github.com/nodejs/node/pull/17487) +* [[`6e7ace2dcf`](https://github.com/nodejs/node/commit/6e7ace2dcf)] - **test**: replace fs.accessSync with fs.existsSync (Leko) [#17446](https://github.com/nodejs/node/pull/17446) +* [[`3cf8f98c3e`](https://github.com/nodejs/node/commit/3cf8f98c3e)] - **test**: add common.crashOnUnhandledRejection() (IHsuan) [#17247](https://github.com/nodejs/node/pull/17247) +* [[`d1d547d2ab`](https://github.com/nodejs/node/commit/d1d547d2ab)] - **test**: update test-http-request-dont-override-options to use common.mustCall (Mithun Sasidharan) [#17438](https://github.com/nodejs/node/pull/17438) +* [[`f9adf51744`](https://github.com/nodejs/node/commit/f9adf51744)] - **test**: use common.mustCall in test-http-malformed-request (Mithun Sasidharan) [#17439](https://github.com/nodejs/node/pull/17439) +* [[`8fc196905d`](https://github.com/nodejs/node/commit/8fc196905d)] - **test**: use Countdown in http test (Mithun Sasidharan) [#17436](https://github.com/nodejs/node/pull/17436) +* [[`47e5fd940e`](https://github.com/nodejs/node/commit/47e5fd940e)] - **test**: update test-http-response-multiheaders to use countdown (hmammedzadeh) [#17419](https://github.com/nodejs/node/pull/17419) +* [[`660e6dea89`](https://github.com/nodejs/node/commit/660e6dea89)] - **test**: update test-http-upgrade-client to use countdown (Mithun Sasidharan) [#17339](https://github.com/nodejs/node/pull/17339) +* [[`8f997c0117`](https://github.com/nodejs/node/commit/8f997c0117)] - **test**: update test-http-status-reason-invalid-chars to use countdown (Mithun Sasidharan) [#17342](https://github.com/nodejs/node/pull/17342) +* [[`42454a5c34`](https://github.com/nodejs/node/commit/42454a5c34)] - **test**: refactored test-http-allow-req-after-204-res to countdown (Mithun Sasidharan) [#17211](https://github.com/nodejs/node/pull/17211) +* [[`3ee4c1e149`](https://github.com/nodejs/node/commit/3ee4c1e149)] - **test**: update test/parallel/test-http-pipe-fs.js to use countdown (ChungNgoops) [#17346](https://github.com/nodejs/node/pull/17346) +* [[`8908cd6cc1`](https://github.com/nodejs/node/commit/8908cd6cc1)] - **test**: refactored test-http-response-splitting to use countdown (Mithun Sasidharan) [#17348](https://github.com/nodejs/node/pull/17348) +* [[`4f3a165827`](https://github.com/nodejs/node/commit/4f3a165827)] - **test**: replace function with ES6 arrow function (Junichi Kajiwara) [#17306](https://github.com/nodejs/node/pull/17306) +* [[`3a0cb8fcae`](https://github.com/nodejs/node/commit/3a0cb8fcae)] - **test**: refactored http test to use countdown (Mithun Sasidharan) [#17241](https://github.com/nodejs/node/pull/17241) +* [[`f3c1158f57`](https://github.com/nodejs/node/commit/f3c1158f57)] - **test**: Update test-http-parser-free to use countdown timer (Mandeep Singh) [#17322](https://github.com/nodejs/node/pull/17322) +* [[`956198f30d`](https://github.com/nodejs/node/commit/956198f30d)] - **test**: Update test-http-client-agent to use countdown timer (Mandeep Singh) [#17325](https://github.com/nodejs/node/pull/17325) +* [[`35cc1b3fcc`](https://github.com/nodejs/node/commit/35cc1b3fcc)] - **test**: fix isNAN-\>Number.isNAN (yuza yuko) [#17309](https://github.com/nodejs/node/pull/17309) +* [[`32ebcf7fd0`](https://github.com/nodejs/node/commit/32ebcf7fd0)] - **test**: make use of Number.isNaN to test-readfloat.js (Hiromu Yoshiwara) [#17310](https://github.com/nodejs/node/pull/17310) +* [[`1cd4076a4e`](https://github.com/nodejs/node/commit/1cd4076a4e)] - **test**: replace function with arrow function (spring_raining) [#17312](https://github.com/nodejs/node/pull/17312) +* [[`0ef4f78ae0`](https://github.com/nodejs/node/commit/0ef4f78ae0)] - **test**: replace function with arrow function (Hiroaki KARASAWA) [#17308](https://github.com/nodejs/node/pull/17308) +* [[`c0c366634d`](https://github.com/nodejs/node/commit/c0c366634d)] - **test**: use arrow function (koooge) [#17318](https://github.com/nodejs/node/pull/17318) +* [[`8098a6ed0e`](https://github.com/nodejs/node/commit/8098a6ed0e)] - **test**: use Number.isNaN() (MURAKAMI Masahiko) [#17319](https://github.com/nodejs/node/pull/17319) +* [[`bdbcdebb65`](https://github.com/nodejs/node/commit/bdbcdebb65)] - **test**: add test of stream Transform (Yoshiya Hinosawa) [#17303](https://github.com/nodejs/node/pull/17303) +* [[`75ad37c854`](https://github.com/nodejs/node/commit/75ad37c854)] - **test**: use common.crashOnUnhandledRejection (Kcin1993) [#17235](https://github.com/nodejs/node/pull/17235) +* [[`b63f51aa7f`](https://github.com/nodejs/node/commit/b63f51aa7f)] - **test**: use common.crashOnUnhandledRejection (zhengyuanjie) [#17215](https://github.com/nodejs/node/pull/17215) +* [[`797e33b602`](https://github.com/nodejs/node/commit/797e33b602)] - **test**: use common.crashOnUnhandledRejection (Jason Chung) [#17233](https://github.com/nodejs/node/pull/17233) +* [[`699659e5df`](https://github.com/nodejs/node/commit/699659e5df)] - **test**: use common.crashOnUnhandledRejection() (sorarize@gmail.com) [#17232](https://github.com/nodejs/node/pull/17232) +* [[`89f1b6c041`](https://github.com/nodejs/node/commit/89f1b6c041)] - **test**: add common.crashOnHandleRejection (jackyen) [#17225](https://github.com/nodejs/node/pull/17225) +* [[`7cbdeefc7e`](https://github.com/nodejs/node/commit/7cbdeefc7e)] - **test**: remove unlink function which is needless (buji) [#17119](https://github.com/nodejs/node/pull/17119) +* [[`7c57ab76ec`](https://github.com/nodejs/node/commit/7c57ab76ec)] - **test**: dont need to remove nonexistent directory (buji) [#17119](https://github.com/nodejs/node/pull/17119) +* [[`71671df00e`](https://github.com/nodejs/node/commit/71671df00e)] - **test**: fix linting error (James M Snell) [#17251](https://github.com/nodejs/node/pull/17251) +* [[`6620e761d7`](https://github.com/nodejs/node/commit/6620e761d7)] - **test**: use crashOnUnhandledRejection (Roth Peng) [#17226](https://github.com/nodejs/node/pull/17226) +* [[`d4a5499360`](https://github.com/nodejs/node/commit/d4a5499360)] - **test**: use common.crashOnUnhandledRejection (esbb48) [#17218](https://github.com/nodejs/node/pull/17218) +* [[`353e66f823`](https://github.com/nodejs/node/commit/353e66f823)] - **test**: use arrow function instead of bind (Lance Ball) [#17202](https://github.com/nodejs/node/pull/17202) +* [[`289ebb19b5`](https://github.com/nodejs/node/commit/289ebb19b5)] - **test**: use crashOnUnhandledRejection (Chiahao Lin) [#17219](https://github.com/nodejs/node/pull/17219) +* [[`e7ca894114`](https://github.com/nodejs/node/commit/e7ca894114)] - **test**: use common.crashOnUnhandledRejection (Whien) [#17214](https://github.com/nodejs/node/pull/17214) +* [[`0963c75c8e`](https://github.com/nodejs/node/commit/0963c75c8e)] - **test**: clean up inappropriate language (Gus Caplan) [#17170](https://github.com/nodejs/node/pull/17170) +* [[`5d488ee13f`](https://github.com/nodejs/node/commit/5d488ee13f)] - **test**: wrap callback in common.mustCall (suman-mitra) [#17173](https://github.com/nodejs/node/pull/17173) +* [[`fd36b27949`](https://github.com/nodejs/node/commit/fd36b27949)] - **test**: remove unused parameter in test-next-tick-error-spin.js (Francois KY) [#17185](https://github.com/nodejs/node/pull/17185) +* [[`43e4669467`](https://github.com/nodejs/node/commit/43e4669467)] - **test**: remove unused parameter (Fran Herrero) [#17193](https://github.com/nodejs/node/pull/17193) +* [[`4eb1b58481`](https://github.com/nodejs/node/commit/4eb1b58481)] - **test**: remove unused variable (Guillaume Flandre) [#17187](https://github.com/nodejs/node/pull/17187) +* [[`39cd0a8abc`](https://github.com/nodejs/node/commit/39cd0a8abc)] - **test**: utilize common.mustCall() on child exit (sreepurnajasti) [#16996](https://github.com/nodejs/node/pull/16996) +* [[`fe2188620d`](https://github.com/nodejs/node/commit/fe2188620d)] - **test**: use arrow functions instead of bind (Tobias Nießen) [#17070](https://github.com/nodejs/node/pull/17070) +* [[`92daa2d2d3`](https://github.com/nodejs/node/commit/92daa2d2d3)] - **test**: make REPL test pass in coverage mode (Anna Henningsen) [#17082](https://github.com/nodejs/node/pull/17082) +* [[`c18a450e9d`](https://github.com/nodejs/node/commit/c18a450e9d)] - **test**: add coverage to tty module (cjihrig) [#16959](https://github.com/nodejs/node/pull/16959) +* [[`ad0d878772`](https://github.com/nodejs/node/commit/ad0d878772)] - **tools**: simplify buffer-constructor rule (cjihrig) [#17572](https://github.com/nodejs/node/pull/17572) +* [[`5383422672`](https://github.com/nodejs/node/commit/5383422672)] - **tools**: simplify prefer-assert-methods rule (cjihrig) [#17572](https://github.com/nodejs/node/pull/17572) +* [[`3e70ee84fb`](https://github.com/nodejs/node/commit/3e70ee84fb)] - **tools**: simplify prefer-common-mustnotcall rule (cjihrig) [#17572](https://github.com/nodejs/node/pull/17572) +* [[`afd4d9e348`](https://github.com/nodejs/node/commit/afd4d9e348)] - **tools**: add Boxstarter script (Bartosz Sosnowski) [#17046](https://github.com/nodejs/node/pull/17046) +* [[`466e94a6c1`](https://github.com/nodejs/node/commit/466e94a6c1)] - **tools**: avoid using process.cwd in tools/lint-js (Tobias Nießen) [#17121](https://github.com/nodejs/node/pull/17121) +* [[`dcf7646725`](https://github.com/nodejs/node/commit/dcf7646725)] - **tools**: fail tests if malformed status file (Rich Trott) [#16703](https://github.com/nodejs/node/pull/16703) +* [[`d176073511`](https://github.com/nodejs/node/commit/d176073511)] - **tty**: refactor exports (cjihrig) [#16959](https://github.com/nodejs/node/pull/16959) + ## 2017-12-08, Version 6.12.2 'Boron' (LTS), @MylesBorins diff --git a/doc/guides/maintaining-V8.md b/doc/guides/maintaining-V8.md index 509686e7ef0e10..1e525809a04abc 100644 --- a/doc/guides/maintaining-V8.md +++ b/doc/guides/maintaining-V8.md @@ -59,11 +59,11 @@ includes the following branches1: - Node.js v4.x + Node.js 4.x 2015-10-01 - 2018-04-01 + April 2018 4.5 @@ -73,11 +73,11 @@ includes the following branches1: - Node.js v6.x + Node.js 6.x 2016-04-01 - 2019-04-01 + April 2019 5.1 @@ -87,17 +87,31 @@ includes the following branches1: - Node.js v7.x + Node.js 8.x - 2016-10-01 + 2017-05-30 - 2017-04-01 + December 2019 - 5.5 + 6.1 (soon to be 6.2) - 2016-12-06 + 2017-10-17 (6.2) - 2017-01-24 + ~2017-12-05 (6.2) + + + + Node.js 9.x + + 2017-10-31 + + April 2018 + + 6.2 + + 2017-10-17 + + ~2017-12-05 @@ -107,11 +121,11 @@ includes the following branches1: N/A - 5.6 + 6.2 - 2017-01-31 + 2017-10-17 - 2017-03-07 + ~2017-12-05 diff --git a/doc/guides/maintaining-npm.md b/doc/guides/maintaining-npm.md new file mode 100644 index 00000000000000..af9d3af04f2360 --- /dev/null +++ b/doc/guides/maintaining-npm.md @@ -0,0 +1,68 @@ +# Maintaining npm in Node.js + +## Step 1: Clone npm + +```console +$ git clone https://github.com/npm/npm.git +$ cd npm +``` + +or if you already have npm cloned make sure the repo is up to date + +```console +$ git remote update -p +$ git reset --hard origin latest +``` + +## Step 2: Build release + +```console +$ git checkout vX.Y.Z +$ make release +``` + +Note: please run `npm dist-tag ls npm` and make sure this is the `latest` **dist-tag**. `latest` on git is usually released as `next` when it's time to downstream + +## Step 3: Remove old npm + +```console +$ cd /path/to/node +$ git remote update -p +$ git checkout -b npm-x.y.z origin/master +$ cd deps +$ rm -rf npm +``` + +## Step 4: Extract and commit new npm + +```console +$ tar zxf /path/to/npm/release/npm-x.y.z.tgz +$ git add -A npm +$ git commit -m "deps: upgrade npm to x.y.z" +$ cd .. +``` + +## Step 5: Update licenses + +```console +$ ./configure +$ make -j4 +$ ./tools/license-builder.sh +# The following commands are only necessary if there are changes +$ git add . +$ git commit -m "doc: update npm LICENSE using license-builder.sh" +``` + +Note: please ensure you are only making the updates that are changed by npm. + +## Step 6: Apply Whitespace fix + +```console +$ git rebase --whitespace=fix master +``` + +## Step 7: Test the build + +```console +$ make test-npm +``` diff --git a/doc/releases.md b/doc/releases.md index 35de027e56a480..339ee291508554 100644 --- a/doc/releases.md +++ b/doc/releases.md @@ -22,7 +22,7 @@ The [Node.js build team](https://github.com/nodejs/build) is able to provide thi The _dist_ user on nodejs.org controls the assets available in . is an alias for . -The Jenkins release build slaves upload their artifacts to the web server as the _staging_ user. The _dist_ user has access to move these assets to public access while, for security, the _staging_ user does not. +The Jenkins release build workers upload their artifacts to the web server as the _staging_ user. The _dist_ user has access to move these assets to public access while, for security, the _staging_ user does not. Nightly builds are promoted automatically on the server by a cron task for the _dist_ user. @@ -197,17 +197,17 @@ This is particularly recommended if there has been recent work relating to the m Use **[iojs+release](https://ci-release.nodejs.org/job/iojs+release/)** to produce release artifacts. Enter the commit that you want to build from and select "release" for "disttype". -Artifacts from each slave are uploaded to Jenkins and are available if further testing is required. Use this opportunity particularly to test macOS and Windows installers if there are any concerns. Click through to the individual slaves for a run to find the artifacts. +Artifacts from each worker are uploaded to Jenkins and are available if further testing is required. Use this opportunity particularly to test macOS and Windows installers if there are any concerns. Click through to the individual workers for a run to find the artifacts. -All release slaves should achieve "SUCCESS" (and be green, not red). A release with failures should not be promoted as there are likely problems to be investigated. +All release workers should achieve "SUCCESS" (and be green, not red). A release with failures should not be promoted as there are likely problems to be investigated. You can rebuild the release as many times as you need prior to promoting them if you encounter problems. -If you have an error on Windows and need to start again, be aware that you'll get immediate failure unless you wait up to 2 minutes for the linker to stop from previous jobs. i.e. if a build fails after having started compiling, that slave will still have a linker process that's running for another couple of minutes which will prevent Jenkins from clearing the workspace to start a new one. This isn't a big deal, it's just a hassle because it'll result in another failed build if you start again! +If you have an error on Windows and need to start again, be aware that you'll get immediate failure unless you wait up to 2 minutes for the linker to stop from previous jobs. i.e. if a build fails after having started compiling, that worker will still have a linker process that's running for another couple of minutes which will prevent Jenkins from clearing the workspace to start a new one. This isn't a big deal, it's just a hassle because it'll result in another failed build if you start again! ARMv7 takes the longest to compile. Unfortunately ccache isn't as effective on release builds, I think it's because of the additional macro settings that go in to a release build that nullify previous builds. Also most of the release build machines are separate to the test build machines so they don't get any benefit from ongoing compiles between releases. You can expect 1.5 hours for the ARMv7 builder to complete and you should normally wait for this to finish. It is possible to rush a release out if you want and add additional builds later but we normally provide ARMv7 from initial promotion. -You do not have to wait for the ARMv6 / Raspberry PI builds if they take longer than the others. It is only necessary to have the main Linux (x64 and x86), macOS .pkg and .tar.gz, Windows (x64 and x86) .msi and .exe, source, headers and docs (both produced currently by an macOS slave). **If you promote builds _before_ ARM builds have finished, you must repeat the promotion step for the ARM builds when they are ready**. +You do not have to wait for the ARMv6 / Raspberry PI builds if they take longer than the others. It is only necessary to have the main Linux (x64 and x86), macOS .pkg and .tar.gz, Windows (x64 and x86) .msi and .exe, source, headers and docs (both produced currently by an macOS worker). **If you promote builds _before_ ARM builds have finished, you must repeat the promotion step for the ARM builds when they are ready**. ### 9. Test the Build diff --git a/lib/path.js b/lib/path.js index bbe5f0b5be0716..a121f5bf7e0160 100644 --- a/lib/path.js +++ b/lib/path.js @@ -269,7 +269,6 @@ const win32 = { (code >= 97/*a*/ && code <= 122/*z*/)) { // Possible device root - code = path.charCodeAt(1); if (path.charCodeAt(1) === 58/*:*/) { device = path.slice(0, 2); rootEnd = 2; @@ -391,7 +390,6 @@ const win32 = { (code >= 97/*a*/ && code <= 122/*z*/)) { // Possible device root - code = path.charCodeAt(1); if (path.charCodeAt(1) === 58/*:*/) { device = path.slice(0, 2); rootEnd = 2; @@ -504,7 +502,6 @@ const win32 = { // This means that the user can use join to construct UNC paths from // a server name and a share name; for example: // path.join('//server', 'share') -> '\\\\server\\share\\') - //var firstPart = paths[0]; var needsReplace = true; var slashCount = 0; var code = firstPart.charCodeAt(0); @@ -770,7 +767,6 @@ const win32 = { (code >= 97/*a*/ && code <= 122/*z*/)) { // Possible device root - code = path.charCodeAt(1); if (path.charCodeAt(1) === 58/*:*/) { rootEnd = offset = 2; if (len > 2) { @@ -1038,7 +1034,6 @@ const win32 = { (code >= 97/*a*/ && code <= 122/*z*/)) { // Possible device root - code = path.charCodeAt(1); if (path.charCodeAt(1) === 58/*:*/) { rootEnd = 2; if (len > 2) { diff --git a/lib/tty.js b/lib/tty.js index b9c829066d5f00..17b0acadc10441 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -8,10 +8,9 @@ const inherits = util.inherits; const errnoException = util._errnoException; const readline = require('readline'); - -exports.isatty = function(fd) { +function isatty(fd) { return Number.isInteger(fd) && fd >= 0 && isTTY(fd); -}; +} function ReadStream(fd, options) { @@ -32,8 +31,6 @@ function ReadStream(fd, options) { } inherits(ReadStream, net.Socket); -exports.ReadStream = ReadStream; - ReadStream.prototype.setRawMode = function(flag) { flag = !!flag; this._handle.setRawMode(flag); @@ -64,7 +61,6 @@ function WriteStream(fd) { } } inherits(WriteStream, net.Socket); -exports.WriteStream = WriteStream; WriteStream.prototype.isTTY = true; @@ -105,3 +101,6 @@ WriteStream.prototype.clearScreenDown = function() { WriteStream.prototype.getWindowSize = function() { return [this.columns, this.rows]; }; + + +module.exports = { isatty, ReadStream, WriteStream }; diff --git a/node.gyp b/node.gyp index 345188257998e0..1b17d991ae3244 100644 --- a/node.gyp +++ b/node.gyp @@ -1,6 +1,7 @@ { 'variables': { 'v8_use_snapshot%': 'false', + 'v8_trace_maps%': 0, 'node_use_dtrace%': 'false', 'node_use_lttng%': 'false', 'node_use_etw%': 'false', diff --git a/src/base64.h b/src/base64.h index 92dc565e65eb1c..b4ab030dae842c 100644 --- a/src/base64.h +++ b/src/base64.h @@ -6,6 +6,7 @@ #include "util.h" #include +#include namespace node { //// Base 64 //// diff --git a/src/node_crypto.cc b/src/node_crypto.cc index ba693377a77bc9..af892d4367c5da 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -1290,7 +1290,7 @@ void SecureContext::GetCertificate(const FunctionCallbackInfo& args) { else cert = wrap->issuer_; if (cert == nullptr) - return args.GetReturnValue().Set(Null(env->isolate())); + return args.GetReturnValue().SetNull(); int size = i2d_X509(cert, nullptr); Local buff = Buffer::New(env, size).ToLocalChecked(); diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h index 0b0c8b1712c3ee..ee9cce1848a363 100644 --- a/src/node_crypto_clienthello.h +++ b/src/node_crypto_clienthello.h @@ -3,9 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" - #include // size_t +#include #include // nullptr namespace node { diff --git a/src/node_version.h b/src/node_version.h index da16d06d2fd8b9..86bef618a1bd41 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -8,7 +8,7 @@ #define NODE_VERSION_IS_LTS 1 #define NODE_VERSION_LTS_CODENAME "Boron" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) diff --git a/src/node_win32_perfctr_provider.cc b/src/node_win32_perfctr_provider.cc index ebb299e4c54758..df7812b1f8a6a4 100644 --- a/src/node_win32_perfctr_provider.cc +++ b/src/node_win32_perfctr_provider.cc @@ -159,7 +159,7 @@ void InitPerfCountersWin32() { status = perfctr_setCounterSetInfo(NodeCounterProvider, &NodeCounterSetInfo.CounterSet, - sizeof(NodeCounterSetInfo)); + sizeof(NodeCounterSetInfo.CounterSet)); if (status != ERROR_SUCCESS) { perfctr_stopProvider(NodeCounterProvider); NodeCounterProvider = nullptr; diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 1dabd3e63d9340..12c418fd28438f 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -314,7 +314,7 @@ class ZCtx : public AsyncWrap { } break; default: - CHECK(0 && "wtf?"); + UNREACHABLE(); } // pass any errors back to the main thread to deal with. @@ -525,7 +525,7 @@ class ZCtx : public AsyncWrap { ->AdjustAmountOfExternalAllocatedMemory(kInflateContextSize); break; default: - CHECK(0 && "wtf?"); + UNREACHABLE(); } ctx->dictionary_ = reinterpret_cast(dictionary); diff --git a/test/addons/make-callback-recurse/test.js b/test/addons/make-callback-recurse/test.js index 895769bc33029a..cdddc3cae7e957 100644 --- a/test/addons/make-callback-recurse/test.js +++ b/test/addons/make-callback-recurse/test.js @@ -9,6 +9,7 @@ const makeCallback = binding.makeCallback; // Make sure this is run in the future. const mustCallCheckDomains = common.mustCall(checkDomains); +common.crashOnUnhandledRejection(); // Make sure that using MakeCallback allows the error to propagate. assert.throws(function() { diff --git a/test/common/countdown.js b/test/common/countdown.js index 6a22be0a07eb0b..93bdbbfb16da5d 100644 --- a/test/common/countdown.js +++ b/test/common/countdown.js @@ -17,6 +17,7 @@ class Countdown { assert(this[kLimit] > 0, 'Countdown expired'); if (--this[kLimit] === 0) this[kCallback](); + return this[kLimit]; } get remaining() { diff --git a/test/common/index.js b/test/common/index.js index 148dad20001b04..6ea3d89f0b9a37 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -466,7 +466,7 @@ function _mustCallInner(fn, criteria, field) { exports.hasMultiLocalhost = function hasMultiLocalhost() { const TCP = process.binding('tcp_wrap').TCP; const t = new TCP(); - const ret = t.bind('127.0.0.2', exports.PORT); + const ret = t.bind('127.0.0.2', 0); t.close(); return ret === 0; }; diff --git a/test/inspector/test-inspector-stops-no-file.js b/test/inspector/test-inspector-stops-no-file.js index d0f3a753464096..1df77362c5a778 100644 --- a/test/inspector/test-inspector-stops-no-file.js +++ b/test/inspector/test-inspector-stops-no-file.js @@ -6,7 +6,7 @@ const child = spawn(process.execPath, [ '--inspect', 'no-such-script.js' ], { 'stdio': 'inherit' }); -function signalHandler(value) { +function signalHandler() { child.kill(); process.exit(1); } diff --git a/test/parallel/test-child-process-fork-exec-argv.js b/test/parallel/test-child-process-fork-exec-argv.js index 97d1e21a2f6d7a..e051908b11699d 100644 --- a/test/parallel/test-child-process-fork-exec-argv.js +++ b/test/parallel/test-child-process-fork-exec-argv.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const child_process = require('child_process'); const spawn = child_process.spawn; @@ -22,7 +22,7 @@ if (process.argv[2] === 'fork') { out += chunk; }); - child.on('exit', function() { + child.on('exit', common.mustCall(function() { assert.deepStrictEqual(JSON.parse(out), execArgv); - }); + })); } diff --git a/test/parallel/test-child-process-send-cb.js b/test/parallel/test-child-process-send-cb.js index d65a1abd204a04..daecd722533f57 100644 --- a/test/parallel/test-child-process-send-cb.js +++ b/test/parallel/test-child-process-send-cb.js @@ -4,15 +4,15 @@ const assert = require('assert'); const fork = require('child_process').fork; if (process.argv[2] === 'child') { - process.send('ok', common.mustCall(function(err) { + process.send('ok', common.mustCall((err) => { assert.strictEqual(err, null); })); } else { const child = fork(process.argv[1], ['child']); - child.on('message', common.mustCall(function(message) { + child.on('message', common.mustCall((message) => { assert.strictEqual(message, 'ok'); })); - child.on('exit', common.mustCall(function(exitCode, signalCode) { + child.on('exit', common.mustCall((exitCode, signalCode) => { assert.strictEqual(exitCode, 0); assert.strictEqual(signalCode, null); })); 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 71333bdbd534ab..0880c49868fae0 100644 --- a/test/parallel/test-child-process-stdio-big-write-end.js +++ b/test/parallel/test-child-process-stdio-big-write-end.js @@ -9,7 +9,7 @@ switch (process.argv[2]) { case 'child': return child(); default: - throw new Error('wtf?'); + throw new Error('invalid'); } function parent() { diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js index 57fb8eb59c7f7c..17466841c1b331 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const cluster = require('cluster'); const net = require('net'); @@ -111,9 +111,9 @@ if (cluster.isWorker) { worker.kill(); }); - worker.on('exit', function() { + worker.on('exit', common.mustCall(function() { process.exit(0); - }); + })); }); process.once('exit', function() { diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index eb70640be461b1..8268a39e18e9d7 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -3,54 +3,32 @@ const common = require('../common'); const assert = require('assert'); const fs = require('fs'); -function unlink(pathname) { - try { - fs.rmdirSync(pathname); - } catch (e) { - } -} - common.refreshTmpDir(); { const pathname = `${common.tmpDir}/test1`; - unlink(pathname); - fs.mkdir(pathname, common.mustCall(function(err) { assert.strictEqual(err, null); assert.strictEqual(common.fileExists(pathname), true); })); - - process.on('exit', function() { - unlink(pathname); - }); } { const pathname = `${common.tmpDir}/test2`; - unlink(pathname); - fs.mkdir(pathname, 0o777, common.mustCall(function(err) { assert.strictEqual(err, null); assert.strictEqual(common.fileExists(pathname), true); })); - - process.on('exit', function() { - unlink(pathname); - }); } { const pathname = `${common.tmpDir}/test3`; - unlink(pathname); fs.mkdirSync(pathname); const exists = common.fileExists(pathname); - unlink(pathname); - assert.strictEqual(exists, true); } diff --git a/test/parallel/test-http-agent.js b/test/parallel/test-http-agent.js index cfb37539ede878..5c229d5b86c343 100644 --- a/test/parallel/test-http-agent.js +++ b/test/parallel/test-http-agent.js @@ -1,7 +1,8 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const http = require('http'); +common.crashOnUnhandledRejection(); const server = http.Server(function(req, res) { res.writeHead(200); 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 e2243400fcc5bb..872fa8c16197c9 100644 --- a/test/parallel/test-http-allow-req-after-204-res.js +++ b/test/parallel/test-http-allow-req-after-204-res.js @@ -2,12 +2,12 @@ const common = require('../common'); const http = require('http'); const assert = require('assert'); +const Countdown = require('../common/countdown'); // first 204 or 304 works, subsequent anything fails const codes = [204, 200]; -// Methods don't really matter, but we put in something realistic. -const methods = ['DELETE', 'DELETE']; +const countdown = new Countdown(codes.length, () => server.close()); const server = http.createServer(common.mustCall((req, res) => { const code = codes.shift(); @@ -18,17 +18,13 @@ const server = http.createServer(common.mustCall((req, res) => { }, codes.length)); function nextRequest() { - const method = methods.shift(); - const request = http.request({ + const request = http.get({ port: server.address().port, - method: method, path: '/' }, common.mustCall((response) => { response.on('end', common.mustCall(() => { - if (methods.length === 0) { - server.close(); - } else { + if (countdown.dec()) { // throws error: nextRequest(); // works just fine: diff --git a/test/parallel/test-http-client-agent.js b/test/parallel/test-http-client-agent.js index a24d886c041984..a5df3729d7b86f 100644 --- a/test/parallel/test-http-client-agent.js +++ b/test/parallel/test-http-client-agent.js @@ -2,10 +2,10 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); +const Countdown = require('../common/countdown'); let name; const max = 3; -let count = 0; const server = http.Server(common.mustCall((req, res) => { if (req.url === '/0') { @@ -24,6 +24,12 @@ server.listen(0, common.mustCall(() => { request(i); })); +const countdown = new Countdown(max, () => { + assert(!http.globalAgent.sockets.hasOwnProperty(name)); + assert(!http.globalAgent.requests.hasOwnProperty(name)); + server.close(); +}); + function request(i) { const req = http.get({ port: server.address().port, @@ -31,14 +37,10 @@ function request(i) { }, function(res) { const socket = req.socket; socket.on('close', common.mustCall(() => { - ++count; - if (count < max) { + countdown.dec(); + if (countdown.remaining > 0) { assert.strictEqual(http.globalAgent.sockets[name].includes(socket), false); - } else { - assert(!http.globalAgent.sockets.hasOwnProperty(name)); - assert(!http.globalAgent.requests.hasOwnProperty(name)); - server.close(); } })); res.resume(); diff --git a/test/parallel/test-http-end-throw-socket-handling.js b/test/parallel/test-http-end-throw-socket-handling.js index cb4f125948a3c9..134938ef09c7bd 100644 --- a/test/parallel/test-http-end-throw-socket-handling.js +++ b/test/parallel/test-http-end-throw-socket-handling.js @@ -1,5 +1,6 @@ 'use strict'; const common = require('../common'); +const Countdown = require('../common/countdown'); // Make sure that throwing in 'end' handler doesn't lock // up the socket forever. @@ -8,10 +9,10 @@ const common = require('../common'); // the same, we should not be so brittle and easily broken. const http = require('http'); +const countdown = new Countdown(10, () => server.close()); -let n = 0; const server = http.createServer((req, res) => { - if (++n === 10) server.close(); + countdown.dec(); res.end('ok'); }); diff --git a/test/parallel/test-http-incoming-pipelined-socket-destroy.js b/test/parallel/test-http-incoming-pipelined-socket-destroy.js index aef43eaba1f622..61e7729acc5324 100644 --- a/test/parallel/test-http-incoming-pipelined-socket-destroy.js +++ b/test/parallel/test-http-incoming-pipelined-socket-destroy.js @@ -1,10 +1,12 @@ 'use strict'; const common = require('../common'); +const Countdown = require('../common/countdown'); const http = require('http'); const net = require('net'); const seeds = [ 3, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 ]; +const countdown = new Countdown(seeds.length, () => server.close()); // Set up some timing issues where sockets can be destroyed // via either the req or res. @@ -51,11 +53,8 @@ function generator(seeds) { server.listen(0, common.mustCall(function() { const client = net.connect({ port: this.address().port }); - let done = 0; server.on('requestDone', function() { - if (++done === seeds.length) { - server.close(); - } + countdown.dec(); }); // immediately write the pipelined requests. diff --git a/test/parallel/test-http-malformed-request.js b/test/parallel/test-http-malformed-request.js index f0846edadbddd3..3f1ecead4ee465 100644 --- a/test/parallel/test-http-malformed-request.js +++ b/test/parallel/test-http-malformed-request.js @@ -1,25 +1,20 @@ 'use strict'; -require('../common'); -const assert = require('assert'); +const common = require('../common'); const net = require('net'); const http = require('http'); const url = require('url'); // Make sure no exceptions are thrown when receiving malformed HTTP // requests. - -let nrequests_completed = 0; -const nrequests_expected = 1; - -const server = http.createServer(function(req, res) { +const server = http.createServer(common.mustCall((req, res) => { console.log(`req: ${JSON.stringify(url.parse(req.url))}`); res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello World'); res.end(); - if (++nrequests_completed === nrequests_expected) server.close(); -}); + server.close(); +})); server.listen(0); server.on('listening', function() { @@ -29,7 +24,3 @@ server.on('listening', function() { c.end(); }); }); - -process.on('exit', function() { - assert.strictEqual(nrequests_expected, nrequests_completed); -}); diff --git a/test/parallel/test-http-parser-free.js b/test/parallel/test-http-parser-free.js index aff0fa6198ef44..ea865d83241dc5 100644 --- a/test/parallel/test-http-parser-free.js +++ b/test/parallel/test-http-parser-free.js @@ -2,13 +2,15 @@ require('../common'); const assert = require('assert'); const http = require('http'); +const Countdown = require('../common/countdown'); const N = 100; -let responses = 0; const server = http.createServer(function(req, res) { res.end('Hello'); }); +const countdown = new Countdown(N, () => server.close()); + server.listen(0, function() { http.globalAgent.maxSockets = 1; let parser; @@ -21,15 +23,9 @@ server.listen(0, function() { assert.strictEqual(req.parser, parser); } - if (++responses === N) { - server.close(); - } + countdown.dec(); res.resume(); }); })(i); } }); - -process.on('exit', function() { - assert.strictEqual(responses, N); -}); diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 440cab413c50a5..9b0ee9a2b59988 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -8,17 +8,17 @@ let resultServer = ''; const expectedClient = 'Response Body from Server'; let resultClient = ''; -const server = http.createServer(function(req, res) { +const server = http.createServer((req, res) => { console.error('pause server request'); req.pause(); - setTimeout(function() { + setTimeout(() => { console.error('resume server request'); req.resume(); req.setEncoding('utf8'); - req.on('data', function(chunk) { + req.on('data', (chunk) => { resultServer += chunk; }); - req.on('end', function() { + req.on('end', () => { console.error(resultServer); res.writeHead(200); res.end(expectedClient); @@ -31,16 +31,16 @@ server.listen(0, function() { port: this.address().port, path: '/', method: 'POST' - }, function(res) { + }, (res) => { console.error('pause client response'); res.pause(); - setTimeout(function() { + setTimeout(() => { console.error('resume client response'); res.resume(); - res.on('data', function(chunk) { + res.on('data', (chunk) => { resultClient += chunk; }); - res.on('end', function() { + res.on('end', () => { console.error(resultClient); server.close(); }); @@ -49,7 +49,7 @@ server.listen(0, function() { req.end(expectedServer); }); -process.on('exit', function() { +process.on('exit', () => { assert.strictEqual(expectedServer, resultServer); assert.strictEqual(expectedClient, resultClient); }); diff --git a/test/parallel/test-http-pipe-fs.js b/test/parallel/test-http-pipe-fs.js index 4dc86a2022527e..11af232454ffb5 100644 --- a/test/parallel/test-http-pipe-fs.js +++ b/test/parallel/test-http-pipe-fs.js @@ -3,6 +3,10 @@ const common = require('../common'); const http = require('http'); const fs = require('fs'); const path = require('path'); +const Countdown = require('../common/countdown'); +const NUMBER_OF_STREAMS = 2; + +const countdown = new Countdown(NUMBER_OF_STREAMS, () => server.close()); common.refreshTmpDir(); @@ -18,27 +22,23 @@ const server = http.createServer(common.mustCall(function(req, res) { }, 2)).listen(0, function() { http.globalAgent.maxSockets = 1; - for (let i = 0; i < 2; ++i) { - (function(i) { - const req = http.request({ - port: server.address().port, - method: 'POST', - headers: { - 'Content-Length': 5 - } - }, function(res) { - res.on('end', function() { - console.error(`res${i} end`); - if (i === 2) { - server.close(); - } - }); - res.resume(); - }); - req.on('socket', function(s) { - console.error(`req${i} start`); + for (let i = 0; i < NUMBER_OF_STREAMS; ++i) { + const req = http.request({ + port: server.address().port, + method: 'POST', + headers: { + 'Content-Length': 5 + } + }, function(res) { + res.on('end', function() { + console.error(`res${i + 1} end`); + countdown.dec(); }); - req.end('12345'); - }(i + 1)); + res.resume(); + }); + req.on('socket', function(s) { + console.error(`req${i + 1} start`); + }); + req.end('12345'); } }); diff --git a/test/parallel/test-http-pipeline-regr-2639.js b/test/parallel/test-http-pipeline-regr-2639.js index 133e4126683d9b..8eaf5588aaf2bd 100644 --- a/test/parallel/test-http-pipeline-regr-2639.js +++ b/test/parallel/test-http-pipeline-regr-2639.js @@ -1,25 +1,20 @@ 'use strict'; -require('../common'); -const assert = require('assert'); +const common = require('../common'); const http = require('http'); const net = require('net'); const COUNT = 10; -let received = 0; - -const server = http.createServer(function(req, res) { +const server = http.createServer(common.mustCall((req, res) => { // Close the server, we have only one TCP connection anyway - if (received++ === 0) - server.close(); - + server.close(); res.writeHead(200); res.write('data'); setTimeout(function() { res.end(); }, (Math.random() * 100) | 0); -}).listen(0, function() { +}, COUNT)).listen(0, function() { const s = net.connect(this.address().port); const big = 'GET / HTTP/1.0\r\n\r\n'.repeat(COUNT); @@ -27,7 +22,3 @@ const server = http.createServer(function(req, res) { s.write(big); s.resume(); }); - -process.on('exit', function() { - assert.strictEqual(received, COUNT); -}); diff --git a/test/parallel/test-http-request-dont-override-options.js b/test/parallel/test-http-request-dont-override-options.js index 33ed2ed6c0070d..ff534436cb8f93 100644 --- a/test/parallel/test-http-request-dont-override-options.js +++ b/test/parallel/test-http-request-dont-override-options.js @@ -4,14 +4,13 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); -let requests = 0; -http.createServer(function(req, res) { +const server = http.createServer(common.mustCall(function(req, res) { res.writeHead(200); res.end('ok'); +})); - requests++; -}).listen(0, function() { +server.listen(0, function() { const agent = new http.Agent(); agent.defaultPort = this.address().port; @@ -30,16 +29,12 @@ http.createServer(function(req, res) { http.request(options, function(res) { res.resume(); - }).end(); - - process.on('exit', function() { - assert.strictEqual(requests, 1); - + server.close(); assert.strictEqual(options.host, undefined); assert.strictEqual(options.hostname, common.localhostIPv4); assert.strictEqual(options.port, undefined); assert.strictEqual(options.defaultPort, undefined); assert.strictEqual(options.path, undefined); assert.strictEqual(options.method, undefined); - }); -}).unref(); + }).end(); +}); diff --git a/test/parallel/test-http-response-multi-content-length.js b/test/parallel/test-http-response-multi-content-length.js index c915cb1d531808..84aa872cf0685c 100644 --- a/test/parallel/test-http-response-multi-content-length.js +++ b/test/parallel/test-http-response-multi-content-length.js @@ -3,6 +3,7 @@ const common = require('../common'); const http = require('http'); const assert = require('assert'); +const Countdown = require('../common/countdown'); const MAX_COUNT = 2; @@ -24,7 +25,7 @@ const server = http.createServer((req, res) => { res.end('ok'); }); -let count = 0; +const countdown = new Countdown(MAX_COUNT, () => server.close()); server.listen(0, common.mustCall(() => { for (let n = 1; n <= MAX_COUNT; n++) { @@ -40,13 +41,7 @@ server.listen(0, common.mustCall(() => { ).on('error', common.mustCall((err) => { assert(/^Parse Error/.test(err.message)); assert.strictEqual(err.code, 'HPE_UNEXPECTED_CONTENT_LENGTH'); - count++; - if (count === MAX_COUNT) - server.close(); + countdown.dec(); })); } })); - -process.on('exit', () => { - assert.strictEqual(count, MAX_COUNT); -}); diff --git a/test/parallel/test-http-response-multiheaders.js b/test/parallel/test-http-response-multiheaders.js index 5739dac31d690b..71d55ef7e3cd70 100644 --- a/test/parallel/test-http-response-multiheaders.js +++ b/test/parallel/test-http-response-multiheaders.js @@ -3,6 +3,7 @@ const common = require('../common'); const http = require('http'); const assert = require('assert'); +const Countdown = require('../common/countdown'); // Test that certain response header fields do not repeat. // 'content-length' should also be in this list but it is @@ -27,6 +28,7 @@ const norepeat = [ 'age', 'expires' ]; +const runCount = 2; const server = http.createServer(function(req, res) { const num = req.headers['x-num']; @@ -47,8 +49,8 @@ const server = http.createServer(function(req, res) { }); server.listen(0, common.mustCall(function() { - let count = 0; - for (let n = 1; n <= 2; n++) { + const countdown = new Countdown(runCount, () => server.close()); + for (let n = 1; n <= runCount; n++) { // this runs twice, the first time, the server will use // setHeader, the second time it uses writeHead. The // result on the client side should be the same in @@ -58,7 +60,7 @@ server.listen(0, common.mustCall(function() { http.get( {port: this.address().port, headers: {'x-num': n}}, common.mustCall(function(res) { - if (++count === 2) server.close(); + countdown.dec(); for (const name of norepeat) { assert.strictEqual(res.headers[name], 'A'); } diff --git a/test/parallel/test-http-response-splitting.js b/test/parallel/test-http-response-splitting.js index aebb6b813be35e..8d8cc43a86f222 100644 --- a/test/parallel/test-http-response-splitting.js +++ b/test/parallel/test-http-response-splitting.js @@ -5,6 +5,7 @@ const http = require('http'); const net = require('net'); const url = require('url'); const assert = require('assert'); +const Countdown = require('../common/countdown'); // Response splitting example, credit: Amit Klein, Safebreach const str = '/welcome?lang=bar%c4%8d%c4%8aContent­Length:%200%c4%8d%c4%8a%c' + @@ -18,6 +19,7 @@ const x = 'fooഊSet-Cookie: foo=barഊഊ'; const y = 'foo⠊Set-Cookie: foo=bar'; let count = 0; +const countdown = new Countdown(3, () => server.close()); function test(res, code, header) { assert.throws(() => { @@ -40,8 +42,7 @@ const server = http.createServer((req, res) => { default: assert.fail('should not get to here.'); } - if (count === 3) - server.close(); + countdown.dec(); res.end('ok'); }); server.listen(0, () => { diff --git a/test/parallel/test-http-response-statuscode.js b/test/parallel/test-http-response-statuscode.js index ed3676b03e1f0c..ad50c79022ba3d 100644 --- a/test/parallel/test-http-response-statuscode.js +++ b/test/parallel/test-http-response-statuscode.js @@ -2,6 +2,7 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); +const Countdown = require('../common/countdown'); const MAX_REQUESTS = 13; let reqNum = 0; @@ -86,13 +87,17 @@ const server = http.Server(common.mustCall(function(req, res) { }, MAX_REQUESTS)); server.listen(); +const countdown = new Countdown(MAX_REQUESTS, () => server.close()); + server.on('listening', function makeRequest() { http.get({ port: this.address().port }, (res) => { assert.strictEqual(res.statusCode, 200); res.on('end', () => { - if (++reqNum < MAX_REQUESTS) + countdown.dec(); + reqNum = MAX_REQUESTS - countdown.remaining; + if (countdown.remaining > 0) makeRequest.call(this); }); res.resume(); diff --git a/test/parallel/test-http-set-cookies.js b/test/parallel/test-http-set-cookies.js index 7be28b04034fb0..a0f2be63b946b8 100644 --- a/test/parallel/test-http-set-cookies.js +++ b/test/parallel/test-http-set-cookies.js @@ -2,9 +2,9 @@ require('../common'); const assert = require('assert'); const http = require('http'); +const Countdown = require('../common/countdown'); -let nresponses = 0; - +const countdown = new Countdown(2, () => server.close()); const server = http.createServer(function(req, res) { if (req.url === '/one') { res.writeHead(200, [['set-cookie', 'A'], @@ -34,9 +34,7 @@ server.on('listening', function() { }); res.on('end', function() { - if (++nresponses === 2) { - server.close(); - } + countdown.dec(); }); }); @@ -51,14 +49,8 @@ server.on('listening', function() { }); res.on('end', function() { - if (++nresponses === 2) { - server.close(); - } + countdown.dec(); }); }); }); - -process.on('exit', function() { - assert.strictEqual(2, nresponses); -}); diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js index 4a9ff8e2a538e3..8b4619afbc0e75 100644 --- a/test/parallel/test-http-should-keep-alive.js +++ b/test/parallel/test-http-should-keep-alive.js @@ -3,6 +3,7 @@ require('../common'); const assert = require('assert'); const http = require('http'); const net = require('net'); +const Countdown = require('../common/countdown'); const SERVER_RESPONSES = [ 'HTTP/1.0 200 ok\r\nContent-Length: 0\r\n\r\n', @@ -20,34 +21,27 @@ const SHOULD_KEEP_ALIVE = [ true, // HTTP/1.1, Connection: keep-alive false // HTTP/1.1, Connection: close ]; -let requests = 0; -let responses = 0; http.globalAgent.maxSockets = 5; +const countdown = new Countdown(SHOULD_KEEP_ALIVE.length, () => server.close()); + +const getCountdownIndex = () => SERVER_RESPONSES.length - countdown.remaining; + const server = net.createServer(function(socket) { - socket.write(SERVER_RESPONSES[requests]); - ++requests; + socket.write(SERVER_RESPONSES[getCountdownIndex()]); }).listen(0, function() { function makeRequest() { const req = http.get({port: server.address().port}, function(res) { assert.strictEqual( - req.shouldKeepAlive, SHOULD_KEEP_ALIVE[responses], - `${SERVER_RESPONSES[responses]} should ${ - SHOULD_KEEP_ALIVE[responses] ? '' : 'not '}Keep-Alive`); - ++responses; - if (responses < SHOULD_KEEP_ALIVE.length) { + req.shouldKeepAlive, SHOULD_KEEP_ALIVE[getCountdownIndex()], + `${SERVER_RESPONSES[getCountdownIndex()]} should ${ + SHOULD_KEEP_ALIVE[getCountdownIndex()] ? '' : 'not '}Keep-Alive`); + countdown.dec(); + if (countdown.remaining) { makeRequest(); - } else { - server.close(); } res.resume(); }); } - makeRequest(); }); - -process.on('exit', function() { - assert.strictEqual(requests, SERVER_RESPONSES.length); - assert.strictEqual(responses, SHOULD_KEEP_ALIVE.length); -}); diff --git a/test/parallel/test-http-status-reason-invalid-chars.js b/test/parallel/test-http-status-reason-invalid-chars.js index 75ccb2c2430c53..ce08ff84a09b42 100644 --- a/test/parallel/test-http-status-reason-invalid-chars.js +++ b/test/parallel/test-http-status-reason-invalid-chars.js @@ -3,6 +3,7 @@ const common = require('../common'); const assert = require('assert'); const http = require('http'); +const Countdown = require('../common/countdown'); function explicit(req, res) { assert.throws(() => { @@ -34,13 +35,12 @@ const server = http.createServer((req, res) => { } }).listen(0, common.mustCall(() => { const hostname = 'localhost'; + const countdown = new Countdown(2, () => server.close()); const url = `http://${hostname}:${server.address().port}`; - let left = 2; const check = common.mustCall((res) => { - left--; assert.notStrictEqual(res.headers['content-type'], 'text/html'); assert.notStrictEqual(res.headers['content-type'], 'gotcha'); - if (left === 0) server.close(); + countdown.dec(); }, 2); http.get(`${url}/explicit`, check).end(); http.get(`${url}/implicit`, check).end(); diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index 34e3e8f24158e7..4539972437d507 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -8,6 +8,7 @@ const assert = require('assert'); const http = require('http'); const net = require('net'); +const Countdown = require('../common/countdown'); // Create a TCP server const srv = net.createServer(function(c) { @@ -39,7 +40,8 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { ['Origin', 'http://www.websocket.org'] ] ]; - let left = headers.length; + const countdown = new Countdown(headers.length, () => srv.close()); + headers.forEach(function(h) { const req = http.get({ port: port, @@ -66,8 +68,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { assert.deepStrictEqual(expectedHeaders, res.headers); socket.end(); - if (--left === 0) - srv.close(); + countdown.dec(); })); req.on('close', common.mustCall(function() { assert.strictEqual(sawUpgrade, true); diff --git a/test/parallel/test-https-truncate.js b/test/parallel/test-https-truncate.js index c2873e2e8af186..b4fbfda796f56c 100644 --- a/test/parallel/test-https-truncate.js +++ b/test/parallel/test-https-truncate.js @@ -46,6 +46,6 @@ const test = common.mustCall(function(res) { res.on('data', function(chunk) { bytes += chunk.length; this.pause(); - setTimeout(this.resume.bind(this), 1); + setTimeout(() => { this.resume(); }, 1); }); }); diff --git a/test/parallel/test-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js index df90b6d3a372da..fab1e378d9a4b0 100644 --- a/test/parallel/test-microtask-queue-integration-domain.js +++ b/test/parallel/test-microtask-queue-integration-domain.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to @@ -9,6 +9,8 @@ const assert = require('assert'); // removed. require('domain'); +common.crashOnUnhandledRejection(); + const implementations = [ function(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-microtask-queue-integration.js b/test/parallel/test-microtask-queue-integration.js index 22704ab4a51d49..6d9a2e63266285 100644 --- a/test/parallel/test-microtask-queue-integration.js +++ b/test/parallel/test-microtask-queue-integration.js @@ -1,7 +1,9 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); +common.crashOnUnhandledRejection(); + const implementations = [ function(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-microtask-queue-run-domain.js b/test/parallel/test-microtask-queue-run-domain.js index 8ce2f6cd992648..190af6a83867ca 100644 --- a/test/parallel/test-microtask-queue-run-domain.js +++ b/test/parallel/test-microtask-queue-run-domain.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to @@ -9,6 +9,8 @@ const assert = require('assert'); // removed. require('domain'); +common.crashOnUnhandledRejection(); + function enqueueMicrotask(fn) { Promise.resolve().then(fn); } diff --git a/test/parallel/test-microtask-queue-run-immediate-domain.js b/test/parallel/test-microtask-queue-run-immediate-domain.js index 8c4d4d40d46d6b..301655283a0625 100644 --- a/test/parallel/test-microtask-queue-run-immediate-domain.js +++ b/test/parallel/test-microtask-queue-run-immediate-domain.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); // Requiring the domain module here changes the function that is used by node to @@ -9,6 +9,8 @@ const assert = require('assert'); // removed. require('domain'); +common.crashOnUnhandledRejection(); + function enqueueMicrotask(fn) { Promise.resolve().then(fn); } diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index 9fee54b2d741cf..f95e2722acca52 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -1,7 +1,9 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); +common.crashOnUnhandledRejection(); + function enqueueMicrotask(fn) { Promise.resolve().then(fn); } diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index 1a8f8e2ba32bc0..96ab4d34814d02 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -1,7 +1,9 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); +common.crashOnUnhandledRejection(); + function enqueueMicrotask(fn) { Promise.resolve().then(fn); } diff --git a/test/parallel/test-net-server-max-connections-close-makes-more-available.js b/test/parallel/test-net-server-max-connections-close-makes-more-available.js index db7e1692ab66f7..479c1d489b271f 100644 --- a/test/parallel/test-net-server-max-connections-close-makes-more-available.js +++ b/test/parallel/test-net-server-max-connections-close-makes-more-available.js @@ -1,8 +1,9 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const net = require('net'); +common.crashOnUnhandledRejection(); // Sets the server's maxConnections property to 1. // Open 2 connections (connection 0 and connection 1). diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index 4e718a78ddcbdd..d4f8149a844a27 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -55,7 +55,5 @@ function handleExit(error, stdout, stderr) { assert.strictEqual(code, 0, `npm install got error code ${code}`); assert.strictEqual(signalCode, null, `unexpected signal: ${signalCode}`); - assert.doesNotThrow(function() { - fs.accessSync(`${installDir}/node_modules/package-name`); - }); + assert(fs.existsSync(`${installDir}/node_modules/package-name`)); } diff --git a/test/parallel/test-process-emit.js b/test/parallel/test-process-emit.js index f4f6d546f15cfa..8c2ad675cf8c62 100644 --- a/test/parallel/test-process-emit.js +++ b/test/parallel/test-process-emit.js @@ -19,4 +19,4 @@ process.emit('normal', 'normalData'); process.emit(sym, 'symbolData'); process.emit('SIGPIPE', 'signalData'); -assert.strictEqual(isNaN(process._eventsCount), false); +assert.strictEqual(Number.isNaN(process._eventsCount), false); diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js index c26a72fcc596d7..11e00152fdf011 100644 --- a/test/parallel/test-process-exit-code.js +++ b/test/parallel/test-process-exit-code.js @@ -16,7 +16,7 @@ switch (process.argv[2]) { case undefined: return parent(); default: - throw new Error('wtf'); + throw new Error('invalid'); } function child1() { diff --git a/test/parallel/test-process-raw-debug.js b/test/parallel/test-process-raw-debug.js index b9dbb8a2de9490..1b5c7242f9afdc 100644 --- a/test/parallel/test-process-raw-debug.js +++ b/test/parallel/test-process-raw-debug.js @@ -9,7 +9,7 @@ switch (process.argv[2]) { case undefined: return parent(); default: - throw new Error(`wtf? ${process.argv[2]}`); + throw new Error(`invalid: ${process.argv[2]}`); } function parent() { diff --git a/test/parallel/test-readfloat.js b/test/parallel/test-readfloat.js index 0175c195b8ec22..79e0d5a044f936 100644 --- a/test/parallel/test-readfloat.js +++ b/test/parallel/test-readfloat.js @@ -29,7 +29,7 @@ function test(clazz) { buffer[1] = 0xff; buffer[2] = 0x7f; buffer[3] = 0x7f; - assert.ok(isNaN(buffer.readFloatBE(0))); + assert.ok(Number.isNaN(buffer.readFloatBE(0))); assert.strictEqual(3.4028234663852886e+38, buffer.readFloatLE(0)); buffer[0] = 0xab; diff --git a/test/parallel/test-repl-load-multiline.js b/test/parallel/test-repl-load-multiline.js index 3a60c7b4576a79..8ab878ae768ddd 100644 --- a/test/parallel/test-repl-load-multiline.js +++ b/test/parallel/test-repl-load-multiline.js @@ -1,11 +1,12 @@ 'use strict'; const common = require('../common'); -const path = require('path'); -const fixtures = common.fixturesDir; +const fixtures = require('../common/fixtures'); const assert = require('assert'); const repl = require('repl'); -const command = `.load ${path.join(fixtures, 'repl-load-multiline.js')}`; +common.crashOnUnhandledRejection(); + +const command = `.load ${fixtures.path('repl-load-multiline.js')}`; const terminalCode = '\u001b[1G\u001b[0J \u001b[1G'; const terminalCodeRegex = new RegExp(terminalCode.replace(/\[/g, '\\['), 'g'); diff --git a/test/parallel/test-repl-reset-event.js b/test/parallel/test-repl-reset-event.js index 190aa2227de9a3..22f81604886f49 100644 --- a/test/parallel/test-repl-reset-event.js +++ b/test/parallel/test-repl-reset-event.js @@ -4,6 +4,7 @@ common.globalCheck = false; const assert = require('assert'); const repl = require('repl'); +const util = require('util'); // Create a dummy stream that does nothing const dummy = new common.ArrayStream(); @@ -17,11 +18,13 @@ function testReset(cb) { r.context.foo = 42; r.on('reset', common.mustCall(function(context) { assert(!!context, 'REPL did not emit a context with reset event'); - assert.strictEqual(context, r.context, 'REPL emitted incorrect context'); + assert.strictEqual(context, r.context, 'REPL emitted incorrect context. ' + + `context is ${util.inspect(context)}, expected ${util.inspect(r.context)}`); assert.strictEqual( context.foo, undefined, - 'REPL emitted the previous context, and is not using global as context' + 'REPL emitted the previous context and is not using global as context. ' + + `context.foo is ${context.foo}, expected undefined.` ); context.foo = 42; cb(); @@ -40,7 +43,8 @@ function testResetGlobal() { assert.strictEqual( context.foo, 42, - '"foo" property is missing from REPL using global as context' + '"foo" property is different from REPL using global as context. ' + + `context.foo is ${context.foo}, expected 42.` ); })); r.resetContext(); diff --git a/test/parallel/test-repl-syntax-error-handling.js b/test/parallel/test-repl-syntax-error-handling.js index 9014f9a02f22be..c56c45dc6b90ae 100644 --- a/test/parallel/test-repl-syntax-error-handling.js +++ b/test/parallel/test-repl-syntax-error-handling.js @@ -8,7 +8,7 @@ switch (process.argv[2]) { case undefined: return parent(); default: - throw new Error('wtf'); + throw new Error('invalid'); } function parent() { diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index df7300e526e8c1..1179259c79d026 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -373,8 +373,8 @@ const editor = repl.start({ editorStream.run(['.clear']); editorStream.run(['.editor']); -editor.completer('co', common.mustCall((error, data) => { - assert.deepStrictEqual(data, [['con'], 'co']); +editor.completer('Uin', common.mustCall((error, data) => { + assert.deepStrictEqual(data, [['Uint'], 'Uin']); })); editorStream.run(['.clear']); diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index c8fe92a0bdbf02..1ba3af9f7d68bd 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -15,15 +15,15 @@ class MyStream extends Readable { case 0: return this.push(null); case 1: - return setTimeout(function() { + return setTimeout(() => { this.push('last chunk'); - }.bind(this), 100); + }, 100); case 2: return this.push('second to last chunk'); case 3: - return process.nextTick(function() { + return process.nextTick(() => { this.push('first chunk'); - }.bind(this)); + }); default: throw new Error('?'); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index e28e615852bec5..d2ca48f0f46ad5 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -75,6 +75,13 @@ const Transform = require('_stream_transform'); assert(pt instanceof PassThrough); } +{ + // Verify transform constructor behavior + const pt = Transform(); + + assert(pt instanceof Transform); +} + { // Perform a simple transform const pt = new Transform(); @@ -190,14 +197,14 @@ const Transform = require('_stream_transform'); if (!chunk) chunk = ''; const s = chunk.toString(); - setTimeout(function() { + setTimeout(() => { this.state += s.charAt(0); if (this.state.length === 3) { pt.push(Buffer.from(this.state)); this.state = ''; } cb(); - }.bind(this), 10); + }, 10); }; pt._flush = function(cb) { diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index daabfcf29ddf19..dbbf3dc899b15a 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -33,12 +33,12 @@ const inputs = [ const timeouts = []; const intervals = []; -inputs.forEach(function(value, index) { - setTimeout(function() { +inputs.forEach((value, index) => { + setTimeout(() => { timeouts[index] = true; }, value); - const handle = setInterval(function() { + const handle = setInterval(() => { clearInterval(handle); // disarm timer or we'll never finish intervals[index] = true; }, value); @@ -47,9 +47,9 @@ inputs.forEach(function(value, index) { // All values in inputs array coerce to 1 ms. Therefore, they should all run // before a timer set here for 2 ms. -setTimeout(common.mustCall(function() { +setTimeout(common.mustCall(() => { // assert that all other timers have run - inputs.forEach(function(value, index) { + inputs.forEach((value, index) => { assert.strictEqual(true, timeouts[index]); assert.strictEqual(true, intervals[index]); }); diff --git a/test/parallel/test-writedouble.js b/test/parallel/test-writedouble.js index fa9c94022d419b..dc3696070501ba 100644 --- a/test/parallel/test-writedouble.js +++ b/test/parallel/test-writedouble.js @@ -168,8 +168,8 @@ function test(clazz) { // Darwin ia32 does the other kind of NaN. // Compiler bug. No one really cares. assert(0x7F === buffer[15] || 0xFF === buffer[15]); - assert.ok(isNaN(buffer.readDoubleBE(0))); - assert.ok(isNaN(buffer.readDoubleLE(8))); + assert.ok(Number.isNaN(buffer.readDoubleBE(0))); + assert.ok(Number.isNaN(buffer.readDoubleLE(8))); } diff --git a/test/parallel/test-writeuint.js b/test/parallel/test-writeuint.js index e91e1d256d0261..5a2f2da9da75e8 100644 --- a/test/parallel/test-writeuint.js +++ b/test/parallel/test-writeuint.js @@ -129,10 +129,10 @@ function testUint(clazz) { // Test 0 to 5 bytes. for (let i = 0; i <= 5; i++) { const errmsg = `byteLength: ${i}`; - assert.throws(function() { + assert.throws(() => { data.writeUIntBE(val, 0, i); }, /"value" argument is out of bounds/, errmsg); - assert.throws(function() { + assert.throws(() => { data.writeUIntLE(val, 0, i); }, /"value" argument is out of bounds/, errmsg); val *= 0x100; diff --git a/test/pseudo-tty/test-tty-stream-constructors.js b/test/pseudo-tty/test-tty-stream-constructors.js new file mode 100644 index 00000000000000..27c33bad1868d6 --- /dev/null +++ b/test/pseudo-tty/test-tty-stream-constructors.js @@ -0,0 +1,21 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const { ReadStream, WriteStream } = require('tty'); + +{ + // Verify that tty.ReadStream can be constructed without new. + const stream = ReadStream(0); + + stream.unref(); + assert(stream instanceof ReadStream); + assert.strictEqual(stream.isTTY, true); +} + +{ + // Verify that tty.WriteStream can be constructed without new. + const stream = WriteStream(1); + + assert(stream instanceof WriteStream); + assert.strictEqual(stream.isTTY, true); +} diff --git a/test/pseudo-tty/test-tty-stream-constructors.out b/test/pseudo-tty/test-tty-stream-constructors.out new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/test/pseudo-tty/test-tty-window-size.js b/test/pseudo-tty/test-tty-window-size.js new file mode 100644 index 00000000000000..782b66802e3ada --- /dev/null +++ b/test/pseudo-tty/test-tty-window-size.js @@ -0,0 +1,85 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const { WriteStream } = require('tty'); +const { TTY } = process.binding('tty_wrap'); +const getWindowSize = TTY.prototype.getWindowSize; + +function monkeyPatchGetWindowSize(fn) { + TTY.prototype.getWindowSize = function() { + TTY.prototype.getWindowSize = getWindowSize; + return fn.apply(this, arguments); + }; +} + +{ + // tty.WriteStream constructor does not define columns and rows if an error + // occurs while retrieving the window size from the handle. + monkeyPatchGetWindowSize(function() { + return -1; + }); + + const stream = WriteStream(1); + + assert(stream instanceof WriteStream); + assert.strictEqual(stream.columns, undefined); + assert.strictEqual(stream.rows, undefined); +} + +{ + // _refreshSize() emits an error if an error occurs while retrieving the + // window size from the handle. + const stream = WriteStream(1); + + stream.on('error', common.mustCall((err) => { + assert.strictEqual(err.syscall, 'getWindowSize'); + })); + + monkeyPatchGetWindowSize(function() { + return -1; + }); + + stream._refreshSize(); +} + +{ + // _refreshSize() emits a 'resize' event when the window size changes. + monkeyPatchGetWindowSize(function(size) { + size[0] = 80; + size[1] = 24; + return 0; + }); + + const stream = WriteStream(1); + + stream.on('resize', common.mustCall(() => { + assert.strictEqual(stream.columns, 82); + assert.strictEqual(stream.rows, 26); + })); + + assert.strictEqual(stream.columns, 80); + assert.strictEqual(stream.rows, 24); + + monkeyPatchGetWindowSize(function(size) { + size[0] = 82; + size[1] = 26; + return 0; + }); + + stream._refreshSize(); +} + +{ + // WriteStream.prototype.getWindowSize() returns the current columns and rows. + monkeyPatchGetWindowSize(function(size) { + size[0] = 99; + size[1] = 32; + return 0; + }); + + const stream = WriteStream(1); + + assert.strictEqual(stream.columns, 99); + assert.strictEqual(stream.rows, 32); + assert.deepStrictEqual(stream.getWindowSize(), [99, 32]); +} diff --git a/test/pseudo-tty/test-tty-window-size.out b/test/pseudo-tty/test-tty-window-size.out new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/test/sequential/test-child-process-pass-fd.js b/test/sequential/test-child-process-pass-fd.js index 8cc11f6c11f5b4..73e469cdede2be 100644 --- a/test/sequential/test-child-process-pass-fd.js +++ b/test/sequential/test-child-process-pass-fd.js @@ -1,11 +1,20 @@ 'use strict'; const common = require('../common'); + +// On some OS X versions, when passing fd's between processes: +// When the handle associated to a specific file descriptor is closed by the +// sender process before it's received in the destination, the handle is indeed +// closed while it should remain opened. In order to fix this behavior, don't +// close the handle until the `NODE_HANDLE_ACK` is received by the sender. +// This test is basically `test-cluster-net-send` but creating lots of workers +// so the issue reproduces on OS X consistently. + if ((process.config.variables.arm_version === '6') || (process.config.variables.arm_version === '7')) common.skip('Too slow for armv6 and armv7 bots'); const assert = require('assert'); -const fork = require('child_process').fork; +const { fork } = require('child_process'); const net = require('net'); const N = 80; @@ -46,14 +55,14 @@ if (process.argv[2] !== 'child') { process.on('message', common.mustCall()); const server = net.createServer((c) => { - process.once('message', function(msg) { + process.once('message', (msg) => { assert.strictEqual(msg, 'got'); c.end('hello'); }); socketConnected(); }).unref(); server.listen(0, common.localhostIPv4, () => { - const port = server.address().port; + const { port } = server.address(); socket = net.connect(port, common.localhostIPv4, socketConnected).unref(); }); } diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index 46448342a2f257..e0cce99524a867 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -14,7 +14,7 @@ switch (process.argv[2]) { case 'server': return server(); case 'client': return client(); case undefined: return parent(); - default: throw new Error('wtf'); + default: throw new Error('invalid'); } function server() { diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index 911d99d7416db5..2ea4b33c9bf8ac 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -21,7 +21,7 @@ if (process.argv[2] !== 'child') { process.maxTickDepth = 10; // in the error handler, we trigger several MakeCallback events - d.on('error', function(e) { + d.on('error', function() { console.log('a'); console.log('b'); console.log('c'); diff --git a/test/sequential/test-timers-block-eventloop.js b/test/sequential/test-timers-block-eventloop.js index 78ecc9e31746f5..f6426e454e0882 100644 --- a/test/sequential/test-timers-block-eventloop.js +++ b/test/sequential/test-timers-block-eventloop.js @@ -16,7 +16,7 @@ const t3 = setTimeout(common.mustNotCall('eventloop blocked!'), platformTimeout(200)); setTimeout(function() { - fs.stat('/dev/nonexistent', (err, stats) => { + fs.stat('/dev/nonexistent', () => { clearInterval(t1); clearInterval(t2); clearTimeout(t3); diff --git a/tools/bootstrap/README.md b/tools/bootstrap/README.md new file mode 100644 index 00000000000000..a61e947a2af0b4 --- /dev/null +++ b/tools/bootstrap/README.md @@ -0,0 +1,55 @@ +# Node.js Bootstrapping Guide + +## Windows + +A [Boxstarter][] script can be used for easy setup of Windows systems with all +the required prerequisites for Node.js development. This script will install +the following [Chocolatey] packages: + * [Git for Windows][] with the `git` and Unix tools added to the `PATH` + * [Python 2.x][] + * [Visual Studio 2017 Build Tools][] with [Visual C++ workload][] + +To install Node.js prerequisites using [Boxstarter WebLauncher][], just open +[this link](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter) +with Internet Explorer or Edge browser on the target machine. + +Alternatively, you can use PowerShell. Run those commands from an elevated +PowerShell terminal: +```console +Set-ExecutionPolicy Unrestricted -Force +iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) +get-boxstarter -Force +Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots +``` + +Entire installation will take up about 8 GB of disk space. + +## Linux + +For building Node.js on Linux, following packages are required (note, that this +can vary from distribution to distribution): + * `git` + * `python` + * `gcc-c++` or `g++` + * `make` + +To bootstrap Node.js on Linux, run in terminal: + * OpenSUSE: `sudo zypper install git python gcc-c++ make` + * Fedora: `sudo dnf install git python gcc-c++ make` + * Ubuntu, Debian: `sudo apt-get install git python g++ make` + +## macOS + +To install required tools on macOS, run in terminal: +```console +xcode-select --install +``` + +[Boxstarter]: http://boxstarter.org/ +[Boxstarter WebLauncher]: http://boxstarter.org/WebLauncher +[Chocolatey]: https://chocolatey.org/ +[Git for Windows]: https://chocolatey.org/packages/git +[Python 2.x]: https://chocolatey.org/packages/python2 +[Visual Studio 2017 Build Tools]: https://chocolatey.org/packages/visualstudio2017buildtools +[Visual C++ workload]: https://chocolatey.org/packages/visualstudio2017-workload-vctools + diff --git a/tools/bootstrap/windows_boxstarter b/tools/bootstrap/windows_boxstarter new file mode 100644 index 00000000000000..144c309ae11ad0 --- /dev/null +++ b/tools/bootstrap/windows_boxstarter @@ -0,0 +1,21 @@ +# Boxstarter (http://boxstarter.org/) script for Node.js prerequisites +# +# To install either open this link in IE or Edge: +# http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter +# +# Or run those commands in an elevated Powershell terminal: +# iex ((New-Object System.Net.WebClient).DownloadString('http://boxstarter.org/bootstrapper.ps1')) +# get-boxstarter -Force +# Install-BoxstarterPackage https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter -DisableReboots +# +# For more detail see +# https://github.com/nodejs/node/blob/master/tools/bootstrap/README.md +# + +# Git and Unix tools will be added to the PATH +choco install git -params /GitAndUnixToolsOnPath -y +choco install python2 -y + +# Installs VS 2017 Build Tools +choco install visualstudio2017buildtools -y +choco install visualstudio2017-workload-vctools -y diff --git a/tools/eslint-rules/buffer-constructor.js b/tools/eslint-rules/buffer-constructor.js index 938598e8dbf618..412fdaa934664b 100644 --- a/tools/eslint-rules/buffer-constructor.js +++ b/tools/eslint-rules/buffer-constructor.js @@ -10,16 +10,11 @@ const msg = 'Use of the Buffer() constructor has been deprecated. ' + 'Please use either Buffer.alloc(), Buffer.allocUnsafe(), ' + 'or Buffer.from()'; - -function test(context, node) { - if (node.callee.name === 'Buffer') { - context.report(node, msg); - } -} +const astSelector = 'NewExpression[callee.name="Buffer"],' + + 'CallExpression[callee.name="Buffer"]'; module.exports = function(context) { return { - 'NewExpression': (node) => test(context, node), - 'CallExpression': (node) => test(context, node) + [astSelector]: (node) => context.report(node, msg) }; }; diff --git a/tools/eslint-rules/prefer-assert-methods.js b/tools/eslint-rules/prefer-assert-methods.js index fa345eb7c3fc33..0604fd3ed99046 100644 --- a/tools/eslint-rules/prefer-assert-methods.js +++ b/tools/eslint-rules/prefer-assert-methods.js @@ -1,15 +1,8 @@ 'use strict'; -function isAssert(node) { - return node.expression && - node.expression.type === 'CallExpression' && - node.expression.callee && - node.expression.callee.name === 'assert'; -} - -function getFirstArg(expression) { - return expression.arguments && expression.arguments[0]; -} +const astSelector = 'ExpressionStatement[expression.type="CallExpression"]' + + '[expression.callee.name="assert"]' + + '[expression.arguments.0.type="BinaryExpression"]'; function parseError(method, op) { return `'assert.${method}' should be used instead of '${op}'`; @@ -24,15 +17,11 @@ const preferedAssertMethod = { module.exports = function(context) { return { - ExpressionStatement(node) { - if (isAssert(node)) { - const arg = getFirstArg(node.expression); - if (arg && arg.type === 'BinaryExpression') { - const assertMethod = preferedAssertMethod[arg.operator]; - if (assertMethod) { - context.report(node, parseError(assertMethod, arg.operator)); - } - } + [astSelector]: function(node) { + const arg = node.expression.arguments[0]; + const assertMethod = preferedAssertMethod[arg.operator]; + if (assertMethod) { + context.report(node, parseError(assertMethod, arg.operator)); } } }; diff --git a/tools/eslint-rules/prefer-common-mustnotcall.js b/tools/eslint-rules/prefer-common-mustnotcall.js index 6bc428ed59a8b8..ef3c5fb729f31f 100644 --- a/tools/eslint-rules/prefer-common-mustnotcall.js +++ b/tools/eslint-rules/prefer-common-mustnotcall.js @@ -10,30 +10,21 @@ const msg = 'Please use common.mustNotCall(msg) instead of ' + 'common.mustCall(fn, 0) or common.mustCall(0).'; - -function isCommonMustCall(node) { - return node && - node.callee && - node.callee.object && - node.callee.object.name === 'common' && - node.callee.property && - node.callee.property.name === 'mustCall'; -} - -function isArgZero(argument) { - return argument && - typeof argument.value === 'number' && - argument.value === 0; -} +const mustCallSelector = 'CallExpression[callee.object.name="common"]' + + '[callee.property.name="mustCall"]'; +const arg0Selector = `${mustCallSelector}[arguments.0.value=0]`; +const arg1Selector = `${mustCallSelector}[arguments.1.value=0]`; module.exports = function(context) { + function report(node) { + context.report(node, msg); + } + return { - CallExpression(node) { - if (isCommonMustCall(node) && - (isArgZero(node.arguments[0]) || // catch common.mustCall(0) - isArgZero(node.arguments[1]))) { // catch common.mustCall(fn, 0) - context.report(node, msg); - } - } + // Catch common.mustCall(0) + [arg0Selector]: report, + + // Catch common.mustCall(fn, 0) + [arg1Selector]: report }; }; diff --git a/tools/lint-js.js b/tools/lint-js.js index 5143aea0369112..5adf31d34e1c38 100644 --- a/tools/lint-js.js +++ b/tools/lint-js.js @@ -13,7 +13,6 @@ const totalCPUs = require('os').cpus().length; const CLIEngine = require('./eslint').CLIEngine; const glob = require('./eslint/node_modules/glob'); -const cwd = process.cwd(); const cliOptions = { rulePaths: rulesDirs, extensions: extensions, @@ -82,9 +81,7 @@ if (cluster.isMaster) { if (i !== -1) { if (!process.argv[i + 1]) throw new Error('Missing output filename'); - var outPath = process.argv[i + 1]; - if (!path.isAbsolute(outPath)) - outPath = path.join(cwd, outPath); + const outPath = path.resolve(process.argv[i + 1]); fd = fs.openSync(outPath, 'w'); outFn = function(str) { fs.writeSync(fd, str, 'utf8'); @@ -176,8 +173,6 @@ if (cluster.isMaster) { while (paths.length) { var dir = paths.shift(); curPath = dir; - if (dir.indexOf('/') > 0) - dir = path.join(cwd, dir); const patterns = cli.resolveFileGlobPatterns([dir]); dir = path.resolve(patterns[0]); files = glob.sync(dir, globOptions); diff --git a/tools/test.py b/tools/test.py index e7c01c8658b23d..561473f246629b 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1287,9 +1287,7 @@ def ReadConfigurationInto(path, sections, defs): if prefix_match: prefix = SplitPath(prefix_match.group(1).strip()) continue - print "Malformed line: '%s'." % line - return False - return True + raise Exception("Malformed line: '%s'." % line) # ---------------