globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 603 forks source link

Unsafe JSON.stringify in runtimeKey() #677

Closed ruslansavenok closed 7 years ago

ruslansavenok commented 7 years ago

Different browsers or sites with polyfills has different implementation of JSON.stringify, this causes different results for runtimeKey() between node env, which compiled code and the browser.

For example: JSON.stringify(['minute', {}]) produces: "["minute",{}]" or ""[\"minute\",{}]""

rxaviers commented 7 years ago

Hi @ruslansavenok, thanks for your input. Please, do you have additional details about your statement? I'd like to see some examples of browsers vs. different outputs. Thanks

rxaviers commented 7 years ago

Closing... We can reopen if we have additional details.