Keyhan Vakil
8c35a4e4e6
src: remove unowned usages of GetBackingStore
...
This removes all usages of GetBackingStore without any entries in the
`CODEOWNERS` file. For the most part this is a pretty straightforward
review; except `SPREAD_BUFFER_ARG` and the changes to `CopyArrayBuffer`.
See the linked issue for an explanation.
Refs: https://github.com/nodejs/node/issues/32226
Refs: https://github.com/nodejs/node/pull/43921
PR-URL: https://github.com/nodejs/node/pull/44080
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2022-08-03 06:45:45 +00:00
legendecas
a7e5b413ef
src: split property helpers from node::Environment
...
PR-URL: https://github.com/nodejs/node/pull/44056
Refs: https://github.com/nodejs/node/issues/42528
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
2022-08-02 00:01:02 +08:00
Antoine du Hamel
70b516e4db
dns: accept 'IPv4' and 'IPv6' for family
...
Refs: https://github.com/nodejs/node/issues/43014
PR-URL: https://github.com/nodejs/node/pull/43054
Fixes: https://github.com/nodejs/node/issues/43014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Beth Griggs <bgriggs@redhat.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2022-06-15 18:02:01 -04:00
Antoine du Hamel
3a26db9697
net: make server.address() return an integer for family
...
`dns.lookup` options only accepts integer for `family` options,
having a string doesn't really make sense here.
PR-URL: https://github.com/nodejs/node/pull/41431
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2022-04-12 05:50:09 +02:00
Joyee Cheung
f69a4f61b2
src: register external references in os bindings
...
PR-URL: https://github.com/nodejs/node/pull/40239
Refs: https://github.com/nodejs/node/pull/38905
Refs: https://github.com/nodejs/node/issues/37476
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-10-19 17:44:55 +08:00
Michaël Zasso
b346cd1760
src: avoid implicit type conversions
...
This fixes a bunch of C4244 ('conversion' conversion from 'type1' to
'type2', possible loss of data) MSVC warnings in the code base.
PR-URL: https://github.com/nodejs/node/pull/37149
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-02-07 17:51:41 -08:00
Yash Ladha
cb2535ef7f
os: performance improvement in vector allocation
...
We were using the result vector with an object which is not a primitive
data type, and going with the constructor allocation pattern it creates
a size of that vector and also initializes the spaces with the data type
as well which is in our case is `Local<Value>`. It leads to waste of
some CPU cycles and instead we just wanted to have some reserved space
in our vector.
We can use `reserve` method on vector to reserve some space for the
vector but doesn't initialize the value since we are anyways doing it in
the following loop.
PR-URL: https://github.com/nodejs/node/pull/36748
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-01-18 13:41:29 -08:00
Anna Henningsen
a038199265
src,doc,test: remove String::New default parameter
...
`kNormal` has been the implicit default for a while now (since V8 7.6).
Refs: https://github.com/v8/v8/commit/e0d7f816990ada28ebe1281ca9431236ef8c6e4f
PR-URL: https://github.com/nodejs/node/pull/34248
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-07-14 15:13:34 +02:00
wenningplus
4438852aa1
src: use ToLocal in node_os.cc
...
PR-URL: https://github.com/nodejs/node/pull/33939
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-06-24 18:00:51 -07:00
rickyes
17f1202cac
src: use using NewStringType
...
PR-URL: https://github.com/nodejs/node/pull/32843
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
2020-04-23 09:11:02 -07:00
Juan José Arboleda
250060a050
src: remove validation of unreachable code
...
Based on https://github.com/nodejs/help/issues/2600#issuecomment-612857153
the condition (amount < 0) won't be possible.
PR-URL: https://github.com/nodejs/node/pull/32818
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Zeyu Yang <himself65@outlook.com >
Reviewed-By: Shelley Vohr <codebytere@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
2020-04-19 09:24:09 -05:00
Juan José Arboleda
c1e672595f
src: create a getter for kernel version
...
PR-URL: https://github.com/nodejs/node/pull/31732
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2020-03-09 12:44:16 +01:00
Anna Henningsen
e66a2acc4c
src: migrate off ArrayBuffer::GetContents
...
V8 deprecates `GetContents()` in favour of `GetBackingStore()`.
Update our code to reflect that.
V8 also deprecates `Externalize()` and `IsExternal()`; we should
be able to remove all usage of this once V8 8.0 is there.
PR-URL: https://github.com/nodejs/node/pull/30339
Refs: https://github.com/v8/v8/commit/bfe3d6bce734e596e312465e207bcfd55a59fe34
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2019-11-12 06:29:23 +01:00
Anna Henningsen
6072e01c93
src: do not use std::function for OnScopeLeave
...
Using `std::function` adds an extra layer of indirection, and in
particular, heap allocations that are not necessary in our use case
here.
PR-URL: https://github.com/nodejs/node/pull/30134
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-11-07 10:39:40 +01:00
Anna Henningsen
6f924b60c5
os: assume UTF-8 for hostname
...
Do not assume Latin-1, but rather UTF-8 for the result of getting the
OS hostname.
While in 99 % of cases these strings are stored in ASCII, the OS does
not enforce an encoding on its own, and apparently the hostname is
sometimes set to non-ASCII data (despite at least some versions of
hostname(1) rejecting such input, making it even harder to write a
test for this which would already require root privileges).
In any case, these are short strings, so assuming UTF-8 comes
with no significant overhead.
Fixes: https://github.com/nodejs/node/issues/27848
PR-URL: https://github.com/nodejs/node/pull/27849
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2019-05-26 15:38:51 +02:00
Sam Roberts
b6bfc19378
src: remove util-inl.h from header files
...
Its intended that *-inl.h header files are only included into the src
files that call the inline methods. Explicitly include it into the files
that need it.
PR-URL: https://github.com/nodejs/node/pull/27631
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-05-13 13:43:26 -07:00
Sam Roberts
060d901f87
src: replace FromJust() with Check() when possible
...
FromJust() is often used not for its return value, but for its
side-effects. In these cases, Check() exists, and is more clear as to
the intent. From its comment:
To be used, where the actual value of the Maybe is not needed, like
Object::Set.
See: https://github.com/nodejs/node/pull/26929/files#r269256335
PR-URL: https://github.com/nodejs/node/pull/27162
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2019-04-12 12:33:37 -07:00
Refael Ackermann
f2064dfc1f
src: de-lint header usage
...
PR-URL: https://github.com/nodejs/node/pull/26306
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
2019-03-12 09:57:19 -04:00
gengjiawen
8137668c53
src: apply clang-tidy rule modernize-deprecated-headers
...
PR-URL: https://github.com/nodejs/node/pull/26159
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-02-27 05:35:53 +01:00
Gireesh Punathil
e51da1fcad
src: simplify loop arithmetic in GetCPUInfo
...
Cache the repeated operations and reuse; potentially generating
efficient code in some platforms, and improving readability.
PR-URL: https://github.com/nodejs/node/pull/26183
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-02-21 08:45:40 +01:00
cjihrig
8ecf313324
os,report: use UV_MAXHOSTNAMESIZE
...
UV_MAXHOSTNAMESIZE was introduced in libuv 1.26.0. Use this
instead of including multiple header files, adding fallback
ifdef logic, and remembering to add one to the buffer size
for the terminating nul character with MAXHOSTNAMELEN.
PR-URL: https://github.com/nodejs/node/pull/26038
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-02-13 08:19:41 -05:00
cjihrig
16e4cd19f2
os: implement os.type() using uv_os_uname()
...
The happy path behavior should be identical on all
platforms except MinGW, which now identifies MinGW
separately from Windows.
PR-URL: https://github.com/nodejs/node/pull/25659
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Minwoo Jung <minwoo@nodesource.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2019-01-25 08:54:55 -05:00
cjihrig
d40ed71c11
src: remove using v8::Function in node_os.cc
...
PR-URL: https://github.com/nodejs/node/pull/25640
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2019-01-24 08:30:19 -05:00
cjihrig
914af23b3d
os: implement os.release() using uv_os_uname()
...
For non-Windows platforms, the happy path behavior should be
identical. On Windows, uv_os_uname() attempts to use
RtlGetVersion() before falling back to the deprecated
GetVersionExW() that Node was previously using.
PR-URL: https://github.com/nodejs/node/pull/25600
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2019-01-23 00:15:10 -05:00
Joyee Cheung
1838d00eba
src: reduce includes of node_internals.h
...
PR-URL: https://github.com/nodejs/node/pull/25507
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-01-21 07:54:42 +01:00
Brian White
5021b259ed
os: improve networkInterfaces() performance
...
PR-URL: https://github.com/nodejs/node/pull/25410
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-01-14 07:42:27 +01:00
cjihrig
3438f4b2ca
os: use uv_os_gethostname() in hostname()
...
This commit changes the C++ implementation of os.hostname()
to use uv_os_gethostname().
PR-URL: https://github.com/nodejs/node/pull/25111
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-12-20 13:44:28 -05:00
briete
937c7695aa
os: move process.binding('os') to internalBinding
...
PR-URL: https://github.com/nodejs/node/pull/25087
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-12-20 05:29:16 +01:00
Sam Roberts
0c65314e0e
src: fix type mismatch warnings from missing priv
...
Registration initialization functions are expected to have a 4th
argument, a void*, so add them where necessary to fix the warnings.
PR-URL: https://github.com/nodejs/node/pull/24737
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-12-03 19:44:15 -08:00
leeight
adbf9477eb
src: use arraysize instead of hardcode number
...
PR-URL: https://github.com/nodejs/node/pull/24473
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2018-12-01 18:57:00 +01:00
Daniel Bevenius
9bce68663b
src: fix compiler warning in node_os
...
Currently the following compiler warnings is generated:
../src/node_os.cc:167:24:
warning: comparison of integers of different signs: 'size_t'
(aka 'unsigned long') and 'int' [-Wsign-compare]
for (size_t i = 0; i < count; i++) {
~ ^ ~~~~~
1 warning generated.
This commit changes the type of i to int.
PR-URL: https://github.com/nodejs/node/pull/24356
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-11-16 12:42:02 +01:00
Joyee Cheung
51cea618e2
os: do not call into JS to push values to an array in GetCPUInfo
...
Instead of calling into JS from C++ to push values into an array,
use the new Array::New API that takes a pointer and a length
directly.
PR-URL: https://github.com/nodejs/node/pull/24264
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2018-11-14 02:59:45 +08:00
Daniel Bevenius
344d33eef1
src: fix v8 compiler warnings in src
...
This commit changes the code to use the maybe version.
PR-URL: https://github.com/nodejs/node/pull/24246
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2018-11-11 08:02:30 +01:00
Anna Henningsen
d690a87b8c
os: fix memory leak in userInfo()
...
This previously leaked memory in the ‘success’ case.
PR-URL: https://github.com/nodejs/node/pull/23893
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-10-31 06:17:06 +01:00
Anna Henningsen
b0089a580f
src: make model counter in GetCPUInfo() unsigned
...
This fixes a compiler warning about comparing against
the (unsigned) `NODE_PUSH_VAL_TO_ARRAY_MAX` constant.
PR-URL: https://github.com/nodejs/node/pull/23880
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Matheus Marchini <mat@mmarchini.me >
2018-10-28 09:55:01 +01:00
cjihrig
92880f31da
os: add os.{get,set}Priority()
...
PR-URL: https://github.com/nodejs/node/pull/22407
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2018-08-22 17:27:16 -04:00
Ujjwal Sharma
07cb69720b
src: use UTF-8 for naming interfaces in unix
...
Use a UTF-8 encoded string for naming interfaces in unix, instead of
using Latin-1, as had been done on windows previously.
PR-URL: https://github.com/nodejs/node/pull/21926
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-07-29 17:04:48 +02:00
Ujjwal Sharma
35ec9b247e
src: remove calls to deprecated v8 functions (NewFromUtf8)
...
Remove all calls to deprecated v8 functions (here: String::NewFromUtf8) inside
the code (src directory only).
PR-URL: https://github.com/nodejs/node/pull/21926
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-07-29 16:59:31 +02:00
Daniel Bevenius
e32bbbf4d7
src: use nullptr instead of NULL
...
PR-URL: https://github.com/nodejs/node/pull/17373
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-12-01 07:45:00 +01:00
Yihong Wang
8680bb9f1a
src: explicitly register built-in modules
...
Previously, built-in modules are registered before main() via
__attribute__((constructor)) mechanism in GCC and similiar
mechanism in MSVC. This causes some issues when node is built as
static library. Calling module registration function for built-in
modules in node::Init() helps to avoid the issues.
Signed-off-by: Yihong Wang <yh.wang@ibm.com >
PR-URL: https://github.com/nodejs/node/pull/16565
Refs: https://github.com/nodejs/node/pull/14986#issuecomment-332758206
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-13 23:17:34 +00:00
James M Snell
056b858e57
os: migrate node_os.cc to internal/errors
...
PR-URL: https://github.com/nodejs/node/pull/16567
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-11-02 11:58:38 -07:00
Anna Henningsen
290315ace7
src: refactor #include handling
...
`node_internals.h` already includes the most common headers,
so double includes can be avoided in a lot of cases. Also don’t include
`node_internals.h` from `node.h` implicitly anymore, as that is mostly
unnecessary.
PR-URL: https://github.com/nodejs/node/pull/14697
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-09-14 17:38:38 +02:00
Anna Henningsen
784c6d40f8
src: use proper errors as coming from StringBytes
...
The previous errors were incorrect here, as the code
only failed in situations where strings exceeded size limits or
an OOM situation was encountered, not for invalid encodings
(which aren’t even detected explicitly).
Unfortunately, these situations are hard to test for.
PR-URL: https://github.com/nodejs/node/pull/14579
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2017-08-24 21:05:07 +02:00
Anna Henningsen
d56a7e640f
src: do proper StringBytes error handling
...
- Return `MaybeLocal`s from `StringBytes::Encode`
- Add an `error` out parameter to pass JS exceptions to the callers
(instead of directly throwing)
- Simplify some of the string generation methods in `string_bytes.cc`
by unifying the `EXTERN_APEX` logic
- Reduce usage of deprecated V8 APIs.
- Remove error handling logic from JS, the `buffer.*Slice()` methods
now throw errors themselves.
- Left TODO comments for future semver-major error message
improvements.
This paves the way for better error messages coming out of the
StringBytes methods.
Ref: https://github.com/nodejs/node/issues/3175
PR-URL: https://github.com/nodejs/node/pull/12765
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-05-03 19:21:32 +02:00
Tobias Nießen
88aab45c92
os,vm: fix segfaults and CHECK failure
...
Fixes multiple possible segmentation faults in node_contextify.cc and
an assertion failure in node_os.cc
Fixes: https://github.com/nodejs/node/issues/12369
Fixes: https://github.com/nodejs/node/issues/12370
PR-URL: https://github.com/nodejs/node/pull/12371
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-14 23:02:45 +02:00
James M Snell
98e54b0bd4
meta: restore original copyright header
...
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.
Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155
Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
Brian White
4e05952a8a
os: improve cpus() performance
...
PR-URL: https://github.com/nodejs/node/pull/11564
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
2017-03-02 15:31:21 -05:00
Brian White
efdc571a58
os: improve loadavg() performance
...
PR-URL: https://github.com/nodejs/node/pull/11516
Reviewed-By: Jackson Tian <shyvo1987@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-02-25 20:53:56 -05:00
Alexey Orlenko
c8c79b937f
src: add a missing space in node_os.cc
...
This commit makes a small stylistic fix adding a missing space in
GetOSType function in node_os.cc
PR-URL: https://github.com/nodejs/node/pull/10931
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michal Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-23 09:33:31 -08:00
jBarz
1c3c75dac2
os: fix os.release() for aix and add test
...
PR-URL: https://github.com/nodejs/node/pull/10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-12-27 14:01:49 -08:00