output a warning if attempting to stringify something that is dropped#1691
output a warning if attempting to stringify something that is dropped#1691AD7six wants to merge 1 commit intonodejs:masterfrom AD7six:feature/querystring-stringify-warning
Conversation
|
Not sure if that's desirable. It should either be an error (throwing) or silently ignored. Just like In this case the silent ignoring currently in place seems to make most sense so. |
|
the existing behavior is to silently drop objects and arrays - if bc isn't a concern, throwing an error is more approprioate; but silently dropping potentially big chunks of data is surely something the user should be notified about. ciirular references and functions are not really valid comparisons imo. |
|
In that case I'd propose to coerce these types into strings (value + ''). That will leave users the choice to implement toString() methods for their custom objects, while producing outputs that show what happened by default. Either way, warnings are annoying. |
|
I was just caught by this behaviour. Would it help If I send in a patch that coerce objects and arrays into a string as you suggested? |
See issue #1665 for related discussion