Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit b5f2e28

Browse files
committed
fix: do not output private properties.
Previously we were checking the visibility of the property type, but the correct check uses the jsdoc of the property itself.
1 parent 0fde1ce commit b5f2e28

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/java/com/google/javascript/cl2dts/DeclarationGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ private void visitProperties(ObjectType objType, boolean isStatic, Set<String> s
860860
String qualifiedName = objType.getDisplayName() + "." + propName;
861861
if (provides.contains(qualifiedName)) {
862862
continue;
863-
} else if (isPrivate(propertyType.getJSDocInfo())) {
863+
} else if (isPrivate(objType.getOwnPropertyJSDocInfo(propName))) {
864864
continue;
865865
} else if (propertyType.isEnumType()) {
866866
// For now, we don't emit static enum properties. We theorize it should not be needed.

src/test/java/com/google/javascript/cl2dts/provide_single_class.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ foo.bar.Baz = function() {
1212
// concerned `avalue` lives on the prototype object.
1313
/** @type {string} */
1414
this.avalue = 0;
15+
/** @private {number} */
16+
this.hideMe_ = 0;
1517
};
1618

1719
/**

0 commit comments

Comments
 (0)