summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* doc: make `writable.setDefaultEncoding()` return `this`Alexander Makarenko2016-04-301-0/+1
| | | | | | | | | | Let this function return `this` for parity with `readable.setEncoding()`. PR-URL: https://github.com/nodejs/node/pull/5040 Fixes: https://github.com/nodejs/node/issues/5013 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Calvin Metcalf <calvin.metcalf@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* assert: allow circular referencesRich Trott2016-04-291-4/+17
| | | | | | | | | | assert.deepEqual() and assert.deepStrictEqual() will no longer throw a RangeError if passed objects with circular references. PR-URL: https://github.com/nodejs/node/pull/6432 Fixes: https://github.com/nodejs/node/issues/6416 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* process: add process.cpuUsage() - implementation, doc, testsPatrick Mueller2016-04-292-0/+53
| | | | | | | | | | | Add process.cpuUsage() method that returns the user and system CPU time usage of the current process PR-URL: https://github.com/nodejs/node/pull/6157 Reviewed-By: Robert Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
* events: pass the original listener added by onceDavidCai2016-04-291-3/+4
| | | | | | | | | | When removing a `once` listener, the listener being passed to the `removeListener` callback is the wrapper. This unwraps the listener so that `removeListener` is passed the actual listener. PR-URL: https://github.com/nodejs/node/pull/6394 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: fix error in deprecation messageRich Trott2016-04-281-1/+1
| | | | | | | | | | | | The deprecation message for `crypto.Credentials` says to use `tls.createSecureContext` but the correct property to use is `tls.SecureContext()`. Fix the deprecation message and add a test that checks the mappings of deprecated properties and their warning messages. PR-URL: https://github.com/nodejs/node/pull/6344 Reviewed-By: James M Snell <jasnell@gmail.com>
* http: correct error message for invalid trailerBryan English2016-04-261-1/+1
| | | | | | | | | Prevent misleading error messages when trailers are invalid. PR-URL: https://github.com/nodejs/node/pull/6308 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Brian White <mscdex@mscdex.net>
* doc: use Buffer.from() instead of new Buffer()Jackson Tian2016-04-271-2/+2
| | | | | | | | | Use new API of Buffer to developers in most documents. PR-URL: https://github.com/nodejs/node/pull/6367 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
* net: introduce `Socket#connecting` propertyFedor Indutny2016-04-273-20/+27
| | | | | | | | | | | There is no official way to figure out if the socket that you have on hand is still connecting to the remote host. Introduce `Socket#connecting`, which is essentially an unprefixed `_connecting` property that we already had. PR-URL: https://github.com/nodejs/node/pull/6404 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* buffer: safeguard against accidental kNoZeroFillСковорода Никита Андреевич2016-04-261-20/+15
| | | | | | | | | | | | | | | | | | This makes sure that `kNoZeroFill` flag is not accidentally set by moving the all the flag operations directly inside `createBuffer()`. It safeguards against logical errors like https://github.com/nodejs/node/issues/6006. This also ensures that `kNoZeroFill` flag is always restored to 0 using a try-finally block, as it could be not restored to 0 in cases of failed or zero-size `Uint8Array` allocation. It safeguards against errors like https://github.com/nodejs/node/issues/2930. It also makes the `size > 0` check not needed there. PR-URL: https://github.com/nodejs/node-private/pull/30 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* readline: allow history to be disabledsurya panikkal2016-04-261-1/+7
| | | | | | | | | | | | 1. The `historySize` to default to `30` only if `undefined`. 2. If `historySize` is set to 0, then disable caching the line. 3. Added unit tests. 4. Updated documentation. Fixes: https://github.com/nodejs/node/issues/6336 PR-URL: https://github.com/nodejs/node/pull/6352 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* cluster: migrate from worker.suicideEvan Lucas2016-04-251-17/+31
| | | | | | | | | | | | | Replace it with worker.exitedAfterDisconnect. Print deprecation message when getting or setting until it is removed. PR-URL: https://github.com/nodejs/node/pull/3743 Fixes: https://github.com/nodejs/node/issues/3721 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
* url: drop auth in `url.resolve()` if host changesAlex Kocharin2016-04-251-4/+9
| | | | | | | Fixes: https://github.com/nodejs/node/issues/1435 PR-URL: https://github.com/nodejs/node/pull/1480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
* repl: don’t complete expressions when eval failsAnna Henningsen2016-04-251-2/+3
| | | | | | | | | | | | | | | Instead of changing the way “simple” expressions are detected, switch to ignoring errors when completing. This approach is more generic than the previous one from 0b66b8f2d, but also changes the way errors are thrown when completing. This reverts the code changes from commit 0b66b8f2d2c. The test case is left intact. Fixes: https://github.com/nodejs/node/issues/6325 PR-URL: https://github.com/nodejs/node/pull/6328 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* module: preserve symlinks when requiringAlex Lamar2016-04-251-17/+26
| | | | | | | | | | | | | | | | | | | | Currently, required modules use the real location of the package/file as their __filename and __dirname, instead of the symlinked path if it exists. This behaviour is undocumented (it even goes against documentation in certain scenarios), creating hard-to-debug problems for developers who wish to leverage filesystem abstractions to lay out their application. This patch resolves all required modules to their canonical path while still preserving any symlinks within the path, instead of resolving to their canonical realpath. The one special case observed is when the main module is loaded -- in this case, the realpath does need to be used in order for the main module to load properly. PR-URL: https://github.com/nodejs/node/pull/5950 Reviewed-By: James M Snell <jasnell@gmail.com>
* console: timeEnd() with no label emits warningEugene Obrezkov2016-04-251-2/+3
| | | | | | | | | | When timeEnd() provided with label that doesn't exists it emits warning in the console, so developer get know about it. PR-URL: https://github.com/nodejs/node/pull/5901 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* buffer: add Buffer.prototype.lastIndexOf()dcposch@dcpos.ch2016-04-251-23/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove unnecessary templating from SearchString SearchString used to have separate PatternChar and SubjectChar template type arguments, apparently to support things like searching for an 8-bit string inside a 16-bit string or vice versa. However, SearchString is only used from node_buffer.cc, where PatternChar and SubjectChar are always the same. Since this is extra complexity that's unused and untested (simplifying to a single Char template argument still compiles and didn't break any unit tests), I removed it. * Use Boyer-Hoore[-Horspool] for both indexOf and lastIndexOf Add test cases for lastIndexOf. Test the fallback from BMH to Boyer-Moore, which looks like it was totally untested before. * Extra bounds checks in node_buffer.cc * Extra asserts in string_search.h * Buffer.lastIndexOf: clean up, enforce consistency w/ String.lastIndexOf * Polyfill memrchr(3) for non-GNU systems PR-URL: https://github.com/nodejs/node/pull/4846 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* querystring: fix commentsBrian White2016-04-251-4/+4
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/6365 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
* events: add prependListener() and prependOnceListener()James M Snell2016-04-222-29/+63
| | | | | | | | | | | | | | | | | | A handful of modules (including readable-streams) make inappropriate use of the internal _events property. One such use is to prepend an event listener to the front of the array of listeners. This adds EE.prototype.prependListener() and EE.prototype.prependOnceListener() methods to add handlers to the *front* of the listener array. Doc update and test case is included. Fixes: https://github.com/nodejs/node/issues/1817 PR-URL: https://github.com/nodejs/node/pull/6032 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
* events: make eventNames() use Reflect.ownKeys()Luigi Pinca2016-04-211-6/+1
| | | | | | | | | Use `Reflect.ownKeys()` instead of `Object.keys()` and `Object.getOwnPropertySymbols()`. PR-URL: https://github.com/nodejs/node/pull/5822 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* http: disallow sending obviously invalid status codesBrian White2016-04-201-0/+4
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/6291 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* net: Validate port in createServer().listen()Dirceu Pereira Tiegs2016-04-202-4/+11
| | | | | | | | | | | Make sure we validate the port number in all kinds of `listen()` calls. Fixes: https://github.com/nodejs/node/issues/5727 PR-URL: https://github.com/nodejs/node/pull/5732 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* console: refactor to use rest params and template stringsJames M Snell2016-04-201-16/+15
| | | | | | | | | | | | | | | | | | | | Overall cleanup in code, eliminate reliance on `arguments`. Benchmarks show that as of v8 5.0.71.32, using rest params + apply has good performance. The spread operator is not yet well optimized in v8 ``` misc/console.js method=restAndSpread concat=1 n=1000000: 374779.38359 misc/console.js method=restAndSpread concat=0 n=1000000: 375988.30434 misc/console.js method=argumentsAndApply concat=1 n=1000000: 682618.61125 misc/console.js method=argumentsAndApply concat=0 n=1000000: 645093.74443 misc/console.js method=restAndApply concat=1 n=1000000: 682931.41217 misc/console.js method=restAndApply concat=0 n=1000000: 664473.09700 ``` PR-URL: https://github.com/nodejs/node/pull/6233 Reviewed-By: Brian White <mscdex@mscdex.net>
* stream: make null an invalid chunk to write in object modeCalvin Metcalf2016-04-201-4/+10
| | | | | | | | | | this harmonizes behavior between readable, writable, and transform streams so that they all handle nulls in object mode the same way by considering them invalid chunks. PR-URL: https://github.com/nodejs/node/pull/6170 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* http: unref socket timer on parser executeFedor Indutny2016-04-201-0/+1
| | | | | | | | | | | | | When underlying `net.Socket` instance is consumed in http server - no `data` events are emitted, and thus `socket.setTimeout` fires the callback even if the data is constantly flowing into the socket. Fix this by calling `socket._unrefTimer()` on every `onParserExecute` call. Fix: #5899 PR-URL: https://github.com/nodejs/node/pull/6286 Reviewed-By: James M Snell <jasnell@gmail.com>
* module: fix resolution of filename with trailing slashMichaël Zasso2016-04-201-0/+2
| | | | | | | | | | | | A recent optimization of module loading performance [1] forgot to check that extensions were set in a certain code path. [1] https://github.com/nodejs/node/pull/5172/commits/ae18bbef48d87d9c641df85369f62cfd5ed8c250 Fixes: https://github.com/nodejs/node/issues/6214 PR-URL: https://github.com/nodejs/node/pull/6215 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
* net: replace __defineGetter__ with definePropertyFedor Indutny2016-04-201-7/+15
| | | | | | | | `Object.prototype.__defineGetter__` is deprecated now, use `Object.defineProperty` instead. PR-URL: https://github.com/nodejs/node/pull/6284 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* stream_base: expose `bytesRead` getterFedor Indutny2016-04-201-5/+13
| | | | | | | | This will provide `bytesRead` data on consumed sockets. Fix: #3021 PR-URL: https://github.com/nodejs/node/pull/6284 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* net: set ADDRCONFIG DNS hint in connectionscjihrig2016-04-201-0/+4
| | | | | | | | | | | | | | | | | b85a50b6da5bbd7e9c8902a13dfbe1a142fd786a removed the implicit setting of DNS hints when creating a connection. This caused some of the pi2 machines to become flaky. This commit restores the implicit dns.ADDRCONFIG hint, but not dns.V4MAPPED. Fixes: https://github.com/nodejs/node/issues/6133 PR-URL: https://github.com/nodejs/node/pull/6281 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
* tools: enable linting for v8_prof_processor.jsRich Trott2016-04-201-0/+1
| | | | | | | | | | | | `lib/internal/v8_prof_processor.js` was being excluded from linting, but the only lint issue it has is that it cannot run in strict mode. Disable the `strict` rule with a comment and remove the file from `.eslintignore`. PR-URL: https://github.com/nodejs/node/pull/6262 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* url: use "empty" object for empty query stringsBrian White2016-04-201-2/+8
| | | | | | | | | | | | This makes things consistent with the way that the querystring module creates parsed results. PR-URL: https://github.com/nodejs/node/pull/6289 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* http: skip body and next message of CONNECT resFedor Indutny2016-04-192-3/+6
| | | | | | | | | | | When handling a response to `CONNECT` request - skip message body and do not attempt to parse the next message. `CONNECT` requests are used in similar sense to HTTP Upgrade. Fix: https://github.com/nodejs/node/pull/6198 PR-URL: https://github.com/nodejs/node/pull/6279 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* zlib: fix use after null when calling .closeJames Lal2016-04-191-1/+4
| | | | | | | | | | | | An internal zlib error may cause _handle to be set to null. Close now will check if there is a _handle prior to calling .close on it. PR-URL: https://github.com/nodejs/node/pull/5982 Fixes: https://github.com/nodejs/node/issues/6034 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* events: don't inherit from Object.prototypeBrian White2016-04-181-7/+13
| | | | | | | | | | | This commit safely allows event names that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__. Fixes: https://github.com/nodejs/node/issues/728 PR-URL: https://github.com/nodejs/node/pull/6092 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* querystring: don't inherit from Object.prototypeBrian White2016-04-181-1/+7
| | | | | | | | | | | | | This commit safely allows querystring keys that are named the same as properties that are ordinarily inherited from Object.prototype such as __proto__. Additionally, this commit provides a bit of a speed improvement (~25% in the querystring-parse 'manypairs' benchmark) when there are many unique keys. Fixes: https://github.com/nodejs/node/issues/5642 PR-URL: https://github.com/nodejs/node/pull/6055 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* lib,test,tools: alignment on variable assignmentsRich Trott2016-04-184-10/+14
| | | | | | | | | | Correct alignment on variable assignments that span multiple lines in preparation for lint rule to enforce such alignment. PR-URL: https://github.com/nodejs/node/pull/6242 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: James M Snell <jasnell@gmail.com>
* assert: respect assert.doesNotThrow message.Ilya Shaisultanov2016-04-181-1/+8
| | | | | | | | | | | Special handling to detect when user has supplied a custom message. Added a test for user message. When testing if `actual` value is an error use `util.isError` instead of `instanceof`. Fixes: https://github.com/nodejs/node/issues/2385 PR-URL: https://github.com/nodejs/node/pull/2407 Reviewed-By: James M Snell <jasnell@gmail.com>
* repl: keep the built-in modules non-enumerableAnna Henningsen2016-04-181-10/+25
| | | | | | | | | | Make sure that the built-in modules in the repl stay non-enumerable. Previously, they would pop up as enumerable properties of the global object after having been accessed for the first time. PR-URL: https://github.com/nodejs/node/pull/6207 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* node: make builtin libs available for `--eval`Anna Henningsen2016-04-183-22/+39
| | | | | | | | | | | | | | | | | | Make the builtin libraries available for the `--eval` and `--print` CLI options, using the same mechanism that the REPL uses. This renders workarounds like `node -e 'require("fs").doStuff()'` unnecessary. As part of this, the list of builtin modules and the code for adding the corresponding properties to the target context is moved to `internal/module.js`, and the previously missing `repl` entry is added. PR-URL: https://github.com/nodejs/node/pull/6207 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* process: fix incorrect usage of assert.fail()Rich Trott2016-04-181-1/+1
| | | | | | | | | | | | The message argument for `assert.fail()` is the third argument, not the first. Correct minor misuse in internal module. PR-URL: https://github.com/nodejs/node/pull/6211 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* src: don't set non-primitive values on templatesBen Noordhuis2016-04-181-4/+6
| | | | | | | | | V8 is going to disallow non-primitive values on v8::FunctionTemplate and v8::ObjectTemplate because those can't be shared across contexts. Fixes: https://github.com/nodejs/node/issues/6216 PR-URL: https://github.com/nodejs/node/pull/6228 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
* zlib: Make the finish flush flag configurableAnna Henningsen2016-04-171-12/+20
| | | | | | | | | | | | | | Up to now, `Z_FINISH` was always the flushing flag that was used for the last chunk of input data. This patch makes this choice configurable so that advanced users can perform e.g. decompression of partial data using `Z_SYNC_FLUSH`, if that suits their needs. Add tests to make sure that an error is thrown upon encountering invalid `flush` or `finishFlush` flags. Fixes: https://github.com/nodejs/node/issues/5761 PR-URL: https://github.com/nodejs/node/pull/6069 Reviewed-By: James M Snell <jasnell@gmail.com>
* buffer: add Buffer.allocUnsafeSlow(size)James M Snell2016-04-152-7/+27
| | | | | | | | | | | | | | Aligns the functionality of SlowBuffer with the new Buffer constructor API. Next step is to docs-only deprecate SlowBuffer. Replace the internal uses of SlowBuffer with `Buffer.allocUnsafeSlow(size)` PR-URL: https://github.com/nodejs/node/pull/5833 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* fs: optimize realpath using uv_fs_realpath()Yuval Brik2016-04-152-234/+28
| | | | | | | | | | | | Remove realpath() and realpathSync() cache. Use the native uv_fs_realpath() which is faster then the JS implementation by a few orders of magnitude. PR-URL: https://github.com/nodejs/node/pull/3594 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
* lib: improve module loading performanceBrian White2016-04-144-118/+266
| | | | | | | | | | | | | | | This commit improves module loading performance by at least ~25-35% in the module-loader benchmarks. Some optimization strategies include: * Try-finally/try-catch isolation * Replacing regular expressions with manual parsing * Avoiding unnecessary string and array creation * Avoiding constant recompilation of anonymous functions and function definitions within functions PR-URL: https://github.com/nodejs/node/pull/5172 Reviewed-By: James M Snell <jasnell@gmail.com>
* debugger: run last command on presssing enterRich Trott2016-04-142-23/+26
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/6090 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Fixes: https://github.com/nodejs/node/issues/2895
* repl: don’t complete non-simple expressionsAnna Henningsen2016-04-141-1/+1
| | | | | | | | | | | | | | Change the regular expression that recognizes “simple” JS expressions to requiring that the full line needs to match it. Previously, in terms like `a().b.`, `b.` would be a partial match. This meant that completion would evaluate `b` and either fail with a `ReferenceError` or, if `b` was some global, return the properties of the global `b` object. PR-URL: https://github.com/nodejs/node/pull/6192 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* streams: support unlimited synchronous cork/uncork cyclesMatteo Collina2016-04-141-6/+9
| | | | | | | | | | | | | | net streams can request multiple chunks to be written in a synchronous fashion. If this is combined with cork/uncork, en error is currently thrown because of a regression introduced in: https://github.com/nodejs/node/commit/89aeab901ac9e34c79be3854f1aa41f2a4fb6888 (https://github.com/nodejs/node/pull/4354). Fixes: https://github.com/nodejs/node/issues/6154 PR-URL: https://github.com/nodejs/node/pull/6164 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Mathias Buus <mathiasbuus@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* os: add userInfo() methodcjihrig2016-04-121-0/+1
| | | | | | | | | | | os.userInfo() calls libuv's uv_os_get_passwd() function. It returns an object containing the current effective user's username, uid, gid, shell, and home directory. On Windows, the uid and gid are -1, and the shell is null. Refs: https://github.com/nodejs/node/issues/5582 PR-URL: https://github.com/nodejs/node/pull/6104 Reviewed-By: James M Snell <jasnell@gmail.com>
* stream: Fix readableState.awaitDrain mechanismAnna Henningsen2016-04-111-3/+3
| | | | | | | | | | | | | | | | | | | | In 68990948fe4 (https://github.com/nodejs/node/pull/2325), the conditions for increasing `readableState.awaitDrain` when writing to a piping destination returns false were changed so that they could not actually be met, effectively leaving `readableState.awaitDrain` with a constant value of 0. This patch changes the conditions to testing whether the stream for which `.write()` returned false is still a piping destination, which was likely the intention of the original patch. Fixes: https://github.com/nodejs/node/issues/5820 Fixes: https://github.com/nodejs/node/issues/5257 PR-URL: https://github.com/nodejs/node/pull/6023 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* querystring: using toString for objects on querystring.escapeIgor Kalashnikov2016-04-111-2/+6
| | | | | | | | | | This commit fixes an inconsistency in querystring.escape objects handling compared to native encodeURIComponent function. Fixes: https://github.com/nodejs/node/issues/5309 PR-URL: https://github.com/nodejs/node/pull/5341 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>