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

21470 Commits

Author SHA1 Message Date
Michael Dawson
cd7d7b15c1 n-api: take n-api out of experimental
Take n-api out of experimental as per:
https://github.com/nodejs/TSC/issues/501

PR-URL: https://github.com/nodejs/node/pull/19262
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-03-14 17:12:58 -04:00
Myles Borins
040dd244de
deps: patch V8 to 6.5.254.38
PR-URL: https://github.com/nodejs/node/pull/19303
Refs: https://github.com/v8/v8/compare/6.5.254.31...6.5.254.38
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-14 13:46:20 -04:00
Rich Trott
14809aaa98 doc: clarify default TLS handshake timeout
Because the `handshakeTimeout` is in milliseconds, use that unit of
measurement to express the default value.

PR-URL: https://github.com/nodejs/node/pull/19290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 07:50:16 -07:00
Sergey Golovin
4ae320f2b3 path: remove redundant function
PR-URL: https://github.com/nodejs/node/pull/19237
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-03-14 22:04:00 +08:00
Vse Mozhet Byt
fa8594779a build: do not cd on vcbuild help
`vcbuild help` just outputs help info and exits.

If a user calls this command not from a project root,
the directory change can be unexpected and unwanted.

PR-URL: https://github.com/nodejs/node/pull/19291
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 14:06:04 +02:00
Yuta Hiroto
0a56a1b951 doc: update username and email
PR-URL: https://github.com/nodejs/node/pull/19338
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-14 20:50:29 +09:00
Daniel Bevenius
861285abb5 src: refactor emit before/after/promiseResolve
Currently EmitBefore, EmitAfter, EmitPromiseResolve are very similar.
This commit suggests extracting the code they have in common to a new
function to reduce code duplication.

PR-URL: https://github.com/nodejs/node/pull/19295
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-03-14 10:40:38 +01:00
Ujjwal Sharma
90b0538273 test: use descriptive names for regression tests
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the tests conform to the
standard test structure.

- Rename test-regress-GH-9819 to test-crypto-tostring-segfault
- Rename test-regress-GH-5051 to test-http-addrequest-localaddress
- Rename test-regress-GH-5727 to test-net-listen-invalid-port
- Rename test-regress-GH-5927 to test-tty-stdin-pipe
- Rename test-regress-GH-6235 to test-v8-global-setter

PR-URL: https://github.com/nodejs/node/pull/19275
Refs: https://github.com/nodejs/node/issues/19105
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-13 20:02:47 +01:00
Ujjwal Sharma
52e869bee8 test: delete test/parallel/test-regress-GH-4948
PR-URL: https://github.com/nodejs/node/pull/19279
Refs: https://github.com/nodejs/node/pull/19275#discussion_r173647620
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-13 15:28:10 +01:00
Rich Trott
8ed0f3409a doc: improve style guide text
* Specify that personal pronouns are OK in colloquial documentation
  rather than just pronouns. Pronouns are OK in all documentation. (For
  example, "it" is a pronoun and is acceptable in all types of
  documentation.) Specify "personal pronouns" for clarity.
* more colloquial -> colloquial
* like -> such as
* Remove "mass nouns" as no mass nouns are given as examples. Plural
  nouns seems to be what was meant, so use that instead.
* Repeat "gender-neutral" to make it clear that it refers to both terms
  and not merely the first term it appears before.
* Remove "non-comprehensive examples". Examples are, by definition,
  non-comprehensive. No need to announce that the examples are examples.
  It is obvious.

PR-URL: https://github.com/nodejs/node/pull/19269
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-03-12 20:27:10 -07:00
Yihong Wang
ffd618bd5c test: shared lib build doesn't handle SIGPIPE
For shared lib build, we leave the signal handling for embedding users.
In these two test cases:
- `parallel/test-process-external-stdio-close-spawn`
- `parallel/test-process-external-stdio-close`

The pipe is used for stdout and is destroied before child process uses
it for logging. So the node executble that uses shared lib build
receives SIGPIPE and the child process ends.

This change ignores the SIGPIPE in node_main.cc for shared lib case.

Refs: https://github.com/nodejs/node/issues/18535

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

PR-URL: https://github.com/nodejs/node/pull/19211
Refs: https://github.com/nodejs/node/issues/18535
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-03-12 16:56:04 -07:00
Michaël Zasso
0acdd84026
tools: fix test-npm-package
Migrate the script to the new common tmpDir API.

PR-URL: https://github.com/nodejs/node/pull/19293
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2018-03-12 19:49:27 -04:00
Gus Caplan
cb5f358ee7
vm: add code generation options
Adds options to a VM Context to disable code generation from strings
(such as eval or new Function) and WASM code generation
(WebAssembly.compile).

PR-URL: https://github.com/nodejs/node/pull/19016
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-12 14:39:21 -05:00
Taylor Woll
a03c90b661 n-api,test: add a new.target test to addons-napi
Added a N-API test to verify new.target behavior.

PR-URL: https://github.com/nodejs/node/pull/19236
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-12 11:49:31 -07:00
cjihrig
22b6804259 lib: define printErr() in script string
This commit moves the printErr() function, used by the
tick profiler processer, into the code string passed to
vm.runInThisContext().

PR-URL: https://github.com/nodejs/node/pull/19285
Fixes: https://github.com/nodejs/node/issues/19260
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-12 08:45:13 -07:00
Rich Trott
148d16ab5b doc: do not announce obvious examples
Remove "Examples:" labels that announce things that are clearly
examples.

PR-URL: https://github.com/nodejs/node/pull/19270
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-12 08:43:13 -07:00
Rich Trott
da226eaa86 test: fix assertion argument order
Fix the assertion argument order so that it will report "actual" and
"expected" correctly when the test fails.

Ref: https://github.com/nodejs/node/issues/19263

PR-URL: https://github.com/nodejs/node/pull/19264
Refs: https://github.com/nodejs/node/issues/19263
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-12 08:42:21 -07:00
Luigi Pinca
c9794880e8 stream: make virtual methods errors consistent
Use the same error code and always emit the error instead of
throwing it.

PR-URL: https://github.com/nodejs/node/pull/18813
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaë Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-12 14:24:34 +01:00
Matteo Collina
8403f00dc3 http2: fixes error handling
There should be no default error handling when using Http2Stream.
All errors will end up in `'streamError'` on the server anyway,
but they are emitted on `'stream'` as well, otherwise some error
conditions are impossible to debug.

See: https://github.com/nodejs/node/pull/14991

PR-URL: https://github.com/nodejs/node/pull/19232
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-12 09:36:31 +01:00
Gabriel Schulhof
33e63fe64f n-api: resolve promise in test
The last promise created by the test for the purposes of making sure
that its type is indeed a promise needs to be resolved so as to avoid
having it left in the pending state at the end of the test.

PR-URL: https://github.com/nodejs/node/pull/19245
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-11 23:18:53 -04:00
Vse Mozhet Byt
0048169f5e test: fix path in doctool/test-doctool-json
PR-URL: https://github.com/nodejs/node/pull/19287
Refs: https://github.com/nodejs/node/pull/17820
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-03-11 23:01:24 +02:00
Anna Henningsen
90e70b8caf
http2: simplify timeout tracking
There’s no need to reset the chunk counter for every write.

PR-URL: https://github.com/nodejs/node/pull/19206
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-11 20:16:21 +01:00
Anton Salikhmetov
98a14e026b
tls: expose Finished messages in TLSSocket
Exposes SSL_get_finished and SSL_get_peer_finished routines in OpenSSL
as tlsSocket.getFinished and tlsSocket.getPeerFinished, respectively.

PR-URL: https://github.com/nodejs/node/pull/19102
Fixes: https://github.com/nodejs/node/issues/19055
Refs: https://github.com/ripple/rippled/issues/2413
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 18:29:18 +01:00
Anna Henningsen
d3f174faab
src: add convenience ctor for async trigger id scope
PR-URL: https://github.com/nodejs/node/pull/19204
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-03-11 18:20:38 +01:00
Daniel Bevenius
ddcc00bc1e async_hooks: don't set hook_fields[kTotals] to 0
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

PR-URL: https://github.com/nodejs/node/pull/19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 16:33:43 +01:00
Daniel Bevenius
e16a2be8d8 src: avoid duplicate Before/AtExitCallback structs
Currently, BeforeExitCallback and AtExitCallback are identical apart for
the name of the struct. This commit introduces an ExitCallback struct
with can be used in both cases to avoid the duplication.

PR-URL: https://github.com/nodejs/node/pull/19226
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 16:23:31 +01:00
Daniel Bevenius
695590e386 test: fix compiler warnings in callback-scope
Currently there are two compiler warnings generated from the addons test
callback-scope:

../binding.cc:44:10:
warning: 'Resolve' is deprecated [-Wdeprecated-declarations]
  local->Resolve(v8::Undefined(isolate));
         ^
../../../../deps/v8/include/v8.h:3893:45:
note: 'Resolve' has been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version", void Resolve(Local<Value> value));
         ^

../binding.cc:52:54:
warning: 'New' is deprecated [-Wdeprecated-declarations]
    persistent.Reset(isolate, v8::Promise::Resolver::New(isolate));
                                                     ^
../../../../deps/v8/include/v8.h:3880:42:
note: 'New' has been explicitly marked deprecated here
Local<Resolver> New(Isolate* isolate));

This commit updates the test to use non-deprecated functions.

PR-URL: https://github.com/nodejs/node/pull/19252
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-11 16:13:39 +01:00
Daniel Bevenius
a7e298a4a2 src: init emit_env_nonstring_warning_
Currently there is no member initialiser for emit_env_nonstring_warning_
in the Environment constructor leading to undefined behaviour.
For a debug build, this memory would be initialized:
(lldb) memory read -f x -s 4 -c 1 &emit_env_nonstring_warning_
0x7fff5fbfe254: 0x00000001

But for a release build there will be no such initialization:
(lldb) memory read -f x -s 4 -c 1 `$r12 + 0x46c`
0x7fff5fbfe374: 0x00000000

This can be seen by running test-process-env-deprecation.js using
the Debug build and the Release build.

This commit adds a member initialiser for emit_env_nonstring_warning_
setting it to true.

PR-URL: https://github.com/nodejs/node/pull/19283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-11 15:56:56 +01:00
Vse Mozhet Byt
603afe25c8 doc: fix some recent nits in assert.md
* add missing bottom reference
* fix possible typos
* fix ABC-order in references and sections

PR-URL: https://github.com/nodejs/node/pull/19284
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-11 15:48:26 +02:00
feugy
599337f43e
assert: add rejects() and doesNotReject()
Implement asynchronous equivalent for assert.throws() and
assert.doesNotThrow().

PR-URL: https://github.com/nodejs/node/pull/18023
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-11 04:58:32 +01:00
Ujjwal Sharma
580ad0157a
test: name test files appropriately
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-GH-1531
- test-regress-GH-2245
- test-regress-GH-3238
- test-regress-GH-3542
- test-regress-GH-3739
- test-regress-GH-4256

PR-URL: https://github.com/nodejs/node/pull/19212
Refs: https://github.com/nodejs/node/issues/19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 04:17:42 +01:00
Rich Trott
6ec41bbdd7
doc: remove superfluous text in onboarding-extras
PR-URL: https://github.com/nodejs/node/pull/19247
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 04:06:37 +01:00
Rich Trott
003e5b3404
doc: make caveat in stream.md more concise
PR-URL: https://github.com/nodejs/node/pull/19251
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 04:05:49 +01:00
Yihong Wang
b325b5b435
test: fix test-abort-backtrace in shared lib build
When using shared lib build, the binary path in the stack frames points
to shared lib. Change the checking criteria in the test case to match
that.

Refs: https://github.com/nodejs/node/issues/18535

Signed-off-by: Yihong Wang <yh.wang@ibm.com>

PR-URL: https://github.com/nodejs/node/pull/19213
Refs: https://github.com/nodejs/node/issues/18535
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 04:04:14 +01:00
Anna Henningsen
e0bd2f31e5
src: move Environment ctor/dtor into env.cc
This makes it easier to use methods from other headers
in the constructor and destructor.

PR-URL: https://github.com/nodejs/node/pull/19202
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-11 04:01:51 +01:00
Anna Henningsen
f96bd54dd5
fs: simplify FSReqBase slightly
Replace the `data_` member of `FSReqBase` by a boolean flag, because
the pointer that `data()` returns is already available through the
`buffer_` member, and set the default size for not requiring an
extra allocation to a more reasonable value, as the input is
usually something like a file path.

PR-URL: https://github.com/nodejs/node/pull/19174
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-11 03:59:05 +01:00
Sergey Golovin
f3257dd3ea
benchmark: fix benchmark for url
Rename different parameters with the same names to make it possible
to run tests for url benchmarks.

PR-URL: https://github.com/nodejs/node/pull/19084
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-11 03:56:17 +01:00
Sergey Golovin
2f74326181
url: replace "magic" numbers by constants
PR-URL: https://github.com/nodejs/node/pull/19035
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-03-11 03:45:50 +01:00
Piotr Grzesik
0e35683876
test: Remove unnecessary asserion messages in test-crypto-hash.js
This commit improves asserion messages in parallel/test-crypto-hash.js.
Instead of just simple string literal, messages are changed to also
include values used in assertion, which should improve debugging
in case of errors.

PR-URL: https://github.com/nodejs/node/pull/18984
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-11 03:37:56 +01:00
Prince J Wesley
ebfa8b1464
repl: better handling of recoverable errors
Below syntax errors are handled without force .break/clear
  - Unexpected Token (prefix errors)
  - missing ) after argument list

In the multiline expression, recoverable errors are truly
recoverable, otherwise syntax error will be thrown.

PR-URL: https://github.com/nodejs/node/pull/18915
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-11 03:28:18 +01:00
Bradley Farias
1ed36aeb53
module: check file ext before dir as documented
The documented resolution algorithm started to search for package.json
files prior to searching for file extensions when searching for a
specifier. Oddly, it did not search for index files at same time it
searched for package.json. This restores the documented behavior of
searching for file extensions prior to searching directories.

PR-URL: https://github.com/nodejs/node/pull/15015
Fixes: https://github.com/nodejs/node/issues/14990
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
2018-03-11 02:56:56 +01:00
Ruben Bridgewater
8b69d4aca9
doc: add warning to assert.doesNotThrow()
Using `assert.doesNotThrow()` has no benefit over adding a comment
next to some code that should not throw. Therefore it is from now
on discouraged to use it.

PR-URL: https://github.com/nodejs/node/pull/18699
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-03-11 02:47:26 +01:00
Ruben Bridgewater
4893f70d12
repl: remove magic mode
The magic mode is long deprecated and works the same as the sloppy
mode. Since the sloppy mode is the default, removing the magic mode
should be safe.

PR-URL: https://github.com/nodejs/node/pull/19187
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2018-03-11 02:43:27 +01:00
Ruben Bridgewater
8181c607e5
test: add regression tests
This makes sure util.isDate and util.isRegExp will not abort in case
more than one argument is passed to the utility function.

PR-URL: https://github.com/nodejs/node/pull/19188
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-03-11 02:36:35 +01:00
Rich Trott
97579068b5 test: remove flaky status for test-npm-install
I haven't seen test-npm-install fail on arm in a long time. There is no
open issue for it being unreliable. Remove flaky designation in
parallel.status file. (If it turns out it is flaky, it's easy enough to
open an issue and restore the flaky designation.)

Ref: https://github.com/nodejs/node/issues/13498

PR-URL: https://github.com/nodejs/node/pull/19216
Refs: https://github.com/nodejs/node/issues/13498
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-03-10 08:10:28 -08:00
Michaël Zasso
0eec0735d0
doc: update internal errors documentation
PR-URL: https://github.com/nodejs/node/pull/19203
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-10 12:15:12 +01:00
Michaël Zasso
49963f4da9
lib: remove unused internal error constructors
PR-URL: https://github.com/nodejs/node/pull/19203
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-10 12:15:01 +01:00
Rich Trott
a910320ef3 test: do not check text for engine-generated error
In test-tls-wrap-event-emitter, the text of a TypeError is checked as
part of the test. However, this text is generated by the JavaScript
engine (V8) and not Node.js. Thus, we should not check the text as JS
engine error messages can change without it being considered a breaking
change for Node.js.

A side effect is that node-chakracore will no longer need to patch this
test to pass.

PR-URL: https://github.com/nodejs/node/pull/19215
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-09 20:12:28 -08:00
Gus Caplan
7314b170a4
tools,bootstrap: preprocess gypi files to json
PR-URL: https://github.com/nodejs/node/pull/19140
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-03-09 12:38:31 -06:00
Gibson Fahnestock
099e621648
build: update arm64 minimum supported platform
This is already true in practice.

PR-URL: https://github.com/nodejs/node/pull/19164
Fixes: https://github.com/nodejs/build/issues/1164
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-09 17:25:45 +00:00