0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib/internal
Jeremiah Senkpiel 4d798e1b1b bootstrap: provide usable error on missing internal module
Due to how bootstrap/loaders.js itself is loaded and invoked,
stacktraces from it are munged and no longer point back to the error
source.

That resulted in the following unhelpful error if an internal module
was missing or misnamed:

```
internal/bootstrap/loaders.js:190
  return mod.compile();
             ^

TypeError: Cannot read property 'compile' of undefined
```

This changes that to at least print the id that was attempted to be
loaded:

```
internal/bootstrap/loaders.js:189
  if (!mod) throw new TypeError(`Missing internal module '${id}'`);
            ^

TypeError: Missing internal module 'internal/a'
```

PR-URL: https://github.com/nodejs/node/pull/29593
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-09-18 08:18:38 -07:00
..
assert assert: avoid potentially misleading reference to object identity 2019-07-25 22:36:29 -07:00
bootstrap bootstrap: provide usable error on missing internal module 2019-09-18 08:18:38 -07:00
cluster
console console: display timeEnd with suitable time unit 2019-08-25 16:39:18 +02:00
crypto crypto: add oaepLabel option 2019-09-13 16:58:41 +02:00
dns dns: update lookupService() first arg name 2019-08-10 19:06:21 -07:00
fs fs: add recursive option to rmdir() 2019-08-23 13:59:07 -07:00
http2 http2: do not crash on stream listener removal w/ destroyed session 2019-09-07 21:15:24 -07:00
main bootstrap: run preload prior to frozen-intrinsics 2019-08-20 09:49:48 -05:00
modules module: reintroduce package exports dot main 2019-09-17 18:54:44 -07:00
per_context policy: minor perf opts and cleanup 2019-09-03 11:12:05 -05:00
policy policy: minor perf opts and cleanup 2019-09-03 11:12:05 -05:00
process process: use public readableFlowing property 2019-09-14 16:12:37 +08:00
readline lib: add ASCII fast path to getStringWidth() 2019-09-02 21:02:34 -07:00
repl repl: close file descriptor of history file 2019-08-10 19:21:33 -07:00
streams stream: make finished call the callback if the stream is closed 2019-09-03 10:28:48 +02:00
test
util util: do not throw when inspecting detached ArrayBuffer 2019-08-29 05:52:05 +02:00
vm
worker
assert.js
async_hooks.js
buffer.js
child_process.js
cli_table.js console: use getStringWidth() for character width calculation 2019-09-02 11:43:58 +05:30
constants.js
dgram.js
dtrace.js
encoding.js util: add encodeInto to TextEncoder 2019-09-13 20:27:18 +02:00
error-serdes.js
errors.js inspector: new API - Session.connectToMainThread 2019-09-16 09:01:55 -07:00
fixed_queue.js process: improve nextTick performance 2019-08-27 22:14:15 -04:00
freelist.js
freeze_intrinsics.js
http.js http: simplify drain() 2019-08-19 12:56:08 -07:00
idna.js
inspector_async_hook.js
js_stream_socket.js
linkedlist.js
net.js
options.js
priority_queue.js
querystring.js
readme.md
repl.js
socket_list.js
stream_base_commons.js net: allow reading data into a static buffer 2019-08-23 17:05:52 -04:00
timers.js doc, lib, src, test, tools: fix assorted typos 2019-08-12 16:00:22 -07:00
tls.js
trace_events_async_hooks.js
tty.js tty: add color support for mosh 2019-09-15 21:54:58 -07:00
url.js
util.js lib: consolidate lazyErrmapGet() 2019-08-25 16:10:07 -07:00
v8_prof_polyfill.js
v8_prof_processor.js
validators.js lib: remove the comment of base64 validation 2019-08-24 10:41:58 +05:30
worker.js worker: make terminate() resolve for unref’ed Workers 2019-09-09 22:21:37 +02: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 modules can be changed at any time. Reliance on these modules outside of core is not supported in any way.