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

25588 Commits

Author SHA1 Message Date
Ruben Bridgewater
edde065191
repl: indicate if errors are thrown or not
Currently an error is printed identical, no matter if it is just
inspected or if the error is thrown inside of the REPL. This makes
sure we are able to distinguish these cases.

PR-URL: https://github.com/nodejs/node/pull/25253
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-02 14:58:47 +01:00
Anna Henningsen
0ff1eb83d9
src: simplify JS Array creation
Use `ToV8Value()` where appropriate to reduce duplication
and avoid extra `Array::Set()` calls.

PR-URL: https://github.com/nodejs/node/pull/25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-02 14:46:14 +01:00
Anna Henningsen
112ee2ab07
src: improve ToV8Value() functions
- Cache the `isolate` value between calls
- Introduce an overload for dealing with integers/numbers
- Use the vectored `v8::Array::New` constructor + `MaybeStackBuffer`
  for faster array creation

PR-URL: https://github.com/nodejs/node/pull/25288
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-02 14:46:13 +01:00
peterwmwong
2370bc7143
test: remove unused --expose-native-as V8 flag
test-preload.js was using a V8 flag (`--expose-native-as`) that made
an V8 internally used object available. As this test does not use this
object, this commit removes the usage of this flag.

In some distant past, this internally used object may have had some
external use, but currently is essentially an empty object.

In the near future, the V8 internal infrastructure (JS Natives)
producing the object exposed by `--expose-native-as` will be phased out.
For more details, visit:
https://bugs.chromium.org/p/v8/issues/detail?id=7624

PR-URL: https://github.com/nodejs/node/pull/25275
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2019-01-02 14:41:41 +01:00
Rich Trott
5fab50bdaf test: mark test-util-callbackify flaky on AIX
Refs: https://github.com/nodejs/node/issues/25068

PR-URL: https://github.com/nodejs/node/pull/25284
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-01 17:40:27 -08:00
cjihrig
8881a5ac41
test: make test-v8-coverage.js more strict
Update the coverage test to verify that nothing is printed to
stderr (which happens when coverage errors happen). Also add a
test case to verify that non-absolute coverage paths work.

PR-URL: https://github.com/nodejs/node/pull/25289
Fixes: https://github.com/nodejs/node/issues/25287
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-01 19:36:40 -05:00
cjihrig
a779ee4fad
coverage: pass cwd to path.resolve() in setup
During coverage setup, path.resolve() is called.
path.resolve() can potentially call process.cwd(), which
hasn't been bootstrapped yet. This commit passes the
current working directory directly so that path.resolve()
doesn't attempt to compute it.

PR-URL: https://github.com/nodejs/node/pull/25289
Fixes: https://github.com/nodejs/node/issues/25287
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-01 19:36:34 -05:00
cjihrig
d32f769d75
coverage: use process._rawDebug() during setup
console is not ready to use at this point in the bootstrapping
process, so switch to process._rawDebug() instead.

PR-URL: https://github.com/nodejs/node/pull/25289
Fixes: https://github.com/nodejs/node/issues/25287
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2019-01-01 19:36:19 -05:00
cjihrig
49672f4518
doc: simplify DEP0119 wording
PR-URL: https://github.com/nodejs/node/pull/25276
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-01 10:04:10 -05:00
cjihrig
e7658471d3
test: remove unnecessary test flags
This commit removes unnecessary flags used when starting
tests via the "// Flags:" directive.

PR-URL: https://github.com/nodejs/node/pull/25277
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2019-01-01 09:57:32 -05:00
cjihrig
da9a4d0fb4
src: fix warning in cares_wrap.cc
This commit fixes the following warning:

./src/cares_wrap.cc:1268:5: warning: comparison of integers of
    different signs: 'uint32_t' (aka 'unsigned int') and 'int'
    [-Wsign-compare]
    CHECK_EQ(ret->Length(), a_count + aaaa_count);

PR-URL: https://github.com/nodejs/node/pull/25230
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 11:39:00 -05:00
cjihrig
3c5e2372db
doc: edit and simplify util.inspect() docs
PR-URL: https://github.com/nodejs/node/pull/25195
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-31 11:16:00 -05:00
Joyee Cheung
ee12607c1c
process: move --help and --bash-completeion handling to startExecution
Because they are similar to `--prof-process` and are part of
the execution instead of initialization.
Also move the `getOptionValue` initialization to top scope since
it's used everywhere and add comments about the flags.

PR-URL: https://github.com/nodejs/node/pull/25262
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-31 15:23:48 +08:00
Joyee Cheung
0878b6172e
process: move setup of process warnings into node.js
To clarify the side effects and conditions of the warning setup
during bootstrap.

PR-URL: https://github.com/nodejs/node/pull/25263
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2018-12-31 15:10:00 +08:00
Daniel Bevenius
d28980c464 crypto: add crypto/keys to cannotUseCache
Currently when configuring --without-ssl test-code-cache.js will fail
with the following error:
internal/bootstrap/loaders.js:151
      mod = bindingObj[module] = getInternalBinding(module);
                                 ^

Error: No such module: crypto
    at internalBinding (internal/bootstrap/loaders.js:151:34)
    at internal/crypto/keys.js:14:5
    at NativeModule.compile (internal/bootstrap/loaders.js:342:5)
    at Function.NativeModule.require (internal/bootstrap/loaders.js:213:16)
    at Function.Module._load (internal/modules/cjs/loader.js:539:25)
    at Module.require (internal/modules/cjs/loader.js:654:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/node/test/code-cache/test-code-cache.js:31:3)
    at Module._compile (internal/modules/cjs/loader.js:718:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:729:10)

This commit adds internal/crypto/keys to the cannotUseCache array if
compiled without crypto support.

PR-URL: https://github.com/nodejs/node/pull/25237
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2018-12-31 07:34:25 +01:00
Joyee Cheung
00babd38f3
process: move worker bootstrap code into worker_thread_only.js
Move worker bootstrap code into worker_thread_only.js from
internal/worker.js since they are only run once during bootstrap.

PR-URL: https://github.com/nodejs/node/pull/25199
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 14:19:51 +08:00
Joyee Cheung
af237152cd
process: split worker IO into internal/worker/io.js
- Move `setupProcessStdio` which contains write access to
  the process object into `bootstrap/node.js`
- Move `MessagePort`, `MessageChannel`, `ReadableWorkerStdio`,
  and `WritableWorkerStdio` into `internal/worker/io.js`
- Move more worker-specific bootstrap code into
  `internal/process/worker_thread_only` from `setupChild`
  in `internal/worker.js`, and move the `process._fatalException`
  overwrite into `bootstrap/node.js` for clarity.

PR-URL: https://github.com/nodejs/node/pull/25199
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 14:19:49 +08:00
Joyee Cheung
7163fbf066
process: move eval and exception bootstrap ito process/execution.js
This patch:

- Moves `tryGetCwd`, `evalScript` and `fatalException` from
  `bootstrap/node.js` into `process/execution.js` so that
  they do have to be passed into the worker thread
  setup function, instead the worker code can require them
  when necessary.
- Moves `setUncaughtExceptionCaptureCallback` and
  `hasUncaughtExceptionCaptureCallback` along with the two
  global state `exceptionHandlerState` and
  `shouldAbortOnUncaughtToggle` info `process.execution.js`
  as those are only used by the fatalException and these
  two accessors as one self-contained unit.

PR-URL: https://github.com/nodejs/node/pull/25199
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 14:19:48 +08:00
Anna Henningsen
da13c44b0d src: remove unused variable from string_search.h
PR-URL: https://github.com/nodejs/node/pull/25139
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-30 19:45:14 -08:00
Ujjwal Sharma
48a88c824f doc: include license for src/large_pages in LICENSE
Include License for src/large_pages (MIT licensed by Intel), to the main
LICENSE file and make required changes to the tools/license-builder.sh
script.

Fixes: https://github.com/nodejs/node/issues/25238

PR-URL: https://github.com/nodejs/node/pull/25246
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:43:35 -08:00
ZYSzys
2f981cdd58 test: remove util.inherits() usage
PR-URL: https://github.com/nodejs/node/pull/25245
Refs: https://github.com/nodejs/node/pull/24755
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:42:18 -08:00
Juan José Arboleda
a2f81df5a7 tools: replace NULL with nullptr
PR-URL: https://github.com/nodejs/node/pull/25179
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-30 19:38:07 -08:00
Bartosz Sosnowski
571273adad
win, build: fix building addons on Windows
Building addons would fail because addon-verify.js dependencies from
tools\doc where not installed. This fixes this issue by installing
those dependencies if addons are to be built.

Fixes: https://github.com/nodejs/node/issues/25096

PR-URL: https://github.com/nodejs/node/pull/25108
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-31 01:31:51 +01:00
Denys Otrishko
9b60bcb3b9
test: slightly refactor test-child-process-execsync
* move `start` time to the point of execution (avoids counting 'throws'
  tests towards 'timeout' test case)
* scope cmd/ret values where possible
* use `filter` instead of manual if/return

PR-URL: https://github.com/nodejs/node/pull/25227
Refs: https://github.com/nodejs/node/issues/24921
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 01:28:48 +01:00
Rich Trott
9c2b14013b test: remove try/catch in common.isMainThread
Refactor common.isMainThread.

PR-URL: https://github.com/nodejs/node/pull/25249
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-30 16:28:21 -08:00
Joyee Cheung
39a2ac4c6b
process: move process.features initialization into node.js
Use `internalBinding('config')` to shim the legacy
`process.features`.

PR-URL: https://github.com/nodejs/node/pull/25239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2018-12-31 01:20:33 +01:00
Weijia Wang
6c7c77ef05
util: fix util.inspect with proxied function
PR-URL: https://github.com/nodejs/node/pull/25244
Fixes: https://github.com/nodejs/node/issues/25212
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
2018-12-31 01:19:18 +01:00
cjihrig
ad10cc57ee
tools: remove custom buffer-constructor lint rule
This rule is no longer needed. ESLint's built in
no-buffer-constructor rule is enabled instead.

PR-URL: https://github.com/nodejs/node/pull/25261
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:17:44 -05:00
cjihrig
7bb3d63304
tools: enable no-buffer-constructor lint rule
PR-URL: https://github.com/nodejs/node/pull/25261
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:17:44 -05:00
Anna Henningsen
76ecec2082
buffer: fix crash for invalid index types
2555cb4a40 introduced a crash
when a non-number value was passed to `ParseArrayIndex()`.

We do not always have JS typechecking for that in place, though.
This returns back to the previous behavior of coercing values
to integers, which is certainly questionable.

Refs: https://github.com/nodejs/node/pull/22129
Fixes: https://github.com/nodejs/node/issues/23668

PR-URL: https://github.com/nodejs/node/pull/25154
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-31 01:13:00 +01:00
Anna Henningsen
0043c6f548
src: pass along MaybeLocal<> state from URL::ToObject()
PR-URL: https://github.com/nodejs/node/pull/25141
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-12-31 01:10:36 +01:00
Anna Henningsen
a84e0ec0dd
src: ignore termination exceptions in fatal TryCatch
We don’t want these to terminate the process in case of
Worker threads receiving a termination exception, rather
than a “real one”.

PR-URL: https://github.com/nodejs/node/pull/25141
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-12-31 01:10:35 +01:00
Anna Henningsen
4100001624
lib: remove unintended access to deps/
This brings DEP0084 to End-of-Life. It is unlikely that this
has received much public usage in the first place, so removing
should be okay.

PR-URL: https://github.com/nodejs/node/pull/25138
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-12-30 20:17:19 +01:00
Anna Henningsen
b4b9e0e28c
src: fulfill Maybe contract in InlineDecoder
Use an empty/nothing `Maybe<>` to indicate a pending exception.

PR-URL: https://github.com/nodejs/node/pull/25140
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-30 20:15:39 +01:00
Tobias Nießen
fe5b8dca40
crypto: fix zero byte allocation assertion failure
When an empty string was passed, malloc might have returned a nullptr
depending on the platform, causing an assertion failure. This change
makes private key parsing behave as public key parsing does, causing
a BIO error instead that can be caught in JS.

Fixes: https://github.com/nodejs/node/issues/25247

PR-URL: https://github.com/nodejs/node/pull/25248
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 18:18:40 +01:00
Gireesh Punathil
54fa59c8bf test: regression test for uv threadpool congestion
Validate that massive dns lookups do not block filesytem I/O
(or any fast I/O for that matter).
Prior to https://github.com/libuv/libuv/pull/1845 few back-to-back dns
lookup were sufficient to engage libuv threadpool workers in a blocking
manner, throttling other work items that need the pool. this test acts
as a regression test for the same.

Start slow and fast I/Os together, and make sure fast I/O can complete
in at least in 1/100th of time for slow I/O.

Refs: https://github.com/libuv/libuv/pull/1845
Refs: https://github.com/nodejs/node/issues/8436

PR-URL: https://github.com/nodejs/node/pull/23099
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-30 19:45:57 +05:30
Rich Trott
903630e72e benchmark: fix net-wrap-js-stream-passthrough
The net-wrap-js-stream-passthrough benchmark was inadvertently broken by
00944c7cc2. This fixes it.

PR-URL: https://github.com/nodejs/node/pull/25273
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-12-29 11:07:35 -08:00
cjihrig
69470c87cc
lib: simplify several debug() calls
Avoid calling Array.prototype.join() in debug() calls. These
are evaluated on every call, even if the debug() call is a
no-op. This commit replaces the join() calls with the %j
placeholder.

PR-URL: https://github.com/nodejs/node/pull/25241
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 13:51:35 -05:00
cjihrig
baf03962c1
tools: enable no-useless-catch lint rule
This commit enables ESLint's no-useless-catch rule.

PR-URL: https://github.com/nodejs/node/pull/25236
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 13:36:57 -05:00
cjihrig
1d3a414519
tools: update ESLint to 5.11.1
Update ESLint to 5.11.1.

PR-URL: https://github.com/nodejs/node/pull/25236
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 13:36:31 -05:00
Joyee Cheung
c66c0732e0
src: lazily load internalBinding('uv') and build the errmap lazily
This removes the `internalBinding('uv')` call from the normal
bootstrap for now, and avoids building `errmap` by default which
expands to a lot of calls into V8.

PR-URL: https://github.com/nodejs/node/pull/25143
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-29 19:22:23 +08:00
Joyee Cheung
71a380b9fe
test: add TODO to encoding tests that can be replaced with WPT
PR-URL: https://github.com/nodejs/node/pull/25155
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 19:20:24 +08:00
Joyee Cheung
05ee814f08
test: rename custom encoding tests that cannot be replaced by WPT
PR-URL: https://github.com/nodejs/node/pull/25155
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 19:20:24 +08:00
Joyee Cheung
2b91c2b5ee
test: split encoding tests where some cases can be run without ICU
Split the following tests:

- `test-whatwg-encoding-textdecoder-utf16-surrogates.js`
- `test-whatwg-encoding-textdecoder-ignorebom.js`
- `test-whatwg-encoding-textdecoder-streaming.js`

Each into two files: one that can be run without ICU and one that has
to be run with ICU. The latter can be replaced with WPT later.

PR-URL: https://github.com/nodejs/node/pull/25155
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 19:20:24 +08:00
Joyee Cheung
ab02d380e5
test: split test-whatwg-encoding-textdecoder-fatal.js
Split `test-whatwg-encoding-textdecoder-fatal.js` into

- `test-whatwg-encoding-custom-textdecoder-fatal.js` which
  is a customized version of the WPT that tests for Node.js-specific
  error codes.
- `test-whatwg-encoding-custom-textdecoder-invalid-arg` which
  tests `ERR_INVALID_ARG_TYPE`

PR-URL: https://github.com/nodejs/node/pull/25155
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 19:20:24 +08:00
Joyee Cheung
74a9221f6f
test: split test-whatwg-encoding-textdecoder.js
Split test-whatwg-encoding-textdecoder.js into:

- `test-whatwg-encoding-custom-textdecoder.js` which tests
  Node.js-specific behaviors
- `test-whatwg-encoding-custom-textdecoder-api-invalid-label.js` which
  is a customized version of the WPT counterpart
- `test-whatwg-encoding-custom-api-basics.js` which is the part of
  `test-whatwg-encoding-api-basics.js` that can be run without ICU
- `test-whatwg-encoding-api-basics.js` which can be replaced with WPT
  later.

PR-URL: https://github.com/nodejs/node/pull/25155
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-29 19:20:24 +08:00
Joyee Cheung
8a60be4f0f
process: make internal/queue_microtask.js more self-contained
- Instead of passing triggerFatalException through node.js,
  simply put it on `internalBinding('util')` which has to be
  loaded anyway.
- Expose the implementation of `queueMicrotask` directly instead
  of through an unnecessary factory function.

PR-URL: https://github.com/nodejs/node/pull/25189
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-29 18:58:39 +08:00
Sam Roberts
00944c7cc2 src: use consistent names for JSStream
Its confusing to call a js class with a handle a "Wrap", usually it's
the C++ handle that is called a Wrap (tcp_wrap, tls_wrap, ...). Its
derived from Socket, and makes a JS stream look like a Socket, so call
it that. Also, remove use of lib/_stream_wrap.js so it can be deprecated
some time.

PR-URL: https://github.com/nodejs/node/pull/25153
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-12-28 12:57:46 -08:00
Sam Roberts
03e23a3d10 tls: do not confuse session and session ID
session ID was named session in C++ and key in JS, Name them after what
they are, as the 'newSession' event docs do.

PR-URL: https://github.com/nodejs/node/pull/25153
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-12-28 12:57:41 -08:00
Sam Roberts
b50c22a904 tls: do not confuse TLSSocket and Socket
Don't use "socket" to describe two different objects in the same
function.

PR-URL: https://github.com/nodejs/node/pull/25153
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2018-12-28 12:57:35 -08:00