diff --git a/.eslintrc b/.eslintrc index e4dd84b8893da0..98afe47e780565 100644 --- a/.eslintrc +++ b/.eslintrc @@ -17,6 +17,8 @@ ecmaFeatures: rules: # Possible Errors # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors + ## disallow control characters in regular expressions + no-control-regex: 2 ## check debugger sentence no-debugger: 2 ## check duplicate arguments @@ -25,24 +27,24 @@ rules: no-dupe-keys: 2 ## check duplicate switch-case no-duplicate-case: 2 - ## disallow superfluous semicolons - no-extra-semi: 2 + ## disallow the use of empty character classes in regular expressions + no-empty-character-class: 2 ## disallow assignment of exceptional params no-ex-assign: 2 - ## disallow unreachable code - no-unreachable: 2 - ## require valid typeof compared string like typeof foo === 'strnig' - valid-typeof: 2 - ## disallow controls characters in regular expressions - no-control-regex: 2 ## disallow extra boolean casts no-extra-boolean-cast : 2 + ## disallow superfluous semicolons + no-extra-semi: 2 ## validate regular expressions no-invalid-regexp: 2 ## forbid weird whitespace characters no-irregular-whitespace: 2 ## avoid unexpected multiline expressions no-unexpected-multiline: 2 + ## disallow unreachable code + no-unreachable: 2 + ## require valid typeof compared string like typeof foo === 'strnig' + valid-typeof: 2 # Best Practices # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices @@ -81,6 +83,8 @@ rules: space-after-keywords: 2 ## no leading/trailing spaces in parens space-in-parens: [2, "never"] + ## no spaces with non-word unary operators, require for word unary operators + space-unary-ops: 2 # ECMAScript 6 # list: http://eslint.org/docs/rules/#ecmascript-6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 74f1bc53b6a9fb..ff0f0e2798117e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,145 @@ # Node.js ChangeLog +## 2016-02-09, Version 5.5.1 (Stable), @TODO + +### Notable Changes + +TODO + +### Commits + +* [[`3b6283c163`](https://github.com/nodejs/node/commit/3b6283c163)] - **benchmark**: add a constant declaration for `net` (Minwoo Jung) [#3950](https://github.com/nodejs/node/pull/3950) +* [[`d64e6e0112`](https://github.com/nodejs/node/commit/d64e6e0112)] - **buffer**: remove duplicated code in fromObject (HUANG Wei) [#4948](https://github.com/nodejs/node/pull/4948) +* [[`58d67e26a2`](https://github.com/nodejs/node/commit/58d67e26a2)] - **buffer**: validate list elements in Buffer.concat (Michaël Zasso) [#4951](https://github.com/nodejs/node/pull/4951) +* [[`bafc86f00e`](https://github.com/nodejs/node/commit/bafc86f00e)] - **buffer**: refactor redeclared variables (Rich Trott) [#4886](https://github.com/nodejs/node/pull/4886) +* [[`0fa4d90b94`](https://github.com/nodejs/node/commit/0fa4d90b94)] - **build**: Add VARIATION variable to binary target (Stefan Budeanu) [#4631](https://github.com/nodejs/node/pull/4631) +* [[`0d4b538175`](https://github.com/nodejs/node/commit/0d4b538175)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919) +* [[`abb0f6cd53`](https://github.com/nodejs/node/commit/abb0f6cd53)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914) +* [[`755619c554`](https://github.com/nodejs/node/commit/755619c554)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913) +* [[`cbf36de8f1`](https://github.com/nodejs/node/commit/cbf36de8f1)] - **deps**: upgrade npm to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) +* [[`dd97d07a0d`](https://github.com/nodejs/node/commit/dd97d07a0d)] - **deps**: backport 8d00c2c from v8 upstream (Gibson Fahnestock) [#5024](https://github.com/nodejs/node/pull/5024) +* [[`b75263094b`](https://github.com/nodejs/node/commit/b75263094b)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`b312b7914f`](https://github.com/nodejs/node/commit/b312b7914f)] - **deps**: upgrade openssl sources to 1.0.2f (Myles Borins) [#4961](https://github.com/nodejs/node/pull/4961) +* [[`fa0457ed04`](https://github.com/nodejs/node/commit/fa0457ed04)] - **dns**: throw a TypeError in lookupService with invalid port (Evan Lucas) [#4839](https://github.com/nodejs/node/pull/4839) +* [[`6f58bc578a`](https://github.com/nodejs/node/commit/6f58bc578a)] - **doc**: console is asynchronous unless it's a file (Ben Noordhuis) [#5133](https://github.com/nodejs/node/pull/5133) +* [[`3b960af47a`](https://github.com/nodejs/node/commit/3b960af47a)] - **doc**: fix typo in dgram doc (Rich Trott) [#5114](https://github.com/nodejs/node/pull/5114) +* [[`6363264fa9`](https://github.com/nodejs/node/commit/6363264fa9)] - **doc**: fix links order in Buffer doc (Alexander Makarenko) [#5076](https://github.com/nodejs/node/pull/5076) +* [[`28b392854c`](https://github.com/nodejs/node/commit/28b392854c)] - **doc**: add CTC meeting minutes 2016-01-20 (Rod Vagg) [#4904](https://github.com/nodejs/node/pull/4904) +* [[`e325ece23e`](https://github.com/nodejs/node/commit/e325ece23e)] - **doc**: minor improvement in OS docs (Alexander Makarenko) [#5006](https://github.com/nodejs/node/pull/5006) +* [[`9e4f94bf2b`](https://github.com/nodejs/node/commit/9e4f94bf2b)] - **doc**: add CTC meeting minutes 2016-01-27 (Rod Vagg) [#5057](https://github.com/nodejs/node/pull/5057) +* [[`1e2108a6b7`](https://github.com/nodejs/node/commit/1e2108a6b7)] - **doc**: fix links in Addons docs (Alexander Makarenko) [#5072](https://github.com/nodejs/node/pull/5072) +* [[`e5134b1701`](https://github.com/nodejs/node/commit/e5134b1701)] - **doc**: fix inconsistent styling (Brian White) [#4996](https://github.com/nodejs/node/pull/4996) +* [[`dde160378e`](https://github.com/nodejs/node/commit/dde160378e)] - **doc**: fix link in cluster documentation (Timothy Gu) [#5068](https://github.com/nodejs/node/pull/5068) +* [[`e5254c12f4`](https://github.com/nodejs/node/commit/e5254c12f4)] - **doc**: fix reference to API `hash.final` (Minwoo Jung) [#5050](https://github.com/nodejs/node/pull/5050) +* [[`87fd9968a8`](https://github.com/nodejs/node/commit/87fd9968a8)] - **doc**: clarify optional arguments of Buffer methods (Michaël Zasso) [#5008](https://github.com/nodejs/node/pull/5008) +* [[`9908eced24`](https://github.com/nodejs/node/commit/9908eced24)] - **doc**: uppercase 'RSA-SHA256' in crypto.markdown (Rainer Oviir) [#5044](https://github.com/nodejs/node/pull/5044) +* [[`bf0383bbea`](https://github.com/nodejs/node/commit/bf0383bbea)] - **doc**: apply consistent styling for functions (Rich Trott) [#4974](https://github.com/nodejs/node/pull/4974) +* [[`8c7f4bab2d`](https://github.com/nodejs/node/commit/8c7f4bab2d)] - **doc**: multiple improvements in Stream docs (Alexander Makarenko) [#5009](https://github.com/nodejs/node/pull/5009) +* [[`ee013715b9`](https://github.com/nodejs/node/commit/ee013715b9)] - **doc**: improve styling consistency in VM docs (Alexander Makarenko) [#5005](https://github.com/nodejs/node/pull/5005) +* [[`9824b0d132`](https://github.com/nodejs/node/commit/9824b0d132)] - **doc**: fix anchor links from stream to http and events (piepmatz) [#5007](https://github.com/nodejs/node/pull/5007) +* [[`2c85f79569`](https://github.com/nodejs/node/commit/2c85f79569)] - **doc**: minor improvement to HTTPS doc (Alexander Makarenko) [#5002](https://github.com/nodejs/node/pull/5002) +* [[`9cf1370017`](https://github.com/nodejs/node/commit/9cf1370017)] - **doc**: improve styling consistency in Buffer docs (Alexander Makarenko) [#5001](https://github.com/nodejs/node/pull/5001) +* [[`2750cb0613`](https://github.com/nodejs/node/commit/2750cb0613)] - **doc**: consistent styling for functions in TLS docs (Alexander Makarenko) [#5000](https://github.com/nodejs/node/pull/5000) +* [[`4758bf13a5`](https://github.com/nodejs/node/commit/4758bf13a5)] - **doc**: update npm LICENSE using license-builder.sh (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) +* [[`3b08b5d22c`](https://github.com/nodejs/node/commit/3b08b5d22c)] - **doc**: fix minor typo in process doc (Prayag Verma) [#5018](https://github.com/nodejs/node/pull/5018) +* [[`129977c9c7`](https://github.com/nodejs/node/commit/129977c9c7)] - **doc**: fix typo in Readme.md (Prayag Verma) [#5017](https://github.com/nodejs/node/pull/5017) +* [[`5de3dc557f`](https://github.com/nodejs/node/commit/5de3dc557f)] - **doc**: fix `notDeepEqual` API (Minwoo Jung) [#4971](https://github.com/nodejs/node/pull/4971) +* [[`d47dadcc1f`](https://github.com/nodejs/node/commit/d47dadcc1f)] - **doc**: make buffer methods styles consistent (Timothy Gu) [#4873](https://github.com/nodejs/node/pull/4873) +* [[`17888b122c`](https://github.com/nodejs/node/commit/17888b122c)] - **doc**: fix JSON generation for aliased methods (Timothy Gu) [#4871](https://github.com/nodejs/node/pull/4871) +* [[`396e4b9199`](https://github.com/nodejs/node/commit/396e4b9199)] - **doc**: add more details to process.env (Evan Lucas) [#4924](https://github.com/nodejs/node/pull/4924) +* [[`bc11bf4659`](https://github.com/nodejs/node/commit/bc11bf4659)] - **doc**: don't use "interface" as a variable name (ChALkeR) [#4900](https://github.com/nodejs/node/pull/4900) +* [[`bcf55d2f44`](https://github.com/nodejs/node/commit/bcf55d2f44)] - **doc**: spell writable consistently (Peter Lyons) [#4954](https://github.com/nodejs/node/pull/4954) +* [[`4a6d0ac436`](https://github.com/nodejs/node/commit/4a6d0ac436)] - **doc**: update eol handling in readline (Kári Tristan Helgason) [#4927](https://github.com/nodejs/node/pull/4927) +* [[`e65d3638c0`](https://github.com/nodejs/node/commit/e65d3638c0)] - **doc**: replace function expressions with arrows (Benjamin Gruenbaum) [#4832](https://github.com/nodejs/node/pull/4832) +* [[`423a58d66f`](https://github.com/nodejs/node/commit/423a58d66f)] - **doc**: show links consistently in deprecations (Sakthipriyan Vairamani) [#4907](https://github.com/nodejs/node/pull/4907) +* [[`fd87659139`](https://github.com/nodejs/node/commit/fd87659139)] - **doc**: add docs working group (Bryan English) [#4244](https://github.com/nodejs/node/pull/4244) +* [[`19ed619cff`](https://github.com/nodejs/node/commit/19ed619cff)] - **doc**: remove unnecessary bind(this) (Dmitriy Lazarev) [#4797](https://github.com/nodejs/node/pull/4797) +* [[`5129930786`](https://github.com/nodejs/node/commit/5129930786)] - **doc**: keep the names in sorted order (Sakthipriyan Vairamani) [#4876](https://github.com/nodejs/node/pull/4876) +* [[`3c46c10d54`](https://github.com/nodejs/node/commit/3c46c10d54)] - **doc**: fix nonsensical grammar in Buffer::write (Jimb Esser) [#4863](https://github.com/nodejs/node/pull/4863) +* [[`a1af6fc1a7`](https://github.com/nodejs/node/commit/a1af6fc1a7)] - **doc**: add `servername` parameter docs (Alexander Makarenko) [#4729](https://github.com/nodejs/node/pull/4729) +* [[`f4eeba8467`](https://github.com/nodejs/node/commit/f4eeba8467)] - **doc**: fix code type of markdowns (Jackson Tian) [#4858](https://github.com/nodejs/node/pull/4858) +* [[`fa1d453359`](https://github.com/nodejs/node/commit/fa1d453359)] - **doc**: check for errors in 'listen' event (Benjamin Gruenbaum) [#4834](https://github.com/nodejs/node/pull/4834) +* [[`f462320f74`](https://github.com/nodejs/node/commit/f462320f74)] - **doc**: undo move http.IncomingMessage.statusMessage (Jeff Harris) [#4822](https://github.com/nodejs/node/pull/4822) +* [[`711245e5ac`](https://github.com/nodejs/node/commit/711245e5ac)] - **doc**: style fixes for the TOC (Roman Reiss) [#4748](https://github.com/nodejs/node/pull/4748) +* [[`611c2f6fdf`](https://github.com/nodejs/node/commit/611c2f6fdf)] - **doc**: proper markdown escaping -> \_\_, \*, \_ (Robert Jefe Lindstaedt) [#4805](https://github.com/nodejs/node/pull/4805) +* [[`5a860d9cb7`](https://github.com/nodejs/node/commit/5a860d9cb7)] - **doc**: Examples work when data exceeds buffer size (Glen Arrowsmith) [#4811](https://github.com/nodejs/node/pull/4811) +* [[`71ba14de86`](https://github.com/nodejs/node/commit/71ba14de86)] - **doc**: update list of personal traits in CoC (Kat Marchán) [#4801](https://github.com/nodejs/node/pull/4801) +* [[`97eedfc57a`](https://github.com/nodejs/node/commit/97eedfc57a)] - **doc**: harmonize $ node command line notation (Robert Jefe Lindstaedt) [#4806](https://github.com/nodejs/node/pull/4806) +* [[`2dde0f08c9`](https://github.com/nodejs/node/commit/2dde0f08c9)] - **doc**: add buf.indexOf encoding param with example (Karl Skomski) [#3373](https://github.com/nodejs/node/pull/3373) +* [[`66c74548de`](https://github.com/nodejs/node/commit/66c74548de)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733) +* [[`54e8845b5e`](https://github.com/nodejs/node/commit/54e8845b5e)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959) +* [[`fa940cf9bc`](https://github.com/nodejs/node/commit/fa940cf9bc)] - **fs**: remove unused branches (Benjamin Gruenbaum) [#4795](https://github.com/nodejs/node/pull/4795) +* [[`9b03af254a`](https://github.com/nodejs/node/commit/9b03af254a)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773) +* [[`101de9de3f`](https://github.com/nodejs/node/commit/101de9de3f)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) +* [[`55030922e5`](https://github.com/nodejs/node/commit/55030922e5)] - **lib**: scope loop variables (Rich Trott) [#4965](https://github.com/nodejs/node/pull/4965) +* [[`725ad5b1ce`](https://github.com/nodejs/node/commit/725ad5b1ce)] - **lib**: remove string_decoder.js var redeclarations (Rich Trott) [#4978](https://github.com/nodejs/node/pull/4978) +* [[`c09eb44a59`](https://github.com/nodejs/node/commit/c09eb44a59)] - **module**: refactor redeclared variable (Rich Trott) [#4962](https://github.com/nodejs/node/pull/4962) +* [[`612ce66c78`](https://github.com/nodejs/node/commit/612ce66c78)] - **net**: refactor redeclared variables (Rich Trott) [#4963](https://github.com/nodejs/node/pull/4963) +* [[`c9b05dafe0`](https://github.com/nodejs/node/commit/c9b05dafe0)] - **net**: move isLegalPort to internal/net (Evan Lucas) [#4882](https://github.com/nodejs/node/pull/4882) +* [[`1b49dfbe78`](https://github.com/nodejs/node/commit/1b49dfbe78)] - **node_contextify**: do not incept debug context (Myles Borins) [#4815](https://github.com/nodejs/node/issues/4815) +* [[`f8269fe365`](https://github.com/nodejs/node/commit/f8269fe365)] - **querystring**: check that maxKeys is finite (Myles Borins) [#5066](https://github.com/nodejs/node/pull/5066) +* [[`5a10fe932c`](https://github.com/nodejs/node/commit/5a10fe932c)] - **querystring**: use String.prototype.split's limit (Manuel Valls) [#2288](https://github.com/nodejs/node/pull/2288) +* [[`2844cc03dc`](https://github.com/nodejs/node/commit/2844cc03dc)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977) +* [[`853d73bb50`](https://github.com/nodejs/node/commit/853d73bb50)] - **src**: clean up usage of __proto__ (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069) +* [[`e93b024214`](https://github.com/nodejs/node/commit/e93b024214)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843) +* [[`a2c257a3ef`](https://github.com/nodejs/node/commit/a2c257a3ef)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757) +* [[`ee8d4bb075`](https://github.com/nodejs/node/commit/ee8d4bb075)] - **stream**: prevent object map change in TransformState (Evan Lucas) [#5032](https://github.com/nodejs/node/pull/5032) +* [[`c8b6de244e`](https://github.com/nodejs/node/commit/c8b6de244e)] - **stream**: refactor redeclared variables (Rich Trott) [#4816](https://github.com/nodejs/node/pull/4816) +* [[`fc3c32b582`](https://github.com/nodejs/node/commit/fc3c32b582)] - **test**: fix flaky test-dgram-pingpong (Rich Trott) [#5125](https://github.com/nodejs/node/pull/5125) +* [[`3effca6076`](https://github.com/nodejs/node/commit/3effca6076)] - **test**: mark flaky tests on Raspberry Pi (Rich Trott) [#5082](https://github.com/nodejs/node/pull/5082) +* [[`09917c99d8`](https://github.com/nodejs/node/commit/09917c99d8)] - **test**: fix `net-socket-timeout-unref` flakiness (Santiago Gimeno) [#4772](https://github.com/nodejs/node/pull/4772) +* [[`83da19aa48`](https://github.com/nodejs/node/commit/83da19aa48)] - **test**: fix redeclared test-event-emitter-* vars (Rich Trott) [#4985](https://github.com/nodejs/node/pull/4985) +* [[`87b27c913d`](https://github.com/nodejs/node/commit/87b27c913d)] - **test**: fix redeclared test-intl var (Rich Trott) [#4988](https://github.com/nodejs/node/pull/4988) +* [[`e98772d68e`](https://github.com/nodejs/node/commit/e98772d68e)] - **test**: remove redeclared var in test-domain (Rich Trott) [#4984](https://github.com/nodejs/node/pull/4984) +* [[`443d0463ca`](https://github.com/nodejs/node/commit/443d0463ca)] - **test**: add common.platformTimeout() to dgram test (Rich Trott) [#4938](https://github.com/nodejs/node/pull/4938) +* [[`90219c3398`](https://github.com/nodejs/node/commit/90219c3398)] - **test**: fix flaky cluster test on Windows 10 (Rich Trott) [#4934](https://github.com/nodejs/node/pull/4934) +* [[`3488fa81b5`](https://github.com/nodejs/node/commit/3488fa81b5)] - **test**: fix variable redeclarations (Rich Trott) [#4992](https://github.com/nodejs/node/pull/4992) +* [[`7dc0905d4d`](https://github.com/nodejs/node/commit/7dc0905d4d)] - **test**: fix redeclared test-util-* vars (Rich Trott) [#4994](https://github.com/nodejs/node/pull/4994) +* [[`53e7d605c9`](https://github.com/nodejs/node/commit/53e7d605c9)] - **test**: fix redeclared vars in sequential tests (Rich Trott) [#4999](https://github.com/nodejs/node/pull/4999) +* [[`a62ace9f7e`](https://github.com/nodejs/node/commit/a62ace9f7e)] - **test**: fix tls-no-rsa-key flakiness (Santiago Gimeno) [#4043](https://github.com/nodejs/node/pull/4043) +* [[`9b8f025816`](https://github.com/nodejs/node/commit/9b8f025816)] - **test**: fix redeclared vars in test-url (Rich Trott) [#4993](https://github.com/nodejs/node/pull/4993) +* [[`51fb8845d5`](https://github.com/nodejs/node/commit/51fb8845d5)] - **test**: fix redeclared test-path vars (Rich Trott) [#4991](https://github.com/nodejs/node/pull/4991) +* [[`b16b360ae8`](https://github.com/nodejs/node/commit/b16b360ae8)] - **test**: fix var redeclarations in test-os (Rich Trott) [#4990](https://github.com/nodejs/node/pull/4990) +* [[`d6199773e8`](https://github.com/nodejs/node/commit/d6199773e8)] - **test**: fix test-net-* variable redeclarations (Rich Trott) [#4989](https://github.com/nodejs/node/pull/4989) +* [[`9dd5b3e01b`](https://github.com/nodejs/node/commit/9dd5b3e01b)] - **test**: fix redeclared test-http-* vars (Rich Trott) [#4987](https://github.com/nodejs/node/pull/4987) +* [[`835bf13c1d`](https://github.com/nodejs/node/commit/835bf13c1d)] - **test**: fix var redeclarations in test-fs-* (Rich Trott) [#4986](https://github.com/nodejs/node/pull/4986) +* [[`71d7a4457d`](https://github.com/nodejs/node/commit/71d7a4457d)] - **test**: fix redeclared vars in test-vm-* (Rich Trott) [#4997](https://github.com/nodejs/node/pull/4997) +* [[`38459402a5`](https://github.com/nodejs/node/commit/38459402a5)] - **test**: fix inconsistent styling in test-url (Brian White) [#5014](https://github.com/nodejs/node/pull/5014) +* [[`4934798c0d`](https://github.com/nodejs/node/commit/4934798c0d)] - **test**: pummel test fixes (Rich Trott) [#4998](https://github.com/nodejs/node/pull/4998) +* [[`3970504298`](https://github.com/nodejs/node/commit/3970504298)] - **test**: remove var redeclarations in test-crypto-* (Rich Trott) [#4981](https://github.com/nodejs/node/pull/4981) +* [[`a2881e2187`](https://github.com/nodejs/node/commit/a2881e2187)] - **test**: remove test-cluster-* var redeclarations (Rich Trott) [#4980](https://github.com/nodejs/node/pull/4980) +* [[`c3d93299c2`](https://github.com/nodejs/node/commit/c3d93299c2)] - **test**: fix test-http-extra-response flakiness (Santiago Gimeno) [#4979](https://github.com/nodejs/node/pull/4979) +* [[`0384a43885`](https://github.com/nodejs/node/commit/0384a43885)] - **test**: Add assertion for TLS peer certificate fingerprint (Alan Cohen) [#4923](https://github.com/nodejs/node/pull/4923) +* [[`48a353fe41`](https://github.com/nodejs/node/commit/48a353fe41)] - **test**: scope redeclared vars in test-child-process* (Rich Trott) [#4944](https://github.com/nodejs/node/pull/4944) +* [[`89d1149467`](https://github.com/nodejs/node/commit/89d1149467)] - **test**: fix test-tls-zero-clear-in flakiness (Santiago Gimeno) [#4888](https://github.com/nodejs/node/pull/4888) +* [[`f7ed47341a`](https://github.com/nodejs/node/commit/f7ed47341a)] - **test**: remove Object.observe from tests (Vladimir Kurchatkin) [#4769](https://github.com/nodejs/node/pull/4769) +* [[`d95e53dc3b`](https://github.com/nodejs/node/commit/d95e53dc3b)] - **test**: refactor switch (Rich Trott) [#4870](https://github.com/nodejs/node/pull/4870) +* [[`7f1e3e929a`](https://github.com/nodejs/node/commit/7f1e3e929a)] - **test**: remove race condition in http flood test (Rich Trott) [#4793](https://github.com/nodejs/node/pull/4793) +* [[`6539c64e67`](https://github.com/nodejs/node/commit/6539c64e67)] - **test**: scope redeclared variable (Rich Trott) [#4854](https://github.com/nodejs/node/pull/4854) +* [[`62fb941557`](https://github.com/nodejs/node/commit/62fb941557)] - **test**: fix irregular whitespace issue (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`3b225209f0`](https://github.com/nodejs/node/commit/3b225209f0)] - **test**: fs.link() test runs on same device (Drew Folta) [#4861](https://github.com/nodejs/node/pull/4861) +* [[`1860eae110`](https://github.com/nodejs/node/commit/1860eae110)] - **test**: refactor test-net-settimeout (Rich Trott) [#4799](https://github.com/nodejs/node/pull/4799) +* [[`ae9a8cd053`](https://github.com/nodejs/node/commit/ae9a8cd053)] - **test**: mark test-tick-processor flaky (Rich Trott) [#4809](https://github.com/nodejs/node/pull/4809) +* [[`57cea9e421`](https://github.com/nodejs/node/commit/57cea9e421)] - **test**: remove test-http-exit-delay (Rich Trott) [#4786](https://github.com/nodejs/node/pull/4786) +* [[`2119c76d5a`](https://github.com/nodejs/node/commit/2119c76d5a)] - **test**: refactor test-fs-watch (Rich Trott) [#4776](https://github.com/nodejs/node/pull/4776) +* [[`e487b72459`](https://github.com/nodejs/node/commit/e487b72459)] - **test**: move cluster tests to parallel (Rich Trott) [#4774](https://github.com/nodejs/node/pull/4774) +* [[`8c694a658c`](https://github.com/nodejs/node/commit/8c694a658c)] - **test**: improve test-cluster-disconnect-suicide-race (Rich Trott) [#4739](https://github.com/nodejs/node/pull/4739) +* [[`14f5bb7a99`](https://github.com/nodejs/node/commit/14f5bb7a99)] - **test,buffer**: refactor redeclarations (Rich Trott) [#4893](https://github.com/nodejs/node/pull/4893) +* [[`62479e3406`](https://github.com/nodejs/node/commit/62479e3406)] - **tls**: scope loop vars with let (Rich Trott) [#4853](https://github.com/nodejs/node/pull/4853) +* [[`d6fbd81a7a`](https://github.com/nodejs/node/commit/d6fbd81a7a)] - **tls_wrap**: reach error reporting for UV_EPROTO (Fedor Indutny) [#4885](https://github.com/nodejs/node/pull/4885) +* [[`f513e66075`](https://github.com/nodejs/node/commit/f513e66075)] - **tools**: lint for empty character classes in regex (Rich Trott) [#5115](https://github.com/nodejs/node/pull/5115) +* [[`e05bb409a6`](https://github.com/nodejs/node/commit/e05bb409a6)] - **tools**: lint for spacing around unary operators (Rich Trott) [#5063](https://github.com/nodejs/node/pull/5063) +* [[`7fa5959c59`](https://github.com/nodejs/node/commit/7fa5959c59)] - **tools**: fix redeclared vars in doc/json.js (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`e95fd6ae70`](https://github.com/nodejs/node/commit/e95fd6ae70)] - **tools**: apply linting to doc tools (Rich Trott) [#4973](https://github.com/nodejs/node/pull/4973) +* [[`777ed82162`](https://github.com/nodejs/node/commit/777ed82162)] - **tools**: fix detecting constructor for JSON doc (Timothy Gu) [#4966](https://github.com/nodejs/node/pull/4966) +* [[`5d55f59c85`](https://github.com/nodejs/node/commit/5d55f59c85)] - **tools**: add property types in JSON documentation (Timothy Gu) [#4884](https://github.com/nodejs/node/pull/4884) +* [[`fd5c56698e`](https://github.com/nodejs/node/commit/fd5c56698e)] - **tools**: add support for subkeys in release tools (Myles Borins) [#4807](https://github.com/nodejs/node/pull/4807) +* [[`34df6a5c0c`](https://github.com/nodejs/node/commit/34df6a5c0c)] - **tools**: enable assorted ESLint error rules (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`386ad7e0b5`](https://github.com/nodejs/node/commit/386ad7e0b5)] - **tools**: fix setting path containing an ampersand (Brian White) [#4804](https://github.com/nodejs/node/pull/4804) +* [[`e415eb27e5`](https://github.com/nodejs/node/commit/e415eb27e5)] - **url**: change scoping of variables with let (Kári Tristan Helgason) [#4867](https://github.com/nodejs/node/pull/4867) +* [[`b2c8b7f6d3`](https://github.com/nodejs/node/commit/b2c8b7f6d3)] - internal/child_process: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752) +* [[`5a77c095a6`](https://github.com/nodejs/node/commit/5a77c095a6)] - Event emitters support symbols as event names. The process object (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) + ## 2016-01-20, Version 5.5.0 (Stable), @evanlucas ### Notable Changes diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown index 85e87a6b6fc8f8..4206d0778de596 100644 --- a/doc/api/buffer.markdown +++ b/doc/api/buffer.markdown @@ -75,8 +75,8 @@ The character encodings currently supported by Node.js include: Buffers are also `Uint8Array` TypedArray instances. However, there are subtle incompatibilities with the TypedArray specification in ECMAScript 2015. For instance, while `ArrayBuffer#slice()` creates a copy of the slice, -the implementation of [`Buffer#slice()`][] creates a view over the existing -Buffer without copying, making `Buffer#slice()` far more efficient. +the implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the +existing Buffer without copying, making `Buffer#slice()` far more efficient. It is also possible to create new TypedArray instances from a `Buffer` with the following caveats: @@ -1351,17 +1351,16 @@ socket.on('readable', () => { Use of `SlowBuffer` should be used only as a last resort *after* a developer has observed undue memory retention in their applications. -[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols -[`Array#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf [`Array#includes()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes +[`Array#indexOf()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf +[`buf.entries()`]: #buffer_buf_entries [`buf.fill(0)`]: #buffer_buf_fill_value_offset_end +[`buf.keys()`]: #buffer_buf_keys [`buf.slice()`]: #buffer_buf_slice_start_end +[`buf.values()`]: #buffer_buf_values [`buf1.compare(buf2)`]: #buffer_buf_compare_otherbuffer -[`Buffer#slice()`]: #buffer_buf_slice_start_end +[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify [`RangeError`]: errors.html#errors_class_rangeerror [`String.prototype.length`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length [`util.inspect()`]: util.html#util_util_inspect_object_options -[`buf.values()`]: #buffer_buf_values -[`buf.keys()`]: #buffer_buf_keys -[`buf.entries()`]: #buffer_buf_entries -[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify +[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols diff --git a/doc/api/console.markdown b/doc/api/console.markdown index b6214c47923f75..5ca6ddc149e5f8 100644 --- a/doc/api/console.markdown +++ b/doc/api/console.markdown @@ -53,19 +53,10 @@ duplicate the browsers functionality exactly. ## Asynchronous vs Synchronous Consoles -The console functions are synchronous when the destination is a terminal or -a file (to avoid lost messages in case of premature exit) and asynchronous -when the destination is a pipe (to avoid blocking for long periods of time). - -In the following example, stdout is non-blocking while stderr is blocking: - -``` -$ node script.js 2> error.log | tee info.log -``` - -Typically, the distinction between blocking/non-blocking is not important -unless an application is logging significant amounts of data. High volume -logging *should* use a `Console` instance that writes to a pipe. +The console functions are asynchronous unless the destination is a file. +Disks are fast and operating systems normally employ write-back caching; +it should be a very rare occurrence indeed that a write blocks, but it +is possible. ## Class: Console diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown index 7818e508d24524..0872f311a56290 100644 --- a/doc/api/dgram.markdown +++ b/doc/api/dgram.markdown @@ -86,7 +86,7 @@ Returns an object containing the address information for a socket. For UDP sockets, this object will contain `address`, `family` and `port` properties. -### [socket.bind([port][, address][, callback])] +### socket.bind([port][, address][, callback]) * `port` Integer, Optional * `address` String, Optional diff --git a/doc/api/os.markdown b/doc/api/os.markdown index 6c1a6f3634e69a..ea4f40ba79e958 100644 --- a/doc/api/os.markdown +++ b/doc/api/os.markdown @@ -14,7 +14,7 @@ system. ## os.arch() Returns the operating system CPU architecture. Possible values are `'x64'`, -`'arm'` and `'ia32'`. Returns the value of `process.arch`. +`'arm'` and `'ia32'`. Returns the value of [`process.arch`][]. ## os.cpus() @@ -159,7 +159,7 @@ interfaces that have been assigned an address. Returns the operating system platform. Possible values are `'darwin'`, `'freebsd'`, `'linux'`, `'sunos'` or `'win32'`. Returns the value of -`process.platform`. +[`process.platform`][]. ## os.release() @@ -181,3 +181,6 @@ on OS X and `'Windows_NT'` on Windows. ## os.uptime() Returns the system uptime in seconds. + +[`process.arch`]: process.html#process_process_arch +[`process.platform`]: process.html#process_process_platform diff --git a/doc/ctc-meetings/2016-01-20.md b/doc/ctc-meetings/2016-01-20.md new file mode 100644 index 00000000000000..ceffa500b103b6 --- /dev/null +++ b/doc/ctc-meetings/2016-01-20.md @@ -0,0 +1,337 @@ +# Node Foundation CTC Meeting 2016-01-20 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/ctc-meeting-2016-01-20 +* **GitHub Issue**: https://github.com/nodejs/node/issues/4780 +* **Minutes Google Doc**: +* _Previous Minutes Google Doc: _ + +## Present + +* James Snell (CTC) +* Trevor Norris (CTC) +* Colin Ihrig (CTC) +* Brian White (CTC) +* Alexis Campailla (CTC) +* Bert Belder (CTC) +* Chris Dickinson (CTC) +* Shigeki Ohtsu (CTC) +* Steven Loomis (observer) +* Mikeal Rogers (observer) +* Jeremiah Senkpiel (CTC) +* Rod Vagg (CTC) +* Ben Noordhuis (CTC) +* Domenic Denicola (observer) +* Nikita Skovoroda (observer) +* Ali Sheikh (observer) +* Evan Lucas (observer) + +## Agenda + +Extracted from **ctc-agenda** labelled issues and pull requests from the **nodejs org** prior to the meeting. + +### nodejs/node + +* Enable Node.js to run with Microsoft's ChakraCore engine [#4765](https://github.com/nodejs/node/pull/4765) +* CTC Membership Nominations [#4750](https://github.com/nodejs/node/issues/4750) +* buffer: add Buffer.from(), Buffer.zalloc() and Buffer.alloc(), soft-deprecate Buffer(num) [#4682](https://github.com/nodejs/node/pull/4682) +* Buffer(number) is unsafe [#4660](https://github.com/nodejs/node/issues/4660) +* util: deprecate `util._extend` [#4593](https://github.com/nodejs/node/pull/4593) +* ArrayBuffer.isView() and buffer.buffer property [#4420](https://github.com/nodejs/node/issues/4420) +* doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) +* Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) +* fs: optimize realpath using uv_fs_realpath() [#3594](https://github.com/nodejs/node/pull/3594) + +## Standup + +* James Snell (CTC): Working on the Buffer issue, work on HTTP module, reviewing issues and PRs, attempting to help on 4.2.5, +* Trevor Norris (CTC): AsyncWrap related things +* Colin Ihrig (CTC): Reviewing issues and PRs. Reverted a commit +* Brian White (CTC): Not much, commenting on PRs and issues. +* Alexis Campailla (CTC): Fixing Windows issues on libuv and npm +* Bert Belder (CTC): _[CD - missed what you were looking into due to cross talk]_ +* Mikeal Rogers (observer): Various projects coming into the Foundation +* Jeremiah Senkpiel (CTC): Onboarding new release team members, Working on Timers Refactor more, trying to make sure Chakra and Buffer discussions remain productive +* Rod Vagg (CTC): Working with new contributors, lots of meetings +* Chris Dickinson (CTC): Docs WG stuff +* Shigeki Ohtsu (CTC): +* Steven Loomis (observer): +* Ben Noordhuis (CTC): Been sick, still catching up. +* Rich Trott (observer): Making tests more reliable, spinning up Testing WG +* Nikita Skovoroda “Chalker” (observer): mostly buffer, also the api usage greps are now sorted based on downloads count +* Ali Sheikh (observer): sampling heap profiler in V8 +* Domenic (observer): modules and zones +* Evan Lucas (observer): Working on getting v5.5.0 Release out and looking into v8 extras for some of the builtins. + +## Review of last meeting + +* Nominating new Release team members [#4319](https://github.com/nodejs/node/issues/4319) +* repl: Reverses order of .node_repl_history [#4313](https://github.com/nodejs/node/pull/4313) +* doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) +* Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) +* Potential Licensing issues with npm [#3959](https://github.com/nodejs/node/issues/3959) +* Joyent Copyright still in header of many files [#3926](https://github.com/nodejs/node/issues/3926) +* gripe: deprecating fs.exists/existsSync [#1592](https://github.com/nodejs/node/issues/1592) + +## Minutes + +### Enable Node.js to run with Microsoft's ChakraCore engine [#4765](https://github.com/nodejs/node/pull/4765) + +Put on agenda by Alexis + +Alexis: MS submitted a PR for supporting Chakracore, change in node is fairly small — the shim is in the deps folder. A few CTC members have expressed interest in landing. I was wondering if anyone had opinions about how to proceed with this? + +Domenic: I’m curious about what level of support is implied. Landing it reduces the requirement of maintaining a separate fork, but + +Domenic: What’s the CTC’s goal in merging it in? + +Alexis: Adds Windows IoT. + +Domenic: but it doesn’t, because we’re not supporting it. + +Alexis: I still can build it myself. + +James: As for “why would we land it” — if this is something we think we will eventually support, landing it sends a clear signal that this is the direction we are heading. Landing it now lets the community start contributing to it, and to figure out how + +Trevor: If it was landed, we would not be providing official builds on the website. + +Jeremiah: Maybe Canary builds? + +Mikeal: Microsoft is already providing builds of this. By bringing this into the mainline, the changes get reviewed by the Core team. Its a matter of are those builds off of Node core mainline, or + +Jeremiah: Have we decided we want to this? + +Rod: We’re making a lot of assumptions. + +Trevor: Could we start an issue and list concerns? + +Domenic: Would it be a good idea to restrict to collaborators? + +Jeremiah: There’s not enough outside noise. + +Trevor: Well, the PR has garnered over 100 comments in 24 hours. + +Jeremiah: But it’s not spam. + +Mikeal: What is the title of that issue? + +Domenic: “What is the CTC’s decision on whether to merge the ChakraCore PR?” + +Trevor: or, “Things that prevent it from landing” — if we would hold back a V8 version due to incompability with the shim. James mentioned some concerns as well. + +Jeremiah: How are we going to support a shimmed VM — not officially, but for ourselves in the codebase, when we’re still using a V8 api and exposing that. + +Rod: that’s just one of the questions. + +Mikeal: No one is ever going to say “let’s support chakra” until it’s been in the codebase for a while, and has seen the MS folks show up and support it. + +Rod: We still need to get everyone on board that we want to head in that direction. I don’t think it’s fair to say “get it in the codebase and we’ll sort it out”. I see a lot of assumptions in the thread, and we need to air those assumptions and discuss them + +Mikeal: Is the discussion, “do we want to move in a VM agnostic direction?” Can we scope this? + +Domenic: My worry is: I don’t think the CTC might want to imply full VM agnosticity — they might not want to accept a spidermonkey PR? Maybe making it smaller would makemaek it easier. + +Bert: I agree with Rod that we haven’t actually had the discussion. I’ve always thought it was cool, and pushed for it, but I think _[CD ...]_ +What’s frustrating is that someone has done all the work to land a VM, but we kind of expect it to be “more than perfect” before we land it. I would suggest landing it first but not including it as a default, so we can do comparisons. + +Trevor: don’t feel too bad about this — they had to do this to support IoT. +Bert: I don’t feel bad; are we going to build a higher and higher wall until + +Rod: the problem is that we’re not on the same page, and we need to get on the same page. I’m not hearing anyone say outright that they don’t want VM agnostic. But we’re all saying different things. + +James: I agree. I don’t think there should be any rush in getting the PR landed. We can do some of that review process and take our time over the next few weeks to figure out if this is what we want to do. I don’t think anyone is saying “land it now!” We can take our time. + +Rod: My suggestion is to move back to the issue and let it evolve, and suss out the main philosophical issues from there. There’s so many things to talk about in that thread, and everyone’s g +ot a different take. We’ve got to summarize, and take our time. + +### CTC Membership Nominations [#4750](https://github.com/nodejs/node/issues/4750) + +Rod: A vote will be held in a few weeks time. In the meantime we’ll be in observer mode for these additional people. Not much to discuss here other than, “welcome!” + +### buffer: add Buffer.from(), Buffer.zalloc() and Buffer.alloc(), soft-deprecate Buffer(num) [#4682](https://github.com/nodejs/node/pull/4682) +### Buffer(number) is unsafe [#4660](https://github.com/nodejs/node/issues/4660) + +Rod: want to take it away, James? + +James: Sure everyone’s familiar with the issue up to this point. `Buffer` constructor (`Buffer(num)` or `Buffer(value)` with overloaded). Some portion of the community saying that needs changed, some real world examples of security flaws in the wild, community consensus seems to be that the API should be cleaned up — introducing new factory methods, + +Trevor: Careful saying “community consensus” + +James: Yeah — yes, the discussion seems to lead to where 4682 is now, which has been created as an EPS issue as well (https://github.com/nodejs/node-eps/pull/4). The basic idea is to introduce `Buffer.{from,alloc,allocUnsafe}()`. `allocUnsafe()` would be our current behavior for `Buffer(num)`, alloc would be zero-filled, `.from` takes the place of `Buffer(value)`. Deprecation of constructor would be docs-only, with _possibly_ a warning printed, similar to the memory leak warning on event emitter listeners. The documentation updates go along with that. That’s the overview of the discussion. _[CD phew!]_ + +Bert: What is the argument for not zeroing out buffers, exactly? why do we want to keep supporting that behavior? + +James: comes down to perf + +Trevor: That’s it. You don’t always need to zero fill. + +Domenic: I tried to read through the threads, last I saw there were no benchmarks that were completely fair. `calloc` vs. `memset`, etc. Have there been updated benchmarks? + +Trevor: if the allocation is small enough that it can use the pool, it’s not going to have perf degradation when it becomes larger. + +Domenic: My understanding with larger values is that with calloc makes it free. + +Trevor: No — over 1-4kb. + +Domenic: I don’t know what size “large” is supposed to be for calloc. + +Trevor: I’ve tried for 1mb; perf penalty is 2-3x slower, depending on size. From a dozen to a couple hundred microseconds. + +Domenic: That kind of argues to me for “safe by default.” + +Trevor: I can read in 100’s and 100’s of JSON files all of which are large, I can use fs.read with a buffer, so you have to allocate a buffer, if I have to zerofill it when I’m just going to fill it anyway, that’s just wasted cycle. + +Bert: I think most of the time that will not be the bottleneck. We might have an internal api… + +Trevor: No — the perf penalty on that is so big. This is why I initially got rid of the pooling after my first rewrite. + +Bert: optimization doesn’t have to be done right away. If you’re allocating large buffers, you’re usually mmaping it, so you don’t have to zero fill. + +Ben: But the OS is zeroing it out. + +Bert: So we don’t have to. + +Ben: There’s still CPU time being used there — it’s not free. + +James: The PR has three methods: _[CD — missed the first part]_ `alloc` will do `calloc` under the covers. If a 2nd param is passed, it will do `allocUnsafe` and fill with the string. We can compare all of these using the PR. The current implementation alloc can be 30-60% slower than `allocUnsafe`. + +Ben: We can farm out allocations to another thread, the other thread might need to overalloc a little just to have a bit in reserve. + +Trevor: At minimum that would work for the buffer pool, which is a set size anyway. + +Ben: Is anyone volunteering to write that code? + +James: I already have my hands in there. I need to look into the native buffer constructor anyway. I’ll bring it back to the discussion when I get there. + +Bert: that sounds great. I’m very happy that some experimentation and benchmarking is going on. I’m much in favor of a simple api that is safe by default. Adding a bunch of stuff — like the deprecation in the docs — we are doing too much to deal with not a very complicated issue. + +Mikeal: If you look at all of the exploits, just zero filling doesn’t solve them — they’re still a DoS vector, but no longer a disclosure. WE need the from and alloc APIs to avoid these + +Domenic: that’s a good point. I think adding more explicit APIs would help. + +James: Thank you for pointing that out — it’s an API usability issue. If we decide to zero fill by default this becomes much easier to figure out and we don’t have as much surface area to expand. There is an LTS concern with that — if we switch the default then we run into an issue where we open up a security problem, where modules assume buffer zero fills by default when it doesn’t on the current node version. I’m fine with zero-fill by default. + +Domenic: Real world apps don’t run into perf problems with this quite so often. + +Rod: What do we need to do to move forward? + +James: Ideas on speeding up initialization. Comment on the thread and we’ll go from there. + +### util: deprecate `util._extend` [#4593](https://github.com/nodejs/node/pull/4593) + +Rod: A bunch of +1’s and -1’s. + +Jeremiah: `util._extend` was added Object.assign wasn’t a thing back when we needed it, but since it was publicly exposed, all kinds of folks have used this thing and it’s in wide use. We’re discussing what we want to do with this now that Object.assign is a thing — phase out it’s use? + +Trevor: Is object.assign able to be swapped in? + +Domenic: 95% sure that is the case. + +Trevor: Could we deprecate `_extends` and change it to do Object.assign for the user. + +Domenic: If you overrode object.keys it would give different results. + +Jeremiah: `_extend` is not documented anyway, so for folks to move off of it we’d have to add docs for it or add a deprecation warning + +Rod: my concern: It’s in wide use, it’s undocumented — it just seems like a purist thing to me. “Stop using core stuff!” Apparently Object.assign is a bit slower than extend for our use in core, anyway. I just don’t see any justification for this. + +Domenic: I tend to agree. On the web we’ve got all of this stuff “webkitMatchesSelector” – better to just document it. + +Trevor: I guess what I’m getting at is that there are philosophical issues in trying to + +Document deprecation, but don’t warn on use. + +Domenic is writing a list of minor differences: https://github.com/nodejs/node/pull/4593#issuecomment-173357276 + +### ArrayBuffer.isView() and buffer.buffer property [#4420](https://github.com/nodejs/node/issues/4420) + +Trevor: now that buffer inherits from uint8array, there are undocumented methods on it. If we document that buffer extends from uint8array, then we are supporting those APIs. + +Domenic: I think it’s confusing. Either the TypedArray methods are supported or they aren’t — null them out if they’re not. + +Jeremiah: Probably nulling these things out is a good idea. + +James: in the docs we tell folks that it is a Uint8Array. + +Trevor: Documenting sounds great to me — I can get on that if everyone agrees. + +### doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) + +Chris: current state: call for new members (GitHub, Twitter), got significant reach, several people raising hands. Worked to define what membership means in the governance doc. Onboarding people that raised their hands. Had a second meeting for the group today. Everyone happy to work within the node repo, transition period with guides in the website repo before we get them building in the node repo. Don’t want to block core work so happy to do post-review of docs instead of holding up merges. Have a slack for collaboration now too. + +Rod: what would the post-review process look like? Similar to what we have now with the addition of review for style etc. from docs group? + +Chris: Yes, normal process, lgtm from collaborators, etc. Do a weekly review of the changes in the docs directory and do updates for that. Use slack for this by having a GitHub integration. + +Rod: Happy with progress? + +Chris: yes, going well. Building a Roadmap now for what’s going to be done. Need to telegraph what’s going to be done before it’s done. + +Jeremiah: nobody has worked on the doctool for years, is that on the roadmap? + +Chris: Plan is to build something new alongside it. + +Chris: What else needs to be done to move forward with ratification? + +Rod: Sounds like the boxes have been ticked so probably best to move back to the PR-to-core process and bring it for a vote at this meeting. + +### Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) + +Rod: No progress on that. There’s supposed be another meeting, maybe next week — no material update. I’ll keep it on the agenda to make sure we’re updated with the progress. + +### fs: optimize realpath using uv_fs_realpath() [#3594](https://github.com/nodejs/node/pull/3594) + +Trevor: There’s now realpath in libuv, making the syscall is much faster than going through the JS logic we now have. Using the cache reduces the number of lstat calls — the question is: can we work towards changing the current realpath impl to call realpath in libuv more frequently as our investigation shows is useful — since it’s faster than doing the JS logic, even with the cache. + +Jeremiah: Were there concerns about changing behavior? + +Trevor: If you give it a bad cache it would no longer fail. Some of those issues were nonissues — there’s another one about symlinks. Little edge cases that we wouldn’t consider a problem. + +Jeremiah: If we use realpath(2) that would affect the module resolution? + +Bert: Module also goes through realpath. Hopefully it doesn’t change semantics if impl changes. If the semantics stay the same, it shouldn’t be an issue. Trevor, I’ll give you an issue on why it is the way it is. On OSX, realpath could trigger a buffer overflow, there was no workaround but to write your own. On windows, it used to not exist. We used readlink on all platforms to build our realpath. + +Trevor: To clarify: we make a libuv call, not a syscall + +Bert: Libuv would need to implement this logic — maybe Ben knows? + +Ben: The issue where you could not safely allocate a buffer for the call to store its result in? That used to be an issue with OSX until 10.7 I believe, but we don’t support that anymore, so should not be an issue anymore + +Bert: If we drop WinXP support, it becomes very easy to support + +Trevor: I think we have + +Bert: I’m pretty sure it does not — [cd: might need filled in] + +Trevor: Going to test more, if the results support what you said, are you OK with using the native implementation? This boiled down to throwing away the second optional argument of the cache. + +Bert: The cache has other issues — it can be inconsistent with what’s on disk, for example + +Trevor: We’ll test it and post results. Thank you. + +Bert: cool. + +Rod: do we need to open an issue to officially drop support WinXP? + +Alexis: Changing to prevent install? + +Bert: Sooner rather than later, I think. It’d have to be a major version, and libuv would have to bump to v2 before we could drop the platform. + +Jeremiah: I don’t think that’s an issue on our end. + +Bert: It is — + +Rod: Alexis, are you in on that discussion? + +Alexis: it was a constraint of node, I thought. Everybody agreed that we would prevent node startup on winxp. + +Rod: Back to GitHub! + +### ES Module EP [nodejs/node-eps#3](https://github.com/nodejs/node-eps/pull/3) + +Trevor: One quick thing: bmeck has been working on a EP for ES2015 module loading, figuring out how it could work in node alongside commonJS — originally it was going to be [a?]synchronous. He posted a proposed API for V8, they agreed to implement it, but they want assurances that the CTC agrees on that API. What I want to say: everybody go read the module spec and +1 it. To say “Yes, if V8 adds this API, we will use it to implement ES2015 modules and the Loader spec, too.” Any questions on that? + +## Next Meeting + +2016-01-27 diff --git a/doc/ctc-meetings/2016-01-27.md b/doc/ctc-meetings/2016-01-27.md new file mode 100644 index 00000000000000..3e185c973babfd --- /dev/null +++ b/doc/ctc-meetings/2016-01-27.md @@ -0,0 +1,295 @@ +# Node Foundation CTC Meeting 2016-01-27 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/ctc-meeting-2016-01-27 +* **GitHub Issue**: https://github.com/nodejs/node/issues/4901 +* **Minutes Google Doc**: +* _Previous Minutes Google Doc: _ + +## Present + +* James Snell (CTC) +* Trevor Norris (CTC) +* Colin Ihrig (CTC) +* Brian White (CTC) +* Alexis Campailla (CTC) +* Bert Belder (CTC) (absent) +* Chris Dickinson (CTC) +* Shigeki Ohtsu (CTC) (absent) +* Steven Loomis (observer) (absent) +* Mikeal Rogers (observer) +* Fedor Indutny (CTC) +* Jeremiah Senkpiel (CTC) +* Rod Vagg (CTC) +* Ben Noordhuis (CTC) +* Domenic Denicola (observer) (absent) +* Nikita Skovoroda (observer) +* Ali Sheikh (observer) (absent) +* Evan Lucas (observer) +* Rich Trott (observer) +* Michael Dawson (observer) + + +## Agenda + +Extracted from **ctc-agenda** labelled issues and pull requests from the **nodejs org** prior to the meeting. + +* Enable Node.js to run with Microsoft's ChakraCore engine [#4765](https://github.com/nodejs/node/pull/4765) +* CTC Membership Nominations [#4750](https://github.com/nodejs/node/issues/4750) +* buffer: add Buffer.from(), Buffer.alloc() and Buffer.allocUnsafe(), soft-deprecate Buffer(num) [#4682](https://github.com/nodejs/node/pull/4682) +* Buffer(number) is unsafe [#4660](https://github.com/nodejs/node/issues/4660) +* doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) +* Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) +* Drop Windows XP (and Vista) support in 6.0 [#3804](https://github.com/nodejs/node/issues/3804) + +## Standup + +* James Snell (CTC) — Buffer API change proposal, PR review, error handling summit yesterday, community related issues +* Trevor Norris (CTC) — Writing a patch for Buffer#fill, so it can accept an encoding and a buffer; making MakeCallback reentrant; have a fix but not sure how it’ll affect 3p debugger modules; want to be thorough because this should extend back to v4 +* Colin Ihrig (CTC) — Reviewing issues/PRs, fixing bugs; PR landed in libuv for looking up tmpdir, PR into child process +* Brian White (CTC) — Reviewing/commenting on PRs and issues, working on JS optimizations inside core modules. +* Alexis Campailla (CTC) — Issues/PRs, some work in the testing repo, some work in CI, visual C++ build tools for making modules, investigated a couple issues in libuv +* Chris Dickinson (CTC) — docs WG organization +* Mikeal Rogers (observer) — New education initiatives coming up from Foundation board, legal, working on size & scope of TSC stuff and the incubator +* Jeremiah Senkpiel (CTC) — Administrative and TSC stuff; moderating large issues [CD — thank you!] +* Rod Vagg (CTC) — (Possibly catching up on sleep) +* Ben Noordhuis (CTC) — Reviewing libuv+node PRs, reply to issues, 2 months ahead are busy +* Nikita Skovoroda (observer) — some comments/reviews, nothing interesting. Npm code search update. [JS - Thanks for doing the npm search things!] +* Evan Lucas (observer) — Minor dns/net cleanups, Responding to issues/PRs +* Rich Trott (observer) — Tests, spinning up Testing WG, removing redeclaration of vars from code, especially tests, thus reducing side effects and making it easier to split up tests. +* Michael Dawson (observer) — Benchmarks, results of benchmarks on the website, PPC for big endian machines, V8 testing separate from the node install +* Fedor Indutny (CTC) - Reviewing Pull Requests, fixing issues, V8 code cache API +* Seth Thompson (observer) - Google folks replied to James’ scheduling for face to face meeting for talking about swapping out VMs + +## Review of last meeting + + +* Enable Node.js to run with Microsoft's ChakraCore engine [#4765](https://github.com/nodejs/node/pull/4765) +* CTC Membership Nominations [#4750](https://github.com/nodejs/node/issues/4750) +* buffer: add Buffer.from(), Buffer.zalloc() and Buffer.alloc(), soft-deprecate Buffer(num) [#4682](https://github.com/nodejs/node/pull/4682) +* Buffer(number) is unsafe [#4660](https://github.com/nodejs/node/issues/4660) +* util: deprecate `util._extend` [#4593](https://github.com/nodejs/node/pull/4593) +* ArrayBuffer.isView() and buffer.buffer property [#4420](https://github.com/nodejs/node/issues/4420) +* doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) +* Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) +* fs: optimize realpath using uv_fs_realpath() [#3594](https://github.com/nodejs/node/pull/3594) + + +## Minutes + +### Enable Node.js to run with Microsoft's ChakraCore engine [#4765](https://github.com/nodejs/node/pull/4765) + +Alexis: No action items on the PR itself, which was locked to collabs, since it was turning into noise. Another issue was opened (roadmap#54) by Mikeal re: whether we should be VM agnostic in the future, there’s discussion of pros and cons as well as talk of how this might happen in the future. Chakra folks are on board for the API wg group / VM agnostic API. + +Fedor: Do we have consensus yet? + +Alexis: Not yet. + +Mikeal: The vast majority agree that we should be moving toward it, + +Ben: Is it actually true? I’ve seen it go both ways. + +Mikeal: I haven’t seen objections to being VM neutral, but how we go about it — there’s no agreement at all. + +James: There’s concerns around language support between the two and how that affects us — there’s a lot of issues like that, related to the “how” we go about this, but there seems to be a consensus that this is the way we want to go. + +Mikeal: I’d like to do this before April? + +Ben: Are there collaborators that haven’t spoken up yet, on the principle that they don’t feel too strongly about it? + +Jeremiah: I’m more in line with Oglas (the guy maintaining JXCore), he’s got a lot of experience with this, and his idea was to move to its own VM. I’m not sure we could + +Trevor: You mean maintaining our own VM? + +Mikeal: I had a conversation with Mark Mayo and he thought that would be the direction we’d actually land. + +Alexis: That would require an enormous amount of resources. + +Mikeal: This PR, you say we locked it to collabs, but aren’t the folks posting it not collabs? + +Jeremiah: In the meantime we can add them to a team for this purpose. + +Alexis: I think it looks like the original PR submitter can still comment. + +Alexis: I can facilitate since I’m in contact with them daily. + +Mikeal: We should create teams for V8 and a team for Chakra, for our convenience. + +Alexis: We do have a v8 team, but I think it’s the Node experts on V8. + +Seth: I can make sure the right people from the team are on there. + +Alexis: And I can create one for the Chakra team. + +Michael: there are a few folks I’d like to add from my team, how would I do it. + +Mikeal: James can do it. + +Another question: assuming we do move this direction, should we start an issue around no longer pulling deps into the source tree? + +Michael: Being vm-neutral doesn’t mean we bring in every VM into the source tree? + +Mikeal: But we’re set up to do that right now. + +Alexis: This also affects ICU. + +Jeremiah: I don’t think this is an immediate concern. + +Fedor: Release cycle — Chakra and V8’s release cycle are not aligned, how will that affect us? + +Alexis: Chakra team has folks dedicated to working with Node’s release cycle, so we would align. + +Mikeal: If we tackle this ABI compatibility problem, we may end up revisiting the release cycle since that’s driven by these big VM breaks. + +### CTC Membership Nominations [#4750](https://github.com/nodejs/node/issues/4750) + +Jeremiah: We’re going to keep this open for a couple weeks while the nominees sit in. The vote is TBD. We don’t do this often so the process is rusty. + +### buffer: add Buffer.from(), Buffer.alloc() and Buffer.allocUnsafe(), soft-deprecate Buffer(num) [#4682](https://github.com/nodejs/node/pull/4682) + +James: Where we’re at right now: continuing to update the PR and the EPS proposal that goes along with this based on the conversation. The new APIs seem uncontroversial. Unsurprisingly the name of one method is the most controversial. Currently, it’s allocUnsafe, a few folks don’t like “Unsafe”, would prefer “Raw”. [CD - yay bikesheds!] + +Some of the feedback from Trevor was that the API should be tweaked a bit, where we can pass encoding or a buffer to `.fill`, other than that the conversation around it is dying down. We haven’t decided if we’re going to change the default `new Buffer(n)` to zero-fill — if we do make that change we have to make it all the way down to v0.10 to keep it consistent. + +Mikeal: Call it buffer.remoteDisclosure(). + +Just kidding. + +Ben: if we could make zero-fill as fast as the current impl, then we would of course pick that. + +James: Yes. + +Ben: I’ve been playing with doing init in a separate thread. Perhaps I can close the gap. + +Mikeal: The only objection is perf. + +James: Yep. The baseline impl is that zero fill uses calloc. + +Trevor: We use a pool. It’s always been possible to reach the pool from any buffer instance. Do we want to remove pooling? + +James: Current impl is that zerofill does not pool. + +Trevor: So much overhead! + +_(in document chat)_ + +_Chris: why not use WeakMap for pooling?_ + +_Ben: no weakmaps in v0.10._ + +Jeremiah: Do we have benchmarks for calloc? + +James: Once we get a little further, I’ll revisit benchmarks. + +Trevor: Can the kernel do magic where memory isn’t actually allocated when it’s done in a tight loop? [CD - I didn’t capture this completely] + +Ben: You can mmap memory, memory isn’t actually allocated + zerofilled until you touch it, but touching it causes a page fault. + +### Buffer(number) is unsafe [#4660](https://github.com/nodejs/node/issues/4660) + +Jeremiah: Looks like we covered this. + +### doc: add Docs working group [#4244](https://github.com/nodejs/node/pull/4244) + +Chris: Onboarded some folks. Completed drafting the docs roadmap proposal. Making sure we have adequate tooling to build docs to the website from the node.js core repo. + +Chris: There is a docs wg meeting next week [10AM PST] [Wednesday @ 10am Feb 3rd] + +Chris: Also working with the inclusivity WG to make a new collaborator guide. + +Ben: No loosening of commit formatting, right? + +Chris, Mikeal: nope + +Jeremiah: Has anyone read through the proposed charter? + +Mikeal: hasn’t changed recently + +Ben, James: read though it recently, lgtm + +Jeremiah: Vote? + +Mikeal: No need, no-one objects. + +Jeremiah: Ok, good to go. + +### Seek legal advice on LICENSE and copyright blocks in code [#3979](https://github.com/nodejs/node/issues/3979) + +Mikeal: We’re nearing final documents, and we have some additions to contributing guide that come from legal. The SPDX stuff we talked about. The Foundations IP policy, we mention that we’re going to use CC-4.0 for docs. We should put this to the Docs WG about this. We should have a proper policy from the legal committee really soon. + +Chris: I will bring the CC-4.0 license to the Docs WG. + +### Drop Windows XP (and Vista) support in 6.0 [#3804](https://github.com/nodejs/node/issues/3804) + +Jeremiah: Realpath brought this back up. + +Ben: That was Rod but I can take over. The proposal was to drop vista support in the next major release, that would let us drop a lot of legacy of code. TBH, I thought we had already decided on this, so I’m surprised about this. If you’re not in favor, now would be the time to speak up. + +Trevor: Didn’t libuv drop XP? + +Ben: Nope. + +Trevor: Everything but some subset of the API works on XP? + +Alexis: I also thought this decision was already made. + +Jeremiah: It might have been in some other issue. I seem to recall. + +Alexis: Does anyone object to dropping XP? + +_[crickets]_ + +Fedor: I do! `` + +No objections. + +Alexis: Does anyone object to drop Vista support. + +Mikeal: Let’s get data from NPM. + +Ben: Info was posted on the issue, looks like there’s more XP users than Vista, but still very small percentage. + +Mikeal: Last I checked there were banks that required it, so it’s still out there. + +Trevor: They have LTS, right? + +Colin: If we were going to drop support, that we need to start messaging as soon as possible. + +Alexis: And that we’d put a check so that Node would exit on those platforms. + +Mikeal: It sounds like we’re going to cut some number of users. As long as we’re okay with that… + +Alexis: I think we’re going to support the other users better. + +Trevor: We have v4, and that will be around for [another year? CD] Maybe even V8 won’t support XP by the time v4 expires. + +Jeremiah: I think V8 already stopped supporting it. + +Alexis: I think Nikita articulated that. + +Jeremiah: Seth, if you’re still there, do you have any idea when V8 will drop XP support. + +Seth: We’ve planned that Chrome will probably drop XP support at the same time as … I have to double check. I’ll come back when I find out. + +Mikeal: We’ll drop it, and if anyone complains we’ll just say Microsoft told us to do it :) + +Alexis: I can make the change to stop on startup; in terms of messaging what needs to happen? + +Colin: We just need to get the word out. A tweet or a blogpost or something? + +Jeremiah: We should loop in marketing. + +Seth: It’s April 2016 for sure on the Chrome side. + +Jeremiah: So we have 3 months. + +Mikeal: It’d be a major? + +Jeremiah: Yep. v6. + +Alexis to PR this in. + +## Next Meeting + +2016-02-03 diff --git a/lib/buffer.js b/lib/buffer.js index bd2c859c3ee389..6b1621eae11081 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -117,6 +117,13 @@ function fromString(string, encoding) { return b; } +function fromArrayLike(obj) { + const length = obj.length; + const b = allocate(length); + for (let i = 0; i < length; i++) + b[i] = obj[i] & 255; + return b; +} function fromObject(obj) { if (obj instanceof Buffer) { @@ -129,14 +136,6 @@ function fromObject(obj) { return b; } - if (Array.isArray(obj)) { - const length = obj.length; - const b = allocate(length); - for (let i = 0; i < length; i++) - b[i] = obj[i] & 255; - return b; - } - if (obj == null) { throw new TypeError('must start with number, buffer, array or string'); } @@ -145,25 +144,15 @@ function fromObject(obj) { return binding.createFromArrayBuffer(obj); } - if (obj.buffer instanceof ArrayBuffer || obj.length) { - let length; - if (typeof obj.length !== 'number' || obj.length !== obj.length) - length = 0; - else - length = obj.length; - const b = allocate(length); - for (let i = 0; i < length; i++) { - b[i] = obj[i] & 255; + if (obj.buffer instanceof ArrayBuffer || 'length' in obj) { + if (typeof obj.length !== 'number' || obj.length !== obj.length) { + return allocate(0); } - return b; + return fromArrayLike(obj); } if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - var array = obj.data; - const b = allocate(array.length); - for (let i = 0; i < array.length; i++) - b[i] = array[i] & 255; - return b; + return fromArrayLike(obj.data); } throw new TypeError('must start with number, buffer, array or string'); diff --git a/lib/querystring.js b/lib/querystring.js index d5d4f175b6bebf..4244d8c18b8122 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -215,7 +215,7 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { } // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0) { + if (maxKeys > 0 && isFinite(maxKeys)) { qs = qs.split(sep, maxKeys); } else { qs = qs.split(sep); diff --git a/lib/timers.js b/lib/timers.js index 543a1bf601c7ea..c15b58a17e9608 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -318,7 +318,7 @@ function unrefdHandle() { Timeout.prototype.unref = function() { if (this._handle) { this._handle.unref(); - } else if (typeof(this._onTimeout) === 'function') { + } else if (typeof this._onTimeout === 'function') { var now = Timer.now(); if (!this._idleStart) this._idleStart = now; var delay = this._idleStart + this._idleTimeout - now; diff --git a/src/node.js b/src/node.js index fb39c0e2e74810..19b383ab70b001 100644 --- a/src/node.js +++ b/src/node.js @@ -13,11 +13,12 @@ function startup() { var EventEmitter = NativeModule.require('events'); - process.__proto__ = Object.create(EventEmitter.prototype, { + Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { constructor: { value: process.constructor } - }); + })); + EventEmitter.call(process); process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 6675e2d8a08f70..dc6695893cc609 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -239,37 +239,26 @@ class ContextifyContext { static void RunInDebugContext(const FunctionCallbackInfo& args) { - // Ensure that the debug context has an Environment assigned in case - // a fatal error is raised. The fatal exception handler in node.cc - // is not equipped to deal with contexts that don't have one and - // can't easily be taught that due to a deficiency in the V8 API: - // there is no way for the embedder to tell if the data index is - // in use. - struct ScopedEnvironment { - ScopedEnvironment(Local context, Environment* env) - : context_(context) { - const int index = Environment::kContextEmbedderDataIndex; - context->SetAlignedPointerInEmbedderData(index, env); - } - ~ScopedEnvironment() { - const int index = Environment::kContextEmbedderDataIndex; - context_->SetAlignedPointerInEmbedderData(index, nullptr); - } - Local context_; - }; - Local script_source(args[0]->ToString(args.GetIsolate())); if (script_source.IsEmpty()) return; // Exception pending. Local debug_context = Debug::GetDebugContext(); + Environment* env = Environment::GetCurrent(args); if (debug_context.IsEmpty()) { // Force-load the debug context. Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); debug_context = Debug::GetDebugContext(); CHECK(!debug_context.IsEmpty()); + // Ensure that the debug context has an Environment assigned in case + // a fatal error is raised. The fatal exception handler in node.cc + // is not equipped to deal with contexts that don't have one and + // can't easily be taught that due to a deficiency in the V8 API: + // there is no way for the embedder to tell if the data index is + // in use. + const int index = Environment::kContextEmbedderDataIndex; + debug_context->SetAlignedPointerInEmbedderData(index, env); } - Environment* env = Environment::GetCurrent(args); - ScopedEnvironment env_scope(debug_context, env); + Context::Scope context_scope(debug_context); Local