Ben Noordhuis
b8ab49fc53
src: fix abort on uv_loop_init() failure
...
Fixes: https://github.com/nodejs/node/issues/34855
PR-URL: https://github.com/nodejs/node/pull/34874
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-08-24 07:32:30 -07: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
himself65
1c4b20546a
src: remove duplicated code
...
PR-URL: https://github.com/nodejs/node/pull/32719
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2020-04-11 14:25:37 +08:00
Ben Noordhuis
d09e1da669
src: fix spawnSync CHECK when SIGKILL fails
...
We might not have sufficient privileges to signal the child process
so don't make assumptions about the return value of `uv_process_kill()`.
Example:
node -e 'child_process.spawnSync("sudo", ["ls"], { maxBuffer: 1 })'
No test because:
1. The test needs to run as root (can't invoke sudo), and
2. The parent needs to drop privileges but can't, because
then the child process won't have sufficient privileges.
Fixes: https://github.com/nodejs/node/issues/31747
PR-URL: https://github.com/nodejs/node/pull/31768
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-03-11 19:30:08 +01:00
Anna Henningsen
a7c523e26d
src: prefer 3-argument Array::New()
...
This is nicer, because:
1. It reduces overall code size,
2. It’s faster, because `Object::Set()` calls are relatively slow, and
3. It helps avoid invalid `.Check()`/`.FromJust()` calls.
PR-URL: https://github.com/nodejs/node/pull/31775
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-02-15 21:39:32 +01:00
Anna Henningsen
9cc747bfce
src: add C++-style sprintf utility
...
Add an utility that handles C++-style strings and objects well.
PR-URL: https://github.com/nodejs/node/pull/31446
Fixes: https://github.com/nodejs/node/issues/28761
Fixes: https://github.com/nodejs/node/issues/31218
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-01-23 22:38:58 +01: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
gengjiawen
51079db826
src: apply clang-tidy rule modernize-use-equals-default
...
PR-URL: https://github.com/nodejs/node/pull/27264
Reviewed-By: Refael Ackermann <refack@gmail.com >
2019-04-24 13:32:43 -04: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
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
Anna Henningsen
6f217e7ce5
src: turn ROUND_UP into an inline function
...
PR-URL: https://github.com/nodejs/node/pull/25743
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2019-01-30 23:40:37 +01: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
cjihrig
24e6b709ea
src: use isolate version of BooleanValue()
...
This fixes deprecation warnings.
PR-URL: https://github.com/nodejs/node/pull/24883
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-12-08 22:42:05 -08: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
Steven Auger
c979fad9bb
src: changed stdio_pipes_ to std::vector
...
PR-URL: https://github.com/nodejs/node/pull/23615
Reviewed-By: Sam Ruby <rubys@intertwingly.net >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2018-10-17 13:20:43 -04:00
Andrew J D McCann
244180826e
src: use default initializers over settings fields on the constructor
...
PR-URL: https://github.com/nodejs/node/pull/23532
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-10-15 12:03:08 +02:00
Anto Aravinth
9c9c01f183
child_process: move process.binding('spawn_sync') to internalBinding
...
PR-URL: https://github.com/nodejs/node/pull/22260
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com >
Reviewed-By: Denys Otrishko <shishugi@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-09-15 13:48:44 +02:00
Michaël Zasso
594a84d8f2
src: remove calls to deprecated V8 functions (Int32Value)
...
Remove all calls to deprecated V8 functions (here: Value::Int32Value)
inside the code.
PR-URL: https://github.com/nodejs/node/pull/22662
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Minwoo Jung <minwoo@nodesource.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com >
2018-09-05 12:59:25 +02:00
Ujjwal Sharma and Michaël Zasso
a55c57b8c4
src: rework (mostly internal) functions to use Maybes
...
Rework all affected functions to use Maybes, thus improving error
handling substantially in internal functions, API functions as well as
utilities.
Co-authored-by: Michaël Zasso <targos@protonmail.com >
PR-URL: https://github.com/nodejs/node/pull/21935
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-09-02 14:25:16 +02:00
Ujjwal Sharma
67403b3a84
src: remove calls to deprecated v8 functions (ToString)
...
Remove all calls to deprecated v8 functions (here: Value::ToString)
inside the code (src directory only).
PR-URL: https://github.com/nodejs/node/pull/21935
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2018-09-02 14:24:58 +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
Anna Henningsen
aa2304b8d5
worker,src: display remaining handles if uv_loop_close fails
...
Right now, we crash the process if there are handles remaining
on the event loop when we exit (except for the main thread).
This does not provide a lot of information about causes, though;
in particular, we don’t show which handles are pending and
who own them.
This patch adds debug output to these cases to help with the
situation.
PR-URL: https://github.com/nodejs/node/pull/21238
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-06-13 12:23:36 +02:00
Tobias Nießen
39f209649f
src: add CHECK_NULL/CHECK_NOT_NULL macros
...
This change introduces CHECK_NULL and CHECK_NOT_NULL macros
similar to their definition in v8 and replaces instances of
CHECK/CHECK_EQ/CHECK_NE with these where it seems appropriate.
PR-URL: https://github.com/nodejs/node/pull/20914
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-05-26 12:29:31 +02:00
Daniel Bevenius
489b916c7d
src: remove unused stdlib.h include
...
Commit 870229e665 ("src: Add ABORT
macro") replaced the abort call with the abort macro in util-inl.h.
This commit removes the include as it is not needed anymore.
PR-URL: https://github.com/nodejs/node/pull/19427
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2018-03-20 07:33:45 +01:00
Franziska Hinkelmann
b3127cd537
src: make ownership of stdio_pipes explicit
...
Use smart pointers instead of raw pointers for StdioPipes.
Also, use a smart pointer for the array holding them.
PR-URL: https://github.com/nodejs/node/pull/17030
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-16 16:54: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
cjihrig
6dcc37d0ed
src: combine loops in CopyJsStringArray()
...
In spawn_sync.cc, two consecutive loops are used to convert
data to strings, and compute the size of the data. This commit
merges the two independent loops into one.
Refs: https://github.com/nodejs/node/pull/15380
PR-URL: https://github.com/nodejs/node/pull/16247
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-18 16:38:28 -04:00
cjihrig
ad07065512
src: increase usage of context in spawn_sync.cc
...
Refs: https://github.com/nodejs/node/pull/15380
PR-URL: https://github.com/nodejs/node/pull/16247
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-18 16:38:28 -04:00
cjihrig
3b7a9a2589
child_process: add windowsHide option
...
This commit exposes the UV_PROCESS_WINDOWS_HIDE flag in Node
as a windowsHide option to the child_process methods. The
option is only applicable to Windows, and is ignored elsewhere.
Fixes: https://github.com/nodejs/node/issues/15217
PR-URL: https://github.com/nodejs/node/pull/15380
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-16 16:19:54 -04: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
cjihrig
784eb2fd65
child_process: exit spawnSync with null on signal
...
This commit sets the spawnSync() exit code to null when the
child is killed via signal. This brings the behavior more in
sync with spawn().
Fixes: https://github.com/nodejs/node/issues/11284
PR-URL: https://github.com/nodejs/node/pull/11288
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
2017-02-14 11:44:24 -05:00
cjihrig
8f3ff98f0e
child_process: allow Infinity as maxBuffer value
...
Fixes: https://github.com/nodejs/node/pull/10767
PR-URL: https://github.com/nodejs/node/pull/10769
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-17 10:47:28 -05:00
cjihrig
45c9ca7fd4
src: remove redundant spawn/spawnSync type checks
...
This commit removes C++ checks from spawn() and spawnSync()
that are duplicates of the JavaScript type checking.
Fixes: https://github.com/nodejs/node/issues/8096
Fixes: https://github.com/nodejs/node/issues/8539
Refs: https://github.com/nodejs/node/issues/9722
PR-URL: https://github.com/nodejs/node/pull/8312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-12-25 12:48:55 -05:00
cjihrig
b374ee8c3d
src: add handle check to spawn_sync
...
This commit verifies that the child process handle is of the
correct type before trying to close it in
CloseHandlesAndDeleteLoop(). This catches the case where input
validation failed, and the child process was never actually
spawned.
Fixes: https://github.com/nodejs/node/issues/8096
Fixes: https://github.com/nodejs/node/issues/8539
Refs: https://github.com/nodejs/node/issues/9722
PR-URL: https://github.com/nodejs/node/pull/8312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-12-25 12:46:27 -05:00
Ben Noordhuis
ed3d8b13ee
src: fix bad logic in uid/gid checks
...
Pointed out by Coverity. Introduced in commits 3546383c ("process_wrap:
avoid leaking memory when throwing due to invalid arguments") and
fa4eb47c ("bindings: add spawn_sync bindings").
The return statements inside the if blocks were dead code because their
guard conditions always evaluated to false. Remove them.
PR-URL: https://github.com/nodejs/node/pull/7374
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2016-06-29 12:21:13 +02:00
Ben Noordhuis
d112df4a26
src: fix readability/nolint cpplint warnings
...
PR-URL: https://github.com/nodejs/node/pull/7462
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2016-06-28 21:21:21 +02:00
Evan Lucas
870229e665
src: Add ABORT macro
...
Windows 8+ compiled in Release mode exits with code 0xC0000409 when
abort() is called. This prevents us from being able to reliably verify
an abort exit code (3) on windows.
PR-URL: https://github.com/nodejs/node/pull/2776
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-by: Trevor Norris <trev.norris@gmail.com >
2015-09-17 15:25:14 -05:00
Michaël Zasso
4abc896a82
src: replace usage of v8::Handle with v8::Local
...
v8::Handle is deprecated: https://codereview.chromium.org/1224623004
PR-URL: https://github.com/nodejs/io.js/pull/2202
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-09-06 21:38:05 +10:00
Trevor Norris
36f78f4c1c
buffer: switch API to return MaybeLocal<T>
...
Instead of aborting in case of internal failure, return an empty
Local<Object>. Using the MaybeLocal<T> API, users must check their
return values.
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-08-04 11:56:11 -07:00
Trevor Norris
c1de6d249e
core: implement runtime flag to trace sync io
...
Use the --trace-sync-io flag to print a stack trace whenever a sync
method is used after the first tick, excluding during the process exit
event. (e.g. fs.readFileSync()) It does not track if the warning has
occurred at a specific location in the past and so will print the
warning every time.
Reason for not printing during the first tick of the appication is so
all necessary resources can be required. Also by excluding synchronous
calls during exit is necessary in case any data needs to be logged out
by the application before it shuts down.
Fixes: https://github.com/nodejs/io.js/issues/1674
PR-URL: https://github.com/nodejs/io.js/pull/1707
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Fedor Indutny <fedor@indutny.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Petka Antonov <petka_antonov@hotmail.com >
2015-05-18 10:05:32 -06:00
Ben Noordhuis
2ed10f1349
src: fix minor inefficiency in Buffer::New() call
...
Commit ccb199a ("src: fix deprecation warnings") passes env()->isolate()
to the Buffer::New() call. It's somewhat inefficient because the callee
looks up the environment from the isolate. Just pass the env directly.
PR-URL: https://github.com/iojs/io.js/pull/1577
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2015-05-05 00:41:59 +02:00
Ben Noordhuis
ccb199af17
src: fix deprecation warnings
...
The previous commit enables deprecation warnings, this commit fixes
the handful of offending sites where the isolate was not explicitly
being passed around.
PR-URL: https://github.com/iojs/io.js/pull/1565
Reviewed-By: Trevor Norris <trev.norris@gmail.com >
2015-04-30 01:05:32 +02:00
Ben Noordhuis
ea37ac04f4
src: ignore ENOTCONN on shutdown race with child
...
On AIX, OS X and the BSDs, calling shutdown() on one end of a pipe
when the other end has closed the connection fails with ENOTCONN.
The sequential/test-child-process-execsync test failed sporadically
because of a race between the parent and the child where one closed
its end of the pipe before the other got around to calling shutdown()
on its end of the pipe.
Libuv is not the right place to handle that because it can't tell if
the ENOTCONN error is genuine but io.js can.
Refs: https://github.com/libuv/libuv/pull/268
PR-URL: https://github.com/iojs/io.js/pull/1214
Reviewed-By: Bert Belder <bertbelder@gmail.com >
2015-03-28 13:26:29 +01:00
isaacs
3e1b1dd4a9
Remove excessive copyright/license boilerplate
...
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Trevor Norris
d553386623
src: pass Isolate to additional locations
...
Due to a recent V8 upgrade, more methods require Isolate as an argument.
PR-URL: https://github.com/iojs/io.js/pull/244
Reviewed-by: Ben Noordhuis <info@bnoordhuis.nl >
2015-01-07 14:19:40 -08:00
Juanjo
ea945bf068
lib,src: fix spawnSync ignoring its 'env' option
...
PR-URL: https://github.com/joyent/node/pull/8546
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2014-12-09 18:41:30 +01:00
Ben Noordhuis
2d82cdf670
src: replace NULL with nullptr
...
Now that we are building with C++11 features enabled, replace use
of NULL with nullptr.
The benefit of using nullptr is that it can never be confused for
an integral type because it does not support implicit conversions
to integral types except boolean - unlike NULL, which is defined
as a literal `0`.
2014-10-23 22:49:58 +02:00
Ben Noordhuis
d3c317e08a
src: attach env directly to api functions
...
Attach the per-context execution environment directly to API functions.
Rationale:
* Gets node one step closer to multi-isolate readiness.
* Avoids multi-context confusion, e.g. when the caller and callee live
in different contexts.
* Avoids expensive calls to pthread_getspecific() on platforms where
V8 does not know how to use the thread-local storage directly.
(Linux, the BSDs.)
PR-URL: https://github.com/node-forward/node/pull/18
Reviewed-By: Fedor Indutny <fedor@indutny.com >
2014-10-13 23:46:46 +04:00
Ben Noordhuis
5fdff3854a
src: replace assert() with CHECK()
...
Mechanically replace assert() statements with UNREACHABLE(), CHECK(),
or CHECK_{EQ,NE,LT,GT,LE,GE}() statements.
The exceptions are src/node.h and src/node_object_wrap.h because they
are public headers.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com >
2014-10-12 02:09:46 +04:00
Ben Noordhuis
97585b0d7a
src: remove unnecessary HandleScopes
...
API callback functions don't need to create a v8::HandleScope instance
because V8 already creates one in the JS->C++ adapter frame.
PR-URL: https://github.com/node-forward/node/pull/16
Reviewed-By: Fedor Indutny <fedor@indutny.com >
2014-10-12 02:09:16 +04:00