-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
[Robustness] stringify
: avoid relying on a global undefined
#427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not needless at all. undefined
can be redefined in every scope except the global scope in ES5, and in ES3 - which this package supports - it can be modified in the global scope otherwise.
Yes, but there are many places with same check. For example https://github.com/ljharb/qs/blob/master/lib/stringify.js#L155 or https://github.com/ljharb/qs/blob/master/lib/stringify.js#L195 |
In that case, those should be changed to use typeof instead :-) want to update the PR to do that? |
@ljharb |
852cab8
to
de140f3
Compare
@ljharb updated. |
Definitely the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Almost there.
stringify
: avoid relying on a global undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
5c1223e
to
0a1d3e8
Compare
Codecov Report
@@ Coverage Diff @@
## master #427 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 8 8
Lines 1408 1408
Branches 172 172
=======================================
Hits 1406 1406
Misses 2 2
Continue to review full report at Codecov.
|
I just removed needless(for these cases)
typeof
for checking for undefinedupdate: Added checking for typeof in parser.