mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
9a6dd07e8d
Modernize: * Replace `var` with `const` / `let`. * Wrap `switch` cases with `const`/`let` in blocks. * Replace common functions with arrow functions. * Replace string concatenation with template literals. * Shorthand object literals. * Use destructuring and spread. Optimize: * Move RegExp declaration out of loops. * Replace `.match()` with `.test()` in boolean context. * Replace RegExp with string when string suffices. * Make RegExp more strict to reject unrelated cases. * Make RegExp do the trimming to eliminate many `.trim()` calls. * Cache retrieved object properties. * Remove conditions that cannot be false. * Remove code that seems obsolete (it means a state that cannot happen or is not typical). Clarify: * Sync code examples in comments with the actual source state. * Expand some one-letter variable names. * Rename confusingly similar variables. * Move variable declarations closer to their context. * Remove non-actual commented out code. * Unify blank lines between top-level blocks. Fix: * Fix conditions that cannot be true. Guard: * Throw on unexpected state more often. PR-URL: https://github.com/nodejs/node/pull/19832 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> |
||
---|---|---|
.. | ||
bootstrap | ||
configure.d | ||
doc | ||
eslint-rules | ||
gyp | ||
icu | ||
macos-installer | ||
msvs | ||
node_modules | ||
pkgsrc | ||
remark-cli | ||
remark-preset-lint-node | ||
rpm | ||
.eslintrc.yaml | ||
certdata.txt | ||
check_macros.py | ||
check-imports.py | ||
compress_json.py | ||
cpplint.py | ||
create_android_makefiles | ||
create_expfile.sh | ||
dcheck_macros.py | ||
genv8constants.py | ||
getmoduleversion.py | ||
getnodeversion.py | ||
gyp_node.py | ||
install.py | ||
js2c.py | ||
license2rtf.js | ||
license-builder.sh | ||
lint-js.js | ||
lsan_suppressions.txt | ||
macosx-firewall.sh | ||
make-v8.sh | ||
Makefile | ||
mk-ca-bundle.pl | ||
mkssldef.py | ||
nodcheck_macros.py | ||
osx-codesign.sh | ||
osx-pkg-postinstall.sh | ||
osx-productsign.sh | ||
release.sh | ||
run-valgrind.py | ||
sign.bat | ||
specialize_node_d.py | ||
test-npm-package.js | ||
test-v8.bat | ||
test.py | ||
update-authors.sh | ||
update-babel-eslint.sh | ||
update-eslint.sh | ||
utils.py |