Skip to content

Add how to extend the constructor and prototype#1

Open
ailijic wants to merge 1 commit intomasterfrom
class-annotation-doc-cmwt
Open

Add how to extend the constructor and prototype#1
ailijic wants to merge 1 commit intomasterfrom
class-annotation-doc-cmwt

Conversation

@ailijic
Copy link
Copy Markdown
Owner

@ailijic ailijic commented Aug 25, 2017

Addressing issue facebook#4717.
These changes make it clear how to extend the prototype and constructor of a class. Methods added in the class declaration do not need to be annotated. At this time, methods and properties defined on the constructor (static) and on the prototype need to be annotated in the class definition. This is probably a best practice since, if the class is modified in a location not local to the definition we will want the type checker to notify us.

Addressing issue facebook#4717.
These changes make it clear how to extend the prototype and constructor of a class. Methods added in the class declaration do not need to be annotated. At this time, methods and properties defined on the constructor (static) and on the prototype need to be annotated in the class definition. This is probably a best practice since, if the class is modified in a location not local to the definition we will want the type checker to notify us.
@zen0wu
Copy link
Copy Markdown

zen0wu commented Apr 15, 2018

Thanks for putting this up. But it seems that this PR merges against your local master, instead of upstream master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants