Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-10build: fix various shared library build issuesWilliam Marlow
Node.js unofficially supports a shared library variant where the main node executable is a thin wrapper around node.dll/libnode.so. The key benefit of this is to support embedding Node.js in other applications. Since Node.js 12 there have been a number of issues preventing the shared library build from working correctly, primarily on Windows: * A number of functions used executables such as `mksnapshot` are not exported from `libnode.dll` using a `NODE_EXTERN` attribute * A dependency on the `Winmm` system library is missing * Incorrect defines on executable targets leads to `node.exe` claiming to export a number of functions that are actually in `libnode.dll` * Because `node.exe` attempts to export symbols, `node.lib` gets generated causing native extensions to try to link against `node.exe` not `libnode.dll`. * Similarly, because `node.dll` was renamed to `libnode.dll`, native extensions don't know to look for `libnode.lib` rather than `node.lib`. * On macOS an RPATH is added to find `libnode.dylib` relative to `node` in the same folder. This works fine from the `out/Release` folder but not from an installed prefix, where `node` will be in `bin/` and `libnode.dylib` will be in `lib/`. * Similarly on Linux, no RPATH is added so LD_LIBRARY_PATH needs setting correctly for `bin/node` to find `lib/libnode.so`. For the `libnode.lib` vs `node.lib` issue there are two possible options: 1. Ensure `node.lib` from `node.exe` does not get generated, and instead copy `libnode.lib` to `node.lib`. This means addons compiled when referencing the correct `node.lib` file will correctly depend on `libnode.dll`. The down side is that native addons compiled with stock Node.js will still try to resolve symbols against node.exe rather than libnode.dll. 2. After building `libnode.dll`, dump the exports using `dumpbin`, and process this to generate a `node.def` file to be linked into `node.exe` with the `/DEF:node.def` flag. The export entries in `node.def` will all read ``` my_symbol=libnode.my_symbol ``` so that `node.exe` will redirect all exported symbols back to `libnode.dll`. This has the benefit that addons compiled with stock Node.js will load correctly into `node.exe` from a shared library build, but means that every embedding executable also needs to perform this same trick. I went with the first option as it is the cleaner of the two solutions in my opinion. Projects wishing to generate a shared library variant of Node.js can now, for example, ``` .\vcbuild dll package vs ``` to generate a full node installation including `libnode.dll`, `Release\node.lib`, and all the necessary headers. Native addons can then be built against the shared library build easily by specifying the correct `nodedir` option. For example ``` >npx node-gyp configure --nodedir C:\Users\User\node\Release\node-v18.0.0-win-x64 ... >npx node-gyp build ... >dumpbin /dependents build\Release\binding.node Microsoft (R) COFF/PE Dumper Version 14.29.30136.0 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file build\Release\binding.node File Type: DLL Image has the following dependencies: KERNEL32.dll libnode.dll VCRUNTIME140.dll api-ms-win-crt-string-l1-1-0.dll api-ms-win-crt-stdio-l1-1-0.dll api-ms-win-crt-runtime-l1-1-0.dll ... ``` PR-URL: https://github.com/nodejs/node/pull/41850 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-07node-api,src: fix module registration in MSVC C++Vladimir Morozov
PR-URL: https://github.com/nodejs/node/pull/42459 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-02-24src: allow preventing InitializeInspector in envShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/35025 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-05src: add kNoBrowserGlobals flag for EnvironmentCheng Zhao
PR-URL: https://github.com/nodejs/node/pull/40532 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-10-14src: add flags for controlling process behaviorCheng Zhao
PR-URL: https://github.com/nodejs/node/pull/40339 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-09-18src: add option to disable global search pathsCheng Zhao
PR-URL: https://github.com/nodejs/node/pull/39754 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2021-09-10src: add option to disable loading native addonsDominic Elm
PR-URL: https://github.com/nodejs/node/pull/39977 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-08-21src: add a constructor overload for CallbackScopeDarshan Sen
This overload accepts the current Environment* as an argument, unlike the other constructor, which accepts an Isolate*. This is useful because we can pass the current Environment* directly instead of recomputing it from the Isolate* inside the constructor. Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: https://github.com/nodejs/node/pull/39768 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2021-08-17build: add option to hide console windowCheng Zhao
Adds a Environment flag to allow embedders to set CREATE_NO_WINDOW property when spawning processes, which is useful for GUI programs that do not want to show console windows when running terminal commands. PR-URL: https://github.com/nodejs/node/pull/39712 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shelley Vohr <shelley.vohr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-08-06src: return Maybe from a couple of functionsDarshan Sen
Functions affected: * InitializeContext() * InitializeContextForSnapshot() * InitializePrimordials() Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: https://github.com/nodejs/node/pull/39603 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-04-30src: allow custom PageAllocator in NodePlatformShelley Vohr
For certain embedder use cases there are more complex memory allocation requirements that the default V8 page allocator does not handle. For example, using MAP_JIT when running under a hardened runtime environment on macOS. This allows embedders like Electron to provide their own allocator that does handle these cases. PR-URL: https://github.com/nodejs/node/pull/38362 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-24src: mark internally exported functions as explicitly internalTyler Ang-Wanek
PR-URL: https://github.com/nodejs/node/pull/37000 Fixes: https://github.com/nodejs/node/issues/36349 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-24src: inline AsyncCleanupHookHandle in headersTyler Ang-Wanek
Fixes: https://github.com/nodejs/node/issues/36349 PR-URL: https://github.com/nodejs/node/pull/37000 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-13src: add way to get IsolateData and allocator from EnvironmentAnna Henningsen
Add a way to get the current `IsolateData*` and, from it, the current Node.js `ArrayBufferAllocator` if there is one. This can be useful for re-using either one of these structures as an embedder. PR-URL: https://github.com/nodejs/node/pull/36441 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-12src: allow preventing SetPrepareStackTraceCallbackShelley Vohr
Node.js sets a stack trace handler specific to the v8::Context corresponding to the current Environment. When Electron is running in a non-Node.js v8::Context (e.g in the renderer process with contextIsolation enabled), there will be no correspondent Environment - we therefore need to prevent this handler being set so that Blink falls back to its default handling and displays the correct stacktrace. PR-URL: https://github.com/nodejs/node/pull/36447 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-02src: clean up embedder APIAnna Henningsen
Remove deprecated APIs (and deprecate one legacy API). PR-URL: https://github.com/nodejs/node/pull/35897 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2020-10-26src: remove ignore GCC -Wcast-function-type for v8Daniel Bevenius
This reverts Commit 3ff2aeceba88928f1aa33fe3ff1cc9bf84da739b ("src: ignore GCC -Wcast-function-type for v8.h") and Commit 2462a2c5d7b5ae7e28a0fdefdf4fd5e8eb0ff5ed ("src: fix ignore GCC -Wcast-function-type for older compilers") as this has now been included in the V8 version being used. PR-URL: https://github.com/nodejs/node/pull/35768 Refs: https://github.com/v8/v8/commit/f08cbfdc4051266e4200b6e26775d35307b1259b Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
2020-10-14src: add embedding helpers to reduce boilerplate codeAnna Henningsen
Provide helpers for a) spinning the event loop and b) setting up and tearing down the objects involved in a single Node.js instance, as they would typically be used. The former helper is also usable inside Node.js itself, for both Worker and main threads. PR-URL: https://github.com/nodejs/node/pull/35597 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-10-11src: add maybe versions of EmitExit and EmitBeforeExitAnna Henningsen
This addresses a TODO comment, and removes invalid `.ToLocalChecked()` calls from our code base. PR-URL: https://github.com/nodejs/node/pull/35486 Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-08src: expose v8::Isolate setup callbacksShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/35512 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-08crypto: refactoring internals, add WebCryptoJames M Snell
Fixes: https://github.com/nodejs/node/issues/678 Refs: https://github.com/nodejs/node/issues/26854 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/35093 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-26src: allow N-API addon in `AddLinkedBinding()`Anna Henningsen
`AddLinkedBinding()` can be used to load old-style Node.js addons, but currently not N-API addons. There’s no good reason not to support N-API addons as well, so add that. PR-URL: https://github.com/nodejs/node/pull/35301 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-08-07n-api,src: provide asynchronous cleanup hooksAnna Henningsen
Sometimes addons need to perform cleanup actions, for example closing libuv handles or waiting for requests to finish, that cannot be performed synchronously. Add C++ API and N-API functions that allow providing such asynchronous cleanup hooks. Fixes: https://github.com/nodejs/node/issues/34567 PR-URL: https://github.com/nodejs/node/pull/34572 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
2020-07-21src: allow preventing SetPromiseRejectCallbackShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/34387 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-07-14src: add option to track unmanaged file descriptorsAnna Henningsen
Add the ability to track “raw” file descriptors, i.e. integers returned by `fs.open()`, and close them on `Environment` shutdown, to match the behavior for all other resource types (which are also closed on shutdown). PR-URL: https://github.com/nodejs/node/pull/34303 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-06-29src: allow embedders to disable esm loaderShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/34060 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2020-06-16src: add public APIs to manage v8::TracingControllerAnna Henningsen
We added a hack for this a while ago for Electron, so let’s remove that hack and make this an official API. Refs: https://github.com/nodejs/node/pull/28724 Refs: https://github.com/nodejs/node/issues/33800 PR-URL: https://github.com/nodejs/node/pull/33850 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2020-05-14src: remove deprecated FinalizationRegistry hooksGus Caplan
PR-URL: https://github.com/nodejs/node/pull/33373 Fixes: https://github.com/nodejs/node/issues/33389 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-04-24src: remove unused CancelPendingDelayedTasksAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/32859 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2020-04-24src: deprecate embedder APIs with replacementsAnna Henningsen
Implement a number of TODO comments aiming at the eventual removal of some embedder APIs that now have replacements available. PR-URL: https://github.com/nodejs/node/pull/32858 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2020-04-08src: initialize inspector before RunBootstrapping()Anna Henningsen
This is necessary for `--inspect-brk-node` to work, and for the inspector to be aware of scripts created before bootstrapping. Fixes: https://github.com/nodejs/node/issues/32648 Refs: https://github.com/nodejs/node/pull/30467#discussion_r396879908 PR-URL: https://github.com/nodejs/node/pull/32672 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-03Revert "embedding: make Stop() stop Workers"Anna Henningsen
This reverts commit 037ac99ed5aa763b7a3567da2cc81f9d7b97bdf9. As flaky CI failures have revealed, this feature was implemented incorrectly. `stop_sub_worker_contexts()` needs to be called on the thread on which the `Environment` is currently running, it’s not thread-safe. The current API requires `Stop()` to be thread-safe, though. We could add a new API for this, but unless there’s demand, that’s probably not necessary as `FreeEnvironment()` will also stop Workers, which is commonly the next action on an `Environment` instance after having `Stop()` called on it. Refs: https://github.com/nodejs/node/pull/32531 PR-URL: https://github.com/nodejs/node/pull/32623 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-04-02embedding: make Stop() stop WorkersAnna Henningsen
This makes sense given that terminating execution of the parent thread this way likely also is supposed to stop all running Worker threads spawned by it. PR-URL: https://github.com/nodejs/node/pull/32531 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-02embedding: provide hook for custom process.exit() behaviourAnna Henningsen
Embedders may not want to terminate the process when `process.exit()` is called. This provides a hook for more flexible handling of that situation. Refs: https://github.com/nodejs/node/pull/30467#issuecomment-603689644 PR-URL: https://github.com/nodejs/node/pull/32531 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-21src: allow non-Node.js TracingControllersAnna Henningsen
We do not need a Node.js-provided `v8::TracingController`, generally. Loosen that restriction in order to make it easier for embedders to provide their own subclass of `v8::TracingController`, or none at all. Refs: https://github.com/electron/electron/commit/9c36576dddfaecde1298ff3e089d21a6e54fe67f PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: add ability to look up platform based on `Environment*`Anna Henningsen
This should eventually remove any necessity to use the global-state `GetMainThreadMultiIsolatePlatform()`. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: make InitializeNodeWithArgs() official public APIAnna Henningsen
This is a decent replacement for the to-be-deprecated Init() API. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: add unique_ptr equivalent of CreatePlatformAnna Henningsen
This makes this bit of the embedder situation a bit easier to use. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: add LoadEnvironment() variant taking a stringAnna Henningsen
Allow passing a string as the main module rather than using the callback variant. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: provide a variant of LoadEnvironment taking a callbackAnna Henningsen
This allows embedders to flexibly control how they start JS code rather than using `third_party_main`. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-03-21src: align worker and main thread code with embedder APIAnna Henningsen
This addresses some long-standing TODOs by Joyee and me about making the embedder API more powerful and us less reliant on internal APIs for creating the main thread and Workers. PR-URL: https://github.com/nodejs/node/pull/30467 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2020-01-29src: fix ignore GCC -Wcast-function-type for older compilersDenys Otrishko
Fixes: https://github.com/nodejs/node/issues/31517 PR-URL: https://github.com/nodejs/node/pull/31524 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-26src: ignore GCC -Wcast-function-type for v8.hDaniel Bevenius
This commit suggests that cast-function-type warnings be ignored from v8.h. Currently, GCC reports a number of warnings like this: In file included from ../src/util.h:27, from ../src/aliased_buffer.h:7, from ../src/memory_tracker.h:5, from ../src/base_object.h:27, from ../src/async_wrap.h:27, from ../src/req_wrap.h:6, from ../src/req_wrap-inl.h:6, from ../src/connect_wrap.h:6, from ../src/connect_wrap.cc:1: ../deps/v8/include/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak( P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::BaseObject; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::BaseObject>&)]’: ../src/base_object-inl.h:123:42: required from here ../deps/v8/include/v8.h:10374:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::BaseObject>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::BaseObject>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type] reinterpret_cast<Callback>(callback), type); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The motivation for doing this that it makes it difficult to spot other warnings that might be important. Since it is v8 that performs this cast I was not able to find a way around it. PR-URL: https://github.com/nodejs/node/pull/31475 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-09src: remove node::InitializeV8Platform()Ben Noordhuis
This API method was introduced in commit 90ae4bd0c9 ("src: add InitializeV8Platform function") from July 2018 but wasn't properly exported and therefore not usable on Windows or with shared library builds. The motivation from the commit log is mainly about making it easier to wire up the cctests and there are better ways to do that. Refs: https://github.com/nodejs/node/pull/31217 PR-URL: https://github.com/nodejs/node/pull/31245 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-12-24src,test: use v8::Global instead of v8::PersistentAnna Henningsen
This is in preparation for a lint rule forbidding usage of `v8::Persistent`. PR-URL: https://github.com/nodejs/node/pull/31018 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2019-12-15src: unregister Isolate with platform before disposingAnna Henningsen
I previously thought the order of these calls was no longer relevant. I was wrong. This commit undoes the changes from 312c02d25e9, adds a comment explaining why I was wrong, and flips the order of the calls elsewhere for consistency, the latter having been the goal of 312c02d25e9. Fixes: https://github.com/nodejs/node/issues/30846 Refs: https://github.com/nodejs/node/pull/30181 PR-URL: https://github.com/nodejs/node/pull/30909 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@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: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-11-20src: add abstract `IsolatePlatformDelegate`Marcel Laverdet
Adds a new abstract class for module authors and embedders to register arbitrary isolates with `node::MultiIsolatePlatform`. PR-URL: https://github.com/nodejs/node/pull/30324 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2019-11-18src: expose ability to set optionsShelley Vohr
PR-URL: https://github.com/nodejs/node/pull/30466 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-11-08src: remove custom tracking for SharedArrayBuffersAnna Henningsen
Remove custom tracking for `SharedArrayBuffer`s and their allocators and instead let V8 do the tracking of both. This is required starting in V8 7.9, because lifetime management for `ArrayBuffer::Allocator`s differs from what was performed previously (i.e. it is no longer easily possible for one Isolate to release an `ArrayBuffer` and another to accept it into its own allocator), and the alternative would have been adapting the `SharedArrayBuffer` tracking logic to also apply to regular `ArrayBuffer` instances. Refs: https://github.com/nodejs/node/pull/30044 PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2019-11-08src: allow adding linked bindings to EnvironmentAnna Henningsen
This allows manually adding linked bindings to an `Environment` instance, without having to register modules at program load in a global namespace. PR-URL: https://github.com/nodejs/node/pull/30274 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>