Ruben Bridgewater
520b3e63ea
util: fix map entries inspection
...
This makes sure the arrays returned by Map#entries() are handled as
any other array instead of just visualizing the entries as array.
Therefore options should have an impact on the arrays.
PR-URL: https://github.com/nodejs/node/pull/26918
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-29 11:04:20 +01:00
Ruben Bridgewater
f9da55cca2
test: remove test-path-parse-6229.js from known issues
...
This test precedented the official documentation that states that
this is an expected behavior.
PR-URL: https://github.com/nodejs/node/pull/26913
Refs: https://github.com/nodejs/node/issues/6229
Refs: https://github.com/nodejs/node/pull/12181
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-29 11:02:15 +01:00
Ruben Bridgewater
6e5ffc4147
test: move hasCrypto check
...
The hasCrypto check should be checked before anything else to
prevent overhead in case it's not falsy. Otherwise the file would
be read without any further benefit.
PR-URL: https://github.com/nodejs/node/pull/26858
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-29 10:58:42 +01:00
Ruben Bridgewater and Rich Trott
f2dc99c127
test: do not require flags when executing a file
...
Instead of throwing an error in case a flag is missing, just start
a `child_process` that includes all flags. This improves the situation
for all developers in case they want to just plainly run a test.
Co-authored-by: Rich Trott <rtrott@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/26858
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-29 10:58:41 +01:00
Brian White
7d0e50dcfe
crypto: add crypto.sign() and crypto.verify()
...
These methods are added primarily to allow signing and verifying
using Ed25519 and Ed448 keys, which do not support streaming of
input data. However, any key type can be used with these new
APIs, to allow better performance when only signing/verifying
a single chunk.
Fixes: https://github.com/nodejs/node/issues/26320
PR-URL: https://github.com/nodejs/node/pull/26611
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-03-28 21:57:53 -04:00
Sam Roberts
8c69e06972
tls: return an OpenSSL error from renegotiate
...
A generic error lacks any of the context or detail of the underlying
OpenSSL error, so throw from C++, and report the OpenSSL error to the
callback.
PR-URL: https://github.com/nodejs/node/pull/26868
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-03-28 14:03:25 -07:00
Sam Roberts
bcbd35a48d
crypto: add openssl specific error properties
...
Don't force the user to parse the long-style OpenSSL error message,
decorate the error with the library, reason, code, function.
PR-URL: https://github.com/nodejs/node/pull/26868
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-03-28 14:03:18 -07:00
cjihrig
afad3b443e
test: update postmortem metadata test for V8 7.4
...
Summary of changes:
- v8dbg_class_FixedTypedArrayBase__external_pointer__Object
- Type changed in https://github.com/v8/v8/commit/f70bb59b57e2a66f165a728c1799e36ceb0e9fc8#diff-f3f182b0510ba2ee39ae87e421ff110b .
- Use v8dbg_class_FixedTypedArrayBase__external_pointer__uintptr_t
- v8dbg_class_JSArrayBuffer__backing_store__Object
- Type changed in https://github.com/v8/v8/commit/f70bb59b57e2a66f165a728c1799e36ceb0e9fc8#diff-f3f182b0510ba2ee39ae87e421ff110b .
- Use v8dbg_class_JSArrayBuffer__backing_store__uintptr_t
- v8dbg_class_Map__raw_instance_descriptors__DescriptorArray
- Changed in https://github.com/v8/v8/commit/d7b08b6da2fd963ab7f74319617050329881a8c2#diff-59788e25dc5196c356894d5e1fac6425
- New constant added to V8: v8dbg_class_Map__instance_descriptors_offset
- v8dbg_PointerSizeLog2
- Changed in https://github.com/v8/v8/commit/46d1986812097f712aa7c314c8aa49ec49a33b88#diff-f3f182b0510ba2ee39ae87e421ff110b
- Refs: https://bugs.chromium.org/p/v8/issues/detail?id=8477
- Use new constants: v8dbg_SystemPointerSize, v8dbg_SystemPointerSizeLog2,
v8dbg_TaggedSize, and v8dbg_TaggedSizeLog2
PR-URL: https://github.com/nodejs/node/pull/26685
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2019-03-28 16:39:35 -04:00
Tobias Nießen
c35acc0260
crypto: allow undefined for saltLength and padding
...
PR-URL: https://github.com/nodejs/node/pull/26921
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2019-03-28 14:33:03 +01:00
Ruben Bridgewater
4bfc06f6b5
util: improve proxy inspection
...
This makes sure the brace is actually handled as any other brace.
It was handled differently so far than any other brace and that had
an impact on how the output would be formatted.
PR-URL: https://github.com/nodejs/node/pull/26919
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-28 12:24:51 +01:00
Ruben Bridgewater
3cf1ffebab
path: fix win32 parse regression
...
This fixes the parse function for single character input that are not
a path separator.
PR-URL: https://github.com/nodejs/node/pull/26912
Fixes: https://github.com/nodejs/node/issues/26911
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-28 12:22:21 +01:00
Ruben Bridgewater
4c4ad120c5
test: refactor path parse test
...
Use destructuring and arrow functions and make one test stricter.
Also inline the error object as there's only a sinlge error that can
currently be thrown in the path module.
PR-URL: https://github.com/nodejs/node/pull/26912
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-28 12:22:17 +01:00
Daiki Ihara
85546c2a04
test: add test about unencrypted PKCS#8 private key for RSA
...
PR-URL: https://github.com/nodejs/node/pull/26898
Refs: https://github.com/nodejs/node/issues/24928
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2019-03-28 05:47:57 +01:00
Ruben Bridgewater
b5ea925c8e
util: don't set the prototype of callbackified functions
...
Using `util.callbackify()` should not set the prototype for the
returned function to the one from the input function. It could cause
confusion while debugging otherwise.
PR-URL: https://github.com/nodejs/node/pull/26893
Fixes: https://github.com/nodejs/node/issues/26890
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-27 22:45:20 +01:00
Ruben Bridgewater
46bf0d0f4f
util: rename callbackified function
...
This makes sure the function returned by `util.callbackify()` has a
new name that is not identical to the inputs function name.
PR-URL: https://github.com/nodejs/node/pull/26893
Fixes: https://github.com/nodejs/node/issues/26890
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-27 22:42:13 +01:00
Ruben Bridgewater
61d1334e5b
util: increase function length when using callbackify()
...
The returned function from `util.callbackify()` should increase the
`length` property by one due to the added callback.
PR-URL: https://github.com/nodejs/node/pull/26893
Fixes: https://github.com/nodejs/node/issues/26890
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2019-03-27 22:42:12 +01:00
b1094dbe19
esm: phase two of new esm implementation
...
This PR updates the current `--experimental-modules` implementation
based on the work of the modules team and reflects Phase 2 of our
new modules plan.
The largest differences from the current implementation include
* `packge.type` which can be either `module` or `commonjs`
- `type: "commonjs"`:
- `.js` is parsed as commonjs
- default for entry point without an extension is commonjs
- `type: "module"`:
- `.js` is parsed as esm
- does not support loading JSON or Native Module by default
- default for entry point without an extension is esm
* `--entry-type=[mode]`
- allows you set the type on entry point.
* A new file extension `.cjs`.
- this is specifically to support importing commonjs in the
`module` mode.
- this is only in the esm loader, the commonjs loader remains
untouched, but the extension will work in the old loader if you use
the full file path.
* `--es-module-specifier-resolution=[type]`
- options are `explicit` (default) and `node`
- by default our loader will not allow for optional extensions in
the import, the path for a module must include the extension if
there is one
- by default our loader will not allow for importing directories that
have an index file
- developers can use `--es-module-specifier-resolution=node` to
enable the commonjs specifier resolution algorithm
- This is not a “feature” but rather an implementation for
experimentation. It is expected to change before the flag is
removed
* `--experimental-json-loader`
- the only way to import json when `"type": "module"`
- when enable all `import 'thing.json'` will go through the
experimental loader independent of mode
- based on https://github.com/whatwg/html/issues/4315
* You can use `package.main` to set an entry point for a module
- the file extensions used in main will be resolved based on the
`type` of the module
Refs: https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md
Refs: https://github.com/GeoffreyBooth/node-import-file-specifier-resolution-proposal
Refs: https://github.com/nodejs/modules/pull/180
Refs: https://github.com/nodejs/ecmascript-modules/pull/6
Refs: https://github.com/nodejs/ecmascript-modules/pull/12
Refs: https://github.com/nodejs/ecmascript-modules/pull/28
Refs: https://github.com/nodejs/modules/issues/255
Refs: https://github.com/whatwg/html/issues/4315
Refs: https://github.com/w3c/webcomponents/issues/770
Co-authored-by: Myles Borins <MylesBorins@google.com >
Co-authored-by: John-David Dalton <john.david.dalton@gmail.com >
Co-authored-by: Evan Plaice <evanplaice@gmail.com >
Co-authored-by: Geoffrey Booth <webmaster@geoffreybooth.com >
Co-authored-by: Michaël Zasso <targos@protonmail.com >
PR-URL: https://github.com/nodejs/node/pull/26745
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Ben Coe <bencoe@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
2019-03-27 15:52:11 -04:00
Ruben Bridgewater
b08a867d60
benchmark,doc,lib: capitalize more comments
...
PR-URL: https://github.com/nodejs/node/pull/26849
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
2019-03-27 17:20:06 +01:00
Ruben Bridgewater
115f0f5a57
module: throw an error for invalid package.json main entries
...
We currently ignore invalid `main` entries in package.json files.
This does not seem to be very user friendly as it's certainly an
error if the `main` entry is not a valid file name. So instead of
trying to resolve the file otherwise, throw an error immediately to
improve the user experience.
To keep it backwards compatible `index.js` files in the same directory
as the `package.json` will continue to be resolved instead but that
behavior is now deprecated.
PR-URL: https://github.com/nodejs/node/pull/26823
Fixes: https://github.com/nodejs/node/issues/26588
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2019-03-27 17:11:53 +01:00
Ruben Bridgewater
28e2c3771d
child_process: rename _validateStdtio to getValidStdio
...
The name indicated only validation while it did much more and it
returned a different value to the callee function. The underscore
was also not necessary as the function is internal one way or the
other.
PR-URL: https://github.com/nodejs/node/pull/26809
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-27 17:05:15 +01:00
gengjiawen
8209caec39
tools: remove eslint rule no-let-in-for-declaration
...
PR-URL: https://github.com/nodejs/node/pull/26715
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-03-26 09:46:41 -07:00
Guy Bedford
53ebd3311d
process: global.process, global.Buffer getters
...
PR-URL: https://github.com/nodejs/node/pull/26882
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-03-26 15:26:07 +02:00
cjihrig
5de804e636
tools: enable getter-return lint rule
...
PR-URL: https://github.com/nodejs/node/pull/26615
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Masashi Hirano <shisama07@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2019-03-25 20:02:10 -04:00
Ruben Bridgewater
97737fd5fb
repl: fix terminal default setting
...
This makes sure that the described default behavior for the
`terminal` option is actually always used and not only when running
the REPL as standalone program.
The options code is now logically combined instead of being spread
out in the big REPL constructor.
PR-URL: https://github.com/nodejs/node/pull/26518
Reviewed-By: Lance Ball <lball@redhat.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-25 16:28:07 +01:00
Ruben Bridgewater
96204c3c71
net: do not manipulate potential user code
...
The error provided in this function could come from user code. Thus
the error should not be manipulated in any way. The added properties
do not seem to provide any actual value either as can not be part
of the error. The `hostname` is already set on the error and adding
the `host` property with the identical value does not seem right in
this case.
PR-URL: https://github.com/nodejs/node/pull/26751
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2019-03-25 16:13:33 +01:00
Matteo Collina
bdea725bdc
process: make stdout and stderr emit 'close' on destroy
...
Fix: https://github.com/nodejs/node/issues/26550
PR-URL: https://github.com/nodejs/node/pull/26691
Fixes: https://github.com/false
Fixes: https://github.com/nodejs/node/issues/26550
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-03-25 12:29:16 +01:00
Filip Skokan
85fda7e848
crypto: add support for x25119 and x448 KeyObjects
...
PR-URL: https://github.com/nodejs/node/pull/26774
Refs: https://github.com/nodejs/node/issues/26626
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-25 01:40:54 +01:00
Rich Trott
4ba33c90c6
test: delete pummel/test-dtrace-jsstack
...
The test pummel/test-dtrace-jsstack is broken and probably has been for
a very long time. Remove it.
It gets skipped on anything that is non-SunOS. In our CI, that means
skipped everywhere but SmartOS.
When run on SmartOS in our CI (which never happens because it's in
pummel, but I moved it into sequential to test it), it fails because it
needs elevated privileges.
When I log into the SmartOS machine and run the test as root, it fails
with:
AssertionError [ERR_ASSERTION]: did not find expected frame stalloogle
Since I have dtrace installed on my macOS machine, I tried running it
locally but removing the SunOS check. It failed because the test leaks a
global variable. I removed the global leak check, and the test failed
because I have System Integrity Protection enabled.
In short, the test does not work in its current form, has almost
certainly not worked in a long time, and is very likely to be brittle if
we ever do fix it. I'm inclined to remove it.
PR-URL: https://github.com/nodejs/node/pull/26869
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2019-03-24 14:59:14 -07:00
Rich Trott
4a40ea6894
test: refactor test-https-connect-localport
...
Use arrow functions for callbacks. Replace uses of `this` with explicit
variables. Add a trailing comma in a multiline object literal
declaration.
PR-URL: https://github.com/nodejs/node/pull/26881
Fixes: https://github.com/https://github.com/nodejs/node/issues/26862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2019-03-24 07:56:25 -07:00
Rich Trott
f5969f08a0
test: replace localhost IP with 'localhost' for TLS conformity
...
test-https-connect-localport currently causes a runtime deprecation
warning: "[DEP0123] DeprecationWarning: Setting the TLS ServerName
to an IP address is not permitted by RFC 6066. This will be ignored
in a future version."
Change IP usage to the string 'localhost' instead.
PR-URL: https://github.com/nodejs/node/pull/26881
Fixes: https://github.com/https://github.com/nodejs/node/issues/26862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2019-03-24 07:56:20 -07:00
Rich Trott
229759f961
test: use common.PORT instead of hardcoded number
...
In sequential/test-https-connect-localport, replace 34567 with
common.PORT.
PR-URL: https://github.com/nodejs/node/pull/26881
Fixes: https://github.com/https://github.com/nodejs/node/issues/26862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2019-03-24 07:56:12 -07:00
Rich Trott
0f7e24a0c3
test: move test-https-connect-localport to sequential
...
test-https-connect-localport uses a hard-coded port number. Therefore
the test cannot be in the parallel directory because it will sometimes
conflict with other tests that run at the same time and request that the
OS provide an available port.
Fixes: https://github.com/nodejs/node/issues/26862
PR-URL: https://github.com/nodejs/node/pull/26881
Fixes: https://github.com/https://github.com/nodejs/node/issues/26862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
2019-03-24 07:56:03 -07:00
Rich Trott
8330555295
test: refactor test-dgram-broadcast-multi-process
...
* Add check that `signal` is not null in callback.
* Use arrow functions for callbacks, destructuring where appropriate,
and a trailing comma in multi-line arrays
PR-URL: https://github.com/nodejs/node/pull/26846
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-03-23 19:58:04 -07:00
Gireesh Punathil
ed849f812d
test: strengthen test-worker-prof
...
Force main and worker to stay for some deterministic time
Add some more validation check around profile file generation
Fixes: https://github.com/nodejs/node/issues/26401
PR-URL: https://github.com/nodejs/node/pull/26608
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2019-03-24 07:06:59 +05:30
Jeremiah Senkpiel
7c80f18c41
timers: deprecate active() and _unrefActive()
...
Another nail in the coffin here, farewell ye ol C-style apis.
These apis caused numerous other issues that required far too many
safeguards. This gets us one step closer to not having to worry about
those issues anymore.
Refs: https://github.com/nodejs/node/pull/18066
Refs: https://github.com/nodejs/node/pull/20298
PR-URL: https://github.com/nodejs/node/pull/26760
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2019-03-22 19:47:32 -07:00
Ruben Bridgewater
f0f26cedcc
n-api: remove code from error name
...
This is a first step to align the n-api errors towards errors created
in JS. The stack still has to be updated to add the error code.
PR-URL: https://github.com/nodejs/node/pull/26738
Fixes: https://github.com/nodejs/node/issues/26669
Fixes: https://github.com/nodejs/node/issues/20253
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2019-03-23 02:55:57 +01:00
Ruben Bridgewater
e96e3f9eb0
test: remove redundant common.mustCall
...
All calls verify the cb is called, thus using `common.mustCall` is
not required inside of this function.
PR-URL: https://github.com/nodejs/node/pull/26738
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2019-03-23 02:55:56 +01:00
Ruben Bridgewater
bfbce289c3
lib: refactor Error.captureStackTrace() usage
...
When using `Errors.captureStackFrames` the error's stack property
is set again. This adds a helper function that wraps this functionality
in a simple API that does not only set the stack including the `code`
property but it also improves the performance to create the error.
The helper works for thrown errors and errors returned from wrapped
functions in case they are Node.js core errors.
PR-URL: https://github.com/nodejs/node/pull/26738
Fixes: https://github.com/nodejs/node/issues/26669
Fixes: https://github.com/nodejs/node/issues/20253
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2019-03-23 02:55:54 +01:00
Ruben Bridgewater
1ed3c54ecb
errors: update error name
...
This updates all Node.js errors by removing the `code` being part
of the `name` property. Instead, the name is just changed once on
instantiation, the stack is accessed to create the stack as expected
and then the `name` property is set back to it's original form.
PR-URL: https://github.com/nodejs/node/pull/26738
Fixes: https://github.com/nodejs/node/issues/26669
Fixes: https://github.com/nodejs/node/issues/20253
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2019-03-23 02:55:54 +01:00
Rich Trott
7d201c4e70
test: move pummel tls test to sequential
...
Move test-tls-session-timeout from pummel to sequential. It isn't very
pummel-y and this will result in it being run on our CI more than once a
day. (It broke recently and it would have been caught if it was in
sequential rather than pummel.)
It must be in sequential rather than pummel because it uses
`common.PORT` which can result in test failures if more than one test
uses it at one time in parallel.
PR-URL: https://github.com/nodejs/node/pull/26865
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-03-22 13:57:24 -07:00
Rich Trott
cc89e68e72
test: fix pummel/test-tls-session-timeout
...
The test does not work with TLS 1.3 nor should it. Force TLS version
1.2.
While at it, some refactoring:
* refresh the tmp directory in case it doesn't exist!
* add an assert.strictEqual() check on the client return `code` value
which must be zero
* use arrow functions for callbacks
* add trailing commas for multiline arrays/objects
Fixes: https://github.com/nodejs/node/issues/26839
PR-URL: https://github.com/nodejs/node/pull/26865
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-03-22 13:57:21 -07:00
Rich Trott
6e9551e1b1
test: complete console.assert() coverage
...
There is one condition in the `console.assert()` code that is not
tested currently. Add a test to confirm that `console.assert(false)`
does not include a `:` in its output.
PR-URL: https://github.com/nodejs/node/pull/26827
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-03-22 11:15:39 -07:00
Rich Trott
ee429e4b2c
test: fix test-console-stdio-setters to test setters
...
test-console-stdio-setters needs to test against the global console in
order to test the setters for the lazy-loaded _stdout and _stderr
properties.
PR-URL: https://github.com/nodejs/node/pull/26796
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-03-21 22:22:29 -07:00
Vladislav Kaminsky
82b3ee776b
repl: check colors with .getColorDepth()
...
PR-URL: https://github.com/nodejs/node/pull/26261
Fixes: https://github.com/nodejs/node/issues/26187
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2019-03-21 23:34:14 +01:00
Vladislav Kaminsky
d3a62fe7fc
readline: support TERM=dumb
...
When TERM=dumb and .isTTY=true don't use ANSI escape codes
and ignore all keys, except 'escape', 'return' and 'ctrl-c'.
PR-URL: https://github.com/nodejs/node/pull/26261
Fixes: https://github.com/nodejs/node/issues/26187
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2019-03-21 23:33:55 +01:00
Vladislav Kaminsky
99523758dc
console: don't use ANSI escape codes when TERM=dumb
...
PR-URL: https://github.com/nodejs/node/pull/26261
Fixes: https://github.com/nodejs/node/issues/26187
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2019-03-21 23:32:59 +01:00
Ruben Bridgewater
5a3623af74
assert: validate required arguments
...
This validates most `assert` functions to verify that the required
arguments are indeed passed to the function.
PR-URL: https://github.com/nodejs/node/pull/26641
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2019-03-21 22:58:12 +01:00
Ruben Bridgewater
ab3f7afacc
console: fix trace function
...
A recent refactoring made the slight mistake of calling `trace()`
instead of `this.trace()`.
PR-URL: https://github.com/nodejs/node/pull/26764
Fixes: https://github.com/nodejs/node/issues/26763
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Weijia Wang <starkwang@126.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com >
2019-03-21 22:55:12 +01:00
Ruben Bridgewater
39f4158bc3
lib: move extra properties into error creation
...
This encapsulates the Node.js errors more by adding extra properties
to an error inside of the function to create the error message instead
of adding the properties at the call site. That simplifies the usage
of our errors and makes sure the expected properties are always set.
PR-URL: https://github.com/nodejs/node/pull/26752
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-21 22:52:08 +01:00
Ruben Bridgewater
df0870dddf
test: remove internal error tests
...
These tests tested internal functionality in a way that bypassed all
code that could reach these cases. It gives a false feeling of safety
that some code works as intended while there is no guarantee that
it indeed works as it should.
Therefore it seemed best to remove all of these. The only thing that
should be tested is the raw functionality of the internal errors.
PR-URL: https://github.com/nodejs/node/pull/26752
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-21 22:52:07 +01:00