New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature for token-related methods #1878

Closed
jrvidal opened this Issue Feb 26, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@jrvidal
Contributor

jrvidal commented Feb 26, 2015

The documentation about token-related methods of the context object (getTokens, etc.) seems a little bit confusing to me. They work just fine when passing a Token as argument instead of an ASTNode. However that this usage is correct is not obvious from either the docs or the JSDocs.

Should we make this behaviour explicit?

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Feb 26, 2015

Member

Yeah, all those methods actually work fine with any object that has location information. It's acceptable to pass in either a token or a node.

Member

nzakas commented Feb 26, 2015

Yeah, all those methods actually work fine with any object that has location information. It's acceptable to pass in either a token or a node.

@nzakas nzakas closed this in ba856e7 Feb 28, 2015

@btmills

This comment has been minimized.

Show comment
Hide comment
@btmills

btmills Feb 28, 2015

Member

Since ba856e7 only touches the docs, should we also update the JSDocs to use union types {(ASTNode|Token)}? I can put a PR together for that if needed.

Member

btmills commented Feb 28, 2015

Since ba856e7 only touches the docs, should we also update the JSDocs to use union types {(ASTNode|Token)}? I can put a PR together for that if needed.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Feb 28, 2015

Member

Sure!

Member

nzakas commented Feb 28, 2015

Sure!

btmills added a commit that referenced this issue Feb 28, 2015

nzakas added a commit that referenced this issue Feb 28, 2015

Merge pull request #1907 from eslint/issue1878
Docs: Use union types in TokenStore JSDoc (refs #1878)

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

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