0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

18576 Commits

Author SHA1 Message Date
Evan Lucas
b2a9b81738 http2: fix [kInspect]() output for Http2Stream
This fixes a typo in the util.inspect output of Http2Stream. It
previously had writeableSate instead of writableState.

PR-URL: https://github.com/nodejs/node/pull/14753
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-14 10:06:01 -05:00
Refael Ackermann
85d7d97d81
doc: delint
PR-URL: https://github.com/nodejs/node/pull/14707
Refs: https://github.com/nodejs/node/pull/12756
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-14 08:13:07 -04:00
Refael Ackermann
6d84e30087
doc: fix header level typo
PR-URL: https://github.com/nodejs/node/pull/14707
Refs: https://github.com/nodejs/node/pull/12756
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2017-08-14 08:13:07 -04:00
Oky Antoro
1268737e71
test: cover all HTTP methods that parser supports
Cover all request methods that Node's HTTP parser supports in
parallel/test-http-methods.

PR-URL: https://github.com/nodejs/node/pull/14773
Refs: https://github.com/nodejs/node/issues/14544
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-14 09:44:21 +03:00
Daniel Bevenius
170ff0e4bb lib: move deprecationWarned var
The variable deprecationWarned currently looks a little misplaced. It is
used in emitWarning but declared after it. This commit suggest moving
the var to the beginning of the function.

PR-URL: https://github.com/nodejs/node/pull/14769
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-14 07:42:08 +02:00
Daniel Bevenius
95c8df18f1 test: add test to verify ErrnoException path
This commit adds a test to verify that the path argument to
ErrnoException can contain UTF-8 characters.

PR-URL: https://github.com/nodejs/node/pull/13958
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-14 07:24:22 +02:00
Vincent Xue
e6eb5c00da test: use regular expressions in throw assertions
Test errors thrown in addons-napi/test_constructor more specifically.

PR-URL: https://github.com/nodejs/node/pull/14318
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-08-14 00:01:10 +03:00
Anna Henningsen
314217f8fb
doc: add missing changes: metadata for util
Ref: https://github.com/nodejs/node/pull/14558
PR-URL: https://github.com/nodejs/node/pull/14810
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-13 22:21:03 +02:00
Anna Henningsen
7e0c2ea92b
doc: add missing changes: metadata for streams
Ref: https://github.com/nodejs/node/pull/14636
PR-URL: https://github.com/nodejs/node/pull/14810
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-13 22:20:44 +02:00
Griffith Tchenpan
1df9340d0b test: invoke callback with common.mustCall()
* invoke callback with `common.mustCall()` in test-crypto-hash
* order module declarations aphabetically per test-writing-guide

PR-URL: https://github.com/nodejs/node/pull/8597
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-08-13 12:19:02 -07:00
Ruben Bridgewater
a7189c0177
benchmark: fix and extend assert benchmarks
The benchmarks had the strict and non strict labels switched.
This is fixed and the benchmarks were extended to check more
possible input types and function calls.

PR-URL: https://github.com/nodejs/node/pull/14147
Refs: https://github.com/nodejs/node/pull/13973
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-13 14:31:27 -04:00
Gabriel Schulhof
6fe72c82d2 src: mention that node options are space-separated
The documentation does not mention that the value of NODE_OPTIONS is a
space-separated list.

PR-URL: https://github.com/nodejs/node/pull/14709
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 21:21:39 +03:00
Daijiro Wachi
7294f57c0d doc: fix docs style in util.md
Summary
  + L582: Cell should be padded
  + L589: Cell should be padded
  + L590: Cell should be padded
  + L600: Cell should be padded
  + L622: Cell should be padded

PR-URL: https://github.com/nodejs/node/pull/14711
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 20:19:12 +02:00
Daijiro Wachi
003ba0b0e2 doc: fix docs style in intl.md
Summary
  + L43: Add missing final pipe in table fence
  + L45: Add missing final pipe in table fence
  + L46: Add missing final pipe in table fence
  + L47: Add missing final pipe in table fence
  + L48: Add missing final pipe in table fence
  + L49: Add missing final pipe in table fence
  + L50: Add missing final pipe in table fence
  + L51: Add missing final pipe in table fence
  + L52: Add missing final pipe in table fence
  + L53: Add missing final pipe in table fence
  + L54: Add missing final pipe in table fence
  + L55: Add missing final pipe in table fence

PR-URL: https://github.com/nodejs/node/pull/14711
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-13 20:18:50 +02:00
Ruben Bridgewater
9222fe64ad
assert: optimize code path for deepEqual Maps
PR-URL: https://github.com/nodejs/node/pull/14501
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-13 13:58:11 -04:00
Ruben Bridgewater
95bbb68175
util: improve util.inspect performance
* improve util.inspect performance
  This is a huge performance improvement in case of sparse arrays
  when using util.inspect as the hole will simple be skipped.

* use faster visibleKeys property lookup

* add inspect-array benchmark

PR-URL: https://github.com/nodejs/node/pull/14492
Fixes: https://github.com/nodejs/node/issues/14487
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-13 13:52:33 -04:00
Tristian Flanagan
f2b01cba7b child_process: defer error to next tick
PR-URL: https://github.com/nodejs/node/pull/4670
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
2017-08-13 10:23:50 -07:00
Anna Henningsen
5ea25d2ebe
http2: name padding buffer fields
PR-URL: https://github.com/nodejs/node/pull/14744
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-13 17:21:00 +02:00
Anna Henningsen
e46ae99a2a
http2: use per-environment buffers
As discussed in the review for
https://github.com/nodejs/node/pull/14239, these buffers should
be per-Environment rather than static.

PR-URL: https://github.com/nodejs/node/pull/14744
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-13 17:20:40 +02:00
Anna Henningsen
348dd66337
http2: improve perf of passing headers to C++
By passing a single string rather than many small ones and
a single block allocation for passing headers, save expensive
interactions with JS values and memory allocations.

PR-URL: https://github.com/nodejs/node/pull/14723
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-13 16:09:38 +02:00
Teddy Katz
b646a3df29
repl: include folder extensions in autocomplete
When autocompleting `require` calls, the repl strips .js file extensions
from results. However, stripping an extension from a directory results
in an error. Update the autocompletion logic to avoid stripping
extensions from directories.

PR-URL: https://github.com/nodejs/node/pull/14727
Fixes: https://github.com/nodejs/node/issues/14726
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-08-13 01:03:30 -07:00
Daniel Bevenius
50235a03ef src: avoid creating local data variable
This commit removes the following comment and attempts to fix the issue
as the the requirement of g++ version is now 4.9.4 or newer:

// XXX(bnoordhuis) Work around a g++ 4.9.2 template type inferrer bug
// when the expression is written as info.Data().As<v8::External>().

PR-URL: https://github.com/nodejs/node/pull/14732
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-13 06:32:08 +02:00
Rich Trott
7253eaef58 test: add test-benchmark-arrays
Add minimal test to confirm that arrays benchmarks run.

PR-URL: https://github.com/nodejs/node/pull/14728
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-12 16:33:10 -07:00
Vishal Bisht
89d9cc789b
doc: expanded description of buffer.slice
Added description for the case when `end` is greater than buffer length

PR-URL: https://github.com/nodejs/node/pull/14720
Fixes: https://github.com/nodejs/node/issues/14714
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-12 16:16:46 -04:00
Anna Henningsen
835c383969
n-api: add napi_get_node_version
Add `napi_get_node_version`, to help with feature-detecting
Node.js as an environment.

PR-URL: https://github.com/nodejs/node/pull/14696
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-12 21:28:59 +02:00
Gibson Fahnestock
8780e1d79b
test: allow inspector to reopen with same port
Test checks that if you open the inspector with '0' (pick a random free
port), close it, then reopen it, you get a different port. However this
isn't necessarily true.

PR-URL: https://github.com/nodejs/node/pull/14320
Fixes: https://github.com/nodejs/node/issues/14316
Refs: https://github.com/nodejs/node/issues/14316#issuecomment-315680755
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-12 19:51:39 +01:00
Rich Trott
ab2b331f5e test: make test-tls-alert-handling more strict
Use `common.mustCall()` and `common.mustNotCall()` to more rigorously
check that functions (especially no-op error handlers) are called the
expected number of times in test-tls-alert-handling.

PR-URL: https://github.com/nodejs/node/pull/14650
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-11 16:25:09 -07:00
Anna Henningsen
a6973a3811
Revert "inspector: rewrite inspector test helper"
This reverts commit 2296b677fb.

That commit was landed without a green CI and is failing on Windows.

Ref: https://github.com/nodejs/node/pull/14460
PR-URL: https://github.com/nodejs/node/pull/14777
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-11 22:33:29 +02:00
XadillaX
f422e38bca
test: remove redundant using in cctest
PR-URL: https://github.com/nodejs/node/pull/14739
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
2017-08-11 21:33:38 +02:00
Anna Henningsen
eb8f574229
src: add comments for cares library init refcount
Ref: https://github.com/nodejs/node/pull/14738
PR-URL: https://github.com/nodejs/node/pull/14743
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-11 21:33:37 +02:00
Anna Henningsen
39c67f43a2
src: remove duplicate loop
Two identical `while` loops after each other can be folded into
a single one.

PR-URL: https://github.com/nodejs/node/pull/14750
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
2017-08-11 21:33:36 +02:00
Daniel Bevenius
c27360ea74
src: use local isolate instead of args.GetIsolate
While stepping though SetupPromises I noticed that the environments
Isolate is used but not when creating the string "_setupPromises".

Is there a reason for using args.GetIsolate() instead of using the
environments isolate? I see that GetIsolate() is an inline call, but
could there be situations where it returns a different Isolate?
If not perhaps using the local isolate variable would be a litte
clearer.

PR-URL: https://github.com/nodejs/node/pull/14768
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-11 21:33:35 +02:00
Daniel Bevenius
d94e4b8e81
test: make totalLen snake case
For consistency, use snake case (total_len) for the local totalLen
variable.

PR-URL: https://github.com/nodejs/node/pull/14765
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-08-11 21:33:23 +02:00
Eugene Ostroukhov
63fc89a6a0 inspector: support extra contexts
This enables inspector support for contexts created using the vm module.

PR-URL: https://github.com/nodejs/node/pull/14465
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-08-11 11:25:31 -07:00
Alexey Kozyatinskiy
73c59bbbf9 deps: cherry-pick f19b889 from V8 upstream
Original commit message:
	[inspector] support for cases when embedder doesn't call contextDestroyed

	Node.js doesn't have good place to call contextDestroyed.
	We need to cleanup everything on our side to allow clients to not call
	contextDestroyed method.

	R=dgozman@chromium.org,eostroukhov@chromium.com

	Bug: none
	Change-Id: Ibe3f01fd18afbfa579e5db66ab6f174d5fad7c82
	Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_chromium_rel_ng
	Reviewed-on: https://chromium-review.googlesource.com/575519
	Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
	Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
	Cr-Original-Commit-Position: refs/heads/master@{#46849}
	Reviewed-on: https://chromium-review.googlesource.com/596549
	Cr-Commit-Position: refs/heads/master@{#47060}

Ref: f19b889be8
PR-URL: https://github.com/nodejs/node/pull/14465
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-08-11 11:17:02 -07:00
Daniel Bevenius
7307839b55 test: check crypto before requiring tls module
test-tls-session-cache currently fails if built --without-ssl:
internal/util.js:82
    throw new errors.Error('ERR_NO_CRYPTO');
    ^

Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto
support
    at Object.assertCrypto (internal/util.js:82:11)
    at tls.js:26:14
    at NativeModule.compile (bootstrap_node.js:586:7)
    at Function.NativeModule.require (bootstrap_node.js:531:18)
    at Function.Module._load (module.js:449:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous>
(/node/test/parallel/test-tls-session-cache.js:26:13)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)

The test has a crypto check but it come after the require of the tls
module.

This commit moves the crypto check to come before the require of tls and
allows the test to pass.

PR-URL: https://github.com/nodejs/node/pull/14708
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-11 07:14:30 +02:00
Eugene Ostroukhov
2296b677fb inspector: rewrite inspector test helper
Helper was rewritten to rely on promises instead of manually written
queue and callbacks. This simplifies the code and makes it easier to
maintain and extend.

PR-URL: https://github.com/nodejs/node/pull/14460
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-10 16:19:11 -07:00
Michael Albert
340b3be1df
test: increase http2 coverage
Added tests for `getPackedSettings` to check for not passing `settings`
and for `getUnpackedSettings` to check for a few cases when passing
`{ validate: true }`.

PR-URL: https://github.com/nodejs/node/pull/14701
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-11 00:28:13 +02:00
Gareth Ellis
b5556e4de1
benchmark: Correct constructor for freelist
Updates to use current constructor for freelist, which was changed
under pr #12644

Ref: https://github.com/nodejs/node/pull/12644
PR-URL: https://github.com/nodejs/node/pull/14627
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-08-10 22:45:15 +02:00
Anna Henningsen
2421984727
zlib: check cleanup return values
PR-URL: https://github.com/nodejs/node/pull/14673
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-10 22:38:46 +02:00
Rich Trott
cea4bd92fd
test: make test-tls-connect checks more strict
Check the error code on expected errors so that the introduction of
different errors in refactoring is caught.

While at it, re-order modules alphabetically per test-writing guide.

PR-URL: https://github.com/nodejs/node/pull/14695
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-08-10 22:34:42 +02:00
Anna Henningsen
c80d400c01
Revert "test: disable MultipleEnvironmentsPerIsolate"
This reverts commit 95ab966a74.

Ref: https://github.com/nodejs/node/issues/14206
Ref: https://github.com/nodejs/node/pull/14246
PR-URL: https://github.com/nodejs/node/pull/14749
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10 22:09:44 +02:00
Anna Henningsen
ef7da4200d
Revert "test: add DISABLED_ prefix to commented out test"
This reverts commit 75bf8a9db9.

Ref: https://github.com/nodejs/node/issues/14206
Ref: https://github.com/nodejs/node/pull/14317
PR-URL: https://github.com/nodejs/node/pull/14749
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10 22:09:37 +02:00
Anna Henningsen
93f25f4b44
test: properly order freeing resources in cctest
The `IsolateData` instance is created before the `Environment` instance,
so free in reverse order.

Fixes: https://github.com/nodejs/node/issues/14206
PR-URL: https://github.com/nodejs/node/pull/14749
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10 22:08:56 +02:00
Anna Henningsen
b559e66252
src: add overlooked handle to cleanup
The `Environment::destroy_ids_timer_handle` should be cleaned up
by `Environment::CleanupHandles()`. Fix that by adding it to the list.

This partially fixes a cctest.

Ref: https://github.com/nodejs/node/issues/14206
PR-URL: https://github.com/nodejs/node/pull/14749
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2017-08-10 22:07:09 +02:00
Rich Trott
97c43940c8 benchmark: cover more nextTick() code
The benchmarks for `process.nextTick()` do not cover the `default` case
in the internal code's `switch` statement where the callback receives
more than 3 arguments. Modify two of the benchmarks to include this
condition.

PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10 09:11:50 -07:00
Rich Trott
a253704446 process: make this value consistent
The value of `this` for callbacks of `nextTick()` can vary depending on
the number of arguments. Make it consistent.

PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10 09:11:47 -07:00
Rich Trott
0d3ef5b0f8 test: check this value for nextTick()
Depending on how many arguments are provided, `nextTick()` may run its
callback with `this` set to `null` or not. Add assertions for
both cases.

PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10 09:11:43 -07:00
Rich Trott
2249234fee fs: invoke callbacks with undefined context
Many callbacks appear to be invoked with `this` set to `undefined`
including `fs.stat()`, `fs.lstat()`, and `fs.fstat()`.

However, some such as `fs.open()` and `fs.mkdtemp()` invoke their
callbacks with `this` set to `null`. Change to `undefined`.

PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10 09:11:38 -07:00
Rich Trott
c6126b1308 test: refactor test-fs-stat
* add `use strict'
* change checks that `this` is mapped to `global` in sloppy mode to
  checks that `this` is `undefined`
* modify arguments to assertions to match docs (actual first, expected
  second)
* add blank line below `common` declaration per test writing guide
* use `assert.ifError()` as appropriate

PR-URL: https://github.com/nodejs/node/pull/14645
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-08-10 09:11:34 -07:00