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

[x] stream: properties cleanup #29046

Closed
wants to merge 4 commits into from

Conversation

ronag
Copy link
Member

@ronag ronag commented Aug 8, 2019

  • Streams are always initialized. Remove redundant checks.
  • enumerable is false by default so there is no reason to explicitly set it.
  • prefer method() {} over method: function() {}
  • move properties directly after constructor

Refs: #28967, #28991

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Aug 8, 2019
@ronag ronag force-pushed the stream-internal-state branch 5 times, most recently from 7a05bdc to 85acbaf Compare August 8, 2019 13:16
@ronag ronag changed the title stream: always initialized stream: properties clenaup Aug 8, 2019
@trivikr trivikr changed the title stream: properties clenaup stream: properties cleanup Aug 8, 2019
@lpinca
Copy link
Member

lpinca commented Aug 8, 2019

I like this but what was the reason for the state check? Did you investigate / run a git blame?

@ronag
Copy link
Member Author

ronag commented Aug 8, 2019

@lpinca: I couldn't find the reason. I asked @mcollina if he knew any reason and he was (as far as I understood) of the opinion that they are not needed.

@nodejs-github-bot
Copy link
Collaborator

@lpinca
Copy link
Member

lpinca commented Aug 8, 2019

I think it was done as a safeguard for cases where a subclass instance uses the getters/setters before calling the super constructor.

@ronag
Copy link
Member Author

ronag commented Aug 8, 2019

It’s not done very consistently though. I’m fine with adding it back. But then we should have it everywhere.

@ronag
Copy link
Member Author

ronag commented Aug 28, 2019

closing for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants