Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Simplify PrivateName and ClassPrivateProperty types #532

Merged
merged 2 commits into from May 22, 2017
Merged

Simplify PrivateName and ClassPrivateProperty types #532

merged 2 commits into from May 22, 2017

Conversation

ghost
Copy link

@ghost ghost commented May 22, 2017

Q A
Bug fix? no
Breaking change? no
New feature? no
Deprecations? no
Spec compliancy? no
Tests added/pass? Tests pass
Fixed tickets #260 (comment)
License MIT

Simplified the type declarations for PrivateName and ClassPrivateProperty.

  • No need to mark PrivateName as PatternBase; it's not a pattern if it can't be used as a parameter.
  • No need to define __clone() on it since that's never used.
  • TypeScript doesn't support class private properties, and I'm pretty sure flow doesn't either, so no need to add ts/flow specific node declarations to ClassPrivateProperty just yet.

Just a thought: You might also consider using ClassProperty with a PrivateName key instead of creating a new node kind for that.

CC @diervo as #260 was just merged today.

@ghost
Copy link
Author

ghost commented May 22, 2017

Actually, ClassPrivateProperty probably doesn't need ClassMemberBase either unless it can be static or have decorators.

@hzoo
Copy link
Member

hzoo commented May 22, 2017

Yeah Diego wanted it merged + transform before the TC39 meeting this week (Tuesday 😅 ) haha. Yeah maybe we should just remove any unnecessary types then given it's not supported anyway.

Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

looks fine

@codecov
Copy link

codecov bot commented May 22, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@01da622). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #532   +/-   ##
=========================================
  Coverage          ?   98.18%           
=========================================
  Files             ?       22           
  Lines             ?     3572           
  Branches          ?      992           
=========================================
  Hits              ?     3507           
  Misses            ?       24           
  Partials          ?       41
Flag Coverage Δ
#babel 80.34% <ø> (?)
#babylon 96.94% <ø> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01da622...2b90e6a. Read the comment docs.

@hzoo
Copy link
Member

hzoo commented May 22, 2017

Although there is https://github.com/erights/Orthogonal-Classes but we can also just that stuff when we get to it (static, etc)

context: seems like they wanted to merge private, public class properties + ^ proposal

@hzoo hzoo merged commit 2541ab5 into babel:master May 22, 2017
@ghost ghost deleted the PrivateName branch May 22, 2017 17:43
@diervo
Copy link
Contributor

diervo commented May 22, 2017

Orthogonal classes have a lot of open questions and is not likely to be advancing any time soon.
Now regarding public and private fields, let's not worry about naming or final semantics until both proposals move forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants