Example #1
0
LastFmApi.albumInfo = function(artist, album, hollaback) {
  var key = Spotbox.namespace("lastfm:albuminfo:" + artist + album);
  var params = {
    method: "album.getinfo",
    artist: artist,
    album:  album,
  };
  cachedRequest(options, params, key, function(error, data) {
    if (error) {
      hollaback(error);
    } else {
      var album   = data.album
      var artwork = album && album.image || [];
      hollaback(null, { artwork: artwork });
    }
  });
};
Example #2
0
 'Let expression': function (test) {
     test.expect(1);
     
     test.deepEqual(objcode.generateObjCode(deBruijn.indexes(compiler.expression(list(), ast.expr.let("b",ast.namespace(ast.expr.ident("a"),'Main'),ast.expr.ident("b"))).success())),
                    [[$i.code.CLOSURE,
                      [[$i.code.ACCESS, 1], 
                       $i.code.RETURN]],
                     $i.code.EVAL,
                     [$i.code.IDENT,'Main.a'],
                     $i.code.APPLY]);
     test.done();
 },
Example #3
0
  'Controller with filtered unbox': function (test) {
      test.expect(1);
      
      var aPackages = packages(option.none());

      aPackages.defineInRoot([], [ast.entity('number', ast.model('number',[],[]))]);
      
      test.deepEqual(objcode.generateObjCode(deBruijn.indexes(compiler.entity(environment(aPackages),
                                     ast.controller("A",
                                                    [],
                                                    ast.param("this",ast.type.native("a")),
                                                    [],
                                                    [ast.method("unbox", ast.expr.ident("this"), ast.namespace(ast.type.variable('number'),"main"))])).success())),
                     [ [$i.code.CLASS, ['A', [ ["number.unbox", [ [$i.code.ACCESS, 1],$i.code.RETURN]]], []]]]);
      test.done();
  },