Masashi Hirano
1e23e3ceb3
fs: make process.binding('fs') internal
...
Refs: https://github.com/nodejs/node/issues/22160
PR-URL: https://github.com/nodejs/node/pull/22478
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
2018-11-16 21:56:29 +09:00
Rich Trott
bd4773a043
module: use undefined if no main
...
If the package.json file does not have a "main" entry, return undefined
rather than an empty string. This is to make more consistent behavior.
For example, when package.json is a directory, "main" is undefined
rather than an empty string.
PR-URL: https://github.com/nodejs/node/pull/18593
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-02-11 14:19:07 -08:00
John-David Dalton
fea1e05ba5
module: rename internalModuleReadFile to internalModuleReadJSON
...
PR-URL: https://github.com/nodejs/node/pull/17084
Fixes: https://github.com/nodejs/node/issues/17076
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-11-28 16:21:53 -05:00
Ben Noordhuis
0fdd88a374
module: speed up package.json parsing more
...
Move the logic from the previous commit to C++ land in order to avoid
creating a new string when we know we won't parse it anyway.
PR-URL: https://github.com/nodejs/node/pull/15767
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-11-15 12:01:20 +01:00
Ben Noordhuis
f823d381e7
src: fix UB in InternalModuleReadFile()
...
`&vec[0]` is undefined behavior when `vec.size() == 0`.
It is mostly academic because package.json files are not usually empty
and because with most STL implementations it decays to something that
is legal C++ as long as the result is not dereferenced, but better safe
than sorry.
Note that the tests don't actually fail because of that, I added them
as sanity checks.
PR-URL: https://github.com/nodejs/node/pull/16871
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-11-09 12:57:16 +01:00