Commits

David Chambers committed 63c7587

CoffeeScript 1.3.1

Comments (0)

Files changed (1)

+// Generated by CoffeeScript 1.3.1
 (function() {
   var format, lookup,
-    __slice = Array.prototype.slice;
+    __slice = [].slice;
 
   format = String.prototype.format = function() {
     var args, error, explicit, idx, implicit,
     explicit = implicit = false;
     error = 'cannot switch from {} to {} numbering'.format();
     return this.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g, function(match, literal, key, transformer) {
-      var fn, value, _ref, _ref2, _ref3;
-      if (literal) return literal;
+      var fn, value, _ref, _ref1, _ref2;
+      if (literal) {
+        return literal;
+      }
       if (key.length) {
         explicit = true;
-        if (implicit) throw error('implicit', 'explicit');
+        if (implicit) {
+          throw error('implicit', 'explicit');
+        }
         value = (_ref = lookup(args, key)) != null ? _ref : '';
       } else {
         implicit = true;
-        if (explicit) throw error('explicit', 'implicit');
-        value = (_ref2 = args[idx++]) != null ? _ref2 : '';
+        if (explicit) {
+          throw error('explicit', 'implicit');
+        }
+        value = (_ref1 = args[idx++]) != null ? _ref1 : '';
       }
       value = value.toString();
       if (fn = format.transformers[transformer]) {
-        return (_ref3 = fn.call(value)) != null ? _ref3 : '';
+        return (_ref2 = fn.call(value)) != null ? _ref2 : '';
       } else {
         return value;
       }
 
   lookup = function(object, key) {
     var match;
-    if (!/^(\d+)([.]|$)/.test(key)) key = '0.' + key;
+    if (!/^(\d+)([.]|$)/.test(key)) {
+      key = '0.' + key;
+    }
     while (match = /(.+?)[.](.+)/.exec(key)) {
       object = object[match[1]];
       key = match[2];