woothemes/woocommerce — pull request #5602 by getdave (2014-06-02 15:43:38+00:00)
Title: Ensure script is safe when global var not available/enqueued

`wc_address_i18n_params` is enqueued as a global JavaScript variable via `wp_localize_script()` and attached to the registered script `wc-address-i18n` [here](https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-frontend-scripts.php#L165).

However, it is only enqueued conditionally [here](https://github.com/woothemes/woocommerce/blob/master/includes/shortcodes/class-wc-shortcode-my-account.php#L147) and therefore is not always available to the JavaScript. The problem is that WooCommerce JS files assume that this global variable is *always* available and there are certain circumstances (see [this Issue](https://github.com/woothemes/woocommerce/issues/4202#issuecomment-43856951)) where this cannot be guaranteed.

Therefore I've introduced a conditional check for the script to bailout if the required global JS is not found.