Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upremove unused catch bindings #24079
Conversation
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
added
the
lib / src
label
Nov 4, 2018
cjihrig
added
dont-land-on-v8.x
dont-land-on-v6.x
labels
Nov 4, 2018
sam-github
approved these changes
Nov 4, 2018
|
It would also be handy to have eslint check for unused catch bindings, so they don't creep back into the code. |
refack
added
the
refactor to ES6+
label
Nov 4, 2018
This comment has been minimized.
This comment has been minimized.
|
@sam-github enabled linting for unused catch bindings. Good idea. |
This comment has been minimized.
This comment has been minimized.
|
I'm +1 on this (both for readability, and explicit-y), but there was the "backporting" argument made in another PR. @bmeurer does not binding the unused exception object provide any performance benefit (or will in the future
I would actually suggest the opposite, lint for these and force the author explicitly comment why it's Ok (out of scope of this PR). |
This comment has been minimized.
This comment has been minimized.
|
@refack V8 doesn't need to allocate the catch context in that case, which makes the exception object available. TurboFan will probably optimize that away anyways, but for bytecode it's a nice saving. |
This comment has been minimized.
This comment has been minimized.
geek
approved these changes
Nov 6, 2018
cjihrig
added some commits
Nov 4, 2018
cjihrig
force-pushed the
cjihrig:catch
branch
from
540b3cd
to
5e6193f
Nov 6, 2018
cjihrig
merged commit 5e6193f
into
nodejs:master
Nov 6, 2018
cjihrig
deleted the
cjihrig:catch
branch
Nov 6, 2018
This comment has been minimized.
This comment has been minimized.
|
This PR appears to be crashing Travis CI on PRs since this was merged? https://travis-ci.com/nodejs/node/builds/90427486 $ make lint
make[1]: Entering directory `/home/travis/build/nodejs/node'
Running JS linter...
/home/travis/build/nodejs/node/.eslintrc.js:20
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at module.exports (/home/travis/build/nodejs/node/tools/node_modules/eslint/node_modules/require-uncached/index.js:28:9) |
yehiyam
referenced this pull request
Nov 6, 2018
Closed
test: add test for deepEqual Float32Array byte length difference #24164
targos
added a commit
that referenced
this pull request
Nov 6, 2018
targos
added a commit
that referenced
this pull request
Nov 6, 2018
This comment has been minimized.
This comment has been minimized.
|
@cjihrig i see |
This comment has been minimized.
This comment has been minimized.
|
I believe optional |
cjihrig commentedNov 4, 2018
•
edited
NOTE: I didn't update the unused bindings in the stream subsystem, as I assume that would break readable-stream.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes