Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9.11.0 proposal #19799

Merged
merged 81 commits into from
Apr 4, 2018
Merged

v9.11.0 proposal #19799

merged 81 commits into from
Apr 4, 2018

Conversation

targos
Copy link
Member

@targos targos commented Apr 4, 2018

2018-04-04, Version 9.11.0 (Current), @MylesBorins prepared by @targos

Notable Changes

  • deps:
    • Updated ICU to 61.1 (Steven R. Loomis) #19621
      Includes CLDR 33 (many new languages and data improvements).
  • fs:
    • Emit 'ready' event for ReadStream and WriteStream (Sameer Srivastava) #19408
  • n-api:
    • Bump version of n-api supported (Michael Dawson) #19497
  • net:
    • Emit 'ready' event for Socket (Sameer Srivastava) #19408
  • Added new collaborators

Commits

  • [0bd78dc391] - buffer: use v8::TypedArray::kMaxLength as buffer::kMaxLength (Joyee Cheung) #19738
  • [54b84f3c26] - buffer: remove "new" from deprecation message (Rich Trott) #19687
  • [0127712cf5] - build: introduce make jstest (Joyee Cheung) #19324
  • [58f61dbf8e] - deps: ICU 61.1 bump (Steven R. Loomis) #19621
  • [97a92c4973] - deps: turn in std::string for ICU (Steven R. Loomis) #19624
  • [ae86adc086] - doc: fix various nits (Vse Mozhet Byt) #19743
  • [041f6cd9c9] - doc: improve Buffer.allocUnsafeSlow() and related (Rich Trott) #19742
  • [42671f24ba] - doc: add mafintosh to collaborators (Mathias Buus) #19773
  • [c1b83fcbc2] - doc: update to adding listens on SIGUSR1 (willhayslett) #19709
  • [1aaad92101] - doc: fix lint nits in COLLABORATOR_GUIDE.md (Vse Mozhet Byt) #19762
  • [5149e18719] - doc: deprecation clarifications (James M Snell) #19522
  • [c5469bb7a8] - doc: remove "if provided" for optional arguments (Rich Trott) #19690
  • [3a3ae0134d] - doc: do not identify string as "JavaScript string" (Rich Trott) #19689
  • [d111037624] - doc: favor utf16le over ucs2 in buffer.md (Rich Trott) #19688
  • [bb32bc8686] - doc: fix links in vm.md (Vse Mozhet Byt) #19721
  • [44361bd1c8] - doc: fix quotes mistypes in inline code blocks (Сковорода Никита Андреевич) #19713
  • [c8fa8f1f9d] - doc: remove ES6/ECMAScript 2015 from buffer.md (Rich Trott) #19685
  • [9f20534889] - doc: shorten character encoding introduction (Rich Trott) #19648
  • [078616109c] - doc: guard against md list parsing edge case (Vse Mozhet Byt) #19647
  • [2ea7f90728] - doc: fix grammar error in process.md (Kenji Okamoto) #19641
  • [7555deeb8c] - doc: improve zero-fill-buffers text (Rich Trott) #19623
  • [5e90fc6a85] - fs: use fs.access in fs.exists (Bartosz Sosnowski) #18618
  • [8a8b43e1b1] - (SEMVER-MINOR) fs,net: emit 'ready' for fs streams and sockets (Sameer Srivastava) #19408
  • [e1f44a6366] - http: fix request when setHost is true (XadillaX) #19502
  • [dac5f67e64] - http: support server options on createServer (Wes Todd) #19461
  • [2bdf3ca235] - http2: callback valid check before closing request (Trivikram) #19061
  • [7b850a7565] - http2: destroy() stream, upon errnoException (Sarat Addepalli) #19389
  • [441175c29a] - http2: refer to stream errors by name (Anna Henningsen) #18966
  • [0bcad33c7a] - inspector: report client-visible host and port (Eugene Ostroukhov) #19664
  • [8e440115ec] - lib: add back lib/module.js redirection (Joyee Cheung) #19177
  • [45c477c2e6] - lib: restructure cjs and esm loaders (Joyee Cheung) #19177
  • [152a86c6aa] - lib: make isStackOverflowError() engine-agnostic (Mike Kaufman) #19705
  • [889a3b44b3] - lib: fix a typo in lib/timers "read through" (wangzengdi) #19666
  • [a45f3f8fd2] - lib: document nextTick queue internals (Anna Henningsen) #19469
  • [d3d1ee7279] - lib: add internal check macros (Gus Caplan) #18852
  • [e0c7d783e0] - lint: change require-buffer rule message (Gus Caplan) #19701
  • [859b719927] - module: skip preserveSymlinks for main (Guy Bedford) #19388
  • [a0a58730e0] - n-api: back up env before finalize (Gabriel Schulhof) #19718
  • [b0a3a44ff6] - n-api: ensure in-module exceptions are propagated (Gabriel Schulhof) #19537
  • [94a10bad3a] - (SEMVER-MINOR) n-api: bump version of n-api supported (Michael Dawson) #19497
  • [ee4390a167] - repl: fix tab completion of inspector module (Michaël Zasso) #19505
  • [ebdcf91dcc] - src: put bootstrappers in lib/internal/bootstrap/ (Joyee Cheung) #19177
  • [ff7a116ba3] - src: move internal loaders out of bootstrap_node.js (Joyee Cheung) #19112
  • [75d23ab2a0] - src: fix warnings in aliased_buffer (Kyle Farnung) #19665
  • [01e31906e8] - src: general C++ cleanup in node_url.cc (Anna Henningsen) #19598
  • [6c466811d3] - src: name all builtin init functions Initialize (Daniel Bevenius) #19550
  • [1a38b9bd0f] - src: remove unused 'ares.h' include from env.h (Anna Henningsen) #19557
  • [cae9ff256b] - src: fix upcoming V8 deprecation warnings (Sarat Addepalli) #19490
  • [83ebaf08d9] - test: remove NODE_DEBUG in global module loading test (Joyee Cheung) #19177
  • [92e9ed09e9] - test: test process.setuid for bad argument types (Divyanshu Singh) #19703
  • [4df3377856] - test: update test to comply with lint rule (Rich Trott) #19784
  • [f379167917] - test: improve assert message (fatahn) #19629
  • [46569d644d] - test: remove third argument from call to assert.strictEqual() (Forrest Wolf) #19659
  • [e44b7779d6] - test: fix flaky test-cluster-send-handle-twice (Rich Trott) #19700
  • [90c85461ff] - test: rename regression tests more expressively (Ujjwal Sharma) #19668
  • [ff7f28c4f2] - test: remove 3rd argument from assert.strictEqual (Arian Santrach) #19707
  • [0b27416516] - test: make test-http-expect-continue more strict (Rich Trott) #19669
  • [94b28aaf07] - test: use createReadStream instead of ReadStream (Daniel Bevenius) #19636
  • [7ae2ca4476] - test: removed default message from assert.strictEqual (jaspal-yupana) #19660
  • [a89ba21ab4] - test: refactor test-net-dns-error (Luigi Pinca) #19640
  • [677b613d24] - test: fix typo in test-tls-cnnic-whitelist (Daniel Bevenius) #19662
  • [806bc0d8f7] - test: fix assert.throws error in test-http-parser (Rich Trott) #19626
  • [2f09ee78fb] - test: refactor test-http-expect-continue (Rich Trott) #19625
  • [278e8af7a6] - test: rename tests with descriptive filenames (Ujjwal Sharma) #19608
  • [0daa063021] - test: amplify and optimize doctool/test-make-doc (Vse Mozhet Byt) #19581
  • [274eff5376] - test: update link according to NIST bibliography (Tobias Nießen) #19593
  • [21e69d1222] - test: fix test-tty-get-color-depth (Bartosz Sosnowski) #18478
  • [4caf536b20] - test: http2 stream.respond() error checks (Trivikram) #18861
  • [ca97be52a2] - test: fix wrong error classes passed in as type (Ruben Bridgewater) #13686
  • [44b12c158d] - test: fix common.expectsError (Refael Ackermann) #13686
  • [cc68bc27f8] - test: add more asserts to test-internal-errors (Refael Ackermann) #13686
  • [6bc49f03b9] - test: http2 errors on req.close() (Trivikram) #18854
  • [53d7fbbbf5] - tools: don’t emit illegal utf-8 from icutrim/iculslocs (Steven R. Loomis) #19756
  • [b80d169e7c] - tools: apply editorconfig rules to tools also (Tobias Nießen) #19521
  • [239a036317] - tools: remove src dir from JS editorconfig rule (Tobias Nießen) #19521
  • [7043e95fb7] - tools: dry utility function in tools/doc/json.js (Vse Mozhet Byt) #19692
  • [140611b2c6] - tools: fix comment nits in tools/doc/*.js files (Vse Mozhet Byt) #19696
  • [2c5d53f7cb] - tools: fix nits in tools/doc/type-parser.js (Vse Mozhet Byt) #19612
  • [fdc51a1331] - url: remove redundant function (Sergey Golovin) #19076
  • [99e3c77808] - url: refactor "escapeParam" function to make it common (Sergey Golovin) #19076

trivikr and others added 30 commits March 30, 2018 15:14
Backport-PR-URL: #19579
PR-URL: #18854
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Backport-PR-URL: #19579
PR-URL: #13686
Fixes: #13682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
The function should strictly test for the error class and only accept
the correct one. Any other error class should fail.

Backport-PR-URL: #19579
PR-URL: #13686
Fixes: #13682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Backport-PR-URL: #19579
PR-URL: #13686
Fixes: #13682
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Backport-PR-URL: #19579
PR-URL: #18861
Reviewed-By: James M Snell <jasnell@gmail.com>
Display the constant name instead of a stream error code
in the error message, because the numerical codes give absolutely
no clue about what happened when an error is emitted.

Backport-PR-URL: #19579
PR-URL: #18966
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
If getTTYfd returns 0, and stdin is not writable (like on Windows),
trying to create WriteStream will fail. This commit fixes that by
skipping fd 0.

PR-URL: #18478
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19490
Fixes: #18909
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Correctly check for the presence of the inspector module before adding
it to the builtin libs list.

PR-URL: #19505
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #19076
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #19076
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
... in addition to the event names they currently use.

Currently, various internal streams have different events that
indicate that the underlying resource has successfully been
established. This commit adds ready event for fs and net
sockets to standardize on emitting ready for all of these streams.

PR-URL: #19408
Fixes: #19304
Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #19461
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
First steps towards #19060

PR-URL: #19389
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
PR-URL: #18852
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Make this code (a bit more) comprehensible by adding some
internals docs.

With diagrams and everything! 🎉

PR-URL: #19469
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
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: Gus Caplan <me@gus.host>
PR-URL: #19557
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit renames a few of the builtin modules init functions to
Initialize for consistency.

PR-URL: #19550
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Bump the version due to additions to the api.

PR-URL: #19497
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
According to NIST SP 800 38D, this is the document the link orginally
pointed to.

Fixes: #17619

PR-URL: #19593
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
* improve text for easier comprehension
* clarify that performance impact is *negative*
* remove superfluous "either" (should only be used when there are 2
  options anyway)
* remove superfluous italics
* line wrap at 80 chars

PR-URL: #19623
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Whenever we call into an addon, whether it is for a callback, for
module init, or for async work-related reasons, we should make sure
that

* the last error is cleared,
* the scopes before the call are the same as after, and
* if an exception was thrown and captured inside the module, then it is
  re-thrown after the call.

Therefore we should call into the module in a unified fashion. This
change introduces the macro NAPI_CALL_INTO_MODULE() which should be
used whenever invoking a callback provided by the module.

Fixes: #19437
PR-URL: #19537
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #19641
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #19581
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #19612
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Khaidi Chu <i@2333.moe>
- node and v8 did not call into std::string previously,
so that access was shut off.
- this fixes compilation for ICU 58.2 (backlevel) but may
be expressed in other versions also.

Fixes: #19151

PR-URL: #19624
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
PR-URL: #19647
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Chen Gang <gangc.cxy@foxmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: #19608
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
PR-URL: #19666
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Use common.mustCall() where appropriate. Remove some logic that is not
required when common.mustCall() is used (incrementor/decrementor to make
sure everything is called the same number of times).

PR-URL: #19625
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Trott and others added 13 commits April 4, 2018 12:07
* Fixed "cleanup" being misused as a verb
* "Use of Foo should only be used" construction changed to "Foo should
  only be used..."
* Otherwise-unmentioned "`Persistent`" changed to more understandable
  "persistent"
* remove an instance of unnecessary italics
* wrap at 80 characters

Change all "initialize a...instance to zeroes" to say "with zeroes"
instead. Previously, both formulations appeared.

PR-URL: #19742
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Test process.setuid with an object as an argument. An equivalent test
exists for process.seteuid.

PR-URL: #19703
Fixes: #19591
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Add a `make jstest` target that runs tests written in JavaScript
(excluding documentation tests which are run in `make test-doc`).

PR-URL: #19324
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
This was added in v8 6.2, looks like a safe replacement for
our own buffer::kMaxLength.

PR-URL: #19738
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Replace 2 hyphens (--) by spaced m-dashes (—) as per STYLE_GUIDE.md.
* Space infix operators.
* Unify quotes in inline code spans (use only single quotes).
* Unify `* Returns:` (eliminate deviations).
* Dedupe spaces.

PR-URL: #19743
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Uses fs.access to implement fs.exists functionality. Fixes a issue,
when a file exists but user does not have privileges to do stat on the
file.

Fixes: #17921

Backport-PR-URL: #19654
PR-URL: #18618
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
- Moves the creation of `process.binding()`, `process._linkedBinding()`
  `internalBinding()` and `NativeModule` into a separate file
  `lib/internal/bootstrap_loaders.js`, and documents them there.
  This file will be compiled and run before `bootstrap_node.js`, which
  means we now bootstrap the internal module & binding system before
  actually bootstrapping Node.js.
- Rename the special ID that can be used to require `NativeModule`
  as `internal/bootstrap_loaders` since it is setup there. Also put
  `internalBinding` in the object exported by `NativeModule.require`
  instead of putting it inside the `NativeModule.wrapper`
- Use the original `getBinding()` to get the source code of native
  modules instead of getting it from `process.binding('native')`
  so that users cannot fake native modules by modifying the binding
  object.
- Names the bootstrapping functions so their names show up
  in the stack trace.

Backport-PR-URL: #19374
PR-URL: #19112
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Create `lib/internal/bootstrap/` and put bootstrappers there:

Before:

```
lib/internal
├── ...
├── bootstrap_loaders.js
└── bootstrap_node.js
```

After:

```
lib/internal
├── ...
└── bootstrap
    ├── loaders.js
    └── node.js
```

Backport-PR-URL: #19374
PR-URL: #19177
Refs: #19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Otherwise the debug log output might be mixed up with
the expected errors and the assertion matching the error
message would fail.

Backport-PR-URL: #19374
PR-URL: #19177
Refs: #19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Create `lib/internal/modules` and restructure the module loaders
to make the purpose of those files clearer.

Also make it clear in the code that the object exported by
`lib/internal/modules/cjs/loader.js` is `CJSModule` instead of the
ambiguous `Module`.

Before:

```
lib
├── ...
├── internal
│       ├── loaders
│       │     ├── CreateDynamicModule.js
│       │     ├── DefaultResolve.js
│       │     ├── Loader.js
│       │     ├── ModuleJob.js
│       │     ├── ModuleMap.js
│       │     ├── ModuleWrap.js
│       │     └── Translators.js
│       └── module.js
└── module.js
```

After:

```
lib
├── ...
├── internal
│       ├── ...
│       └── modules
│              ├── cjs
│              │     ├── helpers.js
│              │     └── loader.js
│              └── esm
│                    ├── CreateDynamicModule.js
│                    ├── DefaultResolve.js
│                    ├── Loader.js
│                    ├── ModuleJob.js
│                    ├── ModuleMap.js
│                    └── Translators.js
└── module.js # deleted in this commit to work with git file mode
```

Backport-PR-URL: #19374
PR-URL: #19177
Refs: #19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
The previous commit deleted lib/module.js so that git
recognize the file move `lib/module.js` ->
`lib/internal/modules/cjs/loader.js`. This commit add the
redirection back.

Backport-PR-URL: #19374
PR-URL: #19177
Refs: #19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Do not close the request if callback is not a function, and
throw ERR_INVALID_CALLBACK TypeError

Backport-PR-URL: #19229
PR-URL: #19061
Fixes: #18855
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Notable changes:

* deps:
  - Updated ICU to 61.1 (Steven R. Loomis)
    [#19621](#19621)
    Includes CLDR 33 (many new languages and data improvements).
* fs:
  - Emit 'ready' event for `ReadStream` and `WriteStream` (Sameer
    Srivastava) [#19408](#19408)
* n-api:
  - Bump version of n-api supported (Michael Dawson)
    [#19497](#19497)
* net:
  - Emit 'ready' event for `Socket` (Sameer Srivastava)
    [#19408](#19408)
* Added new collaborators
  - [mafintosh](https://github.com/mafintosh) Mathias Buus
@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory. v9.x labels Apr 4, 2018
@targos targos removed build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. meta Issues and PRs related to the general management of the project. tools Issues and PRs related to the tools directory. labels Apr 4, 2018
@MylesBorins
Copy link
Contributor

I will publish this release when tests are green

@MylesBorins MylesBorins self-assigned this Apr 4, 2018
Copy link
Contributor

@MylesBorins MylesBorins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MylesBorins MylesBorins merged commit 11c8db4 into v9.x Apr 4, 2018
MylesBorins added a commit that referenced this pull request Apr 4, 2018
@targos targos deleted the v9.11.0-proposal branch April 5, 2018 09:02
targos referenced this pull request Apr 6, 2018
Notable changes:

* deps:
  - Updated ICU to 61.1 (Steven R. Loomis)
    [#19621](#19621)
    Includes CLDR 33 (many new languages and data improvements).
* fs:
  - Emit 'ready' event for `ReadStream` and `WriteStream` (Sameer
    Srivastava) [#19408](#19408)
* n-api:
  - Bump version of n-api supported (Michael Dawson)
    [#19497](#19497)
* net:
  - Emit 'ready' event for `Socket` (Sameer Srivastava)
    [#19408](#19408)
* Added new collaborators
  - [mafintosh](https://github.com/mafintosh) Mathias Buus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.