Skip to content
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

Warn when functions intended as constructors are called without new #2021

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

charmander
Copy link
Collaborator

in preparation for #1541. eval is a bit awkward, but it’s more accurate than an instanceof check and will work on platforms new enough to support pg 8 (i.e. only not Node 4).

@charmander charmander added this to the [email protected] milestone Dec 6, 2019
@charmander

This comment has been minimized.

in preparation for brianc#1541. `eval` is a bit awkward, but it’s more accurate than an `instanceof` check and will work on platforms new enough to support pg 8 (i.e. only not Node 4).
@charmander charmander force-pushed the class-warning branch 2 times, most recently from dbe46c7 to deebe7d Compare December 6, 2019 16:46
@charmander charmander changed the title Warn when pg.Pool() isn’t called as a constructor Warn when functions intended as constructors are called without new Dec 6, 2019
@charmander
Copy link
Collaborator Author

charmander commented Dec 6, 2019

Confirmed that BoundPool and Query are the only two constructor-like functions that can work without new right now.

@brianc
Copy link
Owner

brianc commented Dec 12, 2019

great! You want me to merge this before 8.0 right?

@charmander
Copy link
Collaborator Author

@brianc Yep! Thanks for looking at it.

@brianc
Copy link
Owner

brianc commented Dec 17, 2019

totes! Okay gonna merge this & then work on the monorepo over the christmas break. I really want to ship 8.0 in January and start cranking on this again - the end of the year has been non-stop travel and crunch mode at work so looking forward to some FOSS gardening time.

@brianc brianc merged commit 2b59209 into brianc:master Dec 17, 2019
@charmander charmander deleted the class-warning branch December 18, 2019 02:17
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