mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
6946812191
Modernize: * Replace `var` with `const` / `let`. * Replace common functions with arrow functions. * Use destructuring. * Use `String.prototype.padStart()`, `String.prototype.endsWith()`. Optimize: * Reduce function calls. * Reduce intermediate variables. * Cache retrieved object properties. * Move RegExp declaration out of a cycle. * Simplify RegExps. * Replace RegExp with string when string suffices. * Remove conditions that cannot be false. * Replace for..in with `Object.keys().forEach()`. Also, eliminate needlessly complicated function chains: * `ondone` callback only checks errors; * if there is an error, it is called once and throws, then script exits; * if there are no errors, it is noop; * so there is no need to wrap it into `once()` function * and there is no need to call it without errors; * we can eliminate it and replace with `throw` where an error occurs; * we can also replace `onprogress` callback with `console.log` in place; * at last, we can eliminate `waiting` counter and `once()` utility. The new script produces results identical to the old ones. PR-URL: https://github.com/nodejs/node/pull/20188 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> |
||
---|---|---|
.. | ||
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 |