nornagon/atom

ReferenceError in sound API?

Closed this issue · 4 comments

The sound API seems broken -- from the compiled JS:

atom.preloadSounds = function(sfx, cb) {
   var name, toLoad, url, _results; 

  if (!atom.audioContext) {
    return typeof cb === "function" ? cb('No audio support') : void 0;
  }
  toLoad = 0;
  _results = [];
  for (name in sfx) {
    url = sfx[name];
    toLoad++;
    _results.push((function(name, url) {
      return atom.loadSound("sounds/" + url, function(error, buffer) {
        if (error) {
          console.error(error);
        }
        if (buffer) {
          atom.sfx[s] = buffer;

Here's where we throw Uncaught ReferenceError: s is not defined.

        }
        if (!--toLoad) {
          return typeof cb === "function" ? cb() : void 0;
        }
      });
    })(name, url));
  }
  return _results;
};

This seems to be resolved by replacing s with name.

Closing for the time being.

Send a pull request?

On Monday, 15 April 2013, Joseph Weissman wrote:

Closing for the time being.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-16366780
.

j

PR'd! :)