★ wanayoo — archive 1999 https://github.com/nodejs/node/pull/24079Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused catch bindings #24079

Merged
merged 12 commits into from Nov 6, 2018

Conversation

Projects
None yet
8 participants
@cjihrig
Copy link
Contributor

cjihrig commented Nov 4, 2018

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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
@sam-github
Copy link
Member

sam-github left a comment

It would also be handy to have eslint check for unused catch bindings, so they don't creep back into the code.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

cjihrig commented Nov 4, 2018

@sam-github enabled linting for unused catch bindings. Good idea.

@refack

This comment has been minimized.

Copy link
Member

refack commented Nov 4, 2018

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 🤞 )?

It would also be handy to have eslint check for unused catch bindings, so they don't creep back into the code.

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).

@bmeurer

This comment has been minimized.

Copy link
Member

bmeurer commented Nov 4, 2018

@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.

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

cjihrig commented Nov 6, 2018

@geek

geek approved these changes Nov 6, 2018

cjihrig added some commits Nov 4, 2018

fs: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
assert: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
events: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
bootstrap: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
esm: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
inspector: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
v8_prof_polyfill: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
querystring: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
repl: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
test: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
benchmark: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
tools: lint for unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

@cjihrig cjihrig force-pushed the cjihrig:catch branch from 540b3cd to 5e6193f Nov 6, 2018

@cjihrig cjihrig merged commit 5e6193f into nodejs:master Nov 6, 2018

@cjihrig cjihrig deleted the cjihrig:catch branch Nov 6, 2018

@Jimbly

This comment has been minimized.

Copy link
Contributor

Jimbly commented Nov 6, 2018

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)

targos added a commit that referenced this pull request Nov 6, 2018

fs: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

targos added a commit that referenced this pull request Nov 6, 2018

assert: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>
@codebytere

This comment has been minimized.

Copy link
Member

codebytere commented Nov 29, 2018

@cjihrig i see don't-lands for v6.x and v8.x; should this also not be backported to v10.x?

@cjihrig

This comment has been minimized.

Copy link
Contributor Author

cjihrig commented Nov 29, 2018

I believe optional catch bindings are supported in Node 10, so it can be backported.

codebytere added a commit that referenced this pull request Nov 29, 2018

fs: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

assert: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

events: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

bootstrap: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

esm: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

inspector: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

v8_prof_polyfill: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

querystring: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

repl: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

test: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

benchmark: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

tools: lint for unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

codebytere added a commit that referenced this pull request Nov 29, 2018

tools: lint for unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

fs: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

assert: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

events: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

bootstrap: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

esm: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

inspector: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

v8_prof_polyfill: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

querystring: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

repl: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

test: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

benchmark: remove unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

MylesBorins added a commit that referenced this pull request Dec 3, 2018

tools: lint for unused catch bindings
PR-URL: #24079
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Wyatt Preul <wpreul@gmail.com>

@codebytere codebytere referenced this pull request Dec 3, 2018

Merged

v10.14.2 proposal #24727

@ZYSzys ZYSzys referenced this pull request Dec 18, 2018

Merged

chore: remove unused catch bindings #16121

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.