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

incorrect check for arg undefined #26

Closed
lmccart opened this issue Aug 14, 2013 · 6 comments
Closed

incorrect check for arg undefined #26

lmccart opened this issue Aug 14, 2013 · 6 comments

Comments

@lmccart
Copy link
Member

lmccart commented Aug 14, 2013

needs to be

if (typeof variable === 'undefined')

@ghost ghost assigned evhan55 Aug 19, 2013
@evhan55
Copy link
Contributor

evhan55 commented Aug 22, 2013

@lmccart

I looked through the file for 'undefined' and found places where you are already doing the check that way. Are there other instances I should be looking for?

@lmccart
Copy link
Member Author

lmccart commented Aug 22, 2013

@evhan55 there are a few places I'm doing it correctly (using typeof) but there are a lot of overloaded fxns where I'm distinguishing between types by checking if the last args exist. for example:

https://github.com/lmccart/processing-js/blob/master/lib/pjs.js#L1016

should remove check if (x) and replace with if (typeof x === 'undefined'), etc.

@evhan55
Copy link
Contributor

evhan55 commented Aug 22, 2013

@lmccart cool, I see now, ok I will look for them

Bocoup training also suggests treating method overloads with this check:

if(arguments.length === 0) { then do this thing }
etc.
but I will keep typeof !== 'undefined' for now

@lmccart
Copy link
Member Author

lmccart commented Aug 22, 2013

@evhan55 oh that's a good point... go with that instead if you think it's better!

@evhan55
Copy link
Contributor

evhan55 commented Aug 22, 2013

@lmccart I'll stick with typeof for now and we can see later!

@evhan55
Copy link
Contributor

evhan55 commented Aug 22, 2013

closing for now and opening a new one about typeof vs. arguments

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

No branches or pull requests

2 participants