Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to v0.12 #1

Open
wants to merge 302 commits into
base: master
Choose a base branch
from
Open

update to v0.12 #1

wants to merge 302 commits into from

Conversation

lizhizhou
Copy link
Member

update to v0.12

Julien Gilli and others added 30 commits February 16, 2015 15:34
Conflicts:
	deps/v8/src/log-utils.cc
431eb17 had integrated the addition of
V8's version in V8's profiler log files, without backporting the test
that was included in the original change
(https://codereview.chromium.org/806143002). This commit backports this
test.

The newly added test was tested with
#9208.
The commit in v0.10 (431eb17) that
backported the original change
(https://codereview.chromium.org/806143002) did add an extra newline
because the logging facilities in v0.10's V8 do not add one.

When merging this commit in v0.12, V8's logging facilities now
automatically add the newline character, and the debug builds assert if
one is already present.
Conflicts:
	src/node_version.h
Currently, fs.truncate() silently fails when a file descriptor
is passed as the first argument. This commit changes this
behavior to properly call fs.ftruncate(). This commit also
adds proper type checking to the callback provided to
makeCallback().

PR-URL: #9161
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Currently, fs.truncate() silently fails when a file descriptor
is passed as the first argument. This commit changes this
behavior to properly call fs.ftruncate().

PR-URL: #9161
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Server sockets should be shared by default, and client sockets should be
exclusive by default. For net/TCP, this is how it is, for dgram/UDP, its
a little less clear what a client socket is, but a socket that is
auto-bound during a dgram.send() is not usefully shared among cluster
workers, any more than an outgoing TCP connection would be usefully
shared.

Since implicit binds become exclusive, implicit/client dgram sockets can
now be used with cluster on Windows. Before, neither explicit nor
implicitly bound sockets could be used, causing dgram to be completely
unsupported with cluster on Windows. After this change, they become half
supported.

PR: #8643
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-by: Bert Belder <bertbelder@gmail.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
This is a backport of 6c3647c from
v0.12 to v0.10.

Console.prototype.timeEnd() returns NaN if the timer label
corresponds to a property on Object.prototype. In v0.12, this was fixed
by using Object.create(null) to construct the _times object

However, the version of V8 in the v0.10 branch makes this fix not work
as expected. In v0.10, this commit changes the _times object into a
array of objects of the form:

{ label: someLabel, time: staringWallClockTime }

someLabel can thus be any string, including any string that represents
any Object.prototype field.

Fixes #9116.

PR: #9215
PR-URL: #9215
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
`TLSSocket` wraps the original `net.Socket`, but writes/reads to/from
`TLSSocket` do not touch the timers of original `net.Socket`.

Introduce `socket._parent` property, and iterate through all parents
to unref timers and prevent timeout event on original `net.Socket`.

Fix: #9242
PR-URL: nodejs/node#891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
node::Environment isn't accessible to user APIs, so extend smalloc to
also accept v8::Isolate.

Fixes: 75adde0 "src: remove `node_isolate` from source"
PR-URL: nodejs/node#905
Reviewed-by: Fedor Indutny <fedor@indutny.com>
Original commit message:

  Fix --max_old_space_size=4096 integer overflow.

  BUG=v8:3857
  LOG=N

  Review URL: https://codereview.chromium.org/897543002

  Cr-Commit-Position: refs/heads/master@{#26510}

PR-URL: #9200
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
closes nodejs/nodejs.org-archive#77

PR: #9172
PR-URL: #9172
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
In the documentation for querystring.parse, the documentation mentions
that the default value for options.decodeURIComponent is the
decodeURIComponent function, but it's actually the querystring.unescape
function.

PR-URL: #9259
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
 - add an article: `decode a non-utf8 string`
 - explain default and fallback behaviour of `querystring.unescape`

PR-URL: #9259
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>
test/simple/test-http-destroyed-socket-write2.js validates
that you get an appropriate error when trying to write to
a request when the response on the other side has been destroyed.

The test uses http.request to get a request and then keeps writing
to it until either it hits 128 writes or gets the expected error.
Since the writes are asynchronous we see that the writes just end
up adding events to the event loop, which then later get processed
once the connection supporting the request is fully ready.

The test is timing dependent and if takes too long for the connection
to be made the limit of 128 writes is exceeded and the test fails.
The fact that the test allows a number of writes is probably to allow
some delay for the connection to be ready for writing.

On AIX, in the default configuration using the loopback interface
is slower and the test fails because the delay is such that many
more writes can be queued up before the connection takes place.
If we use the host ip instead of defaulting to the loopback then
the test passes.

The test needs to be made more robust to delays. Since each write
simply enqueues an additional write to the event queue there is
probably no point in doing the second write until the first has
completed. This patch schedules the next write when the first one
completes and allows the test to pass even if it takes longer for
the connection to be ready for writing

PR-URL: #9270
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
Currently, lib/_tls_legacy.js and lib/crypto.js cannot be loaded when
--use-strict is passed to node. In addition to that, console.trace
throws because it uses arguments.callee.

This change fixes these issues and adds a test that makes sure
every external built-in module can be loaded with require when
--use-strict is enabled.

Please note that this change does not fix all issues with built-in
modules' code running with --use-strict. It is very likely that some
code in the built-in modules still fails when passing this flag.

However, fixing all code would require us to enable strict mode by
default in all builtins modules, which would certainly break existing
applications.

Fixes #9187.

PR: #9237
PR-URL: #9237
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Conflicts:
	lib/console.js
	test/simple/test-console.js
This test setups two event listeners: one on a child process' exit event
, another for the same child process' stdandard output's 'data' event.
The data even listener writes to a stream, and the exit event listener
ends it.

Because the exit event can be emitted before the data event, there is a
chance that something will be written to the stream after it's ended,
and that an error is thrown.

This change makes the test end the stream in the listener for the child
process' standard output's end event, which is guaranteed to be emitted
after the last data event, thus avoiding the race.

PR: #9301
PR-URL: #9301
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
PR: #9297
PR-URL: #9297
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This is a follow-up commit for b233131.

It enables strict mode in all built-in modules.

PR: #9302
PR-URL: #9302
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
this brings the error messaging in line with
other node TypeError messages.

fixes #7766.

PR: #8723
PR-URL: #8723
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The added validation allows non-negative numbers and numeric
strings. All other values result in a thrown exception.

Fixes: #9194
PR-URL: #9268
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
A significant performance regressions has been introduced in 1fddc1f for
GET requests which send data through response.end(). The number of
requests per second dropped to somewhere around 6% of their previous
level.

The fix consists of removing a part of the lines added by 1fddc1f,
lines which were supposed to affect only HEAD requests, but interfered
with GET requests instead.

The lines removed would not have affected the behaviour in the case of
a HEAD request as this._hasBody would always be false. Therefore, they
were not required to fix the issue reported in #8361.

Fixes #8940.

PR: #9026
PR-URL: #9026
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR: #9274
PR-URL: #9274
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
This reverts commit ad06848.

Initially, this bug fix targeted master, and I pushed to have it
included in v0.10. In retrospect, I'm not sure it should have made into
v0.10 as it seems it could break a lot of existing working code.

In my opinion, this change is still a bug fix, and it is not backward
incompatible per se. However, I'm not sure that taking the risk to break
a lot of users with a new 0.10.x release that would include this fix is
reasonable, especially now that 0.10.x releases are entering
maintenance mode.

PR-URL: #9257
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
danielrentz and others added 30 commits July 10, 2015 09:15
Fix for #25559 (Typo in example of util.deprecate() documentation)

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25635
Per #14604,

Document that performing an `unshift` during a read
can have unexpected results. Following the `unshift`
with a `push('')` resets the reading state appropriately.
Also indicate that doing an `unshift` during a read
is not optimal and should be avoided.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25635
per #14597

Indicate that `'readable'` indicates only that data can
be read from the stream, not that there is actually data
to be consumed. `readable.read([size])` can still return
null. Includes an example that illustrates the point.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25635
Per #25635 (comment)

Additional refinement to the clarification on the `readable` event

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25635
This is a minimal effort to support test output written both to
stdout and file in order to get our buildbots understanding
test output.

Cherry picked from jbergstroem/node@3194073
Original commit message follows:
  PR-URL: nodejs/node#934
  Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
  Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

Conflicts:
	tools/test.py

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
On a few of our installations (namely CentOS), passing 'INFO'
resulted in a silent loglevel. Use a logging constant instead.

Cherry-picked from nodejs/node@8606793
Original commit metadata follows:
  Fixes: nodejs/build#104
  PR-URL: nodejs/node#1842
  Reviewed-By: Rod Vagg <rod@vagg.org>

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
Adding support for specifying flaky test mode to
the test runner:
- via an environment variable FLAKY_TESTS for Makefile
- via an argument ignore-flaky for vcbuild.bat

Conflicts:
	Makefile

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
Make the test runner return a 0 exit code when only
flaky tests fail and --flaky-tests=dontcare is specified.

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
Adding a single rule to be called from Jenkins.

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25653
- `test-crypto-domains` was fixed by
2afa3d8

- All tests under linux appear to be fixed and have not failed recently
on Jenkins

- `test-http-dns-fail` was fixed by the DNS configuration change
mentioned in #8056

Fixes #25656
Fixes #25673

Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
PR-URL: #25676
Add a configuration flag that prevents mdb_v8.so from being built.
The default behavior is still the same and mdb_v8.so is built by default
on Solaris based platforms such as SmartOS.

Using --without-mdb fixes build issues on Solaris based platforms where
libproc.h is not available or not compatible with the one shipped by
SmartOS.

Fixes #6439.

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25707
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #25707
When listening for client hello parser events (like OCSP requests), do
not hang if `newSession` event handler is not present.

Fix: #8660
Fix: #25735

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: #25739
See: #25736

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: #25739
Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: #25739
The MSI install scope was set to the WiX default, which is per-user.
However, with UAC, it could not be installed by a standard user because
InstallPrivileges is elevated by default, hence the install scope
should be set to per-machine. Furthermore, the default install path is
a per-machine location and setting the system path requires
administrator privileges.

By changing the InstallScope to perMachine, Start Menu shortcuts are
placed in ProgramData and not the installing user's AppData folder,
making the shortcuts available to other users. This also fixes the
installation when AppData is a network folder.

The custom action is necessary to allow upgrades. Since a per-machine
MSI cannot upgrade an application installed per-user, the custom action
checks if there is going to be an upgrade to a previous version
installed per-user and sets the installation as per-user to allow
upgrading. Hence, the advantages of installing per-machine will only
apply in fresh installations.

Fixes #5849
Fixes #7629

PR-URL: #25640
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Since install is per machine only, installation path should be stored
in local machine instead of current user. The registry stores HKLM in
different places for 32 and 64 bit applications, so the installer will
not suggest the old path when upgrading from 32 to 64 bit version.

Fixes #5592
Fixes #25087

PR-URL: #25640
Reviewed-By: Alexis Campailla <alexis@janeasystems.com>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
This change is a backport of 2b4b600
from io.js.

Original commit message:

  This test was failing because the spawned process was terminated
  before anything could be done, by calling child.stdin.end. With this
  change, the child's stdin is no longer closed. When the stdin is not
  a tty, io.js waits for the whole input before starting, so the child
  must be run with --interactive to process the command sent by the
  parent. The child is killed explicitly by the parent before it exits.

  This test was failing silently because the asserts were not called if
  nothing was received from the child. This fix moves assertOutputLines
  to always run on exit.

  Fixes: nodejs/node#2177
  Refs: nodejs/node#2094
  PR-URL: nodejs/node#2186
  Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  Reviewed-By: Rod Vagg <rod@vagg.org>
  Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  Reviewed-By: Alexis Campailla <alexis@janeasystems.com>

Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #25748
This test just failed on Ubuntu in Jenkins, for a change that
is 100% Windows-specific.

Reviewed-By: Joao Reis <reis@janeasystems.com>
PR-URL: #25750
Handle case where realloc fails and returns a null ptr

Reviewed-By: Michael Dawson <mdawson@devrus.com>
PR-URL: #25534
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25805
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.

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25786
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25767
No offense to @izs, but the doxygen he put up 3.5 years ago isn't
accurate for node 0.12 nor io.js. I'm trying to keep up and have
multiple sets of doxygen of v8 available at http://v8dox.com/

Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #25658
PR-URL: #25615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
PR-URL: #25818
Reviewed-By: James M Snell <jasnell@gmail.com>
See #7345

Adding a test to verify that a node process spawned via cmd with
named pipes can access its stdio streams.

PR-URL: #7433
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Ref: #25876

PR-URL: #25897
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis  <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.