Skip to content

Commit

Permalink
[wip] Attempt to surface ClassPrivateMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Ricard committed Jun 22, 2018
1 parent 99feb31 commit 181e814
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/babel-plugin-proposal-class-properties/src/index.js
Expand Up @@ -71,7 +71,9 @@ export default declare((api, options) => {
const body = path.get("body.body");

for (const prop of body) {
if (!prop.isClassPrivateProperty()) continue;
if (!prop.isClassPrivateProperty() && !prop.isClassPrivateMethod()) {
continue;
}
if (prop.node.key.id.name !== name) continue;

// This class redeclares the private name.
Expand Down Expand Up @@ -368,7 +370,7 @@ export default declare((api, options) => {
);
}

if (path.isClassPrivateProperty()) {
if (path.isClassPrivateProperty() || path.isClassPrivateMethod()) {
const { static: isStatic, key: { id: { name } } } = path.node;

if (isStatic) {
Expand Down
1 change: 1 addition & 0 deletions packages/babel-types/src/definitions/es2015.js
Expand Up @@ -89,6 +89,7 @@ defineType("ClassBody", {
"ClassMethod",
"ClassProperty",
"ClassPrivateProperty",
"ClassPrivateMethod",
"TSDeclareMethod",
"TSIndexSignature",
),
Expand Down

0 comments on commit 181e814

Please sign in to comment.