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
Merged

remove unused catch bindings #24079

merged 12 commits into from
Nov 6, 2018

Conversation

cjihrig
Copy link
Contributor

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

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Nov 4, 2018
Copy link
Contributor

@sam-github sam-github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cjihrig
Copy link
Contributor Author

cjihrig commented Nov 4, 2018

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

@refack
Copy link
Contributor

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
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
Copy link
Contributor Author

cjihrig commented Nov 6, 2018

PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
PR-URL: nodejs#24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
@cjihrig cjihrig merged commit 5e6193f into nodejs:master Nov 6, 2018
@cjihrig cjihrig deleted the catch branch November 6, 2018 16:23
@Jimbly
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 pushed a commit that referenced this pull request Nov 6, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
targos pushed a commit that referenced this pull request Nov 6, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
@codebytere
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
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 pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #24079
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Wyatt Preul <[email protected]>
@codebytere codebytere mentioned this pull request Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants