File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -756,7 +756,7 @@ func (b *Bindings) CommentGojaObject(comments []SyntheticComment, object *goja.O
756756 sep := ""
757757 for _ , cmt := range jsDoc {
758758 jsDocComment .WriteString (sep )
759- jsDocComment .WriteString (cmt .Text )
759+ jsDocComment .WriteString (convertDeprecation ( cmt .Text ) )
760760 sep = "\n *"
761761 }
762762 jsDocComment .WriteString ("\n " )
@@ -790,3 +790,11 @@ func (b *Bindings) CommentGojaObject(comments []SyntheticComment, object *goja.O
790790
791791 return node , nil
792792}
793+
794+ func convertDeprecation (txt string ) string {
795+ if len (txt ) > 13 && txt [:13 ] == " Deprecated: " {
796+ return " @deprecated " + txt [13 :]
797+ }
798+
799+ return txt
800+ }
Original file line number Diff line number Diff line change @@ -41,3 +41,9 @@ type BlockComment struct {
4141
4242// Constant is just a value
4343const Constant = "value" // An inline note
44+
45+ // DeprecatedComment is a comment with a deprecation note
46+ //
47+ // Deprecated: this type is no longer used
48+ type DeprecatedComment struct {
49+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ export interface CommentedStructure {
4343export const Constant = "value" ; // An inline note
4444
4545
46+ // From comments/comments.go
47+ /**
48+ * DeprecatedComment is a comment with a deprecation note
49+ *
50+ * @deprecated this type is no longer used
51+ */
52+ export interface DeprecatedComment {
53+ }
54+
4655// From comments/comments.go
4756export interface InheritedCommentedStructure extends CommentedStructure {
4857}
You can’t perform that action at this time.
0 commit comments