node/lib/internal
Anna Henningsen 91694497ba
src: refactor WriteWrap and ShutdownWraps
Encapsulate stream requests more:

- `WriteWrap` and `ShutdownWrap` classes are now tailored to the
  streams on which they are used. In particular, for most streams
  these are now plain `AsyncWrap`s and do not carry the overhead
  of unused libuv request data.
- Provide generic `Write()` and `Shutdown()` methods that wrap
  around the actual implementations, and make *usage* of streams
  easier, rather than implementing; for example, wrap objects
  don’t need to be provided by callers anymore.
- Use `EmitAfterWrite()` and `EmitAfterShutdown()` handlers to
  call the corresponding JS handlers, rather than always trying
  to call them. This makes usage of streams by other C++ code
  easier and leaner.

Also fix up some tests that were previously not actually testing
asynchronicity when the comments indicated that they would.

PR-URL: https://github.com/nodejs/node/pull/18676
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-02-27 17:56:01 +01:00
..
cluster cluster: fix inspector port assignment 2018-02-26 23:42:43 +01:00
crypto lib: switch to Number.isNaN 2018-02-21 14:20:28 -05:00
http2 src: refactor WriteWrap and ShutdownWraps 2018-02-27 17:56:01 +01:00
loader loader: fix up #18394 2018-02-21 14:20:23 -05:00
process process: use linked reusable queue for ticks 2018-02-27 17:55:58 +01:00
streams stream: remove unreachable code 2018-01-30 14:25:36 -06:00
test tools: non-Ascii linter for /lib only 2018-02-21 10:19:15 -05:00
util repl: show lexically scoped vars in tab completion 2018-01-10 03:09:43 -05:00
vm loader: fix up #18394 2018-02-21 14:20:23 -05:00
async_hooks.js src: replace var for let / const. 2018-02-21 14:20:08 -05:00
bootstrap_node.js process: do not directly schedule _tickCallback in _fatalException 2018-02-26 18:39:43 -05:00
buffer.js buffer: move setupBufferJS to internal 2017-10-25 10:36:17 -07:00
child_process.js errors: move error creation helpers to errors.js 2018-02-26 18:39:49 -05:00
constants.js path: replace "magic" numbers by readable constants 2018-02-21 14:20:19 -05:00
encoding.js lib: extract validation functions 2018-02-21 10:19:00 -05:00
errors.js errors: move error creation helpers to errors.js 2018-02-26 18:39:49 -05:00
freelist.js
fs.js lib: use destructuring for some constants 2017-10-16 23:34:32 +02:00
http.js
inspector_async_hook.js inspector: no async tracking for promises 2017-12-11 17:27:40 -05:00
linkedlist.js
module.js module: support custom paths to require.resolve() 2017-10-25 09:14:14 -04:00
net.js process: use more direct sync I/O for stdio 2018-02-26 23:42:52 +01:00
os.js
process.js errors: move error creation helpers to errors.js 2018-02-26 18:39:49 -05:00
querystring.js
readline.js src: replace var for let / const. 2018-02-21 14:20:08 -05:00
readme.md
repl.js lib: switch to Number.isNaN 2018-02-21 14:20:28 -05:00
safe_globals.js
socket_list.js child_process: fix memory leak in .fork() 2017-09-30 22:18:29 -07:00
tls.js
trace_events_async_hooks.js lib: fix typo in trace_events_async_hooks.js 2018-01-30 14:25:18 -06:00
url.js url: simplify constructor URLSearchParams. Remove needless check null 2018-02-21 14:20:14 -05:00
util.js util: skip type checks in internal getSystemErrorName 2018-02-26 18:39:49 -05:00
v8_prof_polyfill.js tools, test: fix prof polyfill readline 2018-02-26 23:42:51 +01:00
v8_prof_processor.js lib: replace eval with vm.runInThisContext 2018-02-21 18:12:30 -05:00
wrap_js_stream.js src: refactor WriteWrap and ShutdownWraps 2018-02-27 17:56:01 +01:00

Internal Modules

The modules in lib/internal are intended for internal use in Node.js core only, and are not accessible with require() from user modules. These are subject to change at any time. Reliance on these modules outside of core is not supported in any way.