-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Symbol JSON.stringify returns immediately without calling replacer fn when target is undefined #345
Comments
Hi @zloirock, do you think you can have a look on this issue? Is there any reason why the Symbol polyfill was implemented in that way so that the replacer function is not called? |
Thanks for the report, sorry for the delay. |
Fixed in |
When I use
triggered by a call to The tests are passing properly with |
@romeovs could you provide your input data? Something like that is possible with incorrect |
@zloirock Thanks for your responsiveness! |
@romgar fixed in |
I confirm that it fixed it! |
Hi, first of all thanks for this nice library, it is really handy for those struggling with cross-browser compatible apps or better said IE-proof apps :p
I recently stumbled upon an issue though. It took me a bit of time to troubleshoot but here it is:
I have an app in angularjs and it uses the latest
angular-ui-router
. Then, in this router library there is this line of code that tries to get an stringified object passing a replacer function to ultimately log something to the console.The problem pops up in IE11, when the core-js Symbol polyfill is used; which means that also the
JSON.stringify()
method is wrapped to work correctly with Symbols.At some point, the routing library will call the JSON.stringify method passing
undefined
and a replacer function, and then, the wrapped JSON.stringify() function simply returns without doing anything nor even calling the replacer function.This behaviour seems totally different in the native implementation of compliant browsers like Chrome and Firefox where the replacer function is called even if the target is undefined.
Do you think this could be refactored so that the replacer function is called?
The text was updated successfully, but these errors were encountered: