summaryrefslogtreecommitdiff
path: root/src/node_options.h
Commit message (Collapse)AuthorAgeFilesLines
* repl: enable --experimental-repl-await /w opt-outhemanth.hm2021-07-291-1/+1
| | | | | | | | | Unflags top-level await for the REPL by enabling --experimental-repl-await by default. Opt-out is supported via --no-experimental-repl-await. PR-URL: https://github.com/nodejs/node/pull/34733 Reviewed-By: Guy Bedford <guybedford@gmail.com>
* src: allow to negate boolean CLI flagsMichaël Zasso2021-06-211-5/+7
| | | | | | | | | | | | | | | | | | | This change allows all boolean flags to be negated using the `--no-` prefix. Flags that are `true` by default (for example `--deprecation`) are still documented as negations. With this change, it becomes possible to easily flip the default value of a boolean flag and to override the value of a flag passed in the NODE_OPTIONS environment variable. `process.allowedNodeEnvironmentFlags` contains both the negated and non-negated versions of boolean flags. Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/39023 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* dns: allow `--dns-result-order` to change default dns verbatimOuyang Yadong2021-06-111-0/+1
| | | | | | | | | | | | | | Allow the `--dns-result-order` option to change the default value of verbatim in `dns.lookup()`. This is useful when running Node.js in ipv6-only environments to avoid possible ENETUNREACH errors. PR-URL: https://github.com/nodejs/node/pull/38099 Refs: https://github.com/nodejs/node/issues/31566 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src: fix typo for initializationYash Ladha2021-04-081-1/+1
| | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/37974 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* crypto: make FIPS related options always awailableVít Ondruch2021-02-251-2/+0
| | | | | | | | | | | | | | | | | There is no reason to hide FIPS functionality behind build flags. OpenSSL always provide the information about FIPS availability via `FIPS_mode()` function. This makes the user experience more consistent, because the OpenSSL library is always queried and the `crypto.getFips()` always returns OpenSSL settings. Fixes #34903 PR-URL: https://github.com/nodejs/node/pull/36341 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* crypto: implement basic secure heap supportJames M Snell2021-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds two new command line arguments: * `--secure-heap=n`, which causes node.js to initialize an openssl secure heap of `n` bytes on openssl initialization. * `--secure-heap-min=n`, which specifies the minimum allocation from the secure heap. * A new method `crypto.secureHeapUsed()` that returns details about the total and used secure heap allocation. The secure heap is an openssl feature that allows certain kinds of potentially sensitive information (such as private key BigNums) to be allocated from a dedicated memory area that is protected against pointer over- and underruns. The secure heap is a fixed size, so it's important that users pick a large enough size to cover the crypto operations they intend to utilize. The secure heap is disabled by default. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36779 Refs: https://github.com/nodejs/node/pull/36729 Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* src: add --heapsnapshot-near-heap-limit optionJoyee Cheung2020-10-221-0/+1
| | | | | | | | | | | | | This patch adds a --heapsnapshot-near-heap-limit CLI option that takes heap snapshots when the V8 heap is approaching the heap size limit. It will try to write the snapshots to disk before the program crashes due to OOM. PR-URL: https://github.com/nodejs/node/pull/33010 Refs: https://github.com/nodejs/node/issues/27552 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* src: add check against non-weak BaseObjects at process exitAnna Henningsen2020-10-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a process exits cleanly, i.e. because the event loop ends up without things to wait for, the Node.js objects that are left on the heap should be: 1. weak, i.e. ready for garbage collection once no longer referenced, or 2. detached, i.e. scheduled for destruction once no longer referenced, or 3. an unrefed libuv handle, i.e. does not keep the event loop alive, or 4. an inactive libuv handle (essentially the same here) There are a few exceptions to this rule, but generally, if there are C++-backed Node.js objects on the heap that do not fall into the above categories, we may be looking at a potential memory leak. Most likely, the cause is a missing `MakeWeak()` call on the corresponding object. In order to avoid this kind of problem, we check the list of BaseObjects for these criteria. In this commit, we only do so when explicitly instructed to or when in debug mode (where --verify-base-objects is always-on). In particular, this avoids the kinds of memory leak issues that were fixed in the PRs referenced below. Refs: https://github.com/nodejs/node/pull/35488 Refs: https://github.com/nodejs/node/pull/35487 Refs: https://github.com/nodejs/node/pull/35481 PR-URL: https://github.com/nodejs/node/pull/35490 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* module: fix specifier resolution option valuehimself652020-09-101-1/+0
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/35095 PR-URL: https://github.com/nodejs/node/pull/35098 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* module: custom --conditions flag optionGuy Bedford2020-08-111-0/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/34637 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
* module: unflag Top-Level AwaitMyles Borins2020-08-031-1/+1
| | | | | | | | | | | | | | | | | | | This unflags Top-Level await so it can be used by default in the module goal. This is accomplished by manually setting the --harmony-top-level-await flag. We are allowing this as a one of approval based on circumstances. It is not a precedent that future harmony features will be manually enabled. Refs: https://github.com/nodejs/node/issues/34551 PR-URL: https://github.com/nodejs/node/pull/34558 Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
* src: allow setting a dir for all diagnostic outputAshCripps2020-07-201-0/+1
| | | | | | | | | | | | | | Add a flag that allows for the setting of a directory where all diagnostic output will be written to. e.g. --redirect-warnings Refs: https://github.com/nodejs/node/pull/33010#issuecomment-618544792 PR-URL: https://github.com/nodejs/node/pull/33584 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: unflag AbortControllerJames M Snell2020-06-051-1/+0
| | | | | | | | | | | It's still experimental, but make the flag non-op Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* lib: initial experimental AbortController implementationJames M Snell2020-06-051-0/+1
| | | | | | | | | | | | | | | AbortController impl based very closely on: https://github.com/mysticatea/abort-controller Marked experimental. Not currently used by any of the existing promise apis. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* cli: add `--trace-atomics-wait` flagAnna Henningsen2020-05-151-0/+1
| | | | | | | | | | | | | Adds a flag that helps with debugging deadlocks due to incorrectly implemented `Atomics.wait()` calls. PR-URL: https://github.com/nodejs/node/pull/33292 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
* src: add support for TLAGus Caplan2020-05-141-0/+3
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/30370 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* src: sync access for report and openssl optionsSam Roberts2020-04-081-4/+17
| | | | | | | | | | | | | | Audited usage of per-process OpenSSL and Report options, adding two required mutexes. Also documented existence and typical use of the per-process cli option mutex. PR-URL: https://github.com/nodejs/node/pull/32618 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* src: handle report options on fatalerrorSam Roberts2020-03-311-3/+3
| | | | | | | | | | | Follow on to https://github.com/nodejs/node/pull/32207, 3 other options are also not respected under situations that the isolate is not available. PR-URL: https://github.com/nodejs/node/pull/32497 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* http: increase default header size from 8KB to 16KBunknown2020-03-291-1/+1
| | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/27645 PR-URL: https://github.com/nodejs/node/pull/32520 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
* report: handle on-fatalerror betterHarshitha KP2020-03-251-1/+1
| | | | | | | | | | | | | | | | --report-on-fatalerror was not honored properly, as there was no way to check the value which was stored in the Environment pointer which can be inaccessible under certain fatal error situations. Move the flag out of Environment pointer so that this is doable. Co-authored-by: Shobhit Chittora schittora@paypal.com PR-URL: https://github.com/nodejs/node/pull/32207 Fixes: https://github.com/nodejs/node/issues/31576 Refs: https://github.com/nodejs/node/pull/29881 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
* lib: add option to disable __proto__Gus Caplan2020-03-181-0/+1
| | | | | | | | | | | | | | | | Adds `--disable-proto` CLI option which can be set to `delete` or `throw`. Fixes #31951 PR-URL: https://github.com/nodejs/node/pull/32279 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
* src,cli: support compact (one-line) JSON reportsSam Roberts2020-03-171-0/+1
| | | | | | | | | | | | | Multi-line JSON is more human readable, but harder for log aggregators to consume, they usually require a log message per line, particularly for JSON. Compact output will be consumable by aggregators such as EFK (Elastic Search-Fluentd-Kibana), LogDNA, DataDog, etc. PR-URL: https://github.com/nodejs/node/pull/32254 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* doc,lib,src,test: make --experimental-report a nopcjihrig2020-03-151-2/+1
| | | | | | | | | | | | This commit makes the --experimental-report CLI flag a no-op. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: unconditionally include report featurecjihrig2020-03-151-8/+0
| | | | | | | | | | | | | This commit removes all #ifdef NODE_REPORT checks in the src directory. PR-URL: https://github.com/nodejs/node/pull/32242 Fixes: https://github.com/nodejs/node/issues/26293 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: allow to reuse env options handlingDenys Otrishko2020-02-131-0/+7
| | | | | | PR-URL: https://github.com/nodejs/node/pull/31711 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* esm: import.meta.resolve with nodejs: builtinsGuy Bedford2020-02-031-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/31032 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* src,lib: make ^C print a JS stack tracelegendecas2020-01-281-0/+1
| | | | | | | | | | | | | | | | | | | | | If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace leading up to the currently executing code. The feature would be enabled under option `--trace-sigint`. Conditions of no stacktrace on sigint: - has (an) active sigint listener(s); - main thread is idle (i.e. uv polling), a message instead of stacktrace would be printed. PR-URL: https://github.com/nodejs/node/pull/29207 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Christopher Hiller <boneskull@boneskull.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* module: unflag conditional exportsGuy Bedford2020-01-151-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/31001 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* module: unflag resolve selfGuy Bedford2020-01-021-1/+0
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/31002 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* src: port --bash-completion to C++Joyee Cheung2019-12-251-0/+2
| | | | | | | | | | | | | | | | | So that it gets handle earlier and faster during the bootstrap process. Drive-by fixes: - Remove `[has_eval_string]` and `[ssl_openssl_cert_store]` from the completion output - Set `kProfProcess` execution mode for `--prof-process` instead of `kPrintBashProcess` which is removed in this patch. - Append new line to the end of the output of --bash-completion PR-URL: https://github.com/nodejs/node/pull/25901 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: make --use-largepages a runtime optionGabriel Schulhof2019-12-221-0/+1
| | | | | | | | | | | | | | | | | Moves the option that instructs Node.js to-remap its static code to large pages from a configure-time option to a runtime option. This should make it easy to assess the performance impact of such a change without having to custom-build. PR-URL: https://github.com/nodejs/node/pull/30954 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: David Carlier <devnexen@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: Denys Otrishko <shishugi@gmail.com> Co-authored-by: David Carlier <devnexen@gmail.com>
* cli: add --trace-exit cli optionlegendecas2019-12-161-0/+1
| | | | | | | | | | It could be convenient to trace abnormal exit of the Node.js processes that printing stacktrace on each `process.exit` call with a cli option. This also takes effects on worker threads. PR-URL: https://github.com/nodejs/node/pull/30516 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: make debug_options getters publicShelley Vohr2019-12-141-2/+3
| | | | | | | | | | | | This simplifies requires for those using DebugOptions, since debug_options was defined in src/node_options-inl.h and thus embedders would need to require an extra file to do what could trivially be consolidated into one. PR-URL: https://github.com/nodejs/node/pull/30494 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com>
* http: llhttp opt-in insecure HTTP header parsingSam Roberts2019-12-091-0/+2
| | | | | | | | | | | | | | | Allow insecure HTTP header parsing. Make clear it is insecure. See: - https://github.com/nodejs/node/pull/30553 - https://github.com/nodejs/node/issues/27711#issuecomment-556265881 - https://github.com/nodejs/node/issues/30515 PR-URL: https://github.com/nodejs/node/pull/30567 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* esm: make specifier flag clearly experimentalMyles Borins2019-12-041-0/+1
| | | | | | | | | | | | | | | `--es-module-specifier-resolution` is the only flagged portion of the ESM implementation that does not have the word experimental in the flag name. This commit changes the flag to: `--experimental-specifier-resolution` `--es-module-specifier-resolution` remains as an alias for backwards compatibility but it is no longer documented. PR-URL: https://github.com/nodejs/node/pull/30678 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
* http: make maximum header size configurable per-stream or per-serverAnna Henningsen2019-12-011-1/+1
| | | | | | | | | | | | | | | Make `maxHeaderSize` a.k.a. `--max-header-size` configurable now that the legacy parser is gone (which only supported a single global value). Refs: https://github.com/nodejs/node/pull/30567 PR-URL: https://github.com/nodejs/node/pull/30570 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* wasi: introduce initial WASI supportcjihrig2019-11-301-0/+1
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: Gus Caplan <me@gus.host> Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com> Co-authored-by: Jiawen Geng <technicalcute@gmail.com> Co-authored-by: Tobias Nießen <tniessen@tnie.de> Co-authored-by: Chengzhong Wu <legendecas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/30258 Refs: https://github.com/nodejs/node/pull/27850 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* tls: cli option to enable TLS key logging to fileSam Roberts2019-11-201-0/+1
| | | | | | | | | | | | | | | | | | Debugging HTTPS or TLS connections from a Node.js app with (for example) Wireshark is unreasonably difficult without the ability to get the TLS key log. In theory, the application can be modified to use the `'keylog'` event directly, but for complex apps, or apps that define there own HTTPS Agent (like npm), this is unreasonably difficult. Use of the option triggers a warning to be emitted so the user is clearly notified of what is happening and its effect. PR-URL: https://github.com/nodejs/node/pull/30055 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: expose ability to set optionsShelley Vohr2019-11-181-5/+0
| | | | | | | | 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>
* esm: unflag --experimental-modulesGuy Bedford2019-11-121-1/+0
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29866 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* module: conditional exports with flagged conditionsGuy Bedford2019-11-081-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29978 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* module: resolve self-referencesJan Krems2019-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Adds the ability to `import` or `require` a package from within its own source code. This allows tests and examples to be written using the package name, making them easier to reuse by consumers of the package. Assuming the `name` field in `package.json` is set to `my-pkg`, its test could use `require('my-pkg')` or `import 'my-pkg'` even if there's no `node_modules/my-pkg` while testing the package itself. An important difference between this and relative specifiers like `require('../')` is that self-references use the public interface of the package as defined in the `exports` field while relative specifiers don't. This behavior is guarded by a new experimental flag (`--experimental-resolve-self`). PR-URL: https://github.com/nodejs/node/pull/29327 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* cli: add --trace-uncaught flagAnna Henningsen2019-10-221-0/+1
| | | | | | | | | | | | | | Add a flag that makes Node.js print the stack trace at the time of *throwing* uncaught exceptions, rather than at the creation of the `Error` object, if there is any. This is disabled by default because it affects GC behavior. PR-URL: https://github.com/nodejs/node/pull/30025 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* esm: unflag --experimental-exportsGuy Bedford2019-10-101-1/+0
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29867 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* Revert "esm: remove experimental status from JSON modules"Guy Bedford2019-10-081-0/+1
| | | | | | | | This reverts commit ec8776da6fa77628e12718bb38cee687303d4137. PR-URL: https://github.com/nodejs/node/pull/29754 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
* dgram: use `uv_udp_try_send()`Anna Henningsen2019-10-051-0/+1
| | | | | | | | | | | | | | | | | | | This improves dgram performance by avoiding unnecessary async operations. One issue with this commit is that it seems hard to actually create conditions under which the fallback path to the async case is actually taken, for all supported OS, so an internal CLI option is used for testing that path. Another caveat is that the lack of an async operation means that there are slight timing differences (essentially `nextTick()` rather than `setImmediate()` for the send callback). PR-URL: https://github.com/nodejs/node/pull/29832 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* process: add source-map support to stack tracesbcoe2019-10-051-0/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/29564 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: add buildflag to force context-aware addonsShelley Vohr2019-09-241-0/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29631 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* http: remove legacy parserAnna Henningsen2019-09-201-1/+0
| | | | | | | | | | | | | | | | Remove the legacy `http_parser` implementation as a dependency and all code that uses it in favor of llhttp, given that the latter has been the default for all of Node 12 with no outstanding issues. PR-URL: https://github.com/nodejs/node/pull/29589 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* policy: add policy-integrity to mitigate policy tamperingBradley Farias2019-07-201-0/+2
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/28734 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>