This makes the output of console.timeEnd in line with major browsers.
PR-URL: https://github.com/nodejs/node/pull/3166
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
f2a45caf2e contained a test for a
regression that had been introduced by the original change that
77a10ed05f ported. While
77a10ed05f did not contain that
regression, the test that f2a45caf2e
contained should still be in the code base to prevent any regression
from happening in the future.
Original message for the commit that contained the test:
domains: fix stack clearing after error handled
caeb67735b introduced a regression where
the domains stack would not be cleared after an error had been handled
by the top-level domain.
This change clears the domains stack regardless of the position of the
active domain in the stack.
PR: #9364
PR-URL: https://github.com/joyent/node/pull/9364
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR: #3356
PR-URL: https://github.com/nodejs/node/pull/3356
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
The assert.fail function signature has the message as the third argument
but, understandably, it is often assumed that it is the first argument
(or at least the first argument if no other arguments are passed).
This corrects the assert.fail() invocations in the Node.js tests.
Before:
assert.fail('message');
// result: AssertionError: 'message' undefined undefined
After:
assert.fail(null, null, 'message');
// result: AssertionError: message
PR-URL: https://github.com/nodejs/node/pull/3378
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
To make it easy to figure out where the warning comes from.
Also fix style and variable name that was made in #1739.
PR-URL: https://github.com/nodejs/node/pull/1831
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Add a new option to specifiy a minimum size of an ephemeral DH
parameter to accept a tls connection. Default is 1024 bit.
PR-URL: https://github.com/nodejs/node/pull/1831
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Returns an object representing a type, name and size of an ephemeral
key exchange in a client connection. Currently only DHE and ECHE are
supported.
This api only works on on a client connection. When it is called on a
server connection, null is returned. When its key exchange is not
ephemeral, an empty object is returned.
PR-URL: https://github.com/nodejs/node/pull/1831
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Markdown requires 4-space indent to correctly format code blocks. This
fixes the example so it's correctly presented as code.
PR-URL: https://github.com/nodejs/node/pull/3372
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3360
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Avoids doing a buffer.concat on the internal buffer
when that array has only a single thing in it.
Reviewed-By: Chris Dickinson <chris@neversaw.us>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3300
This a backport of the following commits from the v8's upstream:
* 1a8c38c50513f9af07ada479629a653e1cf36ff3
* 206f12abee3f1e7eda8fc6521d48f3c319460ee1
* 9e3676da9ab1aaf7de3e8582cb3fdefcc3dbaf33
Original commit message:
heap: make array buffer maps disjoint
Remove intersection from the `std::map`s representing current live
ArrayBuffers. While being simpler to understand, it poses
significant performance issue for the active ArrayBuffer users (like
node.js).
Store buffers separately, and process them together during
mark-sweep phase.
The results of benchmarks are:
$ ./node-slow bench && ./node-fast bench
4997.4 ns/op
4685.7 ns/op
NOTE: `fast` - was a patched node.js, `slow` - unpatched node.js
with vanilla v8.
Ref: https://github.com/nodejs/node/pull/2732
PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Backport 56a0a797f210e04746f2888116365d29a4bb6afc from V8 upstream to
include post-mortem metadata used by mdb_v8 to support V8 4.6.
Original commit message:
Update post-mortem metadata generation
mdb_v8, a post-mortem debugger for Node.js, now uses JSArrayBuffer's
backing_store property and JSArrayBufferView's byte_offset property to
get access to the content of Buffer instances in node (which are
Uint8Array instances). This change adds post-mortem metadata for these
two properties.
This change also fixes a typo in
inobject_properties_of_constructor_function_index_offset that was added
to gen-postmortem-metadata in a previous change. It should be named
inobject_properties_or_constructor_function_index instead.
R=bmeurer@chromium.org
Review URL: https://codereview.chromium.org/1363403003
Cr-Commit-Position: refs/heads/master@{#30926}
Ref: https://github.com/nodejs/node/pull/3057
PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Some error messages have changed and the --debugger flag does
not exist in V8 anymore.
PR-URL: https://github.com/nodejs/node/pull/3351
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Now that we have backticks we no longer need to use util.format
to template strings!
This commit was inspired by #3324, and it replaces instances of
util.format with backtick strings in a number of tests
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3359
This is a two-part fix:
- Fix pending data notification in `OutgoingMessage` to notify server
about flushed data too
- Fix pause/resume behavior for the consumed socket. `resume` event is
emitted on a next tick, and `socket._paused` can already be `true` at
this time. Pause the socket again to avoid PAUSED error on parser.
Fix: https://github.com/nodejs/node/issues/3332
PR-URL: https://github.com/nodejs/node/pull/3342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Add SIGTRAP and the corresponding exit code to the list of signals/exit
codes that are expected when running tests that throw an uncaught error
and have --abort-on-uncaught-exception enabled.
Also refactor a bit related comments so that they better reflect what's
actually happening.
Fixes#3239.
PR: #3354
PR-URL: https://github.com/nodejs/node/pull/3354
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This comment was a bit misleading, since it was missing the `encoding`
argument.
PR-URL: https://github.com/nodejs/node/pull/3248
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
When the test fails (as it does frequently on FreeBSD unfortunately)
provide a non-cryptic error message that also provides a line number.
PR-URL: https://github.com/nodejs/node/pull/3335
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Update the label for v4.2.0 to (LTS) from (Stable)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3343
The debug process running "node debug a.js" will be stuck when the
script ends. This is because the debug handler has been unrefed.
We shouldn't unref the debug handler to avoid this problem.
PR-URL: https://github.com/nodejs/node/pull/2778
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
util is loaded just for one use of util.format(). Replace it with a
string template. While we're at it, delete nearby lengthy comment
justifying use of fs.readFileSync().
PR-URL: https://github.com/nodejs/node/pull/3324
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed By: Evan Lucas <evanlucas@me.com>
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`,
therefore `SPREAD_ARG` will abort with:
Assertion failed: ((object)->IsUint8Array())
Make changes necessary to migrate it to `ArrayBuffer`.
See: https://github.com/nodejs/node/pull/3080#issuecomment-147502167
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3329
The Pi 1's in CI don't always fail on the buffer.toString() tests. But
they time out sometimes, so let's split the tests up so they don't.
PR-URL: https://github.com/nodejs/node/pull/3323
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed By: Trevor Norris <trev.norris@gmail.com>
63644dd1cd introduced a regression caused by everyone's favourite
JavaScript feature: undefined < 0 === undefined >= 0.
Add a case to the existing tests to cover this scenario and then add
the check for undefined that makes the test pass.
PR-URL: https://github.com/nodejs/node/pull/3331
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed By: Evan Lucas <evanlucas@me.com>
When closing the child TLSWrap handle - wait for the proper parent's
handle close callback invocation. `uv_close_cb` may be invoked much
later than the next libuv tick, depending on the platform.
The only platform that currently seem to defer `uv_close_cb` is Windows
XP. This behavior was not observed on other Windows systems, and is not
possible on Unixes.
Fix: https://github.com/nodejs/node/issues/2979
PR-URL: https://github.com/nodejs/node/pull/2991
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The current wording "This module is used for writing unit tests for your
applications, you can access it with require('assert')." implies that
this module should only be used in development while unit testing.
The article "Error Handling in Node.js" by Joyent
(https://www.joyent.com/developers/node/design/errors) uses the assert
module in an efficient way to validate required function arguments.
PR-URL: https://github.com/nodejs/node/pull/2799
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
The node-gyp is now in the nodejs/node-gyp. This commit replaces the
repository owner link with the new nodejs/node-gyp link.
PR-URL: https://github.com/nodejs/node/pull/3320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Fixes a persistently troublesome failing test by splitting it
out into multiple parallel tests.
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed By: Trevor Norris <trev.norris@gmail.com>
Reviewed By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3287
On Big Endian platforms v8 strings are need to converted
to Little Endian before searching in utf16le buffer
Fixes: https://github.com/nodejs/node/issues/3283
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com>
PR-URL: https://github.com/nodejs/node/pull/3295
test-sys.js tests common.inspect() (which is test-specific code) and not
sys (which, although deprecated, should still be tested).
This commit moves the tests to the not-deprecated util and adds a test
to check that deprecated sys and util are the same.
PR-URL: https://github.com/nodejs/node/pull/3256
Reviewed-By: Evan Lucas <evanlucas@me.com>
Accessing prototype properties directly on a typed array will throw. So
do an extra check in Buffer's own getters to verify it is being called
on an instance.
Fixes: https://github.com/nodejs/node/issues/3297
PR-URL: https://github.com/nodejs/node/pull/3302
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Instead of recommending `0` as the magic value to set max listeners to
unlimited, recommend `Infinity`. This paves the way for `0` as a magic
value eventually being deprecated and finally removed.
PR-URL: https://github.com/nodejs/node/pull/2559
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>