0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

3459 Commits

Author SHA1 Message Date
Rich Trott
7cb89f515d test: remove flaky status from eval_messages test
This test has not failed on armv7-wheezy in over 6 weeks. Let's remove its
"flaky" status.

Fixes: https://github.com/nodejs/node/issues/2672
Reviewed-By: Rod Vagg <r@va.gg>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3420
2015-10-20 12:16:00 -07:00
Junliang Yan
a1886cf1be test: skip test-dns-ipv6.js if ipv6 is unavailable
Test should be skipped if ipv6 is unavailable on the running system.

Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3444
2015-10-20 12:07:22 -07:00
Fedor Indutny
3eecdf9f14 timers: reuse timer in setTimeout().unref()
Instead of creating new timer - reuse the timer from the freelist. This
won't make the freelist timer active for the duration of `uv_close()`,
and will let the event-loop exit properly.

Fix: #1264
PR-URL: https://github.com/nodejs/node/pull/3407
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-20 14:20:24 -04:00
Rich Trott
1c57845118 test: fix flaky test for symlinks
If the symlink portion of the test was being skipped due to a
combination of OS support and user privileges, then an assertion would
always fail. This fixes that problem, improves assertion error reporting
and splits the test to make it clear that it is a test for links and
symlinks.

Fixes: https://github.com/nodejs/node/issues/3311
PR-URL: https://github.com/nodejs/node/pull/3418
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-20 09:20:21 -07:00
Jeremiah Senkpiel
5923dee07e test: repl-persistent-history is no longer flaky
The race conditions were fixed in
286ef1daca

PR-URL: https://github.com/nodejs/node/pull/3437
Reviewed By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-20 10:44:06 -04:00
Yuval Brik
0fc0902c21 zlib: decompression throw on truncated input
Check for unexpected end-of-file error when decompressing. If the output
buffer still has space after decompressing and deflate returned Z_OK or
Z_BUF_ERROR - that means unexpected end-of-file. Added
test-zlib-truncated.js for the case of truncated input. Fixed the zlib
dictionary test to not end the inflate stream on a truncated output (no
crc) of deflate

Fixes: https://github.com/nodejs/node/issues/2043
PR-URL: https://github.com/nodejs/node/pull/2595
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-19 15:06:05 -06:00
Wyatt Preul
8b4adb267b util: Remove p, has been deprecated for years
Update deprecation test to use another method.

Ref: https://github.com/nodejs/node/pull/2529
PR-URL: https://github.com/nodejs/node/pull/3432
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-19 20:52:56 +02:00
Jeremiah Senkpiel
73b7e052c0 repl: limit persistent history correctly on load
Previously the wrong end of the history was limited on load.

PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>
2015-10-19 11:53:54 -04:00
Jeremiah Senkpiel
286ef1daca test: cleanup, improve repl-persistent-history
- Now cleans up the history file unless told otherwise.
- Now also logs which test case failed.
- Waits for flush after repl close if necessary.

Fixes: https://github.com/nodejs/node/issues/2319
PR-URL: https://github.com/nodejs/node/pull/2356
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed By: Evan Lucas <evanlucas@me.com>
2015-10-19 11:53:54 -04:00
Коренберг Марк
d8db75730f tls: add options argument to createSecurePair
Helps in implementation of #6204, where some options passed to
`createSecurePair()` are ignored before this patch.

These options are very helpful if someone wants to pass
`options.servername` or `options.SNICallback` to securepair.

PR-URL: https://github.com/nodejs/node/pull/2441
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-10-17 11:53:45 -04:00
Johannes Wüller
0803962860 fs: add file descriptor support to *File() funcs
These changes affect the following functions and their synchronous
counterparts:

 * fs.readFile()
 * fs.writeFile()
 * fs.appendFile()

If the first parameter is a uint32, it is treated as a file descriptor.
In all other cases, the original implementation is used to ensure
backwards compatibility. File descriptor ownership is never taken from
the user.

The documentation was adjusted to reflect these API changes. A note was
added to make the user aware of file descriptor ownership and the
conditions under which a file descriptor can be used by each of these
functions.

Tests were extended to test for file descriptor parameters under the
conditions noted in the relevant documentation.

PR-URL: https://github.com/nodejs/node/pull/3163
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-16 17:14:21 -06:00
Rich Trott
0f99320aa0 test: add Symbol test for assert.deepEqual()
The existing test never ran because typeof Symbol === 'function' and not
'symbol'. We have Symbols now so remove the check and just run the test.

PR-URL: https://github.com/nodejs/node/pull/3327
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-10-16 14:31:59 -07:00
Michaël Zasso
419f7d4726 console: sub-millisecond accuracy for console.time
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>
2015-10-16 21:00:51 +02:00
Jonas Dohse
642928b502 test: port domains regression test from v0.10
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>
2015-10-16 11:21:02 -07:00
Rich Trott
676e61872f test: apply correct assert.fail() arguments
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>
2015-10-16 00:31:04 -07:00
Shigeki Ohtsu
f72e178a78 tls: add minDHSize option to tls.connect()
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>
2015-10-16 11:39:54 +09:00
Shigeki Ohtsu
6d92ebac11 tls: add TLSSocket.getEphemeralKeyInfo()
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>
2015-10-16 11:39:45 +09:00
Michaël Zasso
bbdbef9274 test: fix tests after V8 upgrade
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>
2015-10-14 11:20:35 -07:00
Myles Borins
6c032a8333 test: replace util with backtick strings
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
2015-10-14 10:02:47 -07:00
Fedor Indutny
ab03635fb1 http: fix stalled pipeline bug
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>
2015-10-14 12:16:18 -04:00
Julien Gilli
f45c315763 test: fix domain with abort-on-uncaught on PPC
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>
2015-10-13 22:56:47 -07:00
Rich Trott
e3d9d25083 test: add test-child-process-emfile fail message
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>
2015-10-13 18:27:47 -07:00
Rich Trott
6f14b3a7db test: remove util from common
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>
2015-10-12 21:08:53 -07:00
Fedor Indutny
931118c9d7 buffer: fix assertion error in WeakCallback
`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
2015-10-12 20:47:10 -07:00
Rich Trott
7d94611ac9 test: split up buffer tests for reliability
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>
2015-10-12 20:28:33 -07:00
Ryan Graham
bde32f8a4d lib: fix undefined timeout regression
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>
2015-10-12 19:25:14 -04:00
Trevor Norris
a713024579 net: don't throw on bytesWritten access
If bytesWritten is accessed before the object has been properly
constructed then return undefined.

Fixes: https://github.com/nodejs/node/issues/3298
PR-URL: https://github.com/nodejs/node/pull/3305
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-12 08:29:30 -06:00
Rich Trott
3202456baa test: remove util properties from common
common does not need util properties anymore. Remove them.

PR-URL: https://github.com/nodejs/node/pull/3304
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-11 22:09:40 -07:00
Brian White
68990948fe stream: avoid pause with unpipe in buffered write
If a pipe is cleaned up (due to unpipe) during a write that
returned false, the source stream can get stuck in a paused state.

Fixes: https://github.com/nodejs/node/issues/2323
PR-URL: https://github.com/nodejs/node/pull/2325
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-11 14:07:25 -04:00
Rich Trott
31c971d641 test: parallelize long-running test
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
2015-10-10 17:28:27 -07:00
Rich Trott
ead5cd990c test: test util rather than common
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>
2015-10-09 14:45:47 -07:00
Trevor Norris
e97dae573c buffer: don't abort on prototype getters
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>
2015-10-09 15:42:23 -06:00
Rich Trott
72c8a74b55 test: remove common.inspect()
common.inspect() is just util.inspect(). common copies every property
from util but this is the only one that gets used and it only gets used
in three places. Well, four, but the fourth is removed in a pending PR.

This commit removes it. Subsequently, the "copy util to common"
part of `common` can be removed altogether.

PR-URL: https://github.com/nodejs/node/pull/3257
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-10-08 22:35:24 -07:00
Rich Trott
a1040f2065 test: refresh temp directory when using pipe
common.PIPE resides in the temp directory (except on Windows). Insure
that the temp directory is refreshed in tests that use common.PIPE.

PR-URL: https://github.com/nodejs/node/pull/3231
Fixes: https://github.com/nodejs/node/issues/3227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2015-10-08 20:05:22 -07:00
Rich Trott
47befffc53 lib,test: deprecate _linklist
Deprecate _linklist and add test to confirm internal linklist and
public _linklist are the same.

PR-URL: https://github.com/nodejs/node/pull/3078
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-08 17:32:08 -07:00
Junliang Yan
8aa589c069 test: Fix test-fs-read-stream-fd-leak race cond
Fix intermittent test failure on slower machines.
Gives test longer time to complete but checks
at regular intervals so that the test only
runs longer on slower machines or in the failure
case.

PR-URL: https://github.com/nodejs/node/pull/3218
Fixes: https://github.com/nodejs/node/issues/3215
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James Snell <jasnell@gmail.com>>
2015-10-08 16:31:16 -04:00
Trevor Norris
178ac3367f js_stream: prevent abort if isalive doesn't exist
Attempting to check IsAlive() on a JSStream before the isAlive()
callback can be set in JS causes a CHECK to fail in MakeCallback.
Instead return false if the callback hasn't been set.

PR-URL: https://github.com/nodejs/node/pull/3282
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-10-08 11:38:21 -06:00
Ben Noordhuis
ded4f91eef assert: support arrow functions in .throws()
`x instanceof f` where f is an arrow function throws a (spec-conforming)
"Function has non-object prototype 'undefined' in instanceof check"
exception.

Add a workaround so that it's possible to pass arrow functions as the
second argument to assert.throws().  The try/catch block is a little
jarring but swapping around the clauses in the if statements changes
the semantics too much.

Fixes: https://github.com/nodejs/node/issues/3275
PR-URL: https://github.com/nodejs/node/pull/3276
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-08 19:26:01 +02:00
Junliang Yan
a9d42e0131 test: fix losing original env vars issue
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: https://github.com/nodejs/node/pull/3190
2015-10-08 07:51:46 -07:00
Karl Skomski
a18dd7b788 src: replace naive search in Buffer::IndexOf
Adds the string search implementation from v8
which uses naive search if pattern length < 8
or to a specific badness then uses Boyer-Moore-Horspool

Added benchmark shows the expected improvements
Added option to use ucs2 encoding with Buffer::IndexOf

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/2539
2015-10-07 21:09:53 -07:00
Trevor Norris
aeee956ac7 async_wrap: correctly pass parent to init callback
Previous logic didn't allow parent to propagate to the init callback
properly. The fix now allows the init callback to be called and receive
the parent if:

- async wrap callbacks are enabled and parent exists
- the init callback has been called on the parent and an init callback
  exists then it will be called regardless of whether async wrap
  callbacks are disabled.

Change the init/pre/post callback checks to see if it has been properly
set. This allows removal of the Environment "using_asyncwrap" variable.

Pass Isolate to a TryCatch instance.

Fixes: https://github.com/nodejs/node/issues/2986
PR-URL: https://github.com/nodejs/node/pull/3216
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-10-07 13:27:46 -06:00
Rich Trott
099cfbc58c test: remove deprecated error logging
common.error() is just deprecated util.error() renamed.
Remove calls to it and some other extraneous console logging
in tests.

PR-URL: https://github.com/nodejs/node/pull/3079
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-07 11:13:38 -07:00
Rich Trott
6f63a4af0e test: linting for buffer-free-callback test
Test added in d1f24044 does not pass linting rule added in 3de353b5.
Fixed in this commit. `common` module required in all tests except
those that intentionally leak variables.

PR-URL: https://github.com/nodejs/node/pull/3230
Fixes: https://github.com/nodejs/node/issues/3229
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-06 21:35:00 -07:00
Fedor Indutny
d1f24044b9 buffer: FreeCallback should be tied to ArrayBuffer
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`),
not when the view (`Uint8Array` or `Buffer`) is disposed. This causes
bug and crashes in addons which create buffers and store only slices of
them.

PR-URL: https://github.com/nodejs/node/pull/3198
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-06 18:57:46 -04:00
Rich Trott
3de353b554 test: make common.js mandatory via linting rule
test/common.js contains code that detects global variable leaks.

This eslint rule checks that a module named `common` is loaded. It is
only applicable to files in the test directory. Tests that intentionally
leak variables can opt out with an eslint-disable comment.

PR-URL: https://github.com/nodejs/node/pull/3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-10-06 15:11:58 -07:00
Rich Trott
c78091d689 test: load common.js in all tests
common.js contains code that detects leaked variables.

In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.

PR-URL: https://github.com/nodejs/node/pull/3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-10-06 15:11:47 -07:00
James M Snell
e655a437b3 http: do not allow multiple instances of certain response headers
Response headers such as ETag and Last-Modified do not permit
multiple instances, and therefore the comma-separated syntax is
not allowed. When multiple values for these headers are specified,
use only the first instance.

Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/node/pull/3090
2015-10-06 14:53:21 -07:00
Trevor Norris
05d424c029 buffer: only check if instance is Uint8Array
Native Buffer method calls do not require anything from the prototype.
So it is unnecessary to check if the Object's prototype is equal to
Buffer.prototype.

This fixes an issue that prevents Buffer from being inherited the ES5
way. Now the following will work:

    function A(n) {
      const b = new Buffer(n);
      Object.setPrototypeOf(b, A.prototype);
      return b;
    }

    Object.setPrototypeOf(A.prototype, Buffer.prototype);
    Object.setPrototypeOf(A, Buffer);

    console.log(new A(4));

Fix: https://github.com/nodejs/node/issues/2882
PR-URL: https://github.com/nodejs/node/pull/3080
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-06 15:41:24 -06:00
Evan Lucas
7d66749eca test: speed up stringbytes-external test
test-stringbytes-external tends to take quite a while on slower
hardware. A lot of the time is taken by creating a new buffer that is
very large. The improvements come from reusing the same buffer.

PR-URL: https://github.com/nodejs/node/pull/3005
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-06 12:04:42 -05:00
Roman Reiss
81e98e9363 test: use normalize() for unicode paths
OS X 10.11 changed the unicode normalization form of certain code points
returned by system calls like getcwd() from NFC to NFD which made
results in this test failing.

The consensus of https://github.com/nodejs/node/issues/2165 is to delegate
the task of unicode normalization to the user, and work will continue to
document how to handle unicode in a form-sensitive file system.

PR-URL: https://github.com/nodejs/node/pull/3007
Fixes: https://github.com/nodejs/node/issues/2165
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-06 18:10:49 +02:00