Joyee Cheung
052e095c6b
vm: use internal versions of compileFunction and Script
...
Instead of using the public versions of the vm APIs internally,
use the internal versions so that we can skip unnecessary
argument validation.
The public versions would need special care to the generation
of host-defined options to hit the isolate compilation cache
when imporModuleDynamically isn't used, while internally it's
almost always used, so this allows us to handle the host-defined
options separately.
PR-URL: https://github.com/nodejs/node/pull/50137
Backport-PR-URL: https://github.com/nodejs/node/pull/51004
Refs: https://github.com/nodejs/node/issues/35375
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-03-15 17:56:06 +00:00
Antoine du Hamel
92734d4480
esm: use import attributes instead of import assertions
...
The old import assertions proposal has been
renamed to "import attributes" with the follwing major changes:
1. The keyword is now `with` instead of `assert`.
2. Unknown assertions cause an error rather than being ignored,
This commit updates the documentation to encourage folks to use the new
syntax, and add aliases for module customization hooks.
PR-URL: https://github.com/nodejs/node/pull/50140
Backport-PR-URL: https://github.com/nodejs/node/pull/50669
Fixes: https://github.com/nodejs/node/issues/50134
Refs: https://github.com/v8/v8/commit/159c82c5e6392e78b9bba7161b1bed6e23758984
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-11-23 10:52:48 +01:00
Hemanth HM
bbafd42d75
repl: display dynamic import variant in static import error messages
...
Enhance the REPL message for static import error message.
```
> import {foo, bar} from 'moo';
import {foo, bar} from 'moo';
^^^^^^
Uncaught:
SyntaxError: .* dynamic import: const {foo,bar} = await import('moo');
```
PR-URL: https://github.com/nodejs/node/pull/48129
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-11-10 16:21:46 +01:00
Chengzhong Wu
d35f8702c9
src: bootstrap prepare stack trace callback in shadow realm
...
Bootstrap per-realm callbacks like `prepare_stack_trace_callback` in
the ShadowRealm. This enables stack trace decoration in the ShadowRealm.
PR-URL: https://github.com/nodejs/node/pull/47107
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-11-10 14:21:05 +01:00
Joyee Cheung
a3b0f4cf55
module: move modules/cjs/helpers.js to modules/helpers.js
...
The helpers are actually shared by the two loaders, so move them
under modules/ directly.
PR-URL: https://github.com/nodejs/node/pull/45849
Backport-PR-URL: https://github.com/nodejs/node/pull/46425
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2023-11-10 09:49:20 +01:00
Moshe Atlow
c46b31f3bf
lib: support FORCE_COLOR for non TTY streams
...
PR-URL: https://github.com/nodejs/node/pull/48034
Backport-PR-URL: https://github.com/nodejs/node/pull/48684
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-07-11 22:02:04 -04:00
Xuguang Mei
e668efac6b
repl: preserve preview on ESCAPE key press
...
Fix : #46876
PR-URL: https://github.com/nodejs/node/pull/46878
Fixes: https://github.com/nodejs/node/issues/46876
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2023-07-06 11:09:26 -04:00
Antoine du Hamel
91fbad617d
repl: add trailing commas in source files
...
PR-URL: https://github.com/nodejs/node/pull/46757
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com >
Reviewed-By: Qingyu Deng <i@ayase-lab.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2023-04-05 12:52:25 -04:00
Antoine du Hamel
36e080cd13
lib: enforce use of trailing commas for functions
...
PR-URL: https://github.com/nodejs/node/pull/46629
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-04-03 07:43:55 -04:00
Antoine du Hamel
1e32520f72
tools: add ArrayPrototypeConcat to the list of primordials to avoid
...
PR-URL: https://github.com/nodejs/node/pull/44445
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-01-24 16:38:14 -05:00
Antoine du Hamel
784ed594ea
repl: improve robustness wrt to prototype pollution
...
PR-URL: https://github.com/nodejs/node/pull/45604
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-01-24 16:14:37 -05:00
Daeyeon Jeong
90e8418e58
src,lib: group properties used as constants from util binding
...
Properties used as constants in `util` internal binding are
scattered. This suggests using an object holding all of them
for better maintenance.
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/45539
Backport-PR-URL: https://github.com/nodejs/node/pull/45674
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2023-01-03 08:39:17 -05:00
Joyee Cheung
ab73cc8706
src: disambiguate terms used to refer to builtins and addons
...
The term "native module" dates back to some of the oldest code
in the code base. Within the context of Node.js core it usually
refers to modules that are native to Node.js (e.g. fs, http),
but it can cause confusion for people who don't work on this
part of the code base, as "native module" can also refer to
native addons - which is even the case in some of the API
docs and error messages.
This patch tries to make the usage of these terms more consistent.
Now within the context of Node.js core:
- JavaScript scripts that are built-in to Node.js are now referred
to as "built-in(s)". If they are available as modules,
they can also be referred to as "built-in module(s)".
- Dynamically-linked shared objects that are loaded into
the Node.js processes are referred to as "addons".
We will try to avoid using the term "native modules" because it could
be ambiguous.
Changes in this patch:
File names:
- node_native_module.h -> node_builtins.h,
- node_native_module.cc -> node_builtins.cc
C++ binding names:
- `native_module` -> `builtins`
`node::Environment`:
- `native_modules_without_cache` -> `builtins_without_cache`
- `native_modules_with_cache` -> `builtins_with_cache`
- `native_modules_in_snapshot` -> `builtins_in_cache`
- `native_module_require` -> `builtin_module_require`
`node::EnvSerializeInfo`:
- `native_modules` -> `builtins
`node::native_module::NativeModuleLoader`:
- `native_module` namespace -> `builtins` namespace
- `NativeModuleLoader` -> `BuiltinLoader`
- `NativeModuleRecordMap` -> `BuiltinSourceMap`
- `NativeModuleCacheMap` -> `BuiltinCodeCacheMap`
- `ModuleIds` -> `BuiltinIds`
- `ModuleCategories` -> `BuiltinCategories`
- `LoadBuiltinModuleSource` -> `LoadBuiltinSource`
`loader.js`:
- `NativeModule` -> `BuiltinModule` (the `NativeModule` name used in
`process.moduleLoadList` is kept for compatibility)
And other clarifications in the documentation and comments.
PR-URL: https://github.com/nodejs/node/pull/44135
Fixes: https://github.com/nodejs/node/issues/44036
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
2022-08-22 22:39:24 -04:00
Tobias Nießen
aba9c8ebea
repl: fix overzealous top-level await
...
Fixes: https://github.com/nodejs/node/issues/43777
PR-URL: https://github.com/nodejs/node/pull/43827
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2022-07-25 21:43:37 -04:00
Antoine du Hamel
1deb6b73b7
repl: use SafePromiseAll and SafePromiseRace
...
PR-URL: https://github.com/nodejs/node/pull/43758
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2022-07-25 21:43:30 -04:00
Antoine du Hamel
b9198d977f
lib: refactor to avoid unsafe regex primordials
...
PR-URL: https://github.com/nodejs/node/pull/43475
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2022-07-12 07:41:40 +02:00
Antoine du Hamel
ac9599a718
tools: report unsafe string and regex primordials as lint errors
...
| The string method | looks up the property |
| ----------------------------- | --------------------- |
| `String.prototype.match` | `Symbol.match` |
| `String.prototype.matchAll` | `Symbol.matchAll` |
| `String.prototype.replace` | `Symbol.replace` |
| `String.prototype.replaceAll` | `Symbol.replace` |
| `String.prototype.search` | `Symbol.search` |
| `String.prototype.split` | `Symbol.split` |
Functions that lookup the `exec` property on the prototype chain:
* `RegExp.prototype[Symbol.match]`
* `RegExp.prototype[Symbol.matchAll]`
* `RegExp.prototype[Symbol.replace]`
* `RegExp.prototype[Symbol.search]`
* `RegExp.prototype[Symbol.split]`
* `RegExp.prototype.test`
`RegExp.prototype[Symbol.replace]` and `RegExp.prototype[Symbol.split]`
are still allowed for a lack of a better solution.
PR-URL: https://github.com/nodejs/node/pull/43393
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2022-06-15 21:28:47 -04:00
Sergey Petushkov
66d956ca49
repl: make autocomplete case-insensitive
...
This changes autocomplete suggestion filter to ignore input case
allowing for more autosuggest results shown on the screen
Fixes: https://github.com/nodejs/node/issues/41631
PR-URL: https://github.com/nodejs/node/pull/41632
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-06-12 20:24:57 -04:00
Antoine du Hamel
b8644606eb
lib: use null-prototype objects for property descriptors
...
Refs: https://github.com/nodejs/node/pull/42921
PR-URL: https://github.com/nodejs/node/pull/43270
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2022-06-12 19:25:41 -04:00
cjihrig
3c4ee5267a
module,repl: support 'node:'-only core modules
...
This commit makes it possible to add new core modules that can
only be require()'ed and imported when the 'node:' scheme is
used. The 'test' module is the first such module.
These 'node:'-only modules are not included in the list returned
by module.builtinModules.
PR-URL: https://github.com/nodejs/node/pull/42325
Refs: https://github.com/nodejs/node/issues/40954
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-03-21 22:21:09 +00:00
meixg
dc28d6315d
repl: remove preview when press escape
...
Fix: https://github.com/nodejs/node/issues/42040
PR-URL: https://github.com/nodejs/node/pull/42053
Fixes: https://github.com/nodejs/node/issues/42040
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2022-02-22 17:30:02 -08:00
ceadb473e6
esm: support https remotely and http locally under flag
...
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com >
Co-authored-by: James M Snell <jasnell@gmail.com >
Co-authored-by: Jordan Harband <ljharb@gmail.com >
Co-authored-by: James Sumners <james@sumners.email >
PR-URL: https://github.com/nodejs/node/pull/36328
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2022-02-09 19:47:12 -08:00
Xuguang Mei
52b1904a0d
repl: #41690 REPL gives wrong autocomplete on literals
...
Fixes: https://github.com/nodejs/node/issues/41690
PR-URL: https://github.com/nodejs/node/pull/41883
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Mestery <mestery@protonmail.com >
2022-02-10 00:36:23 +00:00
Rich Trott
78a2cd8624
lib: add comments to empty catch statements
...
PR-URL: https://github.com/nodejs/node/pull/41831
Refs: https://eslint.org/docs/rules/no-empty
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2022-02-05 12:58:30 +00:00
Rich Trott
348469b87a
repl: check for precise values rather than falsy in loops
...
This prepares the code for the no-cond-assign ESLint rule.
PR-URL: https://github.com/nodejs/node/pull/41614
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2022-01-22 19:38:15 -08:00
Mestery
af283458ad
repl: fix and extend require/import tab complete
...
PR-URL: https://github.com/nodejs/node/pull/40216
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-11-25 00:01:30 +00:00
Antoine du Hamel and Geoffrey Booth
2cc7a91a5d
esm: add support for JSON import assertion
...
Remove V8 flag for import assertions, enabling support for the syntax;
require the import assertion syntax for imports of JSON.
Support import assertions in user loaders.
Use both resolved module URL and import assertion type as the key for
caching modules.
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com >
PR-URL: https://github.com/nodejs/node/pull/40250
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2021-11-03 20:06:55 -07:00
Jacob
df22736d80
esm: consolidate ESM loader hooks
...
doc: update ESM hook examples
esm: fix unsafe primordial
doc: fix ESM example linting
esm: allow source of type ArrayBuffer
doc: update ESM hook changelog to include resolve format
esm: allow all ArrayBuffers and TypedArrays for load hook source
doc: tidy code & API docs
doc: convert ESM source table header from Title Case to Sentence case
doc: add detailed explanation for getPackageType
esm: add caveat that ESMLoader::import() must NOT be renamed
esm: tidy code declaration of getFormat protocolHandlers
doc: correct ESM doc link (bad conflict resolution)
doc: update ESM hook limitation for CJS
esm: tweak preload description
doc: update ESM getPackageType() example explanation
PR-URL: https://github.com/nodejs/node/pull/37468
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com >
2021-09-11 18:08:35 -07:00
XadillaX
c7222b3589
lib,repl: ignore non-canBeRequiredByUsers built-in
...
e.g. `wasi` under no `--experimental-wasi-unstable-preview1` flag
shouldn't be pre-required.
PR-URL: https://github.com/nodejs/node/pull/39942
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
2021-09-07 10:51:56 +08:00
Anna Henningsen
ba7368a1a9
repl: do not include legacy getter/setter methods in completion
...
For every object that inherits from `Object.prototype`, the REPL
includes the `Object.prototype` methods in its autocompletion.
This is already a little noisy, but in particular, this also
includes the legacy `__defineGetter__` family of methods;
since those are deprecated and not in practical use anymore,
it helps reduce noise a bit to remove them.
This commit does not remove `__proto__` as it is a little
more popular and, despite its downsides, a slightly more convenient
way to access the prototype of an object in the REPL than
`Object.getPrototypeOf(...)`.
PR-URL: https://github.com/nodejs/node/pull/39576
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2021-08-01 16:43:46 +02:00
hemanth.hm
14b26e07bd
repl: enable --experimental-repl-await /w opt-out
...
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 >
2021-07-16 15:14:26 -07:00
ejose19
8879993079
repl: processTopLevelAwait fallback error handling
...
PR-URL: https://github.com/nodejs/node/pull/39290
Reviewed-By: Guy Bedford <guybedford@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-07-08 11:13:55 -07:00
Guy Bedford
8189dcc52a
repl: ensure correct syntax err for await parsing
...
PR-URL: https://github.com/nodejs/node/pull/39154
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-07-02 15:52:11 -07:00
Antoine du Hamel
0996eb71ed
repl: fix Ctrl+C on top level await
...
PR-URL: https://github.com/nodejs/node/pull/38656
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2021-05-15 21:47:55 +02:00
Anna Henningsen
9f5977a74d
repl: display prompt once after error callback
...
Do not call `.displayPrompt()` twice after the `eval` callback
resulted in an error.
(This does not affect the default eval because it doesn’t use
the callback if an error occurs.)
PR-URL: https://github.com/nodejs/node/pull/38314
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2021-04-22 16:39:41 +02:00
Antoine du Hamel
d756d2b99c
lib: enforce using primordials.globalThis instead of global
...
PR-URL: https://github.com/nodejs/node/pull/38230
Reviewed-By: James M Snell <jasnell@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: Luigi Pinca <luigipinca@gmail.com >
2021-04-17 15:30:58 +02:00
Antoine du Hamel
09c9e5dea4
lib: avoid mutating Error.stackTraceLimit when it is not writable
...
PR-URL: https://github.com/nodejs/node/pull/38215
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2021-04-15 00:17:16 +02:00
Anna Henningsen
e7391967c2
repl: fix error message printing
...
The REPL implementation would strip away the first and last character
of a formatted error message if it ended with `]` (but with the
obviously missing check for a starting `]`), leading to things like
`Uncaught rror: foo[a` being printed for input like `Error: foo[a]`.
Refs: https://github.com/nodejs/node/pull/22436
PR-URL: https://github.com/nodejs/node/pull/38209
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2021-04-13 09:48:06 -07:00
ExE Boss
95391fe689
repl: add auto‑completion for node:‑prefixed require(…) calls
...
Refs: https://github.com/nodejs/node/pull/37178
PR-URL: https://github.com/nodejs/node/pull/37246
Reviewed-By: Bradley Farias <bradley.meck@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2021-03-19 12:35:03 +01:00
Antoine du Hamel
f34d8de65a
lib: remove use of array destructuring
...
PR-URL: https://github.com/nodejs/node/pull/36818
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-03-03 19:53:24 +01:00
Rich Trott
b461a1b125
doc,lib: prepare for stricter multi-line array linting
...
We're about to turn on a requirement for dangling commas.
PR-URL: https://github.com/nodejs/node/pull/37088
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2021-02-19 09:55:35 -08:00
Antoine du Hamel
708f049471
repl: refactor to avoid unsafe array iteration
...
PR-URL: https://github.com/nodejs/node/pull/37345
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-02-15 23:06:35 +01:00
ExE Boss and Antoine du Hamel
3aba6fef07
repl: add auto‑completion for dynamic import calls
...
Refs: https://github.com/nodejs/node/issues/33238
Refs: https://github.com/nodejs/node/pull/33282
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/37178
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-02-06 05:12:59 -08:00
Antoine du Hamel
703e566aa1
repl: refactor to avoid unsafe array iteration
...
PR-URL: https://github.com/nodejs/node/pull/37188
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2021-02-05 00:16:36 +01:00
ExE Boss and Antoine du Hamel
728fee22e9
lib: add bound apply variants of varargs primordials
...
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/37005
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2021-01-28 18:45:43 +01:00
029d1fd797
lib: refactor to use validateObject
...
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com >
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/37028
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-01-28 12:53:50 +01:00
ZiJian Liu
064a7070c7
lib: refactor to use validateFunction
...
add validateFunction and refactor to use validateFunction
PR-URL: https://github.com/nodejs/node/pull/37045
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-01-27 20:46:54 +02:00
raisinten
9a18bf2f8c
repl: refactor to avoid unsafe array iteration
...
PR-URL: https://github.com/nodejs/node/pull/36663
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2021-01-18 13:29:43 -08:00
Anna Henningsen
82dd23f5ec
repl: disable blocking completions by default
...
It’s not okay for the REPL to be blocked for multiple seconds after
entering `require('` because the completion is performing blocking
fs operations on potentially huge directories. Turning the REPL
completion function asynchronous would be the right thing to do here,
but unfortunately the way the code is structured doesn’t play well
with that (in particular, it breaks the preview feature).
Therefore, disable these blocking calls by default.
Refs: https://github.com/nodejs/node/pull/33282#issuecomment-733646794
PR-URL: https://github.com/nodejs/node/pull/36564
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2020-12-21 12:52:02 +01:00
Antoine du Hamel
825029ec59
repl: refactor to use more primordials
...
PR-URL: https://github.com/nodejs/node/pull/36264
Reviewed-By: Rich Trott <rtrott@gmail.com >
2020-12-02 20:22:03 +00:00