Passing Settings from Drupal Module to Javascript: Uncaught TypeError: Cannot read property
For future readers who will have the same problem.

My call for retrieving Drupal settings variables was made in the declaration part of the JavaScript:

var my_locs = Drupal.settings.my_module.my_locs;


I supposed this would be correct, since the Drupal settings object is already created, and since Javascript allows, like Java, the creation of new objects at declaration time.
But for some reason it didn't work.

I solved leaving the declaration

var my_locs;


and passing the object inside an initialize() method.

function initialize() {
    my_locs = Drupal.settings.my_module.my_locs;
    [...]


I hope it can be useful, since I lost lot of time on this.