You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pm...@apache.org on 2014/08/30 20:42:34 UTC

[01/14] pre-compile CoffeeScript files in server

Repository: cordova-weinre
Updated Branches:
  refs/heads/CB-7430 [created] 9b06777d6


http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/underscore.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/underscore.js b/weinre.server/node_modules/underscore/underscore.js
index f6f7e2f..b4f49a0 100644
--- a/weinre.server/node_modules/underscore/underscore.js
+++ b/weinre.server/node_modules/underscore/underscore.js
@@ -1,145 +1,176 @@
-//     Underscore.js 1.3.3
-//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-//     Underscore is freely distributable under the MIT license.
-//     Portions of Underscore are inspired or borrowed from Prototype,
-//     Oliver Steele's Functional, and John Resig's Micro-Templating.
-//     For all details and documentation:
-//     http://documentcloud.github.com/underscore
+//     Underscore.js 1.7.0
+//     http://underscorejs.org
+//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
 
 (function() {
 
   // Baseline setup
   // --------------
 
-  // Establish the root object, `window` in the browser, or `global` on the server.
+  // Establish the root object, `window` in the browser, or `exports` on the server.
   var root = this;
 
   // Save the previous value of the `_` variable.
   var previousUnderscore = root._;
 
-  // Establish the object that gets returned to break out of a loop iteration.
-  var breaker = {};
-
   // Save bytes in the minified (but not gzipped) version:
   var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
 
   // Create quick reference variables for speed access to core prototypes.
-  var slice            = ArrayProto.slice,
-      unshift          = ArrayProto.unshift,
-      toString         = ObjProto.toString,
-      hasOwnProperty   = ObjProto.hasOwnProperty;
+  var
+    push             = ArrayProto.push,
+    slice            = ArrayProto.slice,
+    concat           = ArrayProto.concat,
+    toString         = ObjProto.toString,
+    hasOwnProperty   = ObjProto.hasOwnProperty;
 
   // All **ECMAScript 5** native function implementations that we hope to use
   // are declared here.
   var
-    nativeForEach      = ArrayProto.forEach,
-    nativeMap          = ArrayProto.map,
-    nativeReduce       = ArrayProto.reduce,
-    nativeReduceRight  = ArrayProto.reduceRight,
-    nativeFilter       = ArrayProto.filter,
-    nativeEvery        = ArrayProto.every,
-    nativeSome         = ArrayProto.some,
-    nativeIndexOf      = ArrayProto.indexOf,
-    nativeLastIndexOf  = ArrayProto.lastIndexOf,
     nativeIsArray      = Array.isArray,
     nativeKeys         = Object.keys,
     nativeBind         = FuncProto.bind;
 
   // Create a safe reference to the Underscore object for use below.
-  var _ = function(obj) { return new wrapper(obj); };
+  var _ = function(obj) {
+    if (obj instanceof _) return obj;
+    if (!(this instanceof _)) return new _(obj);
+    this._wrapped = obj;
+  };
 
   // Export the Underscore object for **Node.js**, with
   // backwards-compatibility for the old `require()` API. If we're in
-  // the browser, add `_` as a global object via a string identifier,
-  // for Closure Compiler "advanced" mode.
+  // the browser, add `_` as a global object.
   if (typeof exports !== 'undefined') {
     if (typeof module !== 'undefined' && module.exports) {
       exports = module.exports = _;
     }
     exports._ = _;
   } else {
-    root['_'] = _;
+    root._ = _;
   }
 
   // Current version.
-  _.VERSION = '1.3.3';
+  _.VERSION = '1.7.0';
+
+  // Internal function that returns an efficient (for current engines) version
+  // of the passed-in callback, to be repeatedly applied in other Underscore
+  // functions.
+  var createCallback = function(func, context, argCount) {
+    if (context === void 0) return func;
+    switch (argCount == null ? 3 : argCount) {
+      case 1: return function(value) {
+        return func.call(context, value);
+      };
+      case 2: return function(value, other) {
+        return func.call(context, value, other);
+      };
+      case 3: return function(value, index, collection) {
+        return func.call(context, value, index, collection);
+      };
+      case 4: return function(accumulator, value, index, collection) {
+        return func.call(context, accumulator, value, index, collection);
+      };
+    }
+    return function() {
+      return func.apply(context, arguments);
+    };
+  };
+
+  // A mostly-internal function to generate callbacks that can be applied
+  // to each element in a collection, returning the desired result — either
+  // identity, an arbitrary callback, a property matcher, or a property accessor.
+  _.iteratee = function(value, context, argCount) {
+    if (value == null) return _.identity;
+    if (_.isFunction(value)) return createCallback(value, context, argCount);
+    if (_.isObject(value)) return _.matches(value);
+    return _.property(value);
+  };
 
   // Collection Functions
   // --------------------
 
   // The cornerstone, an `each` implementation, aka `forEach`.
-  // Handles objects with the built-in `forEach`, arrays, and raw objects.
-  // Delegates to **ECMAScript 5**'s native `forEach` if available.
-  var each = _.each = _.forEach = function(obj, iterator, context) {
-    if (obj == null) return;
-    if (nativeForEach && obj.forEach === nativeForEach) {
-      obj.forEach(iterator, context);
-    } else if (obj.length === +obj.length) {
-      for (var i = 0, l = obj.length; i < l; i++) {
-        if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
+  // Handles raw objects in addition to array-likes. Treats all
+  // sparse array-likes as if they were dense.
+  _.each = _.forEach = function(obj, iteratee, context) {
+    if (obj == null) return obj;
+    iteratee = createCallback(iteratee, context);
+    var i, length = obj.length;
+    if (length === +length) {
+      for (i = 0; i < length; i++) {
+        iteratee(obj[i], i, obj);
       }
     } else {
-      for (var key in obj) {
-        if (_.has(obj, key)) {
-          if (iterator.call(context, obj[key], key, obj) === breaker) return;
-        }
+      var keys = _.keys(obj);
+      for (i = 0, length = keys.length; i < length; i++) {
+        iteratee(obj[keys[i]], keys[i], obj);
       }
     }
+    return obj;
   };
 
-  // Return the results of applying the iterator to each element.
-  // Delegates to **ECMAScript 5**'s native `map` if available.
-  _.map = _.collect = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
-    each(obj, function(value, index, list) {
-      results[results.length] = iterator.call(context, value, index, list);
-    });
-    if (obj.length === +obj.length) results.length = obj.length;
+  // Return the results of applying the iteratee to each element.
+  _.map = _.collect = function(obj, iteratee, context) {
+    if (obj == null) return [];
+    iteratee = _.iteratee(iteratee, context);
+    var keys = obj.length !== +obj.length && _.keys(obj),
+        length = (keys || obj).length,
+        results = Array(length),
+        currentKey;
+    for (var index = 0; index < length; index++) {
+      currentKey = keys ? keys[index] : index;
+      results[index] = iteratee(obj[currentKey], currentKey, obj);
+    }
     return results;
   };
 
+  var reduceError = 'Reduce of empty array with no initial value';
+
   // **Reduce** builds up a single result from a list of values, aka `inject`,
-  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
-  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
+  // or `foldl`.
+  _.reduce = _.foldl = _.inject = function(obj, iteratee, memo, context) {
     if (obj == null) obj = [];
-    if (nativeReduce && obj.reduce === nativeReduce) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
+    iteratee = createCallback(iteratee, context, 4);
+    var keys = obj.length !== +obj.length && _.keys(obj),
+        length = (keys || obj).length,
+        index = 0, currentKey;
+    if (arguments.length < 3) {
+      if (!length) throw new TypeError(reduceError);
+      memo = obj[keys ? keys[index++] : index++];
+    }
+    for (; index < length; index++) {
+      currentKey = keys ? keys[index] : index;
+      memo = iteratee(memo, obj[currentKey], currentKey, obj);
     }
-    each(obj, function(value, index, list) {
-      if (!initial) {
-        memo = value;
-        initial = true;
-      } else {
-        memo = iterator.call(context, memo, value, index, list);
-      }
-    });
-    if (!initial) throw new TypeError('Reduce of empty array with no initial value');
     return memo;
   };
 
   // The right-associative version of reduce, also known as `foldr`.
-  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
-  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
-    var initial = arguments.length > 2;
+  _.reduceRight = _.foldr = function(obj, iteratee, memo, context) {
     if (obj == null) obj = [];
-    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
-      if (context) iterator = _.bind(iterator, context);
-      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
+    iteratee = createCallback(iteratee, context, 4);
+    var keys = obj.length !== + obj.length && _.keys(obj),
+        index = (keys || obj).length,
+        currentKey;
+    if (arguments.length < 3) {
+      if (!index) throw new TypeError(reduceError);
+      memo = obj[keys ? keys[--index] : --index];
     }
-    var reversed = _.toArray(obj).reverse();
-    if (context && !initial) iterator = _.bind(iterator, context);
-    return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
+    while (index--) {
+      currentKey = keys ? keys[index] : index;
+      memo = iteratee(memo, obj[currentKey], currentKey, obj);
+    }
+    return memo;
   };
 
   // Return the first value which passes a truth test. Aliased as `detect`.
-  _.find = _.detect = function(obj, iterator, context) {
+  _.find = _.detect = function(obj, predicate, context) {
     var result;
-    any(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) {
+    predicate = _.iteratee(predicate, context);
+    _.some(obj, function(value, index, list) {
+      if (predicate(value, index, list)) {
         result = value;
         return true;
       }
@@ -148,167 +179,249 @@
   };
 
   // Return all the elements that pass a truth test.
-  // Delegates to **ECMAScript 5**'s native `filter` if available.
   // Aliased as `select`.
-  _.filter = _.select = function(obj, iterator, context) {
+  _.filter = _.select = function(obj, predicate, context) {
     var results = [];
     if (obj == null) return results;
-    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
-    each(obj, function(value, index, list) {
-      if (iterator.call(context, value, index, list)) results[results.length] = value;
+    predicate = _.iteratee(predicate, context);
+    _.each(obj, function(value, index, list) {
+      if (predicate(value, index, list)) results.push(value);
     });
     return results;
   };
 
   // Return all the elements for which a truth test fails.
-  _.reject = function(obj, iterator, context) {
-    var results = [];
-    if (obj == null) return results;
-    each(obj, function(value, index, list) {
-      if (!iterator.call(context, value, index, list)) results[results.length] = value;
-    });
-    return results;
+  _.reject = function(obj, predicate, context) {
+    return _.filter(obj, _.negate(_.iteratee(predicate)), context);
   };
 
   // Determine whether all of the elements match a truth test.
-  // Delegates to **ECMAScript 5**'s native `every` if available.
   // Aliased as `all`.
-  _.every = _.all = function(obj, iterator, context) {
-    var result = true;
-    if (obj == null) return result;
-    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
-    each(obj, function(value, index, list) {
-      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
+  _.every = _.all = function(obj, predicate, context) {
+    if (obj == null) return true;
+    predicate = _.iteratee(predicate, context);
+    var keys = obj.length !== +obj.length && _.keys(obj),
+        length = (keys || obj).length,
+        index, currentKey;
+    for (index = 0; index < length; index++) {
+      currentKey = keys ? keys[index] : index;
+      if (!predicate(obj[currentKey], currentKey, obj)) return false;
+    }
+    return true;
   };
 
   // Determine if at least one element in the object matches a truth test.
-  // Delegates to **ECMAScript 5**'s native `some` if available.
   // Aliased as `any`.
-  var any = _.some = _.any = function(obj, iterator, context) {
-    iterator || (iterator = _.identity);
-    var result = false;
-    if (obj == null) return result;
-    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
-    each(obj, function(value, index, list) {
-      if (result || (result = iterator.call(context, value, index, list))) return breaker;
-    });
-    return !!result;
+  _.some = _.any = function(obj, predicate, context) {
+    if (obj == null) return false;
+    predicate = _.iteratee(predicate, context);
+    var keys = obj.length !== +obj.length && _.keys(obj),
+        length = (keys || obj).length,
+        index, currentKey;
+    for (index = 0; index < length; index++) {
+      currentKey = keys ? keys[index] : index;
+      if (predicate(obj[currentKey], currentKey, obj)) return true;
+    }
+    return false;
   };
 
-  // Determine if a given value is included in the array or object using `===`.
-  // Aliased as `contains`.
-  _.include = _.contains = function(obj, target) {
-    var found = false;
-    if (obj == null) return found;
-    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
-    found = any(obj, function(value) {
-      return value === target;
-    });
-    return found;
+  // Determine if the array or object contains a given value (using `===`).
+  // Aliased as `include`.
+  _.contains = _.include = function(obj, target) {
+    if (obj == null) return false;
+    if (obj.length !== +obj.length) obj = _.values(obj);
+    return _.indexOf(obj, target) >= 0;
   };
 
   // Invoke a method (with arguments) on every item in a collection.
   _.invoke = function(obj, method) {
     var args = slice.call(arguments, 2);
+    var isFunc = _.isFunction(method);
     return _.map(obj, function(value) {
-      return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
+      return (isFunc ? method : value[method]).apply(value, args);
     });
   };
 
   // Convenience version of a common use case of `map`: fetching a property.
   _.pluck = function(obj, key) {
-    return _.map(obj, function(value){ return value[key]; });
+    return _.map(obj, _.property(key));
   };
 
-  // Return the maximum element or (element-based computation).
-  _.max = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.max.apply(Math, obj);
-    if (!iterator && _.isEmpty(obj)) return -Infinity;
-    var result = {computed : -Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed >= result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
+  // Convenience version of a common use case of `filter`: selecting only objects
+  // containing specific `key:value` pairs.
+  _.where = function(obj, attrs) {
+    return _.filter(obj, _.matches(attrs));
+  };
+
+  // Convenience version of a common use case of `find`: getting the first object
+  // containing specific `key:value` pairs.
+  _.findWhere = function(obj, attrs) {
+    return _.find(obj, _.matches(attrs));
+  };
+
+  // Return the maximum element (or element-based computation).
+  _.max = function(obj, iteratee, context) {
+    var result = -Infinity, lastComputed = -Infinity,
+        value, computed;
+    if (iteratee == null && obj != null) {
+      obj = obj.length === +obj.length ? obj : _.values(obj);
+      for (var i = 0, length = obj.length; i < length; i++) {
+        value = obj[i];
+        if (value > result) {
+          result = value;
+        }
+      }
+    } else {
+      iteratee = _.iteratee(iteratee, context);
+      _.each(obj, function(value, index, list) {
+        computed = iteratee(value, index, list);
+        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
+          result = value;
+          lastComputed = computed;
+        }
+      });
+    }
+    return result;
   };
 
   // Return the minimum element (or element-based computation).
-  _.min = function(obj, iterator, context) {
-    if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.min.apply(Math, obj);
-    if (!iterator && _.isEmpty(obj)) return Infinity;
-    var result = {computed : Infinity};
-    each(obj, function(value, index, list) {
-      var computed = iterator ? iterator.call(context, value, index, list) : value;
-      computed < result.computed && (result = {value : value, computed : computed});
-    });
-    return result.value;
+  _.min = function(obj, iteratee, context) {
+    var result = Infinity, lastComputed = Infinity,
+        value, computed;
+    if (iteratee == null && obj != null) {
+      obj = obj.length === +obj.length ? obj : _.values(obj);
+      for (var i = 0, length = obj.length; i < length; i++) {
+        value = obj[i];
+        if (value < result) {
+          result = value;
+        }
+      }
+    } else {
+      iteratee = _.iteratee(iteratee, context);
+      _.each(obj, function(value, index, list) {
+        computed = iteratee(value, index, list);
+        if (computed < lastComputed || computed === Infinity && result === Infinity) {
+          result = value;
+          lastComputed = computed;
+        }
+      });
+    }
+    return result;
   };
 
-  // Shuffle an array.
+  // Shuffle a collection, using the modern version of the
+  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
   _.shuffle = function(obj) {
-    var shuffled = [], rand;
-    each(obj, function(value, index, list) {
-      rand = Math.floor(Math.random() * (index + 1));
-      shuffled[index] = shuffled[rand];
-      shuffled[rand] = value;
-    });
+    var set = obj && obj.length === +obj.length ? obj : _.values(obj);
+    var length = set.length;
+    var shuffled = Array(length);
+    for (var index = 0, rand; index < length; index++) {
+      rand = _.random(0, index);
+      if (rand !== index) shuffled[index] = shuffled[rand];
+      shuffled[rand] = set[index];
+    }
     return shuffled;
   };
 
-  // Sort the object's values by a criterion produced by an iterator.
-  _.sortBy = function(obj, val, context) {
-    var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
+  // Sample **n** random values from a collection.
+  // If **n** is not specified, returns a single random element.
+  // The internal `guard` argument allows it to work with `map`.
+  _.sample = function(obj, n, guard) {
+    if (n == null || guard) {
+      if (obj.length !== +obj.length) obj = _.values(obj);
+      return obj[_.random(obj.length - 1)];
+    }
+    return _.shuffle(obj).slice(0, Math.max(0, n));
+  };
+
+  // Sort the object's values by a criterion produced by an iteratee.
+  _.sortBy = function(obj, iteratee, context) {
+    iteratee = _.iteratee(iteratee, context);
     return _.pluck(_.map(obj, function(value, index, list) {
       return {
-        value : value,
-        criteria : iterator.call(context, value, index, list)
+        value: value,
+        index: index,
+        criteria: iteratee(value, index, list)
       };
     }).sort(function(left, right) {
-      var a = left.criteria, b = right.criteria;
-      if (a === void 0) return 1;
-      if (b === void 0) return -1;
-      return a < b ? -1 : a > b ? 1 : 0;
+      var a = left.criteria;
+      var b = right.criteria;
+      if (a !== b) {
+        if (a > b || a === void 0) return 1;
+        if (a < b || b === void 0) return -1;
+      }
+      return left.index - right.index;
     }), 'value');
   };
 
+  // An internal function used for aggregate "group by" operations.
+  var group = function(behavior) {
+    return function(obj, iteratee, context) {
+      var result = {};
+      iteratee = _.iteratee(iteratee, context);
+      _.each(obj, function(value, index) {
+        var key = iteratee(value, index, obj);
+        behavior(result, value, key);
+      });
+      return result;
+    };
+  };
+
   // Groups the object's values by a criterion. Pass either a string attribute
   // to group by, or a function that returns the criterion.
-  _.groupBy = function(obj, val) {
-    var result = {};
-    var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
-    each(obj, function(value, index) {
-      var key = iterator(value, index);
-      (result[key] || (result[key] = [])).push(value);
-    });
-    return result;
-  };
+  _.groupBy = group(function(result, value, key) {
+    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
+  });
+
+  // Indexes the object's values by a criterion, similar to `groupBy`, but for
+  // when you know that your index values will be unique.
+  _.indexBy = group(function(result, value, key) {
+    result[key] = value;
+  });
+
+  // Counts instances of an object that group by a certain criterion. Pass
+  // either a string attribute to count by, or a function that returns the
+  // criterion.
+  _.countBy = group(function(result, value, key) {
+    if (_.has(result, key)) result[key]++; else result[key] = 1;
+  });
 
-  // Use a comparator function to figure out at what index an object should
-  // be inserted so as to maintain order. Uses binary search.
-  _.sortedIndex = function(array, obj, iterator) {
-    iterator || (iterator = _.identity);
+  // Use a comparator function to figure out the smallest index at which
+  // an object should be inserted so as to maintain order. Uses binary search.
+  _.sortedIndex = function(array, obj, iteratee, context) {
+    iteratee = _.iteratee(iteratee, context, 1);
+    var value = iteratee(obj);
     var low = 0, high = array.length;
     while (low < high) {
-      var mid = (low + high) >> 1;
-      iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
+      var mid = low + high >>> 1;
+      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
     }
     return low;
   };
 
-  // Safely convert anything iterable into a real, live array.
+  // Safely create a real, live array from anything iterable.
   _.toArray = function(obj) {
-    if (!obj)                                     return [];
-    if (_.isArray(obj))                           return slice.call(obj);
-    if (_.isArguments(obj))                       return slice.call(obj);
-    if (obj.toArray && _.isFunction(obj.toArray)) return obj.toArray();
+    if (!obj) return [];
+    if (_.isArray(obj)) return slice.call(obj);
+    if (obj.length === +obj.length) return _.map(obj, _.identity);
     return _.values(obj);
   };
 
   // Return the number of elements in an object.
   _.size = function(obj) {
-    return _.isArray(obj) ? obj.length : _.keys(obj).length;
+    if (obj == null) return 0;
+    return obj.length === +obj.length ? obj.length : _.keys(obj).length;
+  };
+
+  // Split a collection into two arrays: one whose elements all satisfy the given
+  // predicate, and one whose elements all do not satisfy the predicate.
+  _.partition = function(obj, predicate, context) {
+    predicate = _.iteratee(predicate, context);
+    var pass = [], fail = [];
+    _.each(obj, function(value, key, obj) {
+      (predicate(value, key, obj) ? pass : fail).push(value);
+    });
+    return [pass, fail];
   };
 
   // Array Functions
@@ -318,47 +431,62 @@
   // values in the array. Aliased as `head` and `take`. The **guard** check
   // allows it to work with `_.map`.
   _.first = _.head = _.take = function(array, n, guard) {
-    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
+    if (array == null) return void 0;
+    if (n == null || guard) return array[0];
+    if (n < 0) return [];
+    return slice.call(array, 0, n);
   };
 
-  // Returns everything but the last entry of the array. Especcialy useful on
+  // Returns everything but the last entry of the array. Especially useful on
   // the arguments object. Passing **n** will return all the values in
   // the array, excluding the last N. The **guard** check allows it to work with
   // `_.map`.
   _.initial = function(array, n, guard) {
-    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
+    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
   };
 
   // Get the last element of an array. Passing **n** will return the last N
   // values in the array. The **guard** check allows it to work with `_.map`.
   _.last = function(array, n, guard) {
-    if ((n != null) && !guard) {
-      return slice.call(array, Math.max(array.length - n, 0));
-    } else {
-      return array[array.length - 1];
-    }
+    if (array == null) return void 0;
+    if (n == null || guard) return array[array.length - 1];
+    return slice.call(array, Math.max(array.length - n, 0));
   };
 
-  // Returns everything but the first entry of the array. Aliased as `tail`.
-  // Especially useful on the arguments object. Passing an **index** will return
-  // the rest of the values in the array from that index onward. The **guard**
+  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
+  // Especially useful on the arguments object. Passing an **n** will return
+  // the rest N values in the array. The **guard**
   // check allows it to work with `_.map`.
-  _.rest = _.tail = function(array, index, guard) {
-    return slice.call(array, (index == null) || guard ? 1 : index);
+  _.rest = _.tail = _.drop = function(array, n, guard) {
+    return slice.call(array, n == null || guard ? 1 : n);
   };
 
   // Trim out all falsy values from an array.
   _.compact = function(array) {
-    return _.filter(array, function(value){ return !!value; });
+    return _.filter(array, _.identity);
+  };
+
+  // Internal implementation of a recursive `flatten` function.
+  var flatten = function(input, shallow, strict, output) {
+    if (shallow && _.every(input, _.isArray)) {
+      return concat.apply(output, input);
+    }
+    for (var i = 0, length = input.length; i < length; i++) {
+      var value = input[i];
+      if (!_.isArray(value) && !_.isArguments(value)) {
+        if (!strict) output.push(value);
+      } else if (shallow) {
+        push.apply(output, value);
+      } else {
+        flatten(value, shallow, strict, output);
+      }
+    }
+    return output;
   };
 
-  // Return a completely flattened version of an array.
+  // Flatten out an array, either recursively (by default), or just one level.
   _.flatten = function(array, shallow) {
-    return _.reduce(array, function(memo, value) {
-      if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
-      memo[memo.length] = value;
-      return memo;
-    }, []);
+    return flatten(array, shallow, false, []);
   };
 
   // Return a version of the array that does not contain the specified value(s).
@@ -369,79 +497,120 @@
   // Produce a duplicate-free version of the array. If the array has already
   // been sorted, you have the option of using a faster algorithm.
   // Aliased as `unique`.
-  _.uniq = _.unique = function(array, isSorted, iterator) {
-    var initial = iterator ? _.map(array, iterator) : array;
-    var results = [];
-    // The `isSorted` flag is irrelevant if the array only contains two elements.
-    if (array.length < 3) isSorted = true;
-    _.reduce(initial, function (memo, value, index) {
-      if (isSorted ? _.last(memo) !== value || !memo.length : !_.include(memo, value)) {
-        memo.push(value);
-        results.push(array[index]);
+  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
+    if (array == null) return [];
+    if (!_.isBoolean(isSorted)) {
+      context = iteratee;
+      iteratee = isSorted;
+      isSorted = false;
+    }
+    if (iteratee != null) iteratee = _.iteratee(iteratee, context);
+    var result = [];
+    var seen = [];
+    for (var i = 0, length = array.length; i < length; i++) {
+      var value = array[i];
+      if (isSorted) {
+        if (!i || seen !== value) result.push(value);
+        seen = value;
+      } else if (iteratee) {
+        var computed = iteratee(value, i, array);
+        if (_.indexOf(seen, computed) < 0) {
+          seen.push(computed);
+          result.push(value);
+        }
+      } else if (_.indexOf(result, value) < 0) {
+        result.push(value);
       }
-      return memo;
-    }, []);
-    return results;
+    }
+    return result;
   };
 
   // Produce an array that contains the union: each distinct element from all of
   // the passed-in arrays.
   _.union = function() {
-    return _.uniq(_.flatten(arguments, true));
+    return _.uniq(flatten(arguments, true, true, []));
   };
 
   // Produce an array that contains every item shared between all the
-  // passed-in arrays. (Aliased as "intersect" for back-compat.)
-  _.intersection = _.intersect = function(array) {
-    var rest = slice.call(arguments, 1);
-    return _.filter(_.uniq(array), function(item) {
-      return _.every(rest, function(other) {
-        return _.indexOf(other, item) >= 0;
-      });
-    });
+  // passed-in arrays.
+  _.intersection = function(array) {
+    if (array == null) return [];
+    var result = [];
+    var argsLength = arguments.length;
+    for (var i = 0, length = array.length; i < length; i++) {
+      var item = array[i];
+      if (_.contains(result, item)) continue;
+      for (var j = 1; j < argsLength; j++) {
+        if (!_.contains(arguments[j], item)) break;
+      }
+      if (j === argsLength) result.push(item);
+    }
+    return result;
   };
 
   // Take the difference between one array and a number of other arrays.
   // Only the elements present in just the first array will remain.
   _.difference = function(array) {
-    var rest = _.flatten(slice.call(arguments, 1), true);
-    return _.filter(array, function(value){ return !_.include(rest, value); });
+    var rest = flatten(slice.call(arguments, 1), true, true, []);
+    return _.filter(array, function(value){
+      return !_.contains(rest, value);
+    });
   };
 
   // Zip together multiple lists into a single array -- elements that share
   // an index go together.
-  _.zip = function() {
-    var args = slice.call(arguments);
-    var length = _.max(_.pluck(args, 'length'));
-    var results = new Array(length);
-    for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
+  _.zip = function(array) {
+    if (array == null) return [];
+    var length = _.max(arguments, 'length').length;
+    var results = Array(length);
+    for (var i = 0; i < length; i++) {
+      results[i] = _.pluck(arguments, i);
+    }
     return results;
   };
 
-  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
-  // we need this function. Return the position of the first occurrence of an
-  // item in an array, or -1 if the item is not included in the array.
-  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
+  // Converts lists into objects. Pass either a single array of `[key, value]`
+  // pairs, or two parallel arrays of the same length -- one of keys, and one of
+  // the corresponding values.
+  _.object = function(list, values) {
+    if (list == null) return {};
+    var result = {};
+    for (var i = 0, length = list.length; i < length; i++) {
+      if (values) {
+        result[list[i]] = values[i];
+      } else {
+        result[list[i][0]] = list[i][1];
+      }
+    }
+    return result;
+  };
+
+  // Return the position of the first occurrence of an item in an array,
+  // or -1 if the item is not included in the array.
   // If the array is large and already in sort order, pass `true`
   // for **isSorted** to use binary search.
   _.indexOf = function(array, item, isSorted) {
     if (array == null) return -1;
-    var i, l;
+    var i = 0, length = array.length;
     if (isSorted) {
-      i = _.sortedIndex(array, item);
-      return array[i] === item ? i : -1;
+      if (typeof isSorted == 'number') {
+        i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted;
+      } else {
+        i = _.sortedIndex(array, item);
+        return array[i] === item ? i : -1;
+      }
     }
-    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
-    for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
+    for (; i < length; i++) if (array[i] === item) return i;
     return -1;
   };
 
-  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
-  _.lastIndexOf = function(array, item) {
+  _.lastIndexOf = function(array, item, from) {
     if (array == null) return -1;
-    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
-    var i = array.length;
-    while (i--) if (i in array && array[i] === item) return i;
+    var idx = array.length;
+    if (typeof from == 'number') {
+      idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1);
+    }
+    while (--idx >= 0) if (array[idx] === item) return idx;
     return -1;
   };
 
@@ -453,15 +622,13 @@
       stop = start || 0;
       start = 0;
     }
-    step = arguments[2] || 1;
+    step = step || 1;
 
-    var len = Math.max(Math.ceil((stop - start) / step), 0);
-    var idx = 0;
-    var range = new Array(len);
+    var length = Math.max(Math.ceil((stop - start) / step), 0);
+    var range = Array(length);
 
-    while(idx < len) {
-      range[idx++] = start;
-      start += step;
+    for (var idx = 0; idx < length; idx++, start += step) {
+      range[idx] = start;
     }
 
     return range;
@@ -471,51 +638,76 @@
   // ------------------
 
   // Reusable constructor function for prototype setting.
-  var ctor = function(){};
+  var Ctor = function(){};
 
   // Create a function bound to a given object (assigning `this`, and arguments,
-  // optionally). Binding with arguments is also known as `curry`.
-  // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
-  // We check for `func.bind` first, to fail fast when `func` is undefined.
-  _.bind = function bind(func, context) {
-    var bound, args;
-    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
-    if (!_.isFunction(func)) throw new TypeError;
+  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
+  // available.
+  _.bind = function(func, context) {
+    var args, bound;
+    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
     args = slice.call(arguments, 2);
-    return bound = function() {
+    bound = function() {
       if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
-      ctor.prototype = func.prototype;
-      var self = new ctor;
+      Ctor.prototype = func.prototype;
+      var self = new Ctor;
+      Ctor.prototype = null;
       var result = func.apply(self, args.concat(slice.call(arguments)));
-      if (Object(result) === result) return result;
+      if (_.isObject(result)) return result;
       return self;
     };
+    return bound;
   };
 
-  // Bind all of an object's methods to that object. Useful for ensuring that
-  // all callbacks defined on an object belong to it.
+  // Partially apply a function by creating a version that has had some of its
+  // arguments pre-filled, without changing its dynamic `this` context. _ acts
+  // as a placeholder, allowing any combination of arguments to be pre-filled.
+  _.partial = function(func) {
+    var boundArgs = slice.call(arguments, 1);
+    return function() {
+      var position = 0;
+      var args = boundArgs.slice();
+      for (var i = 0, length = args.length; i < length; i++) {
+        if (args[i] === _) args[i] = arguments[position++];
+      }
+      while (position < arguments.length) args.push(arguments[position++]);
+      return func.apply(this, args);
+    };
+  };
+
+  // Bind a number of an object's methods to that object. Remaining arguments
+  // are the method names to be bound. Useful for ensuring that all callbacks
+  // defined on an object belong to it.
   _.bindAll = function(obj) {
-    var funcs = slice.call(arguments, 1);
-    if (funcs.length == 0) funcs = _.functions(obj);
-    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
+    var i, length = arguments.length, key;
+    if (length <= 1) throw new Error('bindAll must be passed function names');
+    for (i = 1; i < length; i++) {
+      key = arguments[i];
+      obj[key] = _.bind(obj[key], obj);
+    }
     return obj;
   };
 
   // Memoize an expensive function by storing its results.
   _.memoize = function(func, hasher) {
-    var memo = {};
-    hasher || (hasher = _.identity);
-    return function() {
-      var key = hasher.apply(this, arguments);
-      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
+    var memoize = function(key) {
+      var cache = memoize.cache;
+      var address = hasher ? hasher.apply(this, arguments) : key;
+      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
+      return cache[address];
     };
+    memoize.cache = {};
+    return memoize;
   };
 
   // Delays a function for the given number of milliseconds, and then calls
   // it with the arguments supplied.
   _.delay = function(func, wait) {
     var args = slice.call(arguments, 2);
-    return setTimeout(function(){ return func.apply(null, args); }, wait);
+    return setTimeout(function(){
+      return func.apply(null, args);
+    }, wait);
   };
 
   // Defers a function, scheduling it to run after the current call stack has
@@ -525,25 +717,36 @@
   };
 
   // Returns a function, that, when invoked, will only be triggered at most once
-  // during a given window of time.
-  _.throttle = function(func, wait) {
-    var context, args, timeout, throttling, more, result;
-    var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
+  // during a given window of time. Normally, the throttled function will run
+  // as much as it can, without ever going more than once per `wait` duration;
+  // but if you'd like to disable the execution on the leading edge, pass
+  // `{leading: false}`. To disable execution on the trailing edge, ditto.
+  _.throttle = function(func, wait, options) {
+    var context, args, result;
+    var timeout = null;
+    var previous = 0;
+    if (!options) options = {};
+    var later = function() {
+      previous = options.leading === false ? 0 : _.now();
+      timeout = null;
+      result = func.apply(context, args);
+      if (!timeout) context = args = null;
+    };
     return function() {
-      context = this; args = arguments;
-      var later = function() {
+      var now = _.now();
+      if (!previous && options.leading === false) previous = now;
+      var remaining = wait - (now - previous);
+      context = this;
+      args = arguments;
+      if (remaining <= 0 || remaining > wait) {
+        clearTimeout(timeout);
         timeout = null;
-        if (more) func.apply(context, args);
-        whenDone();
-      };
-      if (!timeout) timeout = setTimeout(later, wait);
-      if (throttling) {
-        more = true;
-      } else {
+        previous = now;
         result = func.apply(context, args);
+        if (!timeout) context = args = null;
+      } else if (!timeout && options.trailing !== false) {
+        timeout = setTimeout(later, remaining);
       }
-      whenDone();
-      throttling = true;
       return result;
     };
   };
@@ -553,27 +756,34 @@
   // N milliseconds. If `immediate` is passed, trigger the function on the
   // leading edge, instead of the trailing.
   _.debounce = function(func, wait, immediate) {
-    var timeout;
-    return function() {
-      var context = this, args = arguments;
-      var later = function() {
+    var timeout, args, context, timestamp, result;
+
+    var later = function() {
+      var last = _.now() - timestamp;
+
+      if (last < wait && last > 0) {
+        timeout = setTimeout(later, wait - last);
+      } else {
         timeout = null;
-        if (!immediate) func.apply(context, args);
-      };
-      if (immediate && !timeout) func.apply(context, args);
-      clearTimeout(timeout);
-      timeout = setTimeout(later, wait);
+        if (!immediate) {
+          result = func.apply(context, args);
+          if (!timeout) context = args = null;
+        }
+      }
     };
-  };
 
-  // Returns a function that will be executed at most one time, no matter how
-  // often you call it. Useful for lazy initialization.
-  _.once = function(func) {
-    var ran = false, memo;
     return function() {
-      if (ran) return memo;
-      ran = true;
-      return memo = func.apply(this, arguments);
+      context = this;
+      args = arguments;
+      timestamp = _.now();
+      var callNow = immediate && !timeout;
+      if (!timeout) timeout = setTimeout(later, wait);
+      if (callNow) {
+        result = func.apply(context, args);
+        context = args = null;
+      }
+
+      return result;
     };
   };
 
@@ -581,48 +791,98 @@
   // allowing you to adjust arguments, run code before and after, and
   // conditionally execute the original function.
   _.wrap = function(func, wrapper) {
+    return _.partial(wrapper, func);
+  };
+
+  // Returns a negated version of the passed-in predicate.
+  _.negate = function(predicate) {
     return function() {
-      var args = [func].concat(slice.call(arguments, 0));
-      return wrapper.apply(this, args);
+      return !predicate.apply(this, arguments);
     };
   };
 
   // Returns a function that is the composition of a list of functions, each
   // consuming the return value of the function that follows.
   _.compose = function() {
-    var funcs = arguments;
+    var args = arguments;
+    var start = args.length - 1;
     return function() {
-      var args = arguments;
-      for (var i = funcs.length - 1; i >= 0; i--) {
-        args = [funcs[i].apply(this, args)];
-      }
-      return args[0];
+      var i = start;
+      var result = args[start].apply(this, arguments);
+      while (i--) result = args[i].call(this, result);
+      return result;
     };
   };
 
   // Returns a function that will only be executed after being called N times.
   _.after = function(times, func) {
-    if (times <= 0) return func();
     return function() {
-      if (--times < 1) { return func.apply(this, arguments); }
+      if (--times < 1) {
+        return func.apply(this, arguments);
+      }
+    };
+  };
+
+  // Returns a function that will only be executed before being called N times.
+  _.before = function(times, func) {
+    var memo;
+    return function() {
+      if (--times > 0) {
+        memo = func.apply(this, arguments);
+      } else {
+        func = null;
+      }
+      return memo;
     };
   };
 
+  // Returns a function that will be executed at most one time, no matter how
+  // often you call it. Useful for lazy initialization.
+  _.once = _.partial(_.before, 2);
+
   // Object Functions
   // ----------------
 
   // Retrieve the names of an object's properties.
   // Delegates to **ECMAScript 5**'s native `Object.keys`
-  _.keys = nativeKeys || function(obj) {
-    if (obj !== Object(obj)) throw new TypeError('Invalid object');
+  _.keys = function(obj) {
+    if (!_.isObject(obj)) return [];
+    if (nativeKeys) return nativeKeys(obj);
     var keys = [];
-    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
+    for (var key in obj) if (_.has(obj, key)) keys.push(key);
     return keys;
   };
 
   // Retrieve the values of an object's properties.
   _.values = function(obj) {
-    return _.map(obj, _.identity);
+    var keys = _.keys(obj);
+    var length = keys.length;
+    var values = Array(length);
+    for (var i = 0; i < length; i++) {
+      values[i] = obj[keys[i]];
+    }
+    return values;
+  };
+
+  // Convert an object into a list of `[key, value]` pairs.
+  _.pairs = function(obj) {
+    var keys = _.keys(obj);
+    var length = keys.length;
+    var pairs = Array(length);
+    for (var i = 0; i < length; i++) {
+      pairs[i] = [keys[i], obj[keys[i]]];
+    }
+    return pairs;
+  };
+
+  // Invert the keys and values of an object. The values must be serializable.
+  _.invert = function(obj) {
+    var result = {};
+    var keys = _.keys(obj);
+    for (var i = 0, length = keys.length; i < length; i++) {
+      result[obj[keys[i]]] = keys[i];
+    }
+    return result;
   };
 
   // Return a sorted list of the function names available on the object.
@@ -637,30 +897,62 @@
 
   // Extend a given object with all the properties in passed-in object(s).
   _.extend = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
-      for (var prop in source) {
-        obj[prop] = source[prop];
+    if (!_.isObject(obj)) return obj;
+    var source, prop;
+    for (var i = 1, length = arguments.length; i < length; i++) {
+      source = arguments[i];
+      for (prop in source) {
+        if (hasOwnProperty.call(source, prop)) {
+            obj[prop] = source[prop];
+        }
       }
-    });
+    }
     return obj;
   };
 
   // Return a copy of the object only containing the whitelisted properties.
-  _.pick = function(obj) {
-    var result = {};
-    each(_.flatten(slice.call(arguments, 1)), function(key) {
-      if (key in obj) result[key] = obj[key];
-    });
+  _.pick = function(obj, iteratee, context) {
+    var result = {}, key;
+    if (obj == null) return result;
+    if (_.isFunction(iteratee)) {
+      iteratee = createCallback(iteratee, context);
+      for (key in obj) {
+        var value = obj[key];
+        if (iteratee(value, key, obj)) result[key] = value;
+      }
+    } else {
+      var keys = concat.apply([], slice.call(arguments, 1));
+      obj = new Object(obj);
+      for (var i = 0, length = keys.length; i < length; i++) {
+        key = keys[i];
+        if (key in obj) result[key] = obj[key];
+      }
+    }
     return result;
   };
 
+   // Return a copy of the object without the blacklisted properties.
+  _.omit = function(obj, iteratee, context) {
+    if (_.isFunction(iteratee)) {
+      iteratee = _.negate(iteratee);
+    } else {
+      var keys = _.map(concat.apply([], slice.call(arguments, 1)), String);
+      iteratee = function(value, key) {
+        return !_.contains(keys, key);
+      };
+    }
+    return _.pick(obj, iteratee, context);
+  };
+
   // Fill in a given object with default properties.
   _.defaults = function(obj) {
-    each(slice.call(arguments, 1), function(source) {
+    if (!_.isObject(obj)) return obj;
+    for (var i = 1, length = arguments.length; i < length; i++) {
+      var source = arguments[i];
       for (var prop in source) {
-        if (obj[prop] == null) obj[prop] = source[prop];
+        if (obj[prop] === void 0) obj[prop] = source[prop];
       }
-    });
+    }
     return obj;
   };
 
@@ -678,173 +970,162 @@
     return obj;
   };
 
-  // Internal recursive comparison function.
-  function eq(a, b, stack) {
+  // Internal recursive comparison function for `isEqual`.
+  var eq = function(a, b, aStack, bStack) {
     // Identical objects are equal. `0 === -0`, but they aren't identical.
-    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
-    if (a === b) return a !== 0 || 1 / a == 1 / b;
+    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
+    if (a === b) return a !== 0 || 1 / a === 1 / b;
     // A strict comparison is necessary because `null == undefined`.
     if (a == null || b == null) return a === b;
     // Unwrap any wrapped objects.
-    if (a._chain) a = a._wrapped;
-    if (b._chain) b = b._wrapped;
-    // Invoke a custom `isEqual` method if one is provided.
-    if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
-    if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
+    if (a instanceof _) a = a._wrapped;
+    if (b instanceof _) b = b._wrapped;
     // Compare `[[Class]]` names.
     var className = toString.call(a);
-    if (className != toString.call(b)) return false;
+    if (className !== toString.call(b)) return false;
     switch (className) {
-      // Strings, numbers, dates, and booleans are compared by value.
+      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
+      case '[object RegExp]':
+      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
       case '[object String]':
         // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
         // equivalent to `new String("5")`.
-        return a == String(b);
+        return '' + a === '' + b;
       case '[object Number]':
-        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
-        // other numeric values.
-        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
+        // `NaN`s are equivalent, but non-reflexive.
+        // Object(NaN) is equivalent to NaN
+        if (+a !== +a) return +b !== +b;
+        // An `egal` comparison is performed for other numeric values.
+        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
       case '[object Date]':
       case '[object Boolean]':
         // Coerce dates and booleans to numeric primitive values. Dates are compared by their
         // millisecond representations. Note that invalid dates with millisecond representations
         // of `NaN` are not equivalent.
-        return +a == +b;
-      // RegExps are compared by their source patterns and flags.
-      case '[object RegExp]':
-        return a.source == b.source &&
-               a.global == b.global &&
-               a.multiline == b.multiline &&
-               a.ignoreCase == b.ignoreCase;
+        return +a === +b;
     }
     if (typeof a != 'object' || typeof b != 'object') return false;
     // Assume equality for cyclic structures. The algorithm for detecting cyclic
     // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
-    var length = stack.length;
+    var length = aStack.length;
     while (length--) {
       // Linear search. Performance is inversely proportional to the number of
       // unique nested structures.
-      if (stack[length] == a) return true;
+      if (aStack[length] === a) return bStack[length] === b;
+    }
+    // Objects with different constructors are not equivalent, but `Object`s
+    // from different frames are.
+    var aCtor = a.constructor, bCtor = b.constructor;
+    if (
+      aCtor !== bCtor &&
+      // Handle Object.create(x) cases
+      'constructor' in a && 'constructor' in b &&
+      !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
+        _.isFunction(bCtor) && bCtor instanceof bCtor)
+    ) {
+      return false;
     }
     // Add the first object to the stack of traversed objects.
-    stack.push(a);
-    var size = 0, result = true;
+    aStack.push(a);
+    bStack.push(b);
+    var size, result;
     // Recursively compare objects and arrays.
-    if (className == '[object Array]') {
+    if (className === '[object Array]') {
       // Compare array lengths to determine if a deep comparison is necessary.
       size = a.length;
-      result = size == b.length;
+      result = size === b.length;
       if (result) {
         // Deep compare the contents, ignoring non-numeric properties.
         while (size--) {
-          // Ensure commutative equality for sparse arrays.
-          if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
+          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
         }
       }
     } else {
-      // Objects with different constructors are not equivalent.
-      if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
       // Deep compare objects.
-      for (var key in a) {
-        if (_.has(a, key)) {
-          // Count the expected number of properties.
-          size++;
-          // Deep compare each member.
-          if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
-        }
-      }
-      // Ensure that both objects contain the same number of properties.
+      var keys = _.keys(a), key;
+      size = keys.length;
+      // Ensure that both objects contain the same number of properties before comparing deep equality.
+      result = _.keys(b).length === size;
       if (result) {
-        for (key in b) {
-          if (_.has(b, key) && !(size--)) break;
+        while (size--) {
+          // Deep compare each member
+          key = keys[size];
+          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
         }
-        result = !size;
       }
     }
     // Remove the first object from the stack of traversed objects.
-    stack.pop();
+    aStack.pop();
+    bStack.pop();
     return result;
-  }
+  };
 
   // Perform a deep comparison to check if two objects are equal.
   _.isEqual = function(a, b) {
-    return eq(a, b, []);
+    return eq(a, b, [], []);
   };
 
   // Is a given array, string, or object empty?
   // An "empty" object has no enumerable own-properties.
   _.isEmpty = function(obj) {
     if (obj == null) return true;
-    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
+    if (_.isArray(obj) || _.isString(obj) || _.isArguments(obj)) return obj.length === 0;
     for (var key in obj) if (_.has(obj, key)) return false;
     return true;
   };
 
   // Is a given value a DOM element?
   _.isElement = function(obj) {
-    return !!(obj && obj.nodeType == 1);
+    return !!(obj && obj.nodeType === 1);
   };
 
   // Is a given value an array?
   // Delegates to ECMA5's native Array.isArray
   _.isArray = nativeIsArray || function(obj) {
-    return toString.call(obj) == '[object Array]';
+    return toString.call(obj) === '[object Array]';
   };
 
   // Is a given variable an object?
   _.isObject = function(obj) {
-    return obj === Object(obj);
+    var type = typeof obj;
+    return type === 'function' || type === 'object' && !!obj;
   };
 
-  // Is a given variable an arguments object?
-  _.isArguments = function(obj) {
-    return toString.call(obj) == '[object Arguments]';
-  };
+  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
+  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
+    _['is' + name] = function(obj) {
+      return toString.call(obj) === '[object ' + name + ']';
+    };
+  });
+
+  // Define a fallback version of the method in browsers (ahem, IE), where
+  // there isn't any inspectable "Arguments" type.
   if (!_.isArguments(arguments)) {
     _.isArguments = function(obj) {
-      return !!(obj && _.has(obj, 'callee'));
+      return _.has(obj, 'callee');
     };
   }
 
-  // Is a given value a function?
-  _.isFunction = function(obj) {
-    return toString.call(obj) == '[object Function]';
-  };
-
-  // Is a given value a string?
-  _.isString = function(obj) {
-    return toString.call(obj) == '[object String]';
-  };
-
-  // Is a given value a number?
-  _.isNumber = function(obj) {
-    return toString.call(obj) == '[object Number]';
-  };
+  // Optimize `isFunction` if appropriate. Work around an IE 11 bug.
+  if (typeof /./ !== 'function') {
+    _.isFunction = function(obj) {
+      return typeof obj == 'function' || false;
+    };
+  }
 
   // Is a given object a finite number?
   _.isFinite = function(obj) {
-    return _.isNumber(obj) && isFinite(obj);
+    return isFinite(obj) && !isNaN(parseFloat(obj));
   };
 
-  // Is the given value `NaN`?
+  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
   _.isNaN = function(obj) {
-    // `NaN` is the only value for which `===` is not reflexive.
-    return obj !== obj;
+    return _.isNumber(obj) && obj !== +obj;
   };
 
   // Is a given value a boolean?
   _.isBoolean = function(obj) {
-    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
-  };
-
-  // Is a given value a date?
-  _.isDate = function(obj) {
-    return toString.call(obj) == '[object Date]';
-  };
-
-  // Is the given value a regular expression?
-  _.isRegExp = function(obj) {
-    return toString.call(obj) == '[object RegExp]';
+    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
   };
 
   // Is a given value equal to null?
@@ -857,9 +1138,10 @@
     return obj === void 0;
   };
 
-  // Has own property?
+  // Shortcut function for checking if an object has a given property directly
+  // on itself (in other words, not on a prototype).
   _.has = function(obj, key) {
-    return hasOwnProperty.call(obj, key);
+    return obj != null && hasOwnProperty.call(obj, key);
   };
 
   // Utility Functions
@@ -872,42 +1154,102 @@
     return this;
   };
 
-  // Keep the identity function around for default iterators.
+  // Keep the identity function around for default iteratees.
   _.identity = function(value) {
     return value;
   };
 
+  _.constant = function(value) {
+    return function() {
+      return value;
+    };
+  };
+
+  _.noop = function(){};
+
+  _.property = function(key) {
+    return function(obj) {
+      return obj[key];
+    };
+  };
+
+  // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
+  _.matches = function(attrs) {
+    var pairs = _.pairs(attrs), length = pairs.length;
+    return function(obj) {
+      if (obj == null) return !length;
+      obj = new Object(obj);
+      for (var i = 0; i < length; i++) {
+        var pair = pairs[i], key = pair[0];
+        if (pair[1] !== obj[key] || !(key in obj)) return false;
+      }
+      return true;
+    };
+  };
+
   // Run a function **n** times.
-  _.times = function (n, iterator, context) {
-    for (var i = 0; i < n; i++) iterator.call(context, i);
+  _.times = function(n, iteratee, context) {
+    var accum = Array(Math.max(0, n));
+    iteratee = createCallback(iteratee, context, 1);
+    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
+    return accum;
+  };
+
+  // Return a random integer between min and max (inclusive).
+  _.random = function(min, max) {
+    if (max == null) {
+      max = min;
+      min = 0;
+    }
+    return min + Math.floor(Math.random() * (max - min + 1));
   };
 
-  // Escape a string for HTML interpolation.
-  _.escape = function(string) {
-    return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
+  // A (possibly faster) way to get the current timestamp as an integer.
+  _.now = Date.now || function() {
+    return new Date().getTime();
   };
 
-  // If the value of the named property is a function then invoke it;
-  // otherwise, return it.
-  _.result = function(object, property) {
-    if (object == null) return null;
-    var value = object[property];
-    return _.isFunction(value) ? value.call(object) : value;
+   // List of HTML entities for escaping.
+  var escapeMap = {
+    '&': '&amp;',
+    '<': '&lt;',
+    '>': '&gt;',
+    '"': '&quot;',
+    "'": '&#x27;',
+    '`': '&#x60;'
   };
+  var unescapeMap = _.invert(escapeMap);
 
-  // Add your own custom functions to the Underscore object, ensuring that
-  // they're correctly added to the OOP wrapper as well.
-  _.mixin = function(obj) {
-    each(_.functions(obj), function(name){
-      addToWrapper(name, _[name] = obj[name]);
-    });
+  // Functions for escaping and unescaping strings to/from HTML interpolation.
+  var createEscaper = function(map) {
+    var escaper = function(match) {
+      return map[match];
+    };
+    // Regexes for identifying a key that needs to be escaped
+    var source = '(?:' + _.keys(map).join('|') + ')';
+    var testRegexp = RegExp(source);
+    var replaceRegexp = RegExp(source, 'g');
+    return function(string) {
+      string = string == null ? '' : '' + string;
+      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+    };
+  };
+  _.escape = createEscaper(escapeMap);
+  _.unescape = createEscaper(unescapeMap);
+
+  // If the value of the named `property` is a function then invoke it with the
+  // `object` as context; otherwise, return it.
+  _.result = function(object, property) {
+    if (object == null) return void 0;
+    var value = object[property];
+    return _.isFunction(value) ? object[property]() : value;
   };
 
   // Generate a unique integer id (unique within the entire client session).
   // Useful for temporary DOM ids.
   var idCounter = 0;
   _.uniqueId = function(prefix) {
-    var id = idCounter++;
+    var id = ++idCounter + '';
     return prefix ? prefix + id : id;
   };
 
@@ -922,138 +1264,152 @@
   // When customizing `templateSettings`, if you don't want to define an
   // interpolation, evaluation or escaping regex, we need one that is
   // guaranteed not to match.
-  var noMatch = /.^/;
+  var noMatch = /(.)^/;
 
   // Certain characters need to be escaped so that they can be put into a
   // string literal.
   var escapes = {
-    '\\': '\\',
-    "'": "'",
-    'r': '\r',
-    'n': '\n',
-    't': '\t',
-    'u2028': '\u2028',
-    'u2029': '\u2029'
-  };
-
-  for (var p in escapes) escapes[escapes[p]] = p;
-  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
-  var unescaper = /\\(\\|'|r|n|t|u2028|u2029)/g;
-
-  // Within an interpolation, evaluation, or escaping, remove HTML escaping
-  // that had been previously added.
-  var unescape = function(code) {
-    return code.replace(unescaper, function(match, escape) {
-      return escapes[escape];
-    });
+    "'":      "'",
+    '\\':     '\\',
+    '\r':     'r',
+    '\n':     'n',
+    '\u2028': 'u2028',
+    '\u2029': 'u2029'
+  };
+
+  var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
+
+  var escapeChar = function(match) {
+    return '\\' + escapes[match];
   };
 
   // JavaScript micro-templating, similar to John Resig's implementation.
   // Underscore templating handles arbitrary delimiters, preserves whitespace,
   // and correctly escapes quotes within interpolated code.
-  _.template = function(text, data, settings) {
-    settings = _.defaults(settings || {}, _.templateSettings);
-
-    // Compile the template source, taking care to escape characters that
-    // cannot be included in a string literal and then unescape them in code
-    // blocks.
-    var source = "__p+='" + text
-      .replace(escaper, function(match) {
-        return '\\' + escapes[match];
-      })
-      .replace(settings.escape || noMatch, function(match, code) {
-        return "'+\n_.escape(" + unescape(code) + ")+\n'";
-      })
-      .replace(settings.interpolate || noMatch, function(match, code) {
-        return "'+\n(" + unescape(code) + ")+\n'";
-      })
-      .replace(settings.evaluate || noMatch, function(match, code) {
-        return "';\n" + unescape(code) + "\n;__p+='";
-      }) + "';\n";
+  // NB: `oldSettings` only exists for backwards compatibility.
+  _.template = function(text, settings, oldSettings) {
+    if (!settings && oldSettings) settings = oldSettings;
+    settings = _.defaults({}, settings, _.templateSettings);
+
+    // Combine delimiters into one regular expression via alternation.
+    var matcher = RegExp([
+      (settings.escape || noMatch).source,
+      (settings.interpolate || noMatch).source,
+      (settings.evaluate || noMatch).source
+    ].join('|') + '|$', 'g');
+
+    // Compile the template source, escaping string literals appropriately.
+    var index = 0;
+    var source = "__p+='";
+    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+      source += text.slice(index, offset).replace(escaper, escapeChar);
+      index = offset + match.length;
+
+      if (escape) {
+        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+      } else if (interpolate) {
+        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+      } else if (evaluate) {
+        source += "';\n" + evaluate + "\n__p+='";
+      }
+
+      // Adobe VMs need the match returned to produce the correct offest.
+      return match;
+    });
+    source += "';\n";
 
     // If a variable is not specified, place data values in local scope.
     if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
 
-    source = "var __p='';" +
-      "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" +
-      source + "return __p;\n";
+    source = "var __t,__p='',__j=Array.prototype.join," +
+      "print=function(){__p+=__j.call(arguments,'');};\n" +
+      source + 'return __p;\n';
+
+    try {
+      var render = new Function(settings.variable || 'obj', '_', source);
+    } catch (e) {
+      e.source = source;
+      throw e;
+    }
 
-    var render = new Function(settings.variable || 'obj', '_', source);
-    if (data) return render(data, _);
     var template = function(data) {
       return render.call(this, data, _);
     };
 
-    // Provide the compiled function source as a convenience for build time
-    // precompilation.
-    template.source = 'function(' + (settings.variable || 'obj') + '){\n' +
-      source + '}';
+    // Provide the compiled source as a convenience for precompilation.
+    var argument = settings.variable || 'obj';
+    template.source = 'function(' + argument + '){\n' + source + '}';
 
     return template;
   };
 
-  // Add a "chain" function, which will delegate to the wrapper.
+  // Add a "chain" function. Start chaining a wrapped Underscore object.
   _.chain = function(obj) {
-    return _(obj).chain();
+    var instance = _(obj);
+    instance._chain = true;
+    return instance;
   };
 
-  // The OOP Wrapper
+  // OOP
   // ---------------
-
   // If Underscore is called as a function, it returns a wrapped object that
   // can be used OO-style. This wrapper holds altered versions of all the
   // underscore functions. Wrapped objects may be chained.
-  var wrapper = function(obj) { this._wrapped = obj; };
-
-  // Expose `wrapper.prototype` as `_.prototype`
-  _.prototype = wrapper.prototype;
 
   // Helper function to continue chaining intermediate results.
-  var result = function(obj, chain) {
-    return chain ? _(obj).chain() : obj;
+  var result = function(obj) {
+    return this._chain ? _(obj).chain() : obj;
   };
 
-  // A method to easily add functions to the OOP wrapper.
-  var addToWrapper = function(name, func) {
-    wrapper.prototype[name] = function() {
-      var args = slice.call(arguments);
-      unshift.call(args, this._wrapped);
-      return result(func.apply(_, args), this._chain);
-    };
+  // Add your own custom functions to the Underscore object.
+  _.mixin = function(obj) {
+    _.each(_.functions(obj), function(name) {
+      var func = _[name] = obj[name];
+      _.prototype[name] = function() {
+        var args = [this._wrapped];
+        push.apply(args, arguments);
+        return result.call(this, func.apply(_, args));
+      };
+    });
   };
 
   // Add all of the Underscore functions to the wrapper object.
   _.mixin(_);
 
   // Add all mutator Array functions to the wrapper.
-  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
     var method = ArrayProto[name];
-    wrapper.prototype[name] = function() {
-      var wrapped = this._wrapped;
-      method.apply(wrapped, arguments);
-      var length = wrapped.length;
-      if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
-      return result(wrapped, this._chain);
+    _.prototype[name] = function() {
+      var obj = this._wrapped;
+      method.apply(obj, arguments);
+      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
+      return result.call(this, obj);
     };
   });
 
   // Add all accessor Array functions to the wrapper.
-  each(['concat', 'join', 'slice'], function(name) {
+  _.each(['concat', 'join', 'slice'], function(name) {
     var method = ArrayProto[name];
-    wrapper.prototype[name] = function() {
-      return result(method.apply(this._wrapped, arguments), this._chain);
+    _.prototype[name] = function() {
+      return result.call(this, method.apply(this._wrapped, arguments));
     };
   });
 
-  // Start chaining a wrapped Underscore object.
-  wrapper.prototype.chain = function() {
-    this._chain = true;
-    return this;
-  };
-
   // Extracts the result from a wrapped and chained object.
-  wrapper.prototype.value = function() {
+  _.prototype.value = function() {
     return this._wrapped;
   };
 
-}).call(this);
+  // AMD registration happens at the end for compatibility with AMD loaders
+  // that may not enforce next-turn semantics on modules. Even though general
+  // practice for AMD registration is to be anonymous, underscore registers
+  // as a named module because, like jQuery, it is a base library that is
+  // popular enough to be bundled in a third party lib, but not be part of
+  // an AMD load request. Those cases could generate an error when an
+  // anonymous define() is called outside of a loader request.
+  if (typeof define === 'function' && define.amd) {
+    define('underscore', [], function() {
+      return _;
+    });
+  }
+}.call(this));

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/weinre
----------------------------------------------------------------------
diff --git a/weinre.server/weinre b/weinre.server/weinre
index 55b7f65..573f95d 100755
--- a/weinre.server/weinre
+++ b/weinre.server/weinre
@@ -23,13 +23,4 @@
 
 // script to run the weinre server
 
-var path = require('path')
-var fs   = require('fs')
-
-var rootPath = path.dirname(fs.realpathSync(__filename))
-
-var lib          = path.join(rootPath, 'lib')
-var node_modules = path.join(rootPath, 'node_modules')
-
-require(path.join(node_modules, 'coffee-script'))
-require(path.join(lib, '/cli')).run()
+require("./lib/cli").run()


[04/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/lib/nopt.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/lib/nopt.js b/weinre.server/node_modules/nopt/lib/nopt.js
index ff802da..5309a00 100644
--- a/weinre.server/node_modules/nopt/lib/nopt.js
+++ b/weinre.server/node_modules/nopt/lib/nopt.js
@@ -41,16 +41,16 @@ function nopt (types, shorthands, args, slice) {
   // now data is full
   clean(data, types, exports.typeDefs)
   data.argv = {remain:remain,cooked:cooked,original:original}
-  data.argv.toString = function () {
+  Object.defineProperty(data.argv, 'toString', { value: function () {
     return this.original.map(JSON.stringify).join(" ")
-  }
+  }, enumerable: false })
   return data
 }
 
 function clean (data, types, typeDefs) {
   typeDefs = typeDefs || exports.typeDefs
   var remove = {}
-    , typeDefault = [false, true, null, String, Number]
+    , typeDefault = [false, true, null, String, Array]
 
   Object.keys(data).forEach(function (k) {
     if (k === "argv") return
@@ -125,6 +125,14 @@ function validateString (data, k, val) {
 }
 
 function validatePath (data, k, val) {
+  if (val === true) return false
+  if (val === null) return true
+
+  val = String(val)
+  var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
+  if (val.match(homePattern) && process.env.HOME) {
+    val = path.resolve(process.env.HOME, val.substr(2))
+  }
   data[k] = path.resolve(String(val))
   return true
 }
@@ -235,13 +243,16 @@ function parse (args, data, remain, types, shorthands) {
       args[i] = "--"
       break
     }
-    if (arg.charAt(0) === "-") {
+    var hadEq = false
+    if (arg.charAt(0) === "-" && arg.length > 1) {
       if (arg.indexOf("=") !== -1) {
+        hadEq = true
         var v = arg.split("=")
         arg = v.shift()
         v = v.join("=")
         args.splice.apply(args, [i, 1].concat([arg, v]))
       }
+
       // see if it's a shorthand
       // if so, splice and back up to re-parse it.
       var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
@@ -255,7 +266,7 @@ function parse (args, data, remain, types, shorthands) {
         }
       }
       arg = arg.replace(/^-+/, "")
-      var no = false
+      var no = null
       while (arg.toLowerCase().indexOf("no-") === 0) {
         no = !no
         arg = arg.substr(3)
@@ -266,12 +277,20 @@ function parse (args, data, remain, types, shorthands) {
       var isArray = types[arg] === Array ||
         Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
 
+      // allow unknown things to be arrays if specified multiple times.
+      if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
+        if (!Array.isArray(data[arg]))
+          data[arg] = [data[arg]]
+        isArray = true
+      }
+
       var val
         , la = args[i + 1]
 
-      var isBool = no ||
+      var isBool = typeof no === 'boolean' ||
         types[arg] === Boolean ||
         Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
+        (typeof types[arg] === 'undefined' && !hadEq) ||
         (la === "false" &&
          (types[arg] === null ||
           Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
@@ -316,6 +335,9 @@ function parse (args, data, remain, types, shorthands) {
         continue
       }
 
+      if (types[arg] === String && la === undefined)
+        la = ""
+
       if (la && la.match(/^-{2,}$/)) {
         la = undefined
         i --
@@ -338,215 +360,55 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
   // all of the chars are single-char shorthands, and it's
   // not a match to some other abbrev.
   arg = arg.replace(/^-+/, '')
-  if (abbrevs[arg] && !shorthands[arg]) {
+
+  // if it's an exact known option, then don't go any further
+  if (abbrevs[arg] === arg)
     return null
-  }
-  if (shortAbbr[arg]) {
-    arg = shortAbbr[arg]
-  } else {
-    var singles = shorthands.___singles
-    if (!singles) {
-      singles = Object.keys(shorthands).filter(function (s) {
-        return s.length === 1
-      }).reduce(function (l,r) { l[r] = true ; return l }, {})
-      shorthands.___singles = singles
-    }
-    var chrs = arg.split("").filter(function (c) {
-      return singles[c]
-    })
-    if (chrs.join("") === arg) return chrs.map(function (c) {
-      return shorthands[c]
-    }).reduce(function (l, r) {
-      return l.concat(r)
-    }, [])
+
+  // if it's an exact known shortopt, same deal
+  if (shorthands[arg]) {
+    // make it an array, if it's a list of words
+    if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+      shorthands[arg] = shorthands[arg].split(/\s+/)
+
+    return shorthands[arg]
   }
 
-  if (shorthands[arg] && !Array.isArray(shorthands[arg])) {
-    shorthands[arg] = shorthands[arg].split(/\s+/)
+  // first check to see if this arg is a set of single-char shorthands
+  var singles = shorthands.___singles
+  if (!singles) {
+    singles = Object.keys(shorthands).filter(function (s) {
+      return s.length === 1
+    }).reduce(function (l,r) {
+      l[r] = true
+      return l
+    }, {})
+    shorthands.___singles = singles
+    debug('shorthand singles', singles)
   }
-  return shorthands[arg]
-}
 
-if (module === require.main) {
-var assert = require("assert")
-  , util = require("util")
-
-  , shorthands =
-    { s : ["--loglevel", "silent"]
-    , d : ["--loglevel", "info"]
-    , dd : ["--loglevel", "verbose"]
-    , ddd : ["--loglevel", "silly"]
-    , noreg : ["--no-registry"]
-    , reg : ["--registry"]
-    , "no-reg" : ["--no-registry"]
-    , silent : ["--loglevel", "silent"]
-    , verbose : ["--loglevel", "verbose"]
-    , h : ["--usage"]
-    , H : ["--usage"]
-    , "?" : ["--usage"]
-    , help : ["--usage"]
-    , v : ["--version"]
-    , f : ["--force"]
-    , desc : ["--description"]
-    , "no-desc" : ["--no-description"]
-    , "local" : ["--no-global"]
-    , l : ["--long"]
-    , p : ["--parseable"]
-    , porcelain : ["--parseable"]
-    , g : ["--global"]
-    }
+  var chrs = arg.split("").filter(function (c) {
+    return singles[c]
+  })
 
-  , types =
-    { aoa: Array
-    , nullstream: [null, Stream]
-    , date: Date
-    , str: String
-    , browser : String
-    , cache : path
-    , color : ["always", Boolean]
-    , depth : Number
-    , description : Boolean
-    , dev : Boolean
-    , editor : path
-    , force : Boolean
-    , global : Boolean
-    , globalconfig : path
-    , group : [String, Number]
-    , gzipbin : String
-    , logfd : [Number, Stream]
-    , loglevel : ["silent","win","error","warn","info","verbose","silly"]
-    , long : Boolean
-    , "node-version" : [false, String]
-    , npaturl : url
-    , npat : Boolean
-    , "onload-script" : [false, String]
-    , outfd : [Number, Stream]
-    , parseable : Boolean
-    , pre: Boolean
-    , prefix: path
-    , proxy : url
-    , "rebuild-bundle" : Boolean
-    , registry : url
-    , searchopts : String
-    , searchexclude: [null, String]
-    , shell : path
-    , t: [Array, String]
-    , tag : String
-    , tar : String
-    , tmp : path
-    , "unsafe-perm" : Boolean
-    , usage : Boolean
-    , user : String
-    , username : String
-    , userconfig : path
-    , version : Boolean
-    , viewer: path
-    , _exit : Boolean
-    }
+  if (chrs.join("") === arg) return chrs.map(function (c) {
+    return shorthands[c]
+  }).reduce(function (l, r) {
+    return l.concat(r)
+  }, [])
 
-; [["-v", {version:true}, []]
-  ,["---v", {version:true}, []]
-  ,["ls -s --no-reg connect -d",
-    {loglevel:"info",registry:null},["ls","connect"]]
-  ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
-  ,["ls --registry blargle", {}, ["ls"]]
-  ,["--no-registry", {registry:null}, []]
-  ,["--no-color true", {color:false}, []]
-  ,["--no-color false", {color:true}, []]
-  ,["--no-color", {color:false}, []]
-  ,["--color false", {color:false}, []]
-  ,["--color --logfd 7", {logfd:7,color:true}, []]
-  ,["--color=true", {color:true}, []]
-  ,["--logfd=10", {logfd:10}, []]
-  ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
-  ,["--tmp=tmp -tar=gtar",
-    {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
-  ,["--logfd x", {}, []]
-  ,["a -true -- -no-false", {true:true},["a","-no-false"]]
-  ,["a -no-false", {false:false},["a"]]
-  ,["a -no-no-true", {true:true}, ["a"]]
-  ,["a -no-no-no-false", {false:false}, ["a"]]
-  ,["---NO-no-No-no-no-no-nO-no-no"+
-    "-No-no-no-no-no-no-no-no-no"+
-    "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
-    "-no-body-can-do-the-boogaloo-like-I-do"
-   ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
-  ,["we are -no-strangers-to-love "+
-    "--you-know the-rules --and so-do-i "+
-    "---im-thinking-of=a-full-commitment "+
-    "--no-you-would-get-this-from-any-other-guy "+
-    "--no-gonna-give-you-up "+
-    "-no-gonna-let-you-down=true "+
-    "--no-no-gonna-run-around false "+
-    "--desert-you=false "+
-    "--make-you-cry false "+
-    "--no-tell-a-lie "+
-    "--no-no-and-hurt-you false"
-   ,{"strangers-to-love":false
-    ,"you-know":"the-rules"
-    ,"and":"so-do-i"
-    ,"you-would-get-this-from-any-other-guy":false
-    ,"gonna-give-you-up":false
-    ,"gonna-let-you-down":false
-    ,"gonna-run-around":false
-    ,"desert-you":false
-    ,"make-you-cry":false
-    ,"tell-a-lie":false
-    ,"and-hurt-you":false
-    },["we", "are"]]
-  ,["-t one -t two -t three"
-   ,{t: ["one", "two", "three"]}
-   ,[]]
-  ,["-t one -t null -t three four five null"
-   ,{t: ["one", "null", "three"]}
-   ,["four", "five", "null"]]
-  ,["-t foo"
-   ,{t:["foo"]}
-   ,[]]
-  ,["--no-t"
-   ,{t:["false"]}
-   ,[]]
-  ,["-no-no-t"
-   ,{t:["true"]}
-   ,[]]
-  ,["-aoa one -aoa null -aoa 100"
-   ,{aoa:["one", null, 100]}
-   ,[]]
-  ,["-str 100"
-   ,{str:"100"}
-   ,[]]
-  ,["--color always"
-   ,{color:"always"}
-   ,[]]
-  ,["--no-nullstream"
-   ,{nullstream:null}
-   ,[]]
-  ,["--nullstream false"
-   ,{nullstream:null}
-   ,[]]
-  ,["--notadate 2011-01-25"
-   ,{notadate: "2011-01-25"}
-   ,[]]
-  ,["--date 2011-01-25"
-   ,{date: new Date("2011-01-25")}
-   ,[]]
-  ].forEach(function (test) {
-    var argv = test[0].split(/\s+/)
-      , opts = test[1]
-      , rem = test[2]
-      , actual = nopt(types, shorthands, argv, 0)
-      , parsed = actual.argv
-    delete actual.argv
-    console.log(util.inspect(actual, false, 2, true), parsed.remain)
-    for (var i in opts) {
-      var e = JSON.stringify(opts[i])
-        , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
-      if (e && typeof e === "object") {
-        assert.deepEqual(e, a)
-      } else {
-        assert.equal(e, a)
-      }
-    }
-    assert.deepEqual(rem, parsed.remain)
-  })
+
+  // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
+  if (abbrevs[arg] && !shorthands[arg])
+    return null
+
+  // if it's an abbr for a shorthand, then use that
+  if (shortAbbr[arg])
+    arg = shortAbbr[arg]
+
+  // make it an array, if it's a list of words
+  if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+    shorthands[arg] = shorthands[arg].split(/\s+/)
+
+  return shorthands[arg]
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md b/weinre.server/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
new file mode 100644
index 0000000..2f30261
--- /dev/null
+++ b/weinre.server/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+ To get started, <a
+ href="http://www.clahub.com/agreements/isaacs/abbrev-js">sign the
+ Contributor License Agreement</a>.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/LICENSE
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/LICENSE b/weinre.server/node_modules/nopt/node_modules/abbrev/LICENSE
new file mode 100644
index 0000000..05a4010
--- /dev/null
+++ b/weinre.server/node_modules/nopt/node_modules/abbrev/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/abbrev.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/abbrev.js b/weinre.server/node_modules/nopt/node_modules/abbrev/abbrev.js
new file mode 100644
index 0000000..69cfeac
--- /dev/null
+++ b/weinre.server/node_modules/nopt/node_modules/abbrev/abbrev.js
@@ -0,0 +1,62 @@
+
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+  Object.defineProperty(Array.prototype, 'abbrev', {
+    value: function () { return abbrev(this) },
+    enumerable: false, configurable: true, writable: true
+  })
+
+  Object.defineProperty(Object.prototype, 'abbrev', {
+    value: function () { return abbrev(Object.keys(this)) },
+    enumerable: false, configurable: true, writable: true
+  })
+}
+
+function abbrev (list) {
+  if (arguments.length !== 1 || !Array.isArray(list)) {
+    list = Array.prototype.slice.call(arguments, 0)
+  }
+  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+  }
+
+  // sort them lexicographically, so that they're next to their nearest kin
+  args = args.sort(lexSort)
+
+  // walk through each, seeing how much it has in common with the next and previous
+  var abbrevs = {}
+    , prev = ""
+  for (var i = 0, l = args.length ; i < l ; i ++) {
+    var current = args[i]
+      , next = args[i + 1] || ""
+      , nextMatches = true
+      , prevMatches = true
+    if (current === next) continue
+    for (var j = 0, cl = current.length ; j < cl ; j ++) {
+      var curChar = current.charAt(j)
+      nextMatches = nextMatches && curChar === next.charAt(j)
+      prevMatches = prevMatches && curChar === prev.charAt(j)
+      if (!nextMatches && !prevMatches) {
+        j ++
+        break
+      }
+    }
+    prev = current
+    if (j === cl) {
+      abbrevs[current] = current
+      continue
+    }
+    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+      abbrevs[a] = current
+      a += current.charAt(j)
+    }
+  }
+  return abbrevs
+}
+
+function lexSort (a, b) {
+  return a === b ? 0 : a > b ? 1 : -1
+}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/lib/abbrev.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/weinre.server/node_modules/nopt/node_modules/abbrev/lib/abbrev.js
deleted file mode 100644
index 037de2d..0000000
--- a/weinre.server/node_modules/nopt/node_modules/abbrev/lib/abbrev.js
+++ /dev/null
@@ -1,106 +0,0 @@
-
-module.exports = exports = abbrev.abbrev = abbrev
-
-abbrev.monkeyPatch = monkeyPatch
-
-function monkeyPatch () {
-  Array.prototype.abbrev = function () { return abbrev(this) }
-  Object.prototype.abbrev = function () { return abbrev(Object.keys(this)) }
-}
-
-function abbrev (list) {
-  if (arguments.length !== 1 || !Array.isArray(list)) {
-    list = Array.prototype.slice.call(arguments, 0)
-  }
-  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
-    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
-  }
-
-  // sort them lexicographically, so that they're next to their nearest kin
-  args = args.sort(lexSort)
-
-  // walk through each, seeing how much it has in common with the next and previous
-  var abbrevs = {}
-    , prev = ""
-  for (var i = 0, l = args.length ; i < l ; i ++) {
-    var current = args[i]
-      , next = args[i + 1] || ""
-      , nextMatches = true
-      , prevMatches = true
-    if (current === next) continue
-    for (var j = 0, cl = current.length ; j < cl ; j ++) {
-      var curChar = current.charAt(j)
-      nextMatches = nextMatches && curChar === next.charAt(j)
-      prevMatches = prevMatches && curChar === prev.charAt(j)
-      if (nextMatches || prevMatches) continue
-      else {
-        j ++
-        break
-      }
-    }
-    prev = current
-    if (j === cl) {
-      abbrevs[current] = current
-      continue
-    }
-    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
-      abbrevs[a] = current
-      a += current.charAt(j)
-    }
-  }
-  return abbrevs
-}
-
-function lexSort (a, b) {
-  return a === b ? 0 : a > b ? 1 : -1
-}
-
-
-// tests
-if (module === require.main) {
-
-var assert = require("assert")
-  , sys
-sys = require("util")
-
-console.log("running tests")
-function test (list, expect) {
-  var actual = abbrev(list)
-  assert.deepEqual(actual, expect,
-    "abbrev("+sys.inspect(list)+") === " + sys.inspect(expect) + "\n"+
-    "actual: "+sys.inspect(actual))
-  actual = abbrev.apply(exports, list)
-  assert.deepEqual(abbrev.apply(exports, list), expect,
-    "abbrev("+list.map(JSON.stringify).join(",")+") === " + sys.inspect(expect) + "\n"+
-    "actual: "+sys.inspect(actual))
-}
-
-test([ "ruby", "ruby", "rules", "rules", "rules" ],
-{ rub: 'ruby'
-, ruby: 'ruby'
-, rul: 'rules'
-, rule: 'rules'
-, rules: 'rules'
-})
-test(["fool", "foom", "pool", "pope"],
-{ fool: 'fool'
-, foom: 'foom'
-, poo: 'pool'
-, pool: 'pool'
-, pop: 'pope'
-, pope: 'pope'
-})
-test(["a", "ab", "abc", "abcd", "abcde", "acde"],
-{ a: 'a'
-, ab: 'ab'
-, abc: 'abc'
-, abcd: 'abcd'
-, abcde: 'abcde'
-, ac: 'acde'
-, acd: 'acde'
-, acde: 'acde'
-})
-
-console.log("pass")
-
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/package.json b/weinre.server/node_modules/nopt/node_modules/abbrev/package.json
index 09b485e..b189020 100644
--- a/weinre.server/node_modules/nopt/node_modules/abbrev/package.json
+++ b/weinre.server/node_modules/nopt/node_modules/abbrev/package.json
@@ -1,20 +1,29 @@
 {
   "name": "abbrev",
-  "version": "1.0.3",
+  "version": "1.0.5",
   "description": "Like ruby's abbrev module, but in js",
   "author": {
     "name": "Isaac Z. Schlueter",
     "email": "i@izs.me"
   },
-  "main": "./lib/abbrev.js",
+  "main": "abbrev.js",
   "scripts": {
-    "test": "node lib/abbrev.js"
+    "test": "node test.js"
   },
   "repository": {
     "type": "git",
     "url": "http://github.com/isaacs/abbrev-js"
   },
+  "license": {
+    "type": "MIT",
+    "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE"
+  },
   "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n    var abbrev = require(\"abbrev\");\n    abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n    \n    // returns:\n    { fl: 'flop'\n    , flo: 'flop'\n    , flop: 'flop'\n    , fol: 'folding'\n    , fold: 'folding'\n    , foldi: 'folding'\n    , foldin: 'folding'\n    , folding: 'folding'\n    , foo: 'foo'\n    , fool: 'fool'\n    }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n",
-  "_id": "abbrev@1.0.3",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/isaacs/abbrev-js/issues"
+  },
+  "homepage": "https://github.com/isaacs/abbrev-js",
+  "_id": "abbrev@1.0.5",
   "_from": "abbrev@1"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/node_modules/abbrev/test.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/node_modules/abbrev/test.js b/weinre.server/node_modules/nopt/node_modules/abbrev/test.js
new file mode 100644
index 0000000..d5a7303
--- /dev/null
+++ b/weinre.server/node_modules/nopt/node_modules/abbrev/test.js
@@ -0,0 +1,47 @@
+var abbrev = require('./abbrev.js')
+var assert = require("assert")
+var util = require("util")
+
+console.log("TAP Version 13")
+var count = 0
+
+function test (list, expect) {
+  count++
+  var actual = abbrev(list)
+  assert.deepEqual(actual, expect,
+    "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
+    "actual: "+util.inspect(actual))
+  actual = abbrev.apply(exports, list)
+  assert.deepEqual(abbrev.apply(exports, list), expect,
+    "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
+    "actual: "+util.inspect(actual))
+  console.log('ok - ' + list.join(' '))
+}
+
+test([ "ruby", "ruby", "rules", "rules", "rules" ],
+{ rub: 'ruby'
+, ruby: 'ruby'
+, rul: 'rules'
+, rule: 'rules'
+, rules: 'rules'
+})
+test(["fool", "foom", "pool", "pope"],
+{ fool: 'fool'
+, foom: 'foom'
+, poo: 'pool'
+, pool: 'pool'
+, pop: 'pope'
+, pope: 'pope'
+})
+test(["a", "ab", "abc", "abcd", "abcde", "acde"],
+{ a: 'a'
+, ab: 'ab'
+, abc: 'abc'
+, abcd: 'abcd'
+, abcde: 'abcde'
+, ac: 'acde'
+, acd: 'acde'
+, acde: 'acde'
+})
+
+console.log("0..%d", count)

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/package.json b/weinre.server/node_modules/nopt/package.json
index fd2c42c..c80f907 100644
--- a/weinre.server/node_modules/nopt/package.json
+++ b/weinre.server/node_modules/nopt/package.json
@@ -1,6 +1,6 @@
 {
   "name": "nopt",
-  "version": "1.0.10",
+  "version": "3.0.1",
   "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
   "author": {
     "name": "Isaac Z. Schlueter",
@@ -9,7 +9,7 @@
   },
   "main": "lib/nopt.js",
   "scripts": {
-    "test": "node lib/nopt.js"
+    "test": "tap test/*.js"
   },
   "repository": {
     "type": "git",
@@ -25,7 +25,15 @@
   "dependencies": {
     "abbrev": "1"
   },
-  "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it.  The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser.  We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system.  You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n    // my-program.js\n    var nopt = require(\"nopt\")\n      , Stream = require(\"stream\").Strea
 m\n      , path = require(\"path\")\n      , knownOpts = { \"foo\" : [String, null]\n                    , \"bar\" : [Stream, Number]\n                    , \"baz\" : path\n                    , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n                    , \"flag\" : Boolean\n                    , \"pick\" : Boolean\n                    , \"many\" : [String, Array]\n                    }\n      , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n                     , \"b7\" : [\"--bar\", \"7\"]\n                     , \"m\" : [\"--bloo\", \"medium\"]\n                     , \"p\" : [\"--pick\"]\n                     , \"f\" : [\"--flag\"]\n                     }\n                 // everything is optional.\n                 // knownOpts and shorthands default to {}\n                 // arg list defaults to process.argv\n                 // slice defaults to 2\n      , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n    console.log(parsed)\n\nThis would give you su
 pport for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types,
  then it can take many\n# values, and will always be an array.  The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string.  No parsing is done.\n* path: A file system path.  Gets resolved against cwd if not absolute.\n* url: A url.  If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n  then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`.  If an option is a boolean,\n  then it does not need a value, and its presence will imply `true` as\n  the value.  To negate boolean flags, do `--n
 o-whatever` or `--whatever\n  false`\n* NaN: Means that the option is strictly not allowed.  Any value will\n  fail.\n* Stream: An object matching the \"Stream\" class in node.  Valuable\n  for use when validating programmatically.  (npm uses this to let you\n  supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n  will be parsed as a list of options.  This means that multiple values\n  can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values.  For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and 
 values, or multiple types, in a list.  For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.\n\nTo define a new type, add it to `nopt.typeDefs`.  Each item in that\nhash is an object with a `type` member and a `validate` method.  The\n`type` member is an object that matches what goes in the type list.  The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`.  Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found.  You can change this behavior by assigning a method\nto `nopt.invalidHandler`.  This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.i
 nvalidHandler` is assigned, then it will console.error\nits whining.  If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported.  If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts.  For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --for
 ce --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you.  So they're sliced off by\ndefault.  If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
-  "_id": "nopt@1.0.10",
-  "_from": "nopt@1.0.10"
+  "devDependencies": {
+    "tap": "~0.4.8"
+  },
+  "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it.  The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser.  We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system.  You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n    // my-program.js\n    var nopt = require(\"nopt\")\n      , Stream = require(\"stream\").Strea
 m\n      , path = require(\"path\")\n      , knownOpts = { \"foo\" : [String, null]\n                    , \"bar\" : [Stream, Number]\n                    , \"baz\" : path\n                    , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n                    , \"flag\" : Boolean\n                    , \"pick\" : Boolean\n                    , \"many\" : [String, Array]\n                    }\n      , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n                     , \"b7\" : [\"--bar\", \"7\"]\n                     , \"m\" : [\"--bloo\", \"medium\"]\n                     , \"p\" : [\"--pick\"]\n                     , \"f\" : [\"--flag\"]\n                     }\n                 // everything is optional.\n                 // knownOpts and shorthands default to {}\n                 // arg list defaults to process.argv\n                 // slice defaults to 2\n      , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n    console.log(parsed)\n\nThis would give you su
 pport for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is o
 ne of the types, then it can take many\n# values, and will always be an array.  The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string.  No parsing is done.\n* path: A file system path.  Gets resolved against cwd if not absolute.\n* url: A url.  If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n  then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`.  If an option is a boolean,\n  then it does not need a value, and its presence will imply `true` as\n  the value.  To negate boolea
 n flags, do `--no-whatever` or `--whatever\n  false`\n* NaN: Means that the option is strictly not allowed.  Any value will\n  fail.\n* Stream: An object matching the \"Stream\" class in node.  Valuable\n  for use when validating programmatically.  (npm uses this to let you\n  supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n  will be parsed as a list of options.  This means that multiple values\n  can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values.  For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list.
   For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.  When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`.  Each item in that\nhash is an object with a `type` member and a `validate` method.  The\n`type` member is an object that matches what goes in the type list.  The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`.  Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found.  You can change this behavior by assigning a method\nto `nopt.invalidHandler`.  This
  method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining.  If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported.  If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts.  For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\
 n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you.  So they're sliced off by\ndefault.  If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/isaacs/nopt/issues"
+  },
+  "homepage": "https://github.com/isaacs/nopt",
+  "_id": "nopt@3.0.1",
+  "_from": "nopt@3.0.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/test/basic.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/test/basic.js b/weinre.server/node_modules/nopt/test/basic.js
new file mode 100644
index 0000000..2f9088c
--- /dev/null
+++ b/weinre.server/node_modules/nopt/test/basic.js
@@ -0,0 +1,251 @@
+var nopt = require("../")
+  , test = require('tap').test
+
+
+test("passing a string results in a string", function (t) {
+  var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
+  t.same(parsed.key, "myvalue")
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/31
+test("Empty String results in empty string, not true", function (t) {
+  var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
+  t.same(parsed.empty, "")
+  t.end()
+})
+
+test("~ path is resolved to $HOME", function (t) {
+  var path = require("path")
+  if (!process.env.HOME) process.env.HOME = "/tmp"
+  var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
+  t.same(parsed.key, path.resolve(process.env.HOME, "val"))
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/24
+test("Unknown options are not parsed as numbers", function (t) {
+    var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0)
+    t.equal(parsed['leave-as-is'], '1.20')
+    t.equal(parsed['parse-me'], 1.2)
+    t.end()
+});
+
+test("other tests", function (t) {
+
+  var util = require("util")
+    , Stream = require("stream")
+    , path = require("path")
+    , url = require("url")
+
+    , shorthands =
+      { s : ["--loglevel", "silent"]
+      , d : ["--loglevel", "info"]
+      , dd : ["--loglevel", "verbose"]
+      , ddd : ["--loglevel", "silly"]
+      , noreg : ["--no-registry"]
+      , reg : ["--registry"]
+      , "no-reg" : ["--no-registry"]
+      , silent : ["--loglevel", "silent"]
+      , verbose : ["--loglevel", "verbose"]
+      , h : ["--usage"]
+      , H : ["--usage"]
+      , "?" : ["--usage"]
+      , help : ["--usage"]
+      , v : ["--version"]
+      , f : ["--force"]
+      , desc : ["--description"]
+      , "no-desc" : ["--no-description"]
+      , "local" : ["--no-global"]
+      , l : ["--long"]
+      , p : ["--parseable"]
+      , porcelain : ["--parseable"]
+      , g : ["--global"]
+      }
+
+    , types =
+      { aoa: Array
+      , nullstream: [null, Stream]
+      , date: Date
+      , str: String
+      , browser : String
+      , cache : path
+      , color : ["always", Boolean]
+      , depth : Number
+      , description : Boolean
+      , dev : Boolean
+      , editor : path
+      , force : Boolean
+      , global : Boolean
+      , globalconfig : path
+      , group : [String, Number]
+      , gzipbin : String
+      , logfd : [Number, Stream]
+      , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+      , long : Boolean
+      , "node-version" : [false, String]
+      , npaturl : url
+      , npat : Boolean
+      , "onload-script" : [false, String]
+      , outfd : [Number, Stream]
+      , parseable : Boolean
+      , pre: Boolean
+      , prefix: path
+      , proxy : url
+      , "rebuild-bundle" : Boolean
+      , registry : url
+      , searchopts : String
+      , searchexclude: [null, String]
+      , shell : path
+      , t: [Array, String]
+      , tag : String
+      , tar : String
+      , tmp : path
+      , "unsafe-perm" : Boolean
+      , usage : Boolean
+      , user : String
+      , username : String
+      , userconfig : path
+      , version : Boolean
+      , viewer: path
+      , _exit : Boolean
+      , path: path
+      }
+
+  ; [["-v", {version:true}, []]
+    ,["---v", {version:true}, []]
+    ,["ls -s --no-reg connect -d",
+      {loglevel:"info",registry:null},["ls","connect"]]
+    ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+    ,["ls --registry blargle", {}, ["ls"]]
+    ,["--no-registry", {registry:null}, []]
+    ,["--no-color true", {color:false}, []]
+    ,["--no-color false", {color:true}, []]
+    ,["--no-color", {color:false}, []]
+    ,["--color false", {color:false}, []]
+    ,["--color --logfd 7", {logfd:7,color:true}, []]
+    ,["--color=true", {color:true}, []]
+    ,["--logfd=10", {logfd:10}, []]
+    ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+    ,["--tmp=tmp -tar=gtar",
+      {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+    ,["--logfd x", {}, []]
+    ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+    ,["a -no-false", {false:false},["a"]]
+    ,["a -no-no-true", {true:true}, ["a"]]
+    ,["a -no-no-no-false", {false:false}, ["a"]]
+    ,["---NO-no-No-no-no-no-nO-no-no"+
+      "-No-no-no-no-no-no-no-no-no"+
+      "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+      "-no-body-can-do-the-boogaloo-like-I-do"
+     ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+    ,["we are -no-strangers-to-love "+
+      "--you-know=the-rules --and=so-do-i "+
+      "---im-thinking-of=a-full-commitment "+
+      "--no-you-would-get-this-from-any-other-guy "+
+      "--no-gonna-give-you-up "+
+      "-no-gonna-let-you-down=true "+
+      "--no-no-gonna-run-around false "+
+      "--desert-you=false "+
+      "--make-you-cry false "+
+      "--no-tell-a-lie "+
+      "--no-no-and-hurt-you false"
+     ,{"strangers-to-love":false
+      ,"you-know":"the-rules"
+      ,"and":"so-do-i"
+      ,"you-would-get-this-from-any-other-guy":false
+      ,"gonna-give-you-up":false
+      ,"gonna-let-you-down":false
+      ,"gonna-run-around":false
+      ,"desert-you":false
+      ,"make-you-cry":false
+      ,"tell-a-lie":false
+      ,"and-hurt-you":false
+      },["we", "are"]]
+    ,["-t one -t two -t three"
+     ,{t: ["one", "two", "three"]}
+     ,[]]
+    ,["-t one -t null -t three four five null"
+     ,{t: ["one", "null", "three"]}
+     ,["four", "five", "null"]]
+    ,["-t foo"
+     ,{t:["foo"]}
+     ,[]]
+    ,["--no-t"
+     ,{t:["false"]}
+     ,[]]
+    ,["-no-no-t"
+     ,{t:["true"]}
+     ,[]]
+    ,["-aoa one -aoa null -aoa 100"
+     ,{aoa:["one", null, '100']}
+     ,[]]
+    ,["-str 100"
+     ,{str:"100"}
+     ,[]]
+    ,["--color always"
+     ,{color:"always"}
+     ,[]]
+    ,["--no-nullstream"
+     ,{nullstream:null}
+     ,[]]
+    ,["--nullstream false"
+     ,{nullstream:null}
+     ,[]]
+    ,["--notadate=2011-01-25"
+     ,{notadate: "2011-01-25"}
+     ,[]]
+    ,["--date 2011-01-25"
+     ,{date: new Date("2011-01-25")}
+     ,[]]
+    ,["-cl 1"
+     ,{config: true, length: 1}
+     ,[]
+     ,{config: Boolean, length: Number, clear: Boolean}
+     ,{c: "--config", l: "--length"}]
+    ,["--acount bla"
+     ,{"acount":true}
+     ,["bla"]
+     ,{account: Boolean, credentials: Boolean, options: String}
+     ,{a:"--account", c:"--credentials",o:"--options"}]
+    ,["--clear"
+     ,{clear:true}
+     ,[]
+     ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
+     ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+    ,["--file -"
+     ,{"file":"-"}
+     ,[]
+     ,{file:String}
+     ,{}]
+    ,["--file -"
+     ,{"file":true}
+     ,["-"]
+     ,{file:Boolean}
+     ,{}]
+    ,["--path"
+     ,{"path":null}
+     ,[]]
+    ,["--path ."
+     ,{"path":process.cwd()}
+     ,[]]
+    ].forEach(function (test) {
+      var argv = test[0].split(/\s+/)
+        , opts = test[1]
+        , rem = test[2]
+        , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
+        , parsed = actual.argv
+      delete actual.argv
+      for (var i in opts) {
+        var e = JSON.stringify(opts[i])
+          , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+        if (e && typeof e === "object") {
+          t.deepEqual(e, a)
+        } else {
+          t.equal(e, a)
+        }
+      }
+      t.deepEqual(rem, parsed.remain)
+    })
+  t.end()
+})

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/.npmignore
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/.npmignore b/weinre.server/node_modules/underscore/.npmignore
deleted file mode 100644
index 2ce2684..0000000
--- a/weinre.server/node_modules/underscore/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-test/
-Rakefile
-docs/
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/CNAME
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/CNAME b/weinre.server/node_modules/underscore/CNAME
deleted file mode 100644
index a007e65..0000000
--- a/weinre.server/node_modules/underscore/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-underscorejs.org

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/LICENSE
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/LICENSE b/weinre.server/node_modules/underscore/LICENSE
index 61d28c0..0d6b873 100644
--- a/weinre.server/node_modules/underscore/LICENSE
+++ b/weinre.server/node_modules/underscore/LICENSE
@@ -1,4 +1,5 @@
-Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud
+Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative
+Reporters & Editors
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
@@ -19,4 +20,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/README.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/README.md b/weinre.server/node_modules/underscore/README.md
index a6564a2..c2ba259 100644
--- a/weinre.server/node_modules/underscore/README.md
+++ b/weinre.server/node_modules/underscore/README.md
@@ -1,19 +1,22 @@
-                       __                                                         
-                      /\ \                                                         __           
-     __  __    ___    \_\ \     __   _ __   ____    ___    ___   _ __    __       /\_\    ____  
-    /\ \/\ \ /' _ `\  /'_  \  /'__`\/\  __\/ ,__\  / ___\ / __`\/\  __\/'__`\     \/\ \  /',__\ 
+                       __
+                      /\ \                                                         __
+     __  __    ___    \_\ \     __   _ __   ____    ___    ___   _ __    __       /\_\    ____
+    /\ \/\ \ /' _ `\  /'_  \  /'__`\/\  __\/ ,__\  / ___\ / __`\/\  __\/'__`\     \/\ \  /',__\
     \ \ \_\ \/\ \/\ \/\ \ \ \/\  __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\  __/  __  \ \ \/\__, `\
      \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
-      \/___/  \/_/\/_/\/__,_ /\/____/ \/_/ \/___/  \/____/\/___/  \/_/ \/____/\/_//\ \_\ \/___/ 
-                                                                                  \ \____/      
+      \/___/  \/_/\/_/\/__,_ /\/____/ \/_/ \/___/  \/____/\/___/  \/_/ \/____/\/_//\ \_\ \/___/
+                                                                                  \ \____/
                                                                                    \/___/
-                                                                               
-Underscore.js is a utility-belt library for JavaScript that provides 
-support for the usual functional suspects (each, map, reduce, filter...) 
+
+Underscore.js is a utility-belt library for JavaScript that provides
+support for the usual functional suspects (each, map, reduce, filter...)
 without extending any core JavaScript objects.
 
 For Docs, License, Tests, and pre-packed downloads, see:
-http://documentcloud.github.com/underscore/
+http://underscorejs.org
+
+Underscore is an open-sourced component of DocumentCloud:
+https://github.com/documentcloud
 
 Many thanks to our contributors:
-https://github.com/documentcloud/underscore/contributors
+https://github.com/jashkenas/underscore/contributors

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/favicon.ico
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/favicon.ico b/weinre.server/node_modules/underscore/favicon.ico
deleted file mode 100755
index 0304968..0000000
Binary files a/weinre.server/node_modules/underscore/favicon.ico and /dev/null differ


[08/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/parser.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/parser.js
index f049903..724636b 100755
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/parser.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/parser.js
@@ -1,25 +1,98 @@
-/* Jison generated parser */
+/* parser generated by jison 0.4.13 */
+/*
+  Returns a Parser object of the following structure:
+
+  Parser: {
+    yy: {}
+  }
+
+  Parser.prototype: {
+    yy: {},
+    trace: function(),
+    symbols_: {associative list: name ==> number},
+    terminals_: {associative list: number ==> name},
+    productions_: [...],
+    performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
+    table: [...],
+    defaultActions: {...},
+    parseError: function(str, hash),
+    parse: function(input),
+
+    lexer: {
+        EOF: 1,
+        parseError: function(str, hash),
+        setInput: function(input),
+        input: function(),
+        unput: function(str),
+        more: function(),
+        less: function(n),
+        pastInput: function(),
+        upcomingInput: function(),
+        showPosition: function(),
+        test_match: function(regex_match_array, rule_index),
+        next: function(),
+        lex: function(),
+        begin: function(condition),
+        popState: function(),
+        _currentRules: function(),
+        topState: function(),
+        pushState: function(condition),
+
+        options: {
+            ranges: boolean           (optional: true ==> token location info will include a .range[] member)
+            flex: boolean             (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
+            backtrack_lexer: boolean  (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
+        },
+
+        performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
+        rules: [...],
+        conditions: {associative list: name ==> set},
+    }
+  }
+
+
+  token location info (@$, _$, etc.): {
+    first_line: n,
+    last_line: n,
+    first_column: n,
+    last_column: n,
+    range: [start_number, end_number]       (where the numbers are indexes into the input string, regular zero-based)
+  }
+
+
+  the parseError function receives a 'hash' object with these members for lexer and parser errors: {
+    text:        (matched text)
+    token:       (the produced terminal token, if any)
+    line:        (yylineno)
+  }
+  while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
+    loc:         (yylloc)
+    expected:    (string describing the set of expected tokens)
+    recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
+  }
+*/
 var parser = (function(){
 var parser = {trace: function trace() { },
 yy: {},
-symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"Index":69,"INDEX_START":70,"IndexValue":71,"INDEX_END":72,"INDEX_SOAK":73,"Slice":74,"{":75,"AssignList":76,"}":77,"CLASS":78,"EXTENDS":79,"OptFuncExist":80,"Argu
 ments":81,"SUPER":82,"FUNC_EXIST":83,"CALL_START":84,"CALL_END":85,"ArgList":86,"THIS":87,"@":88,"[":89,"]":90,"RangeDots":91,"..":92,"Arg":93,"SimpleArgs":94,"TRY":95,"Catch":96,"FINALLY":97,"CATCH":98,"THROW":99,"(":100,")":101,"WhileSource":102,"WHILE":103,"WHEN":104,"UNTIL":105,"Loop":106,"LOOP":107,"ForBody":108,"FOR":109,"ForStart":110,"ForSource":111,"ForVariables":112,"OWN":113,"ForValue":114,"FORIN":115,"FOROF":116,"BY":117,"SWITCH":118,"Whens":119,"ELSE":120,"When":121,"LEADING_WHEN":122,"IfBlock":123,"IF":124,"POST_IF":125,"UNARY":126,"-":127,"+":128,"--":129,"++":130,"?":131,"MATH":132,"SHIFT":133,"COMPARE":134,"LOGIC":135,"RELATION":136,"COMPOUND_ASSIGN":137,"$accept":0,"$end":1},
-terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",70:"INDEX_START",72:"INDEX_END",73:"INDEX_SOAK",75:"{",77:"}",78:"CLASS",79:"EXTENDS",82:"SUPER",83:"FUNC_EXIST",84:"CALL_START",85:"CALL_END",87:"THIS",88:"@",89:"[",90:"]",92:"..",95:"TRY",97:"FINALLY",98:"CATCH",99:"THROW",100:"(",101:")",103:"WHILE",104:"WHEN",105:"UNTIL",107:"LOOP",109:"FOR",113:"OWN",115:"FORIN",116:"FOROF",117:"BY",118:"SWITCH",120:"ELSE",122:"LEADING_WHEN",124:"IF",125:"POST_IF",126:"UNARY",127:"-",128:"+",129:"--",130:"++",131:"?",132:"MATH",133:"SHIFT",134:"COMPARE",135:"LOGIC",136:"RELATION",137:"COMPOUND_ASSIGN"},
-productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,1],[62,1],[69,3],[69,2],[71,1],[71,1],[59,4],[76,0],[76,1],[76,3],[76,4],[76,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[80,0],[80,1],[81,2],[81,4],[65,1],[65,1],[44,2],[58,2],[58,4],[91,1],[91,1],[64,5],[74,3],[74,2],[74,2],[74,1],[86,1],[86,3],[86,4],[86,4],[86,6],[93,1],[93,1],[94,1],[94,3],[19,2],[19,3],[19,4],[19,5],[96,3],[24,2],[63,3],[63,5],[102,2],[102,4],[102,2],[102,4],
 [20,2],[20,2],[20,2],[20,1],[106,2],[106,2],[21,2],[21,2],[21,2],[108,2],[108,2],[110,2],[110,3],[114,1],[114,1],[114,1],[114,1],[112,1],[112,3],[111,2],[111,2],[111,4],[111,4],[111,4],[111,6],[111,6],[22,5],[22,7],[22,4],[22,6],[119,1],[119,2],[121,3],[121,4],[123,3],[123,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]],
-performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist"
 :81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"UNARY_MATH":128,"-":129,"+":130,"--":131,"++":132,"?":133,"MATH":134,"**":135,"SHIFT":136,"COMPARE":137,"LOGIC":138,"RELATION":139,"COMPOUND_ASSIGN":140,"$accept":0,"$end":1},
+terminals_: {2:"error",6:"TERMINATOR",11:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"UNARY_MATH",129:"-",130:"+",131:"--",132:"++",133:"?",134:"MATH",135:"**",136:"SHIFT",137:"COMPARE",138:"LOGIC",139:"RELATION",140:"COMPOUND_ASSIGN"},
+productions_: [0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[16,3],[16,4],[16,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[9,2],[9,1],[10,1],[14,5],[14,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[55,1],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[12,1],[12,1],[12,1],[12,1],[12,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[94,1],[95,1],[95,3],[18,2],[18,3],[18,4],[18,5],[97,3],[97,3],[97,2],[23,2],[63,3],[63,5],[10
 3,2],[103,4],[103,2],[103,4],[19,2],[19,2],[19,2],[19,1],[107,2],[107,2],[20,2],[20,2],[20,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[21,5],[21,7],[21,4],[21,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]],
+performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
+/* this == yyval */
 
 var $0 = $$.length - 1;
 switch (yystate) {
-case 1:return this.$ = new yy.Block;
+case 1:return this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block);
 break;
 case 2:return this.$ = $$[$0];
 break;
-case 3:return this.$ = $$[$0-1];
+case 3:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]]));
 break;
-case 4:this.$ = yy.Block.wrap([$$[$0]]);
+case 4:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0]));
 break;
-case 5:this.$ = $$[$0-2].push($$[$0]);
+case 5:this.$ = $$[$0-1];
 break;
-case 6:this.$ = $$[$0-1];
+case 6:this.$ = $$[$0];
 break;
 case 7:this.$ = $$[$0];
 break;
@@ -27,9 +100,9 @@ case 8:this.$ = $$[$0];
 break;
 case 9:this.$ = $$[$0];
 break;
-case 10:this.$ = $$[$0];
+case 10:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 11:this.$ = new yy.Literal($$[$0]);
+case 11:this.$ = $$[$0];
 break;
 case 12:this.$ = $$[$0];
 break;
@@ -53,43 +126,43 @@ case 21:this.$ = $$[$0];
 break;
 case 22:this.$ = $$[$0];
 break;
-case 23:this.$ = $$[$0];
+case 23:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block);
 break;
-case 24:this.$ = new yy.Block;
+case 24:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]);
 break;
-case 25:this.$ = $$[$0-1];
+case 25:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 26:this.$ = new yy.Literal($$[$0]);
+case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 27:this.$ = new yy.Literal($$[$0]);
+case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 28:this.$ = new yy.Literal($$[$0]);
+case 28:this.$ = $$[$0];
 break;
-case 29:this.$ = $$[$0];
+case 29:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 30:this.$ = new yy.Literal($$[$0]);
+case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 31:this.$ = new yy.Literal($$[$0]);
+case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
 break;
-case 32:this.$ = new yy.Literal($$[$0]);
+case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined);
 break;
-case 33:this.$ = new yy.Undefined;
+case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null);
 break;
-case 34:this.$ = new yy.Null;
+case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0]));
 break;
-case 35:this.$ = new yy.Bool($$[$0]);
+case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0]));
 break;
-case 36:this.$ = new yy.Assign($$[$0-2], $$[$0]);
+case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0]));
 break;
-case 37:this.$ = new yy.Assign($$[$0-3], $$[$0]);
+case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1]));
 break;
-case 38:this.$ = new yy.Assign($$[$0-4], $$[$0-1]);
+case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 39:this.$ = new yy.Value($$[$0]);
+case 39:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object'));
 break;
-case 40:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object');
+case 40:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object'));
 break;
-case 41:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object');
+case 41:this.$ = $$[$0];
 break;
 case 42:this.$ = $$[$0];
 break;
@@ -97,41 +170,41 @@ case 43:this.$ = $$[$0];
 break;
 case 44:this.$ = $$[$0];
 break;
-case 45:this.$ = $$[$0];
+case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0]));
 break;
-case 46:this.$ = new yy.Return($$[$0]);
+case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return);
 break;
-case 47:this.$ = new yy.Return;
+case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0]));
 break;
-case 48:this.$ = new yy.Comment($$[$0]);
+case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1]));
 break;
-case 49:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]);
+case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1]));
 break;
-case 50:this.$ = new yy.Code([], $$[$0], $$[$0-1]);
+case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func');
 break;
-case 51:this.$ = 'func';
+case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc');
 break;
-case 52:this.$ = 'boundfunc';
+case 52:this.$ = $$[$0];
 break;
 case 53:this.$ = $$[$0];
 break;
-case 54:this.$ = $$[$0];
+case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]);
 break;
-case 55:this.$ = [];
+case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
 break;
-case 56:this.$ = [$$[$0]];
+case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
 break;
-case 57:this.$ = $$[$0-2].concat($$[$0]);
+case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
 break;
-case 58:this.$ = $$[$0-3].concat($$[$0]);
+case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
 break;
-case 59:this.$ = $$[$0-5].concat($$[$0-2]);
+case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0]));
 break;
-case 60:this.$ = new yy.Param($$[$0]);
+case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true));
 break;
-case 61:this.$ = new yy.Param($$[$0-1], null, true);
+case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0]));
 break;
-case 62:this.$ = new yy.Param($$[$0-2], $$[$0]);
+case 62:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Expansion);
 break;
 case 63:this.$ = $$[$0];
 break;
@@ -141,543 +214,511 @@ case 65:this.$ = $$[$0];
 break;
 case 66:this.$ = $$[$0];
 break;
-case 67:this.$ = new yy.Splat($$[$0-1]);
+case 67:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1]));
 break;
-case 68:this.$ = new yy.Value($$[$0]);
+case 68:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 69:this.$ = $$[$0-1].add($$[$0]);
+case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0]));
 break;
-case 70:this.$ = new yy.Value($$[$0-1], [].concat($$[$0]));
+case 70:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0])));
 break;
 case 71:this.$ = $$[$0];
 break;
 case 72:this.$ = $$[$0];
 break;
-case 73:this.$ = new yy.Value($$[$0]);
+case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 74:this.$ = new yy.Value($$[$0]);
+case 74:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
 case 75:this.$ = $$[$0];
 break;
-case 76:this.$ = new yy.Value($$[$0]);
+case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 77:this.$ = new yy.Value($$[$0]);
+case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 78:this.$ = new yy.Value($$[$0]);
+case 78:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
 case 79:this.$ = $$[$0];
 break;
-case 80:this.$ = new yy.Access($$[$0]);
+case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0]));
 break;
-case 81:this.$ = new yy.Access($$[$0], 'soak');
+case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak'));
 break;
-case 82:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])];
+case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]);
 break;
-case 83:this.$ = new yy.Access(new yy.Literal('prototype'));
+case 83:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]);
 break;
-case 84:this.$ = $$[$0];
+case 84:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype')));
 break;
-case 85:this.$ = $$[$0-1];
+case 85:this.$ = $$[$0];
 break;
-case 86:this.$ = yy.extend($$[$0], {
-          soak: true
-        });
+case 86:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]);
 break;
-case 87:this.$ = new yy.Index($$[$0]);
+case 87:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], {
+          soak: true
+        }));
 break;
-case 88:this.$ = new yy.Slice($$[$0]);
+case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0]));
 break;
-case 89:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated);
+case 89:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0]));
 break;
-case 90:this.$ = [];
+case 90:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated));
 break;
-case 91:this.$ = [$$[$0]];
+case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]);
 break;
-case 92:this.$ = $$[$0-2].concat($$[$0]);
+case 92:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
 break;
-case 93:this.$ = $$[$0-3].concat($$[$0]);
+case 93:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
 break;
-case 94:this.$ = $$[$0-5].concat($$[$0-2]);
+case 94:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
 break;
-case 95:this.$ = new yy.Class;
+case 95:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
 break;
-case 96:this.$ = new yy.Class(null, null, $$[$0]);
+case 96:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class);
 break;
-case 97:this.$ = new yy.Class(null, $$[$0]);
+case 97:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0]));
 break;
-case 98:this.$ = new yy.Class(null, $$[$0-1], $$[$0]);
+case 98:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0]));
 break;
-case 99:this.$ = new yy.Class($$[$0]);
+case 99:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0]));
 break;
-case 100:this.$ = new yy.Class($$[$0-1], null, $$[$0]);
+case 100:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0]));
 break;
-case 101:this.$ = new yy.Class($$[$0-2], $$[$0]);
+case 101:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0]));
 break;
-case 102:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]);
+case 102:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0]));
 break;
-case 103:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+case 103:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0]));
 break;
-case 104:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1]));
 break;
-case 105:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
+case 105:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1]));
 break;
-case 106:this.$ = new yy.Call('super', $$[$0]);
+case 106:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]));
 break;
-case 107:this.$ = false;
+case 107:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0]));
 break;
-case 108:this.$ = true;
+case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false);
 break;
-case 109:this.$ = [];
+case 109:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true);
 break;
-case 110:this.$ = $$[$0-2];
+case 110:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]);
 break;
-case 111:this.$ = new yy.Value(new yy.Literal('this'));
+case 111:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]);
 break;
-case 112:this.$ = new yy.Value(new yy.Literal('this'));
+case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this')));
 break;
-case 113:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this');
+case 113:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this')));
 break;
-case 114:this.$ = new yy.Arr([]);
+case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this'));
 break;
-case 115:this.$ = new yy.Arr($$[$0-2]);
+case 115:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([]));
 break;
-case 116:this.$ = 'inclusive';
+case 116:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2]));
 break;
-case 117:this.$ = 'exclusive';
+case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive');
 break;
-case 118:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]);
+case 118:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive');
 break;
-case 119:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]);
+case 119:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]));
 break;
-case 120:this.$ = new yy.Range($$[$0-1], null, $$[$0]);
+case 120:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1]));
 break;
-case 121:this.$ = new yy.Range(null, $$[$0], $$[$0-1]);
+case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0]));
 break;
-case 122:this.$ = new yy.Range(null, null, $$[$0]);
+case 122:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1]));
 break;
-case 123:this.$ = [$$[$0]];
+case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0]));
 break;
-case 124:this.$ = $$[$0-2].concat($$[$0]);
+case 124:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
 break;
-case 125:this.$ = $$[$0-3].concat($$[$0]);
+case 125:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
 break;
-case 126:this.$ = $$[$0-2];
+case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
 break;
-case 127:this.$ = $$[$0-5].concat($$[$0-2]);
+case 127:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]);
 break;
-case 128:this.$ = $$[$0];
+case 128:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
 break;
 case 129:this.$ = $$[$0];
 break;
 case 130:this.$ = $$[$0];
 break;
-case 131:this.$ = [].concat($$[$0-2], $$[$0]);
+case 131:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Expansion);
+break;
+case 132:this.$ = $$[$0];
+break;
+case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0]));
 break;
-case 132:this.$ = new yy.Try($$[$0]);
+case 134:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0]));
 break;
-case 133:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]);
+case 135:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]));
 break;
-case 134:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]);
+case 136:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0]));
 break;
-case 135:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]);
+case 137:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]));
 break;
-case 136:this.$ = [$$[$0-1], $$[$0]];
+case 138:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]);
 break;
-case 137:this.$ = new yy.Throw($$[$0]);
+case 139:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]);
 break;
-case 138:this.$ = new yy.Parens($$[$0-1]);
+case 140:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]);
 break;
-case 139:this.$ = new yy.Parens($$[$0-2]);
+case 141:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0]));
 break;
-case 140:this.$ = new yy.While($$[$0]);
+case 142:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1]));
 break;
-case 141:this.$ = new yy.While($$[$0-2], {
+case 143:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2]));
+break;
+case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0]));
+break;
+case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], {
           guard: $$[$0]
-        });
+        }));
 break;
-case 142:this.$ = new yy.While($$[$0], {
+case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], {
           invert: true
-        });
+        }));
 break;
-case 143:this.$ = new yy.While($$[$0-2], {
+case 147:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], {
           invert: true,
           guard: $$[$0]
-        });
+        }));
 break;
-case 144:this.$ = $$[$0-1].addBody($$[$0]);
+case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0]));
 break;
-case 145:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+case 149:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]]))));
 break;
-case 146:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]]))));
 break;
-case 147:this.$ = $$[$0];
+case 151:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]);
 break;
-case 148:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]);
+case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0]));
 break;
-case 149:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]]));
+case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]]))));
 break;
-case 150:this.$ = new yy.For($$[$0-1], $$[$0]);
+case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0]));
 break;
-case 151:this.$ = new yy.For($$[$0-1], $$[$0]);
+case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0]));
 break;
-case 152:this.$ = new yy.For($$[$0], $$[$0-1]);
+case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1]));
 break;
-case 153:this.$ = {
-          source: new yy.Value($$[$0])
-        };
+case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
+          source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0]))
+        });
 break;
-case 154:this.$ = (function () {
+case 158:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () {
         $$[$0].own = $$[$0-1].own;
         $$[$0].name = $$[$0-1][0];
         $$[$0].index = $$[$0-1][1];
         return $$[$0];
-      }());
+      }()));
 break;
-case 155:this.$ = $$[$0];
+case 159:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]);
 break;
-case 156:this.$ = (function () {
+case 160:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () {
         $$[$0].own = true;
         return $$[$0];
-      }());
+      }()));
 break;
-case 157:this.$ = $$[$0];
+case 161:this.$ = $$[$0];
 break;
-case 158:this.$ = $$[$0];
+case 162:this.$ = $$[$0];
 break;
-case 159:this.$ = new yy.Value($$[$0]);
+case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 160:this.$ = new yy.Value($$[$0]);
+case 164:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
 break;
-case 161:this.$ = [$$[$0]];
+case 165:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
 break;
-case 162:this.$ = [$$[$0-2], $$[$0]];
+case 166:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]);
 break;
-case 163:this.$ = {
+case 167:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
           source: $$[$0]
-        };
+        });
 break;
-case 164:this.$ = {
+case 168:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
           source: $$[$0],
           object: true
-        };
+        });
 break;
-case 165:this.$ = {
+case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
           source: $$[$0-2],
           guard: $$[$0]
-        };
+        });
 break;
-case 166:this.$ = {
+case 170:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
           source: $$[$0-2],
           guard: $$[$0],
           object: true
-        };
+        });
 break;
-case 167:this.$ = {
+case 171:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
           source: $$[$0-2],
           step: $$[$0]
-        };
+        });
 break;
-case 168:this.$ = {
+case 172:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({
           source: $$[$0-4],
           guard: $$[$0-2],
           step: $$[$0]
-        };
+        });
 break;
-case 169:this.$ = {
+case 173:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({
           source: $$[$0-4],
           step: $$[$0-2],
           guard: $$[$0]
-        };
+        });
 break;
-case 170:this.$ = new yy.Switch($$[$0-3], $$[$0-1]);
+case 174:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1]));
 break;
-case 171:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]);
+case 175:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]));
 break;
-case 172:this.$ = new yy.Switch(null, $$[$0-1]);
+case 176:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1]));
 break;
-case 173:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]);
+case 177:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1]));
 break;
-case 174:this.$ = $$[$0];
+case 178:this.$ = $$[$0];
 break;
-case 175:this.$ = $$[$0-1].concat($$[$0]);
+case 179:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0]));
 break;
-case 176:this.$ = [[$$[$0-1], $$[$0]]];
+case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]);
 break;
-case 177:this.$ = [[$$[$0-2], $$[$0-1]]];
+case 181:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]);
 break;
-case 178:this.$ = new yy.If($$[$0-1], $$[$0], {
+case 182:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], {
           type: $$[$0-2]
-        });
+        }));
 break;
-case 179:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], {
+case 183:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], {
           type: $$[$0-2]
-        }));
+        }))));
 break;
-case 180:this.$ = $$[$0];
+case 184:this.$ = $$[$0];
 break;
-case 181:this.$ = $$[$0-2].addElse($$[$0]);
+case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0]));
 break;
-case 182:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+case 186:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), {
           type: $$[$0-1],
           statement: true
-        });
+        }));
 break;
-case 183:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+case 187:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), {
           type: $$[$0-1],
           statement: true
-        });
+        }));
+break;
+case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0]));
+break;
+case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0]));
 break;
-case 184:this.$ = new yy.Op($$[$0-1], $$[$0]);
+case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0]));
 break;
-case 185:this.$ = new yy.Op('-', $$[$0]);
+case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0]));
 break;
-case 186:this.$ = new yy.Op('+', $$[$0]);
+case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0]));
 break;
-case 187:this.$ = new yy.Op('--', $$[$0]);
+case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0]));
 break;
-case 188:this.$ = new yy.Op('++', $$[$0]);
+case 194:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true));
 break;
-case 189:this.$ = new yy.Op('--', $$[$0-1], null, true);
+case 195:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true));
 break;
-case 190:this.$ = new yy.Op('++', $$[$0-1], null, true);
+case 196:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1]));
 break;
-case 191:this.$ = new yy.Existence($$[$0-1]);
+case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0]));
 break;
-case 192:this.$ = new yy.Op('+', $$[$0-2], $$[$0]);
+case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0]));
 break;
-case 193:this.$ = new yy.Op('-', $$[$0-2], $$[$0]);
+case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
 break;
-case 194:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
 break;
-case 195:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
 break;
-case 196:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+case 202:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
 break;
-case 197:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+case 203:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
 break;
-case 198:this.$ = (function () {
+case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () {
         if ($$[$0-1].charAt(0) === '!') {
           return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert();
         } else {
           return new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
         }
-      }());
+      }()));
 break;
-case 199:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]);
+case 205:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1]));
 break;
-case 200:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]);
+case 206:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]));
 break;
-case 201:this.$ = new yy.Extends($$[$0-2], $$[$0]);
+case 207:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2]));
+break;
+case 208:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0]));
 break;
 }
 },
-table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],101:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,
 64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,7],6:[2,7],26:[2,7],101:[2,7],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,8],6:[2,8],26:[2,8],101:[2,8],102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,12],73:[1,100],77:[2,12],80:92,83:[1,94],84:[2,107],85:[2,12],90:[2,12],92:[2,12],101:[2,12],103:[2,12],104:[2,12],105:[2,12],109:[2,12],117:[2,12],125:[2,12],127:[2,12],128:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],6
 2:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,13],73:[1,100],77:[2,13],80:101,83:[1,94],84:[2,107],85:[2,13],90:[2,13],92:[2,13],101:[2,13],103:[2,13],104:[2,13],105:[2,13],109:[2,13],117:[2,13],125:[2,13],127:[2,13],128:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],72:[2,14],77:[2,14],85:[2,14],90:[2,14],92:[2,14],101:[2,14],103:[2,14],104:[2,14],105:[2,14],109:[2,14],117:[2,14],125:[2,14],127:[2,14],128:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],72:[2,15],77:[2,15],85:[2,15],90:[2,15],92:[2,15],101:[2,15],103:[2,15],104:[2,15],105:[2,15],109:[2,15],117:[2,15],125:[2,15],127:[2,15],128:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],72:[2,16],77:[2,16],85:[2,16],90:[2,16],92:[2,16],1
 01:[2,16],103:[2,16],104:[2,16],105:[2,16],109:[2,16],117:[2,16],125:[2,16],127:[2,16],128:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],72:[2,17],77:[2,17],85:[2,17],90:[2,17],92:[2,17],101:[2,17],103:[2,17],104:[2,17],105:[2,17],109:[2,17],117:[2,17],125:[2,17],127:[2,17],128:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],72:[2,18],77:[2,18],85:[2,18],90:[2,18],92:[2,18],101:[2,18],103:[2,18],104:[2,18],105:[2,18],109:[2,18],117:[2,18],125:[2,18],127:[2,18],128:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],72:[2,19],77:[2,19],85:[2,19],90:[2,19],92:[2,19],101:[2,19],103:[2,19],104:[2,19],105:[2,19],109:[2,19],117:[2,19],125:[2,19],127:[2,19],128:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19],
 135:[2,19],136:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],72:[2,20],77:[2,20],85:[2,20],90:[2,20],92:[2,20],101:[2,20],103:[2,20],104:[2,20],105:[2,20],109:[2,20],117:[2,20],125:[2,20],127:[2,20],128:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],72:[2,21],77:[2,21],85:[2,21],90:[2,21],92:[2,21],101:[2,21],103:[2,21],104:[2,21],105:[2,21],109:[2,21],117:[2,21],125:[2,21],127:[2,21],128:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],72:[2,22],77:[2,22],85:[2,22],90:[2,22],92:[2,22],101:[2,22],103:[2,22],104:[2,22],105:[2,22],109:[2,22],117:[2,22],125:[2,22],127:[2,22],128:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],72:[2,23],77:[2,23],85:[2,23],90:[2,23],92:[2,23],
 101:[2,23],103:[2,23],104:[2,23],105:[2,23],109:[2,23],117:[2,23],125:[2,23],127:[2,23],128:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23]},{1:[2,9],6:[2,9],26:[2,9],101:[2,9],103:[2,9],105:[2,9],109:[2,9],125:[2,9]},{1:[2,10],6:[2,10],26:[2,10],101:[2,10],103:[2,10],105:[2,10],109:[2,10],125:[2,10]},{1:[2,11],6:[2,11],26:[2,11],101:[2,11],103:[2,11],105:[2,11],109:[2,11],125:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,103],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],70:[2,75],72:[2,75],73:[2,75],77:[2,75],83:[2,75],84:[2,75],85:[2,75],90:[2,75],92:[2,75],101:[2,75],103:[2,75],104:[2,75],105:[2,75],109:[2,75],117:[2,75],125:[2,75],127:[2,75],128:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],70:[2,76],72:[2,76],73:[2,76],77:[2,76],83:[2,76],84:[2,76],85:[2,76],90:[2,76],92:[2,76],101:[2,76],103:[2,76],104:[2,
 76],105:[2,76],109:[2,76],117:[2,76],125:[2,76],127:[2,76],128:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],70:[2,77],72:[2,77],73:[2,77],77:[2,77],83:[2,77],84:[2,77],85:[2,77],90:[2,77],92:[2,77],101:[2,77],103:[2,77],104:[2,77],105:[2,77],109:[2,77],117:[2,77],125:[2,77],127:[2,77],128:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],70:[2,78],72:[2,78],73:[2,78],77:[2,78],83:[2,78],84:[2,78],85:[2,78],90:[2,78],92:[2,78],101:[2,78],103:[2,78],104:[2,78],105:[2,78],109:[2,78],117:[2,78],125:[2,78],127:[2,78],128:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],70:[2,79],72:[2,79],73:[2,79],77:[2,79],83:[2,79],8
 4:[2,79],85:[2,79],90:[2,79],92:[2,79],101:[2,79],103:[2,79],104:[2,79],105:[2,79],109:[2,79],117:[2,79],125:[2,79],127:[2,79],128:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],70:[2,105],72:[2,105],73:[2,105],77:[2,105],81:104,83:[2,105],84:[1,105],85:[2,105],90:[2,105],92:[2,105],101:[2,105],103:[2,105],104:[2,105],105:[2,105],109:[2,105],117:[2,105],125:[2,105],127:[2,105],128:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105]},{6:[2,55],25:[2,55],27:109,28:[1,73],44:110,48:106,49:[2,55],54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{5:115,25:[1,5]},{8:116,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47
 :[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:118,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:119,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:
 [1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:120,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:124,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,7
 2],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,72],73:[2,72],77:[2,72],79:[1,128],83:[2,72],84:[2,72],85:[2,72],90:[2,72],92:[2,72],101:[2,72],103:[2,72],104:[2,72],105:[2,72],109:[2,72],117:[2,72],125:[2,72],127:[2,72],128:[2,72],129:[1,125],130:[1,126],131:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[1,127]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],72:[2,180],77:[2,180],85:[2,180],90:[2,180],92:[2,180],101:[2,180],103:[2,180],104:[2,180],105:[2,180],109:[2,180],117:[2,180],120:[1,129],125:[2,180],127:[2,180],128:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180]},{5:130,25:[1,5]},{5:131,25:[1,5]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],72:[2,147],77:[2,147],85:[2,147],90:[2,147],92:[2,147],101:[2,147],103:[2,147],104:[2,147],105:[2,147],109:[2,147],117:[2,147],125:[2,147],127:[2,147],128:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:
 [2,147]},{5:132,25:[1,5]},{8:133,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,134],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,95],5:135,6:[2,95],13:121,14:122,25:[1,5],26:[2,95],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,49:[2,95],54:[2,95],57:[2,95],58:47,59:48,61:137,63:25,64:26,65:27,72:[2,95],75:[1,70],77:[2,95],79:[1,136],82:[1,28],85:[2,95],87:[1,58],88:[1,59],89:[1,57],90:[2,95],92:[2,95],100:[1,56],101:[2,95],103:[2,95],104:[
 2,95],105:[2,95],109:[2,95],117:[2,95],125:[2,95],127:[2,95],128:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95]},{8:138,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,47],6:[2,47],8:139,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[
 1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,47],102:39,103:[2,47],105:[2,47],106:40,107:[1,67],108:41,109:[2,47],110:69,118:[1,42],123:37,124:[1,64],125:[2,47],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],77:[2,48],101:[2,48],103:[2,48],105:[2,48],109:[2,48],125:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],70:[2,73],72:[2,73],73:[2,73],77:[2,73],83:[2,73],84:[2,73],85:[2,73],90:[2,73],92:[2,73],101:[2,73],103:[2,73],104:[2,73],105:[2,73],109:[2,73],117:[2,73],125:[2,73],127:[2,73],128:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],70:[2,74],72:[2,74],73:[2,74],77:[2,74],83:[2,74],84:[2,74],85:[2,74],90:[2,74],92:[2,
 74],101:[2,74],103:[2,74],104:[2,74],105:[2,74],109:[2,74],117:[2,74],125:[2,74],127:[2,74],128:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],70:[2,29],72:[2,29],73:[2,29],77:[2,29],83:[2,29],84:[2,29],85:[2,29],90:[2,29],92:[2,29],101:[2,29],103:[2,29],104:[2,29],105:[2,29],109:[2,29],117:[2,29],125:[2,29],127:[2,29],128:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],70:[2,30],72:[2,30],73:[2,30],77:[2,30],83:[2,30],84:[2,30],85:[2,30],90:[2,30],92:[2,30],101:[2,30],103:[2,30],104:[2,30],105:[2,30],109:[2,30],117:[2,30],125:[2,30],127:[2,30],128:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],70:[2,31],72:[2,31
 ],73:[2,31],77:[2,31],83:[2,31],84:[2,31],85:[2,31],90:[2,31],92:[2,31],101:[2,31],103:[2,31],104:[2,31],105:[2,31],109:[2,31],117:[2,31],125:[2,31],127:[2,31],128:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],70:[2,32],72:[2,32],73:[2,32],77:[2,32],83:[2,32],84:[2,32],85:[2,32],90:[2,32],92:[2,32],101:[2,32],103:[2,32],104:[2,32],105:[2,32],109:[2,32],117:[2,32],125:[2,32],127:[2,32],128:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],70:[2,33],72:[2,33],73:[2,33],77:[2,33],83:[2,33],84:[2,33],85:[2,33],90:[2,33],92:[2,33],101:[2,33],103:[2,33],104:[2,33],105:[2,33],109:[2,33],117:[2,33],125:[2,33],127:[2,33],128:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],
 54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],70:[2,34],72:[2,34],73:[2,34],77:[2,34],83:[2,34],84:[2,34],85:[2,34],90:[2,34],92:[2,34],101:[2,34],103:[2,34],104:[2,34],105:[2,34],109:[2,34],117:[2,34],125:[2,34],127:[2,34],128:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],70:[2,35],72:[2,35],73:[2,35],77:[2,35],83:[2,35],84:[2,35],85:[2,35],90:[2,35],92:[2,35],101:[2,35],103:[2,35],104:[2,35],105:[2,35],109:[2,35],117:[2,35],125:[2,35],127:[2,35],128:[2,35],131:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35]},{4:140,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,141],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75
 :[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:142,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],70:[2,111],72:[2,111],73:[2,111],7
 7:[2,111],83:[2,111],84:[2,111],85:[2,111],90:[2,111],92:[2,111],101:[2,111],103:[2,111],104:[2,111],105:[2,111],109:[2,111],117:[2,111],125:[2,111],127:[2,111],128:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:148,28:[1,73],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],70:[2,112],72:[2,112],73:[2,112],77:[2,112],83:[2,112],84:[2,112],85:[2,112],90:[2,112],92:[2,112],101:[2,112],103:[2,112],104:[2,112],105:[2,112],109:[2,112],117:[2,112],125:[2,112],127:[2,112],128:[2,112],131:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],70:[2,68],72:[2,68],73:[2,68],77:[2,68],79:[2,68],83:[2,68],84:[2,68],85:[2,68],90:[2,68],92:[2,68],101:[2,68],103:[2,68],104:[2,68],105:[2,68],109:[2,68],117:[2,68],125:[2,68],127:[2,68],128:[2,68],129:[2,68],13
 0:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],70:[2,71],72:[2,71],73:[2,71],77:[2,71],79:[2,71],83:[2,71],84:[2,71],85:[2,71],90:[2,71],92:[2,71],101:[2,71],103:[2,71],104:[2,71],105:[2,71],109:[2,71],117:[2,71],125:[2,71],127:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71]},{8:149,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:
 [1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:150,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:151,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89
 :[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:152,8:153,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{27:158,28:[1,73],44:159,58:160,59:161,64:154,75:[1,70],88:[1,113],89:[1,57],112:155,113:[1,156],114:157},{111:162,115:[1,163],116:[1,164]},{6:[2,90],11:168,25:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:
 167,44:171,46:[1,46],54:[2,90],76:165,77:[2,90],88:[1,113]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],70:[2,27],72:[2,27],73:[2,27],77:[2,27],83:[2,27],84:[2,27],85:[2,27],90:[2,27],92:[2,27],101:[2,27],103:[2,27],104:[2,27],105:[2,27],109:[2,27],117:[2,27],125:[2,27],127:[2,27],128:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],70:[2,28],72:[2,28],73:[2,28],77:[2,28],83:[2,28],84:[2,28],85:[2,28],90:[2,28],92:[2,28],101:[2,28],103:[2,28],104:[2,28],105:[2,28],109:[2,28],117:[2,28],125:[2,28],127:[2,28],128:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],70:[2,26],72:[2,26],73:[2,26],77:[2,26],79:[2,26],83:[2,26],84:[2,26],85:[2,26],90:[2,26
 ],92:[2,26],101:[2,26],103:[2,26],104:[2,26],105:[2,26],109:[2,26],115:[2,26],116:[2,26],117:[2,26],125:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,6],6:[2,6],7:172,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,6],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],72:[2,24],77:[2,24],85:[2,24],90:[2,24],92:[2,24],97:[2,24],98:[2,24],101:[2,24],10
 3:[2,24],104:[2,24],105:[2,24],109:[2,24],117:[2,24],120:[2,24],122:[2,24],125:[2,24],127:[2,24],128:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24]},{6:[1,74],26:[1,173]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],72:[2,191],77:[2,191],85:[2,191],90:[2,191],92:[2,191],101:[2,191],103:[2,191],104:[2,191],105:[2,191],109:[2,191],117:[2,191],125:[2,191],127:[2,191],128:[2,191],131:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191]},{8:174,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,4
 2],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:175,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:176,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58
 ],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:177,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:178,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:
 63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:179,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:180,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22
 :17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:181,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],1
 27:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],72:[2,146],77:[2,146],85:[2,146],90:[2,146],92:[2,146],101:[2,146],103:[2,146],104:[2,146],105:[2,146],109:[2,146],117:[2,146],125:[2,146],127:[2,146],128:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],72:[2,151],77:[2,151],85:[2,151],90:[2,151],92:[2,151],101:[2,151],103:[2,151],104:[2,151],105:[2,151],109:[2,151],117:[2,151],125:[2,151],127:[2,151],128:[2,151],131:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151]},{8:182,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78
 :[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],72:[2,145],77:[2,145],85:[2,145],90:[2,145],92:[2,145],101:[2,145],103:[2,145],104:[2,145],105:[2,145],109:[2,145],117:[2,145],125:[2,145],127:[2,145],128:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145],135:[2,145],136:[2,145]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],72:[2,150],77:[2,150],85:[2,150],90:[2,150],92:[2,150],101:[2,150],103:[2,150],104:[2,150],105:[2,150],109:[2,150],117:[2,150],125:[2,150],127:[2,150],128:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150]},{81:183,84:[1,105]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],70:[2,69
 ],72:[2,69],73:[2,69],77:[2,69],79:[2,69],83:[2,69],84:[2,69],85:[2,69],90:[2,69],92:[2,69],101:[2,69],103:[2,69],104:[2,69],105:[2,69],109:[2,69],117:[2,69],125:[2,69],127:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69]},{84:[2,108]},{27:184,28:[1,73]},{27:185,28:[1,73]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:186,28:[1,73],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],70:[2,83],72:[2,83],73:[2,83],77:[2,83],79:[2,83],83:[2,83],84:[2,83],85:[2,83],90:[2,83],92:[2,83],101:[2,83],103:[2,83],104:[2,83],105:[2,83],109:[2,83],117:[2,83],125:[2,83],127:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],70:[2,84],72:[2,84],73:[2,84],77:[2,84],79:[2,84],83:[2,84],84:[2,84],85:[2,84],90:[2,84],92:[2,84],101:[2,84],103:[2,84]
 ,104:[2,84],105:[2,84],109:[2,84],117:[2,84],125:[2,84],127:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84]},{8:188,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,192],58:47,59:48,61:36,63:25,64:26,65:27,71:187,74:189,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],91:190,92:[1,191],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{69:193,70:[1,99],73:[1,100]},{81:194,84:[1,105]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],70:[2,70],72:[2,70],73:[2,70],77:[2,70],79:[2,70],83
 :[2,70],84:[2,70],85:[2,70],90:[2,70],92:[2,70],101:[2,70],103:[2,70],104:[2,70],105:[2,70],109:[2,70],117:[2,70],125:[2,70],127:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70]},{6:[1,196],8:195,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,197],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],70:[2,106],72:[2,106],73:[2,106],77:[2,106],83:[2,106],
 84:[2,106],85:[2,106],90:[2,106],92:[2,106],101:[2,106],103:[2,106],104:[2,106],105:[2,106],109:[2,106],117:[2,106],125:[2,106],127:[2,106],128:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[1,198],86:199,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],49:[1,201],53:203,54:[1,202]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,205],49:[2,60],54:[2,60],57
 :[1,204]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:148,28:[1,73]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],72:[2,5
 0],77:[2,50],85:[2,50],90:[2,50],92:[2,50],101:[2,50],103:[2,50],104:[2,50],105:[2,50],109:[2,50],117:[2,50],125:[2,50],127:[2,50],128:[2,50],131:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],72:[2,184],77:[2,184],85:[2,184],90:[2,184],92:[2,184],101:[2,184],102:87,103:[2,184],104:[2,184],105:[2,184],108:88,109:[2,184],110:69,117:[2,184],125:[2,184],127:[2,184],128:[2,184],131:[1,78],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184]},{102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],72:[2,185],77:[2,185],85:[2,185],90:[2,185],92:[2,185],101:[2,185],102:87,103:[2,185],104:[2,185],105:[2,185],108:88,109:[2,185],110:69,117:[2,185],125:[2,185],127:[2,185],128:[2,185],131:[1,78],132:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:
 [2,186],57:[2,186],72:[2,186],77:[2,186],85:[2,186],90:[2,186],92:[2,186],101:[2,186],102:87,103:[2,186],104:[2,186],105:[2,186],108:88,109:[2,186],110:69,117:[2,186],125:[2,186],127:[2,186],128:[2,186],131:[1,78],132:[2,186],133:[2,186],134:[2,186],135:[2,186],136:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,187],73:[2,72],77:[2,187],83:[2,72],84:[2,72],85:[2,187],90:[2,187],92:[2,187],101:[2,187],103:[2,187],104:[2,187],105:[2,187],109:[2,187],117:[2,187],125:[2,187],127:[2,187],128:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187],135:[2,187],136:[2,187]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:92,83:[1,94],84:[2,107]},{62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:101,83:[1,94],84:[2,107]},{66:[2,75],67:[2,75],68:[2,75],70:[2,75],73:[2,75],83:[2,75],84:[2,75]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],66:[2,
 72],67:[2,72],68:[2,72],70:[2,72],72:[2,188],73:[2,72],77:[2,188],83:[2,72],84:[2,72],85:[2,188],90:[2,188],92:[2,188],101:[2,188],103:[2,188],104:[2,188],105:[2,188],109:[2,188],117:[2,188],125:[2,188],127:[2,188],128:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188],135:[2,188],136:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],72:[2,189],77:[2,189],85:[2,189],90:[2,189],92:[2,189],101:[2,189],103:[2,189],104:[2,189],105:[2,189],109:[2,189],117:[2,189],125:[2,189],127:[2,189],128:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],72:[2,190],77:[2,190],85:[2,190],90:[2,190],92:[2,190],101:[2,190],103:[2,190],104:[2,190],105:[2,190],109:[2,190],117:[2,190],125:[2,190],127:[2,190],128:[2,190],131:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190]},{8:206,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:1
 4,20:15,21:16,22:17,23:18,24:19,25:[1,207],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:208,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123
 :37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:209,25:[1,5],124:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],72:[2,132],77:[2,132],85:[2,132],90:[2,132],92:[2,132],96:211,97:[1,212],98:[1,213],101:[2,132],103:[2,132],104:[2,132],105:[2,132],109:[2,132],117:[2,132],125:[2,132],127:[2,132],128:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],72:[2,144],77:[2,144],85:[2,144],90:[2,144],92:[2,144],101:[2,144],103:[2,144],104:[2,144],105:[2,144],109:[2,144],117:[2,144],125:[2,144],127:[2,144],128:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144],135:[2,144],136:[2,144]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],72:[2,152],77:[2,152],85:[2,152],90:[2,152],92:[2,152],101:[2,152],103:[2,152],104:[2,152],105:[2,152],109:[2,152],117:[2,152],125:[2,152],127:[2,152],128:[2,152],131:[
 2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152]},{25:[1,214],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{119:215,121:216,122:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],72:[2,96],77:[2,96],85:[2,96],90:[2,96],92:[2,96],101:[2,96],103:[2,96],104:[2,96],105:[2,96],109:[2,96],117:[2,96],125:[2,96],127:[2,96],128:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96]},{8:218,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:
 [1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,99],5:219,6:[2,99],25:[1,5],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,99],73:[2,72],77:[2,99],79:[1,220],83:[2,72],84:[2,72],85:[2,99],90:[2,99],92:[2,99],101:[2,99],103:[2,99],104:[2,99],105:[2,99],109:[2,99],117:[2,99],125:[2,99],127:[2,99],128:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],72:[2,137],77:[2,137],85:[2,137],90:[2,137],92:[2,137],101:[2,137],102:87,103:[2,137],104:[2,137],105:[2,137],108:88,109:[2,137],110:69,117:[2,137],125:[2,137],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,46],6:[2,46],26:[2,46],101:[2,46],102:87,103:[2,46],105:[2,46],108:88,109:[2,46],110:69,125:[2,46],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],13
 6:[1,85]},{6:[1,74],101:[1,221]},{4:222,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],90:[2,128],91:223,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],70:[2,114],72:[2,114],73:[2,114],77:[2,114],83
 :[2,114],84:[2,114],85:[2,114],90:[2,114],92:[2,114],101:[2,114],103:[2,114],104:[2,114],105:[2,114],109:[2,114],115:[2,114],116:[2,114],117:[2,114],125:[2,114],127:[2,114],128:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114]},{6:[2,53],25:[2,53],53:225,54:[1,226],90:[2,53]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],85:[2,123],90:[2,123]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:227,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,129],25:[2,129],26:[
 2,129],54:[2,129],85:[2,129],90:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],70:[2,113],72:[2,113],73:[2,113],77:[2,113],79:[2,113],83:[2,113],84:[2,113],85:[2,113],90:[2,113],92:[2,113],101:[2,113],103:[2,113],104:[2,113],105:[2,113],109:[2,113],115:[2,113],116:[2,113],117:[2,113],125:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{5:228,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],72:[2,140],77:[2,140],85:[2,140],90:[2,140],92:[2,140],101:[2,140],102:87,103:[1,65],104:[1,229],105:[1,66],108:88,109:[1,68],110:69,117:[2,140],125:[2,140],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[
 1,84],136:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],72:[2,142],77:[2,142],85:[2,142],90:[2,142],92:[2,142],101:[2,142],102:87,103:[1,65],104:[1,230],105:[1,66],108:88,109:[1,68],110:69,117:[2,142],125:[2,142],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],72:[2,148],77:[2,148],85:[2,148],90:[2,148],92:[2,148],101:[2,148],103:[2,148],104:[2,148],105:[2,148],109:[2,148],117:[2,148],125:[2,148],127:[2,148],128:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],72:[2,149],77:[2,149],85:[2,149],90:[2,149],92:[2,149],101:[2,149],102:87,103:[1,65],104:[2,149],105:[1,66],108:88,109:[1,68],110:69,117:[2,149],125:[2,149],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,153],6:[2,153],25
 :[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],72:[2,153],77:[2,153],85:[2,153],90:[2,153],92:[2,153],101:[2,153],103:[2,153],104:[2,153],105:[2,153],109:[2,153],117:[2,153],125:[2,153],127:[2,153],128:[2,153],131:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153]},{115:[2,155],116:[2,155]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],112:231,114:157},{54:[1,232],115:[2,161],116:[2,161]},{54:[2,157],115:[2,157],116:[2,157]},{54:[2,158],115:[2,158],116:[2,158]},{54:[2,159],115:[2,159],116:[2,159]},{54:[2,160],115:[2,160],116:[2,160]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],72:[2,154],77:[2,154],85:[2,154],90:[2,154],92:[2,154],101:[2,154],103:[2,154],104:[2,154],105:[2,154],109:[2,154],117:[2,154],125:[2,154],127:[2,154],128:[2,154],131:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154]},{8:233,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:1
 8,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:234,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32
 ],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],53:235,54:[1,236],77:[2,53]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],77:[2,91]},{6:[2,39],25:[2,39],26:[2,39],43:[1,237],54:[2,39],77:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],77:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],77:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],77:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],77:[2,45]},{1:[2,5],6:[2,5],26:[2,5],101:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],72:[2,25],77:[2,25],85:[2,25],90:[2,25],92:[2,25],97:[2,25],98:[2,25],101:[2,25],103:[2,25],104:[2,25],105:[2,25],109:[2,25],117:[2,25],120:[2,25],122:[2,25],125:[2,25],127:[2,25],128:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],72:[2,192],77:[2,192],85:[2,192],90:[2,192],92:[2,192],101:[2,192],102:87,103:[2,192],104:[2,192],105:[2,192],108:88,109:[2,1
 92],110:69,117:[2,192],125:[2,192],127:[2,192],128:[2,192],131:[1,78],132:[1,81],133:[2,192],134:[2,192],135:[2,192],136:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],72:[2,193],77:[2,193],85:[2,193],90:[2,193],92:[2,193],101:[2,193],102:87,103:[2,193],104:[2,193],105:[2,193],108:88,109:[2,193],110:69,117:[2,193],125:[2,193],127:[2,193],128:[2,193],131:[1,78],132:[1,81],133:[2,193],134:[2,193],135:[2,193],136:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],72:[2,194],77:[2,194],85:[2,194],90:[2,194],92:[2,194],101:[2,194],102:87,103:[2,194],104:[2,194],105:[2,194],108:88,109:[2,194],110:69,117:[2,194],125:[2,194],127:[2,194],128:[2,194],131:[1,78],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],72:[2,195],77:[2,195],85:[2,195],90:[2,195],92:[2,195],101:[2,195],102:87,103:[2,195],104:[2,195],105:[2,195],108:88,109:[2,195]
 ,110:69,117:[2,195],125:[2,195],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[2,195],134:[2,195],135:[2,195],136:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],72:[2,196],77:[2,196],85:[2,196],90:[2,196],92:[2,196],101:[2,196],102:87,103:[2,19

<TRUNCATED>

[14/14] weinre commit: pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
pre-compile CoffeeScript files in server


Project: http://git-wip-us.apache.org/repos/asf/cordova-weinre/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-weinre/commit/9b06777d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-weinre/tree/9b06777d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-weinre/diff/9b06777d

Branch: refs/heads/CB-7430
Commit: 9b06777d6b23d1d2785b66a0e3f6f6c754561a08
Parents: feb2f06
Author: Patrick Mueller <pm...@apache.org>
Authored: Sat Aug 30 14:42:05 2014 -0400
Committer: Patrick Mueller <pm...@apache.org>
Committed: Sat Aug 30 14:42:05 2014 -0400

----------------------------------------------------------------------
 .wr                                             |    2 +-
 weinre.build/build.xml                          |   21 +
 weinre.build/package.json.template              |   10 +-
 weinre.server/lib-src/Channel.coffee            |  118 +
 weinre.server/lib-src/HttpChannelHandler.coffee |  154 ++
 weinre.server/lib-src/MessageQueue.coffee       |   87 +
 weinre.server/lib-src/channelManager.coffee     |  126 ++
 weinre.server/lib-src/cli.coffee                |  130 ++
 weinre.server/lib-src/dumpingHandler.coffee     |   77 +
 weinre.server/lib-src/extensionManager.coffee   |   30 +
 weinre.server/lib-src/jsonBodyParser.coffee     |   47 +
 weinre.server/lib-src/messageHandler.coffee     |   59 +
 .../lib-src/service/WeinreClientCommands.coffee |  126 ++
 .../lib-src/service/WeinreTargetCommands.coffee |   90 +
 weinre.server/lib-src/serviceManager.coffee     |   95 +
 weinre.server/lib-src/utils.coffee              |  196 ++
 weinre.server/lib-src/weinre.coffee             |  186 ++
 weinre.server/lib/Channel.coffee                |  118 -
 weinre.server/lib/Channel.js                    |  130 ++
 weinre.server/lib/HttpChannelHandler.coffee     |  154 --
 weinre.server/lib/HttpChannelHandler.js         |  130 ++
 weinre.server/lib/MessageQueue.coffee           |   87 -
 weinre.server/lib/MessageQueue.js               |   82 +
 weinre.server/lib/channelManager.coffee         |  126 --
 weinre.server/lib/channelManager.js             |  122 +
 weinre.server/lib/cli.coffee                    |  130 --
 weinre.server/lib/cli.js                        |   97 +
 weinre.server/lib/dumpingHandler.coffee         |   77 -
 weinre.server/lib/dumpingHandler.js             |   74 +
 weinre.server/lib/extensionManager.coffee       |   30 -
 weinre.server/lib/extensionManager.js           |   15 +
 weinre.server/lib/jsonBodyParser.coffee         |   47 -
 weinre.server/lib/jsonBodyParser.js             |   39 +
 weinre.server/lib/messageHandler.coffee         |   59 -
 weinre.server/lib/messageHandler.js             |   51 +
 .../lib/service/WeinreClientCommands.coffee     |  126 --
 .../lib/service/WeinreClientCommands.js         |  140 ++
 .../lib/service/WeinreTargetCommands.coffee     |   90 -
 .../lib/service/WeinreTargetCommands.js         |   78 +
 weinre.server/lib/serviceManager.coffee         |   95 -
 weinre.server/lib/serviceManager.js             |   90 +
 weinre.server/lib/utils.coffee                  |  196 --
 weinre.server/lib/utils.js                      |  194 ++
 weinre.server/lib/weinre.coffee                 |  186 --
 weinre.server/lib/weinre.js                     |  193 ++
 weinre.server/node_modules/.bin/cake            |    2 +-
 weinre.server/node_modules/.bin/coffee          |    2 +-
 weinre.server/node_modules/.bin/express         |    2 +-
 weinre.server/node_modules/.bin/nopt            |    2 +-
 .../node_modules/coffee-script/CONTRIBUTING.md  |    9 +
 .../node_modules/coffee-script/LICENSE          |    4 +-
 weinre.server/node_modules/coffee-script/README |   21 +-
 .../node_modules/coffee-script/README.md        |   60 +
 .../node_modules/coffee-script/Rakefile         |   78 -
 .../node_modules/coffee-script/extras/jsl.conf  |   44 -
 .../coffee-script/lib/coffee-script/browser.js  |  100 +-
 .../coffee-script/lib/coffee-script/cake.js     |   11 +-
 .../lib/coffee-script/coffee-script.js          |  296 ++-
 .../coffee-script/lib/coffee-script/command.js  |  554 +++--
 .../coffee-script/lib/coffee-script/grammar.js  |   79 +-
 .../coffee-script/lib/coffee-script/helpers.js  |  181 +-
 .../coffee-script/lib/coffee-script/index.js    |    2 +-
 .../coffee-script/lib/coffee-script/lexer.js    |  412 ++--
 .../coffee-script/lib/coffee-script/nodes.js    | 1578 +++++++------
 .../coffee-script/lib/coffee-script/optparse.js |    9 +-
 .../coffee-script/lib/coffee-script/parser.js   |  753 ++++---
 .../coffee-script/lib/coffee-script/register.js |   66 +
 .../coffee-script/lib/coffee-script/repl.js     |  381 ++--
 .../coffee-script/lib/coffee-script/rewriter.js |  402 ++--
 .../coffee-script/lib/coffee-script/scope.js    |    6 +-
 .../lib/coffee-script/sourcemap.js              |  161 ++
 .../node_modules/mkdirp/.npmignore              |    2 +
 .../node_modules/mkdirp/.travis.yml             |    5 +
 .../coffee-script/node_modules/mkdirp/LICENSE   |   21 +
 .../node_modules/mkdirp/examples/pow.js         |    6 +
 .../coffee-script/node_modules/mkdirp/index.js  |   82 +
 .../node_modules/mkdirp/package.json            |   34 +
 .../node_modules/mkdirp/readme.markdown         |   63 +
 .../node_modules/mkdirp/test/chmod.js           |   38 +
 .../node_modules/mkdirp/test/clobber.js         |   37 +
 .../node_modules/mkdirp/test/mkdirp.js          |   28 +
 .../node_modules/mkdirp/test/perm.js            |   32 +
 .../node_modules/mkdirp/test/perm_sync.js       |   39 +
 .../node_modules/mkdirp/test/race.js            |   41 +
 .../node_modules/mkdirp/test/rel.js             |   32 +
 .../node_modules/mkdirp/test/return.js          |   25 +
 .../node_modules/mkdirp/test/return_sync.js     |   24 +
 .../node_modules/mkdirp/test/root.js            |   18 +
 .../node_modules/mkdirp/test/sync.js            |   32 +
 .../node_modules/mkdirp/test/umask.js           |   28 +
 .../node_modules/mkdirp/test/umask_sync.js      |   32 +
 .../node_modules/coffee-script/package.json     |   38 +-
 .../node_modules/coffee-script/register.js      |    1 +
 .../node_modules/coffee-script/repl.js          |    1 +
 weinre.server/node_modules/express/History.md   |    5 +
 .../node_modules/express/lib/express.js         |    2 +-
 .../node_modules/express/lib/request.js         |   23 +-
 .../express/node_modules/connect/lib/connect.js |    2 +-
 .../node_modules/connect/lib/middleware/csrf.js |    2 +-
 .../connect/node_modules/formidable/.npmignore  |    5 +-
 .../connect/node_modules/formidable/.travis.yml |    5 +-
 .../connect/node_modules/formidable/LICENSE     |    7 +
 .../connect/node_modules/formidable/Makefile    |   14 -
 .../connect/node_modules/formidable/Readme.md   |  468 ++--
 .../connect/node_modules/formidable/TODO        |    3 -
 .../benchmark/bench-multipart-parser.js         |   70 -
 .../node_modules/formidable/example/post.js     |   43 -
 .../node_modules/formidable/example/upload.js   |   48 -
 .../connect/node_modules/formidable/index.js    |    2 +-
 .../connect/node_modules/formidable/lib/file.js |   45 +-
 .../formidable/lib/incoming_form.js             |  285 ++-
 .../node_modules/formidable/lib/json_parser.js  |   35 +
 .../formidable/lib/multipart_parser.js          |   50 +-
 .../node_modules/formidable/lib/octet_parser.js |   20 +
 .../formidable/lib/querystring_parser.js        |   10 +-
 .../connect/node_modules/formidable/lib/util.js |    6 -
 .../formidable/node-gently/Makefile             |    4 -
 .../formidable/node-gently/Readme.md            |  167 --
 .../formidable/node-gently/example/dog.js       |   22 -
 .../node-gently/example/event_emitter.js        |   11 -
 .../formidable/node-gently/index.js             |    1 -
 .../formidable/node-gently/lib/gently/gently.js |  184 --
 .../formidable/node-gently/lib/gently/index.js  |    1 -
 .../formidable/node-gently/package.json         |   14 -
 .../formidable/node-gently/test/common.js       |    8 -
 .../node-gently/test/simple/test-gently.js      |  348 ---
 .../node_modules/formidable/package.json        |   27 +-
 .../node_modules/formidable/test/common.js      |   19 -
 .../test/fixture/file/funkyfilename.txt         |    1 -
 .../formidable/test/fixture/file/plain.txt      |    1 -
 .../http/special-chars-in-filename/info.md      |    3 -
 .../formidable/test/fixture/js/no-filename.js   |    3 -
 .../fixture/js/special-chars-in-filename.js     |   21 -
 .../formidable/test/fixture/multipart.js        |   72 -
 .../test/integration/test-fixtures.js           |   89 -
 .../formidable/test/legacy/common.js            |   24 -
 .../legacy/integration/test-multipart-parser.js |   80 -
 .../formidable/test/legacy/simple/test-file.js  |  104 -
 .../test/legacy/simple/test-incoming-form.js    |  727 ------
 .../test/legacy/simple/test-multipart-parser.js |   50 -
 .../legacy/simple/test-querystring-parser.js    |   45 -
 .../legacy/system/test-multi-video-upload.js    |   75 -
 .../connect/node_modules/formidable/test/run.js |    2 -
 .../formidable/test/unit/test-incoming-form.js  |   63 -
 .../node_modules/formidable/tool/record.js      |   47 -
 .../express/node_modules/connect/package.json   |    9 +-
 .../express/node_modules/connect/test.js        |   39 +-
 .../express/node_modules/mime/package.json      |   10 +-
 .../express/node_modules/mkdirp/package.json    |    8 +-
 .../express/node_modules/qs/package.json        |    6 +
 weinre.server/node_modules/express/package.json |   10 +-
 weinre.server/node_modules/express/test.js      |    3 +
 weinre.server/node_modules/nopt/.npmignore      |    1 +
 weinre.server/node_modules/nopt/README.md       |   15 +-
 weinre.server/node_modules/nopt/bin/nopt.js     |   14 +-
 weinre.server/node_modules/nopt/lib/nopt.js     |  282 +--
 .../nopt/node_modules/abbrev/CONTRIBUTING.md    |    3 +
 .../nopt/node_modules/abbrev/LICENSE            |   23 +
 .../nopt/node_modules/abbrev/abbrev.js          |   62 +
 .../nopt/node_modules/abbrev/lib/abbrev.js      |  106 -
 .../nopt/node_modules/abbrev/package.json       |   17 +-
 .../nopt/node_modules/abbrev/test.js            |   47 +
 weinre.server/node_modules/nopt/package.json    |   18 +-
 weinre.server/node_modules/nopt/test/basic.js   |  251 +++
 .../node_modules/underscore/.npmignore          |    3 -
 weinre.server/node_modules/underscore/CNAME     |    1 -
 weinre.server/node_modules/underscore/LICENSE   |    5 +-
 weinre.server/node_modules/underscore/README.md |   25 +-
 .../node_modules/underscore/favicon.ico         |  Bin 1406 -> 0 bytes
 .../node_modules/underscore/index.html          | 2109 ------------------
 weinre.server/node_modules/underscore/index.js  |    1 -
 .../node_modules/underscore/package.json        |   38 +-
 .../node_modules/underscore/raw/underscore.psd  |  Bin 215540 -> 0 bytes
 .../node_modules/underscore/underscore-min.js   |   38 +-
 .../node_modules/underscore/underscore.js       | 1390 +++++++-----
 weinre.server/weinre                            |   11 +-
 176 files changed, 8950 insertions(+), 9342 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/.wr
----------------------------------------------------------------------
diff --git a/.wr b/.wr
index 265dd0a..caf5fe6 100644
--- a/.wr
+++ b/.wr
@@ -7,7 +7,7 @@ weinre.build/scripts
 
 weinre.doc
 weinre.server/interfaces
-weinre.server/lib
+weinre.server/lib-src
 weinre.server/package.json
 weinre.server/README.md
 

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.build/build.xml
----------------------------------------------------------------------
diff --git a/weinre.build/build.xml b/weinre.build/build.xml
index 5324454..17f58d5 100644
--- a/weinre.build/build.xml
+++ b/weinre.build/build.xml
@@ -174,6 +174,7 @@ To update the weinre dependencies, use
             >git: ${git-log}
 </concat> <!-- keep this outdented, since Ant is so wonderful -->
 
+        <antcall target="build-server"/>
         <antcall target="build-web"/>
         <antcall target="build-json-idl"/>
         <antcall target="build-client"/>
@@ -202,6 +203,26 @@ To update the weinre dependencies, use
     </target>
 
     <!-- ============================================================
+         basic server resources
+         ============================================================ -->
+
+    <target name="build-server">
+        <delete dir="../${PROJECT_SERVER}/lib" />
+        <mkdir  dir="../${PROJECT_SERVER}/lib" />
+        <mkdir  dir="../${PROJECT_SERVER}/lib/service" />
+
+        <echo message="compiling CoffeeScript files in: ${PROJECT_SERVER}/lib-src"/>
+        <exec executable="node" failonerror="true" failifexecutionfails="true">
+            <arg value="../${PROJECT_SERVER}/node_modules/coffee-script/bin/coffee"/>
+            <arg value="--compile"/>
+            <arg value="--bare"/>
+            <arg value="--output"/>
+            <arg value="../${PROJECT_SERVER}/lib"/>
+            <arg value="../${PROJECT_SERVER}/lib-src"/>
+        </exec>
+    </target>
+
+    <!-- ============================================================
          basic web resources
          ============================================================ -->
 

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.build/package.json.template
----------------------------------------------------------------------
diff --git a/weinre.build/package.json.template b/weinre.build/package.json.template
index 71f3762..1779836 100644
--- a/weinre.build/package.json.template
+++ b/weinre.build/package.json.template
@@ -21,10 +21,13 @@
     },
   "dependencies":
     {
-      "coffee-script": "1.3.x",
       "express":       "2.5.x",
-      "nopt":          "1.0.x",
-      "underscore":    "1.3.x"
+      "nopt":          "3.0.x",
+      "underscore":    "1.7.x"
+    },
+  "devDependencies":
+    {
+      "coffee-script": "1.8.x"
     },
   "main" :             "./lib/weinre",
   "bin":
@@ -39,4 +42,3 @@
       "url":           "https://git-wip-us.apache.org/repos/asf/cordova-weinre.git"
     }
 }
-

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/Channel.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/Channel.coffee b/weinre.server/lib-src/Channel.coffee
new file mode 100644
index 0000000..70f5841
--- /dev/null
+++ b/weinre.server/lib-src/Channel.coffee
@@ -0,0 +1,118 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_ = require 'underscore'
+
+utils          = require './utils'
+channelManager = require './channelManager'
+messageHandler = require './messageHandler'
+MessageQueue   = require './MessageQueue'
+
+AnonymousId = 'anonymous'
+
+#-------------------------------------------------------------------------------
+module.exports = utils.registerClass class Channel
+    
+    #---------------------------------------------------------------------------
+    constructor: (@pathPrefix, @id, @remoteAddress, @isClient) ->
+        prefix         = if @isClient then 'c-' else 't-'
+        @name          = "#{prefix}#{utils.getNextSequenceNumber()}"
+        @messageQueue  = new MessageQueue
+        @isClosed      = false
+        @connections   = []
+        @isTarget      = !@isClient
+        @readTimeout   = utils.options.readTimeout * 1000
+        
+        @id = AnonymousId if !@id 
+        
+        @description = 
+            channel:       @name
+            id:            @id
+            hostName:      @remoteAddress
+            remoteAddress: @remoteAddress
+        
+        @updateLastRead()
+
+        channelManager.created @
+
+    #---------------------------------------------------------------------------
+    close: () ->
+        return if @isClosed
+        
+        channelManager.destroyed @
+        
+        @isClosed = true
+        @messageQueue.shutdown()
+
+    #---------------------------------------------------------------------------
+    sendCallback: (intfName, callbackId, args...) ->
+        return if !callbackId
+        
+        args.unshift callbackId
+        
+        @sendMessage intfName, 'sendCallback', args...
+        
+    #---------------------------------------------------------------------------
+    sendMessage: (intfName, method, args...) ->
+
+        message = genJSON
+            interface: intfName
+            method:    method
+            args:      args
+        
+        @messageQueue.push message
+
+    #---------------------------------------------------------------------------
+    handleMessages: (messages) ->
+
+        for message in messages
+            message = parseJSON(message)
+            continue if !message
+            
+            messageHandler.handleMessage @, message
+        
+    #---------------------------------------------------------------------------
+    getMessages: (callback) ->
+        @updateLastRead()
+        return callback.call(null, null) if @isClosed
+        
+        @messageQueue.pullAll @readTimeout, callback
+        
+    #---------------------------------------------------------------------------
+    updateLastRead: () ->
+        @lastRead = (new Date).valueOf()
+
+    #---------------------------------------------------------------------------
+    toString: () ->
+        connections = _.map(@connections, (val) -> val.name).join(',')
+        "Channel(#{@name}, closed:#{@isClosed}, connections:[#{connections}])"
+
+#-------------------------------------------------------------------------------
+parseJSON = (message) ->
+    try 
+        return JSON.parse(message)
+    catch e
+        return null
+
+#-------------------------------------------------------------------------------
+genJSON = (message) ->
+    try 
+        return JSON.stringify(message)
+    catch e
+        return null

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/HttpChannelHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/HttpChannelHandler.coffee b/weinre.server/lib-src/HttpChannelHandler.coffee
new file mode 100644
index 0000000..dd7f2f4
--- /dev/null
+++ b/weinre.server/lib-src/HttpChannelHandler.coffee
@@ -0,0 +1,154 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_ = require 'underscore'
+
+utils          = require './utils'
+Channel        = require './Channel'
+channelManager = require './channelManager'
+
+#-------------------------------------------------------------------------------
+module.exports = utils.registerClass class HttpChannelHandler
+
+    #---------------------------------------------------------------------------
+    constructor: (@pathPrefix) ->
+    
+        if @pathPrefix == '/ws/client'
+            @isClient = true
+            
+        else if @pathPrefix == '/ws/target'
+            @isClient = false
+            
+        else
+            utils.pitch "invalid pathPrefix: #{@pathPrefix}"
+            
+        @isTarget = !@isClient
+        
+    #---------------------------------------------------------------------------
+    handle: (request, response, uri) ->
+    
+        setCORSHeaders  request, response
+        setCacheHeaders request, response
+
+        #-----------------
+        
+        # * #{pathPrefix}a
+        if uri[0] != '/'
+            return handleError(request, response, 404)
+            
+        #-----------------
+        
+        if uri == '/'
+        
+            # OPTIONS #{pathPrefix}/
+            if request.method == 'OPTIONS'
+                return handleOptions(request, response)
+
+            # POST #{pathPrefix}/
+            if request.method == 'POST'
+                return handleCreate(@pathPrefix, @isClient, request, response)
+                
+            # * #{pathPrefix}/
+            return handleError(request, response, 405)
+            
+        #-----------------
+            
+        parts = uri.split('/')
+        
+        # * #{pathPrefix}/x/y
+        if parts.length > 2
+            return handleError(request, response, 404)
+
+        #-----------------
+        
+        channelName = parts[1]
+        
+        # OPTIONS #{pathPrefix}/x
+        if request.method == 'OPTIONS'
+            return handleOptions(request, response)
+
+        # GET #{pathPrefix}/x
+        if request.method == 'GET'
+            return handleGet(request, response, channelName)
+        
+        # POST #{pathPrefix}/x
+        if request.method == 'POST'
+            return handlePost(request, response, channelName)
+        
+        # anything else
+        return handleError(request, response, 405)
+
+#-------------------------------------------------------------------------------
+handleCreate = (pathPrefix, isClient, request, response) ->
+    id = request.body?.id
+    
+    remoteAddress = request.connection?.remoteAddress || ""
+    
+    channel = new Channel(pathPrefix, id, remoteAddress, isClient)
+    
+    response.contentType 'application/json'
+    response.send JSON.stringify
+        channel: channel.name
+        id:      channel.id
+
+#-------------------------------------------------------------------------------
+handleGet = (request, response, channelName) ->
+    remoteAddress = request.connection?.remoteAddress || ""
+    channel       = channelManager.getChannel(channelName, remoteAddress)
+    return handleError(request, response, 404) if !channel
+    
+    channel.getMessages (messages) => 
+        return handleError(request, response, 404) if channel.isClosed
+        return handleError(request, response, 404) if !messages
+        
+        response.contentType 'application/json'
+        response.send JSON.stringify(messages)
+
+#-------------------------------------------------------------------------------
+handlePost = (request, response, channelName) ->
+    remoteAddress = request.connection?.remoteAddress || ""
+    channel       = channelManager.getChannel(channelName, remoteAddress)
+    return handleError(request, response, 404) if !channel
+    
+    channel.handleMessages(request.body)
+    response.send('')
+
+#-------------------------------------------------------------------------------
+handleOptions = (request, response) ->
+    response.send('')
+
+#-------------------------------------------------------------------------------
+handleError = (request, response, status) ->
+    response.send(status)
+
+#-------------------------------------------------------------------------------
+setCORSHeaders = (request, response) ->
+    origin = request.header 'Origin'
+    return if !origin
+    
+    response.header 'Access-Control-Allow-Origin',  origin
+    response.header 'Access-Control-Max-Age',       '600'
+    response.header 'Access-Control-Allow-Methods', 'GET, POST'
+
+#-------------------------------------------------------------------------------
+setCacheHeaders = (request, response) ->
+    response.header 'Pragma',        'no-cache'
+    response.header 'Expires',       '0'
+    response.header 'Cache-Control', 'no-cache'
+    response.header 'Cache-Control', 'no-store'

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/MessageQueue.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/MessageQueue.coffee b/weinre.server/lib-src/MessageQueue.coffee
new file mode 100644
index 0000000..52af9ea
--- /dev/null
+++ b/weinre.server/lib-src/MessageQueue.coffee
@@ -0,0 +1,87 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_ = require 'underscore'
+
+utils = require './utils'
+
+#-------------------------------------------------------------------------------
+module.exports = utils.registerClass class MessageQueue
+
+    #---------------------------------------------------------------------------
+    constructor: () ->
+        @messages     = []
+        @closed       = false
+        @callback     = null
+        @timer        = null
+        
+        _.bindAll @, '_timerExpired', '_updated'
+        
+    #---------------------------------------------------------------------------
+    shutdown: () ->
+        return if @closed
+
+        @closed = true
+
+        clearTimeout @timer if @timer
+        @callback.call(null, @messages) if @callback
+        
+        @callback = null
+        @messages = null 
+        @timer    = null
+    
+    #---------------------------------------------------------------------------
+    push: (message) ->
+        return if @closed
+        
+        @messages.push message
+        process.nextTick @_updated
+
+    #---------------------------------------------------------------------------
+    pullAll: (timeout, callback) ->
+        return callback.call(null, null) if @closed
+        return callback.call(null, [])   if @callback
+        
+        if @messages.length
+            callback.call(null, @messages)
+            @messages = []
+            return
+        
+        @callback = callback
+        @timer    = setTimeout @_timerExpired, timeout
+
+    #---------------------------------------------------------------------------
+    _timerExpired: () ->
+        @_updated()
+        
+    #---------------------------------------------------------------------------
+    _updated: () ->
+        return if @closed
+        return if !@callback
+        
+        callback = @callback
+        messages = @messages
+        clearTimeout @timer if @timer
+        
+        @callback = null
+        @messages = []
+        @timer    = null
+
+        callback.call(null, messages)      
+

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/channelManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/channelManager.coffee b/weinre.server/lib-src/channelManager.coffee
new file mode 100644
index 0000000..d55bb01
--- /dev/null
+++ b/weinre.server/lib-src/channelManager.coffee
@@ -0,0 +1,126 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_  = require 'underscore'
+
+utils          = require './utils'
+serviceManager = require './serviceManager'
+
+WeinreClientEvents = null
+WeinreTargetEvents = null
+
+channelManager = null
+
+#-------------------------------------------------------------------------------
+utils.registerClass class ChannelManager
+
+    #---------------------------------------------------------------------------
+    constructor: () ->
+        @channels  = {}
+
+    #---------------------------------------------------------------------------
+    initialize: ->
+
+        WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
+        WeinreTargetEvents = serviceManager.get 'WeinreTargetEvents'
+
+        if !WeinreClientEvents
+            utils.exit 'WeinreClientEvents service not registered'
+
+        if !WeinreTargetEvents
+            utils.exit 'WeinreTargetEvents service not registered'
+
+    #---------------------------------------------------------------------------
+    created: (channel) ->
+        @channels[channel.name] = channel
+
+    #---------------------------------------------------------------------------
+    destroyed: (channel) ->
+        if channel.isClient
+            for connection in channel.connections
+                @disconnectChannels(channel, connection)
+        else
+            for connection in channel.connections
+                @disconnectChannels(connection, channel)
+
+        clients = @getClientChannels(channel.id)
+
+        if channel.isClient
+            WeinreClientEvents.clientUnregistered(clients, channel.name)
+        else
+            WeinreClientEvents.targetUnregistered(clients, channel.name)
+
+        delete @channels[channel.name]
+
+    #---------------------------------------------------------------------------
+    getChannel: (name, remoteAddress) ->
+        return null if !_.has(@channels, name)
+
+        channel = @channels[name]
+
+        return null if !channel
+
+#        if remoteAddress
+#            return null if channel.remoteAddress != remoteAddress
+
+        channel
+
+    #---------------------------------------------------------------------------
+    connectChannels: (client, target) ->
+        return if client.isClosed or target.isClosed
+
+        if client.connections.length
+            @disconnectChannels(client, client.connections[0])
+
+        client.connections.push target
+        target.connections.push client
+
+        clients = @getClientChannels(client.id)
+
+        WeinreClientEvents.connectionCreated(clients, client.name, target.name)
+        WeinreTargetEvents.connectionCreated(target,  client.name, target.name)
+
+    #---------------------------------------------------------------------------
+    disconnectChannels: (client, target) ->
+
+        clients = @getClientChannels(client.id)
+
+        WeinreClientEvents.connectionDestroyed(clients, client.name, target.name)
+        WeinreTargetEvents.connectionDestroyed(target,  client.name, target.name)
+
+        client.connections = _.without(client.connections, target)
+        target.connections = _.without(target.connections, client)
+
+    #---------------------------------------------------------------------------
+    getChannels: (id) ->
+        if id?
+            _.filter(@channels, (item) -> item.id == id)
+        else
+            _.values(@channels)
+
+    #---------------------------------------------------------------------------
+    getClientChannels: (id) ->
+        _.filter(@channels, (item) -> item.isClient && item.id == id)
+
+    #---------------------------------------------------------------------------
+    getTargetChannels: (id) ->
+        _.filter(@channels, (item) -> item.isTarget && item.id == id)
+
+#-------------------------------------------------------------------------------
+module.exports = new ChannelManager

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/cli.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/cli.coffee b/weinre.server/lib-src/cli.coffee
new file mode 100644
index 0000000..197e39c
--- /dev/null
+++ b/weinre.server/lib-src/cli.coffee
@@ -0,0 +1,130 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+fs   = require 'fs'
+path = require 'path'
+
+_     = require 'underscore'
+nopt  = require 'nopt'
+
+utils  = require './utils'
+weinre = require './weinre'
+
+optionDefaults =
+    httpPort:     8080
+    boundHost:    'localhost'
+    verbose:      false
+    debug:        false
+    readTimeout:  5
+
+#-------------------------------------------------------------------------------
+exports.run = ->
+
+    knownOpts =
+        httpPort:     Number
+        boundHost:    String
+        verbose:      Boolean
+        debug:        Boolean
+        readTimeout:  Number
+        deathTimeout: Number
+        help:         Boolean
+
+    shortHands =
+        '?':  ['--help']
+        'h':  ['--help']
+
+    nopt.invalidHandler = printNoptError
+    parsedOpts = nopt(knownOpts, shortHands, process.argv, 2)
+
+    #----
+
+    printHelp() if parsedOpts.help
+
+    args = parsedOpts.argv.remain
+
+    printHelp() if args.length != 0
+
+    #----
+
+    delete parsedOpts.argv
+    opts = _.extend {}, optionDefaults, getDotWeinreServerProperties(), parsedOpts
+
+    if !opts.deathTimeout?
+        opts.deathTimeout = 3 * opts.readTimeout
+
+    utils.setOptions opts
+
+    weinre.run opts
+
+#-------------------------------------------------------------------------------
+printNoptError = (key, val, types) ->
+    utils.exit "error with option '#{key}', value '#{val}'"
+
+#-------------------------------------------------------------------------------
+printHelp = () ->
+    version = weinre.getVersion()
+
+    console.error """
+usage:   #{utils.Program} [options]
+version: #{version}
+
+options:
+    --httpPort     port to run the http server on        default: #{optionDefaults.httpPort}
+    --boundHost    ip address to bind the server to      default: #{optionDefaults.boundHost}
+    --verbose      print more diagnostics                default: #{optionDefaults.verbose}
+    --debug        print even more diagnostics           default: #{optionDefaults.debug}
+    --readTimeout  seconds to wait for a client message  default: #{optionDefaults.readTimeout}
+    --deathTimeout seconds to wait to kill client        default: 3*readTimeout
+
+--boundHost can be an ip address, hostname, or -all-, where -all-
+means binding to all ip address on the current machine'
+
+for more info see: http://people.apache.org/~pmuellr/weinre/
+"""
+    process.exit()
+
+#-------------------------------------------------------------------------------
+getDotWeinreServerProperties = () ->
+    properties = {}
+
+    fileName = replaceTilde '~/.weinre/server.properties'
+    return properties if !utils.fileExistsSync(fileName)
+
+    contents = fs.readFileSync(fileName, 'utf8')
+    lines    = contents.split('\n')
+
+    for line in lines
+        line = line.replace(/#.*/,'')
+        match = line.match /\s*(\w+)\s*:\s*(.+)\s*/
+        continue if !match
+
+        key = utils.trim match[1]
+        val = utils.trim match[2]
+
+        properties[key] = val
+
+    properties
+
+#-------------------------------------------------------------------------------
+replaceTilde = (fileName) ->
+    fileName.replace('~', getTildeReplacement())
+
+#-------------------------------------------------------------------------------
+getTildeReplacement = () ->
+    process.env["HOME"] || process.env["USERPROFILE"] || '.'

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/dumpingHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/dumpingHandler.coffee b/weinre.server/lib-src/dumpingHandler.coffee
new file mode 100644
index 0000000..310852d
--- /dev/null
+++ b/weinre.server/lib-src/dumpingHandler.coffee
@@ -0,0 +1,77 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_ = require 'underscore'
+
+utils = require './utils'
+
+#-------------------------------------------------------------------------------
+dumpingHandler = (request, response, uri) ->
+    originalSend = response.send
+    response.send = (body) ->
+        dumpResponse(originalSend, body, request, response, uri)
+    
+    return if request.method != 'POST'
+    
+    utils.logVerbose '--------------------------------------------------'
+    utils.logVerbose "#{request.method} #{uri} [request]"
+    
+    if _.isArray(request.body)
+        for element in request.body
+            utils.logVerbose "   #{enhance(JSON.parse(element))}"
+    else
+        utils.logVerbose "   #{enhance(request.body)}"
+
+#-------------------------------------------------------------------------------
+dumpResponse = (originalSend, body, request, response, uri) ->
+    originalSend.call(response, body)
+
+    return if request.method not in ['GET', 'POST']
+
+    try 
+        body = JSON.parse(body)
+    catch e
+        return
+
+    return if _.isArray(body) && (body.length == 0)
+        
+    utils.logVerbose '--------------------------------------------------'
+    utils.logVerbose "#{request.method} #{uri} #{response.statusCode} [response]"
+    
+    if _.isArray(body)
+        for element in body
+            utils.logVerbose "   #{enhance(JSON.parse(element))}"
+    else
+        utils.logVerbose "   #{enhance(body)}"
+
+#-------------------------------------------------------------------------------
+enhance = (object) ->
+    if !object.interface || !object.method || !object.args 
+        return JSON.stringify(object)
+        
+    signature = "#{object.interface}.#{object.method}"
+
+    args = JSON.stringify(object.args)
+    if args.length > 500
+        args = "#{args.substr(0,50)}..."
+    
+    return "#{signature}(#{args})"
+
+#-------------------------------------------------------------------------------
+module.exports = dumpingHandler

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/extensionManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/extensionManager.coffee b/weinre.server/lib-src/extensionManager.coffee
new file mode 100644
index 0000000..c367425
--- /dev/null
+++ b/weinre.server/lib-src/extensionManager.coffee
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+utils = require './utils'
+
+#-------------------------------------------------------------------------------
+utils.registerClass class ExtensionManager
+
+    #---------------------------------------------------------------------------
+    constructor: () ->
+        @extensions = []
+    
+#-------------------------------------------------------------------------------
+module.exports = new ExtensionManager

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/jsonBodyParser.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/jsonBodyParser.coffee b/weinre.server/lib-src/jsonBodyParser.coffee
new file mode 100644
index 0000000..58f755b
--- /dev/null
+++ b/weinre.server/lib-src/jsonBodyParser.coffee
@@ -0,0 +1,47 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+#-------------------------------------------------------------------------------
+jsonBodyParser = -> 
+    return (request, response, next) -> parseBodyAsJSON(request, response, next)
+        
+#-------------------------------------------------------------------------------
+parseBodyAsJSON = (request, response, next) ->
+
+    return next() if request.body
+    
+    request.body = {}
+    
+    return next() if request.method != 'POST'
+    
+    request.setEncoding 'utf8'
+    
+    buffer = ''
+    request.on 'data', (chunk) -> buffer += chunk
+    request.on 'end', ->
+        return next() if '' == buffer
+
+        try 
+            request.body = JSON.parse(buffer)
+            next()
+        catch e
+            next(e)
+
+#-------------------------------------------------------------------------------
+module.exports = jsonBodyParser

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/messageHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/messageHandler.coffee b/weinre.server/lib-src/messageHandler.coffee
new file mode 100644
index 0000000..0c79430
--- /dev/null
+++ b/weinre.server/lib-src/messageHandler.coffee
@@ -0,0 +1,59 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+utils             = require './utils'
+channelManager    = require './channelManager'
+serviceManager    = require './serviceManager'
+
+#-------------------------------------------------------------------------------
+utils.registerClass class MessageHandler
+
+    #---------------------------------------------------------------------------
+    handleMessage: (channel, message) ->
+        @_serviceMethodInvoker(channel, message.interface, message.method, message.args)
+
+    #---------------------------------------------------------------------------
+    _serviceMethodInvoker: (channel, intfName, method, args) ->
+        methodSignature = "#{intfName}.#{method}()"
+        # utils.logVerbose "MessageHandler._serviceMethodInvoker(#{methodSignature})"
+
+        service = serviceManager.get(intfName)
+        
+        if !service
+            return @_redirectToConnections(channel, intfName, method, args)
+
+        args = args.slice()
+        args.unshift channel
+        
+        try 
+            service[method].apply(service, args)
+            
+        catch e
+            utils.log "error running service method #{methodSignature}: #{e}"
+            utils.log "stack:\n#{e.stack}"
+
+    #---------------------------------------------------------------------------
+    _redirectToConnections: (channel, intfName, method, args) ->
+        # utils.logVerbose "MessageHandler._redirectToConnections(#{channel.name}, #{intfName}, #{method})"
+
+        for connection in channel.connections
+            connection.sendMessage(intfName, method, args...)
+            
+#-------------------------------------------------------------------------------
+module.exports = new MessageHandler

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/service/WeinreClientCommands.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/service/WeinreClientCommands.coffee b/weinre.server/lib-src/service/WeinreClientCommands.coffee
new file mode 100644
index 0000000..713a48b
--- /dev/null
+++ b/weinre.server/lib-src/service/WeinreClientCommands.coffee
@@ -0,0 +1,126 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+_ = require('underscore')
+
+weinre             = require '../weinre'
+utils              = require '../utils'
+channelManager     = require '../channelManager'
+serviceManager     = require '../serviceManager'
+extensionManager   = require '../extensionManager'
+
+WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
+
+#-------------------------------------------------------------------------------
+module.exports = utils.registerClass class WeinreClientCommands
+
+    #---------------------------------------------------------------------------
+    registerClient: (channel, callbackId) ->
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId, channel.description)        
+
+        options = _.extend {}, utils.options
+        for own key, val of options
+            if typeof val in ['number', 'boolean']
+                options[key] = "#{val}"
+        
+        options.version = weinre.getVersion()
+        
+        WeinreClientEvents.serverProperties(channel, options)
+
+        clients = channelManager.getClientChannels(channel.id)
+        WeinreClientEvents.clientRegistered(clients, channel.description)
+
+    #---------------------------------------------------------------------------
+    getTargets: (channel, callbackId) ->
+        channels = channelManager.getTargetChannels(channel.id)
+        result = _.pluck(channels, 'description')
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId, [result])
+
+    #---------------------------------------------------------------------------
+    getClients: (channel, callbackId) ->
+        channels = channelManager.getClientChannels(channel.id)
+        result = _.pluck(channels, 'description')
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId, [result])
+
+    #---------------------------------------------------------------------------
+    getExtensions: (channel, callbackId) ->
+        result = for extension in extensionManager.extensions
+            { startPage: "extensions/#{extension}/extension.html" }
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId, [result])
+
+    #---------------------------------------------------------------------------
+    connectTarget: (channel, clientName, targetName, callbackId) ->
+        client = channelManager.getChannel(clientName)
+        return if !client
+
+        target = channelManager.getChannel(targetName)
+        return if !target
+
+        channelManager.connectChannels(client, target)
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)
+            
+    #---------------------------------------------------------------------------
+    disconnectTarget: (channel, clientName, callbackId) ->
+        client = connectionManager.getClient(clientName)
+        return if !client
+
+        target = client.getConnectedTarget()
+        return if !target
+
+        connectionManager.disconnect(client, target)
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)
+            
+    #---------------------------------------------------------------------------
+    logDebug: (channel, message, callbackId) ->
+        utils.logVerbose "client #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)
+            
+    #---------------------------------------------------------------------------
+    logInfo: (channel, message, callbackId) ->
+        utils.log "client #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)
+            
+    #---------------------------------------------------------------------------
+    logWarning: (channel, message, callbackId) ->
+        utils.log "client #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)
+            
+    #---------------------------------------------------------------------------
+    logError: (channel, message, callbackId) ->
+        utils.log "client #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreClientEvents.sendCallback(channel, callbackId)

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/service/WeinreTargetCommands.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/service/WeinreTargetCommands.coffee b/weinre.server/lib-src/service/WeinreTargetCommands.coffee
new file mode 100644
index 0000000..4603e20
--- /dev/null
+++ b/weinre.server/lib-src/service/WeinreTargetCommands.coffee
@@ -0,0 +1,90 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+utils              = require '../utils'
+channelManager     = require '../channelManager'
+serviceManager     = require '../serviceManager'
+
+WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
+WeinreTargetEvents = serviceManager.get 'WeinreTargetEvents'
+
+#-------------------------------------------------------------------------------
+module.exports = utils.registerClass class WeinreTargetCommands
+
+    #---------------------------------------------------------------------------
+    registerTarget: (channel, url, callbackId) -> 
+        channel.description.url = url
+
+        clients = channelManager.getClientChannels(channel.id)
+        WeinreClientEvents.targetRegistered(clients, channel.description)
+    
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, channel.description)
+
+    #---------------------------------------------------------------------------
+    sendClientCallback: (channel, clientCallbackId, args, callbackId) ->
+
+        # the channel to send the callback to is embedded in the callbackId
+        callbackChannel = getCallbackChannel(clientCallbackId)
+        if !callbackChannel
+            return main.warn "#{@constructor.name}.sendClientCallback() sent with invalid callbackId: #{clientCallbackId}"
+
+        callbackChannel = channelManager.getChannel(callbackChannel)
+        if !callbackChannel
+            # indication that channel was closed; this message may generate a lot of noise
+            return main.warn "#{@constructor.name}.sendClientCallback() unable to find channel : #{clientCallbackId}"
+
+        WeinreClientEvents.sendCallback(callbackChannel, clientCallbackId, args)
+            
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, description)
+
+    #---------------------------------------------------------------------------
+    logDebug: (channel, message, callbackId) ->
+        utils.logVerbose "target #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, description)
+
+    #---------------------------------------------------------------------------
+    logInfo: (channel, message, callbackId) ->
+        utils.log "target #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, description)
+
+    #---------------------------------------------------------------------------
+    logWarning: (channel, message, callbackId) ->
+        utils.log "target #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, description)
+
+    #---------------------------------------------------------------------------
+    logError: (channel, message, callbackId) ->
+        utils.log "target #{channel.name}: #{message}"
+
+        if callbackId
+            WeinreTargetEvents.sendCallback(channel, callbackId, description)
+
+#---------------------------------------------------------------------------
+getCallbackChannel = (callbackId) ->
+    callbackId = callbackId.toString()
+    callbackId.split('::')[0]
+

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/serviceManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/serviceManager.coffee b/weinre.server/lib-src/serviceManager.coffee
new file mode 100644
index 0000000..ade070f
--- /dev/null
+++ b/weinre.server/lib-src/serviceManager.coffee
@@ -0,0 +1,95 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+path = require 'path'
+fs   = require 'fs'
+
+_ = require 'underscore'
+
+utils = require './utils'
+
+Services = {}
+
+#-------------------------------------------------------------------------------
+utils.registerClass class ServiceManager
+    
+    #---------------------------------------------------------------------------
+    constructor: ->
+        @services = {}
+
+    #---------------------------------------------------------------------------
+    get: (name) ->
+        return @services[name] if _.has(@services, name)
+        
+        null
+
+    #---------------------------------------------------------------------------
+    registerLocalClass: (name) ->
+
+        serviceClass = null
+        try
+            serviceClass = require "./service/#{name}"
+        catch e
+            utils.log "local service class not found: #{name}"
+            throw e
+
+        @services[name] = new serviceClass
+    
+    #---------------------------------------------------------------------------
+    registerProxyClass: (name) ->
+    
+        intf = getServiceInterface(name)
+        
+        if !intf
+            utils.exit "proxy service class not found: #{name}"
+            
+        if intf.name != name
+            utils.exit "proxy interface '#{intf.name}' loaded when '#{name}' requested"
+            
+        service = {}
+        
+        for method in intf.methods
+            service[method.name] = getMethodProxy(name, method.name)    
+            
+        @services[name] = service
+
+
+#-------------------------------------------------------------------------------
+getMethodProxy = (intfName, methodName) ->
+    (channels, args...) ->
+        channels = [channels] if !_.isArray(channels) 
+        
+        for channel in channels
+            channel.sendMessage(intfName, methodName, args...)
+    
+#-------------------------------------------------------------------------------
+getServiceInterface = (name) ->
+    jsonName = "#{name}.json"
+    fileName = path.join utils.options.staticWebDir, 'interfaces', jsonName
+    
+    return null if !utils.fileExistsSync(fileName) 
+    
+    contents = fs.readFileSync(fileName, 'utf8')
+    
+    serviceInterface = JSON.parse(contents)
+    
+    return serviceInterface.interfaces[0]
+
+#-------------------------------------------------------------------------------
+module.exports = new ServiceManager
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/utils.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/utils.coffee b/weinre.server/lib-src/utils.coffee
new file mode 100644
index 0000000..ee5a72b
--- /dev/null
+++ b/weinre.server/lib-src/utils.coffee
@@ -0,0 +1,196 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+fs   = require 'fs'
+path = require 'path'
+
+utils = exports
+
+utils.Program = Program = path.basename process.argv[1]
+
+SequenceNumberMax = 100 * 1024 * 1024
+SequenceNumber    = 0
+
+#-------------------------------------------------------------------------------
+utils.getNextSequenceNumber = (g) -> 
+    SequenceNumber++
+    
+    if SequenceNumber > SequenceNumberMax
+        SequenceNumber = 0
+        
+    SequenceNumber
+
+#-------------------------------------------------------------------------------
+utils.trim = (string) -> 
+    string.replace(/(^\s+)|(\s+$)/g,'')
+
+#-------------------------------------------------------------------------------
+utils.log = log = (message) ->
+    date    = new Date()
+    time    = date.toISOString()
+    console.log "#{time} #{Program}: #{message}"
+
+#-------------------------------------------------------------------------------
+utils.logVerbose = (message) ->
+    return if !utils?.options?.verbose
+
+    log message
+
+#-------------------------------------------------------------------------------
+utils.logDebug = (message) ->
+    return if !utils?.options?.debug
+
+    log message
+
+#-------------------------------------------------------------------------------
+utils.exit = (message) ->
+    log message
+    process.exit 1
+
+#-------------------------------------------------------------------------------
+utils.pitch = (message) ->
+    log message
+    throw message
+
+#-------------------------------------------------------------------------------
+utils.setOptions = (options) ->
+    utils.options = options
+    
+#-------------------------------------------------------------------------------
+utils.ensureInteger = (value, message) ->
+    newValue = parseInt value
+    
+    if isNaN newValue
+        utils.exit "#{message}: '#{value}'"
+    
+    newValue    
+    
+#-------------------------------------------------------------------------------
+utils.ensureString = (value, message) ->
+    
+    if typeof value != 'string'
+        utils.exit "#{message}: '#{value}'"
+    
+    value    
+    
+#-------------------------------------------------------------------------------
+utils.ensureBoolean = (value, message) ->
+    uValue = value.toString().toUpperCase()
+
+    newValue = null    
+    switch uValue
+        when 'TRUE'  then newValue = true
+        when 'FALSE' then newValue = false
+    
+    if typeof(newValue) != 'boolean'
+        utils.exit "#{message}: '#{value}'"
+    
+    newValue
+
+#-------------------------------------------------------------------------------
+utils.setNamesForClass = (aClass) ->
+
+    for own key, val of aClass
+        if typeof(val) is "function"
+            val.signature   = "#{aClass.name}::#{key}"
+            val.displayName = val.signature
+            val.name        = val.signature
+
+    for own key, val of aClass.prototype
+        if typeof(val) is "function"
+            val.signature   = "#{aClass.name}.#{key}"
+            val.displayName = val.signature
+            val.name        = val.signature
+
+#-------------------------------------------------------------------------------
+utils.registerClass = (aClass) ->
+    utils.setNamesForClass(aClass)
+    aClass
+
+#-------------------------------------------------------------------------------
+utils.alignLeft = (string, length) ->
+    while string.length < length
+        string = "#{string} "
+        
+    string
+
+#-------------------------------------------------------------------------------
+utils.alignRight = (string, length) ->
+    while string.length < length
+        string = " #{string}"
+
+    string
+
+#-------------------------------------------------------------------------------
+utils.fileExistsSync = (name) ->
+    
+    if fs.existsSync
+        return fs.existsSync name
+        
+    return path.existsSync(name)
+
+#-------------------------------------------------------------------------------
+Error.prepareStackTrace = (error, structuredStackTrace) ->
+    result = []
+    result.push "---------------------------------------------------------"
+    result.push "error: #{error}"
+    result.push "---------------------------------------------------------"
+    result.push "stack: "
+
+    longestFile = 0
+    longestLine = 0
+    
+    for callSite in structuredStackTrace
+        file = callSite.getFileName()
+        line = callSite.getLineNumber()
+
+        file = path.basename(file)
+        line = "#{line}"
+        
+        if file.length > longestFile
+            longestFile = file.length
+    
+        if line.length > longestLine
+            longestLine = line.length
+    
+    for callSite in structuredStackTrace
+        func = callSite.getFunction()
+        file = callSite.getFileName()
+        line = callSite.getLineNumber()
+
+        file = path.basename(file)
+        line = "#{line}"
+        
+        file = utils.alignRight(file, longestFile)
+        line = utils.alignLeft( line, longestLine)
+        
+        funcName = func.displayName ||
+                   func.name || 
+                   callSite.getFunctionName()
+                   callSite.getMethodName()
+                   '???'
+        
+        if funcName == "Module._compile"
+            result.pop()
+            result.pop()
+            break
+            
+        result.push "   #{file}:#{line} - #{funcName}()"
+        
+    result.join "\n"

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib-src/weinre.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib-src/weinre.coffee b/weinre.server/lib-src/weinre.coffee
new file mode 100644
index 0000000..8b7945d
--- /dev/null
+++ b/weinre.server/lib-src/weinre.coffee
@@ -0,0 +1,186 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+fs   = require 'fs'
+net  = require 'net'
+dns  = require 'dns'
+path = require 'path'
+
+_       = require 'underscore'
+express = require 'express'
+
+utils              = require './utils'
+jsonBodyParser     = require './jsonBodyParser'
+HttpChannelHandler = require './HttpChannelHandler'
+dumpingHandler     = require './dumpingHandler'
+channelManager     = require './channelManager'
+serviceManager     = require './serviceManager'
+
+#-------------------------------------------------------------------------------
+exports.run = (options) ->
+    processOptions(options, run2)
+
+#-------------------------------------------------------------------------------
+run2 = ->
+    options = utils.options
+    
+    serviceManager.registerProxyClass 'WeinreClientEvents'
+    serviceManager.registerProxyClass 'WeinreTargetEvents'
+    serviceManager.registerLocalClass 'WeinreClientCommands'
+    serviceManager.registerLocalClass 'WeinreTargetCommands'
+    
+    startDeathWatcher options.deathTimeout
+    
+    startServer()    
+
+#-------------------------------------------------------------------------------
+processOptions = (options, cb) ->
+    options.httpPort     = utils.ensureInteger( options.httpPort,     'the value of the option httpPort is not a number')
+    options.boundHost    = utils.ensureString(  options.boundHost,    'the value of the option boundHost is not a string')
+    options.verbose      = utils.ensureBoolean( options.verbose,      'the value of the option verbose is not a boolean')
+    options.debug        = utils.ensureBoolean( options.debug,        'the value of the option debug is not a boolean')
+    options.readTimeout  = utils.ensureInteger( options.readTimeout,  'the value of the option readTimeout is not a number')
+    options.deathTimeout = utils.ensureInteger( options.deathTimeout, 'the value of the option deathTimeout is not a number')
+
+    options.verbose = true if options.debug
+    
+    options.staticWebDir = getStaticWebDir()
+    
+    utils.logVerbose "pid:                 #{process.pid}"
+    utils.logVerbose "version:             #{getVersion()}"
+    utils.logVerbose "node versions:"
+    
+    names   = _.keys(process.versions)
+    reducer = (memo, name) -> Math.max(memo, name.length)
+    nameLen = _.reduce(names, reducer, 0)
+    
+    for name in names
+        utils.logVerbose "   #{utils.alignLeft(name, nameLen)}: #{process.versions[name]}"
+    
+    utils.logVerbose "options:"
+    utils.logVerbose "   httpPort:     #{options.httpPort}"
+    utils.logVerbose "   boundHost:    #{options.boundHost}"
+    utils.logVerbose "   verbose:      #{options.verbose}"
+    utils.logVerbose "   debug:        #{options.debug}"
+    utils.logVerbose "   readTimeout:  #{options.readTimeout}"
+    utils.logVerbose "   deathTimeout: #{options.deathTimeout}"
+
+    utils.setOptions options
+
+    checkHost options.boundHost, (err) ->
+        if err
+            utils.exit "unable to resolve boundHost address: #{options.boundHost}"
+
+        cb()
+
+#-------------------------------------------------------------------------------
+checkHost = (hostName, cb) ->
+    return cb() if hostName == '-all-'
+    return cb() if hostName == 'localhost'
+    
+    return cb() if net.isIP(hostName)
+    
+    dns.lookup hostName, cb
+
+#-------------------------------------------------------------------------------
+deathTimeout = null
+
+#-------------------------------------------------------------------------------
+startDeathWatcher = (timeout) ->
+    deathTimeout = utils.options.deathTimeout * 1000
+    
+    setInterval checkForDeath, 1000
+
+#-------------------------------------------------------------------------------
+checkForDeath = ->
+    now = (new Date).valueOf()
+    for channel in channelManager.getChannels()
+        if now - channel.lastRead > deathTimeout
+            channel.close()
+
+#-------------------------------------------------------------------------------
+startServer = () ->
+    options = utils.options
+
+    clientHandler = new HttpChannelHandler('/ws/client')
+    targetHandler = new HttpChannelHandler('/ws/target')
+    
+    channelManager.initialize()
+    
+    favIcon = "#{options.staticWebDir}/images/weinre-icon-32x32.png"
+
+    staticCacheOptions =
+        maxObjects: 500
+        maxLength:  32 * 1024 * 1024
+        
+    app = express.createServer()
+    
+    app.on 'error', (error) ->
+        utils.exit "error running server: #{error}"
+
+    app.use express.favicon(favIcon)
+
+    app.use jsonBodyParser()
+
+    app.all /^\/ws\/client(.*)/, (request, response, next) ->
+        uri = request.params[0]
+        uri = '/' if uri == ''
+        
+        dumpingHandler(request, response, uri) if options.debug
+        clientHandler.handle(request, response, uri)
+
+    app.all /^\/ws\/target(.*)/, (request, response, next) ->
+        uri = request.params[0]
+        uri = '/' if uri == ''
+
+        dumpingHandler(request, response, uri) if options.debug
+        targetHandler.handle(request, response, uri)
+
+    app.use express.errorHandler(dumpExceptions: true)
+
+    app.use express.staticCache(staticCacheOptions)
+    app.use express.static(options.staticWebDir)
+    
+    if options.boundHost == '-all-'
+        utils.log "starting server at http://localhost:#{options.httpPort}"
+        app.listen options.httpPort
+        
+    else
+        utils.log "starting server at http://#{options.boundHost}:#{options.httpPort}"
+        app.listen options.httpPort, options.boundHost
+
+#-------------------------------------------------------------------------------
+getStaticWebDir = () ->
+    webDir = path.normalize path.join(__dirname,'../web')
+    return webDir if utils.fileExistsSync webDir
+    
+    utils.exit 'unable to find static files to serve in #{webDir}; did you do a build?'
+    
+#-------------------------------------------------------------------------------
+Version = null
+getVersion = exports.getVersion = () ->
+    return Version if Version 
+
+    packageJsonName  = path.join(path.dirname(fs.realpathSync(__filename)), '../package.json')
+
+    json = fs.readFileSync(packageJsonName, 'utf8')
+    values = JSON.parse(json)
+
+    Version = values.version
+    return Version

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/Channel.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/Channel.coffee b/weinre.server/lib/Channel.coffee
deleted file mode 100644
index 70f5841..0000000
--- a/weinre.server/lib/Channel.coffee
+++ /dev/null
@@ -1,118 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_ = require 'underscore'
-
-utils          = require './utils'
-channelManager = require './channelManager'
-messageHandler = require './messageHandler'
-MessageQueue   = require './MessageQueue'
-
-AnonymousId = 'anonymous'
-
-#-------------------------------------------------------------------------------
-module.exports = utils.registerClass class Channel
-    
-    #---------------------------------------------------------------------------
-    constructor: (@pathPrefix, @id, @remoteAddress, @isClient) ->
-        prefix         = if @isClient then 'c-' else 't-'
-        @name          = "#{prefix}#{utils.getNextSequenceNumber()}"
-        @messageQueue  = new MessageQueue
-        @isClosed      = false
-        @connections   = []
-        @isTarget      = !@isClient
-        @readTimeout   = utils.options.readTimeout * 1000
-        
-        @id = AnonymousId if !@id 
-        
-        @description = 
-            channel:       @name
-            id:            @id
-            hostName:      @remoteAddress
-            remoteAddress: @remoteAddress
-        
-        @updateLastRead()
-
-        channelManager.created @
-
-    #---------------------------------------------------------------------------
-    close: () ->
-        return if @isClosed
-        
-        channelManager.destroyed @
-        
-        @isClosed = true
-        @messageQueue.shutdown()
-
-    #---------------------------------------------------------------------------
-    sendCallback: (intfName, callbackId, args...) ->
-        return if !callbackId
-        
-        args.unshift callbackId
-        
-        @sendMessage intfName, 'sendCallback', args...
-        
-    #---------------------------------------------------------------------------
-    sendMessage: (intfName, method, args...) ->
-
-        message = genJSON
-            interface: intfName
-            method:    method
-            args:      args
-        
-        @messageQueue.push message
-
-    #---------------------------------------------------------------------------
-    handleMessages: (messages) ->
-
-        for message in messages
-            message = parseJSON(message)
-            continue if !message
-            
-            messageHandler.handleMessage @, message
-        
-    #---------------------------------------------------------------------------
-    getMessages: (callback) ->
-        @updateLastRead()
-        return callback.call(null, null) if @isClosed
-        
-        @messageQueue.pullAll @readTimeout, callback
-        
-    #---------------------------------------------------------------------------
-    updateLastRead: () ->
-        @lastRead = (new Date).valueOf()
-
-    #---------------------------------------------------------------------------
-    toString: () ->
-        connections = _.map(@connections, (val) -> val.name).join(',')
-        "Channel(#{@name}, closed:#{@isClosed}, connections:[#{connections}])"
-
-#-------------------------------------------------------------------------------
-parseJSON = (message) ->
-    try 
-        return JSON.parse(message)
-    catch e
-        return null
-
-#-------------------------------------------------------------------------------
-genJSON = (message) ->
-    try 
-        return JSON.stringify(message)
-    catch e
-        return null

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/Channel.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/Channel.js b/weinre.server/lib/Channel.js
new file mode 100644
index 0000000..040e4c3
--- /dev/null
+++ b/weinre.server/lib/Channel.js
@@ -0,0 +1,130 @@
+// Generated by CoffeeScript 1.8.0
+var AnonymousId, Channel, MessageQueue, channelManager, genJSON, messageHandler, parseJSON, utils, _,
+  __slice = [].slice;
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+channelManager = require('./channelManager');
+
+messageHandler = require('./messageHandler');
+
+MessageQueue = require('./MessageQueue');
+
+AnonymousId = 'anonymous';
+
+module.exports = utils.registerClass(Channel = (function() {
+  function Channel(pathPrefix, id, remoteAddress, isClient) {
+    var prefix;
+    this.pathPrefix = pathPrefix;
+    this.id = id;
+    this.remoteAddress = remoteAddress;
+    this.isClient = isClient;
+    prefix = this.isClient ? 'c-' : 't-';
+    this.name = "" + prefix + (utils.getNextSequenceNumber());
+    this.messageQueue = new MessageQueue;
+    this.isClosed = false;
+    this.connections = [];
+    this.isTarget = !this.isClient;
+    this.readTimeout = utils.options.readTimeout * 1000;
+    if (!this.id) {
+      this.id = AnonymousId;
+    }
+    this.description = {
+      channel: this.name,
+      id: this.id,
+      hostName: this.remoteAddress,
+      remoteAddress: this.remoteAddress
+    };
+    this.updateLastRead();
+    channelManager.created(this);
+  }
+
+  Channel.prototype.close = function() {
+    if (this.isClosed) {
+      return;
+    }
+    channelManager.destroyed(this);
+    this.isClosed = true;
+    return this.messageQueue.shutdown();
+  };
+
+  Channel.prototype.sendCallback = function() {
+    var args, callbackId, intfName;
+    intfName = arguments[0], callbackId = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+    if (!callbackId) {
+      return;
+    }
+    args.unshift(callbackId);
+    return this.sendMessage.apply(this, [intfName, 'sendCallback'].concat(__slice.call(args)));
+  };
+
+  Channel.prototype.sendMessage = function() {
+    var args, intfName, message, method;
+    intfName = arguments[0], method = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+    message = genJSON({
+      "interface": intfName,
+      method: method,
+      args: args
+    });
+    return this.messageQueue.push(message);
+  };
+
+  Channel.prototype.handleMessages = function(messages) {
+    var message, _i, _len, _results;
+    _results = [];
+    for (_i = 0, _len = messages.length; _i < _len; _i++) {
+      message = messages[_i];
+      message = parseJSON(message);
+      if (!message) {
+        continue;
+      }
+      _results.push(messageHandler.handleMessage(this, message));
+    }
+    return _results;
+  };
+
+  Channel.prototype.getMessages = function(callback) {
+    this.updateLastRead();
+    if (this.isClosed) {
+      return callback.call(null, null);
+    }
+    return this.messageQueue.pullAll(this.readTimeout, callback);
+  };
+
+  Channel.prototype.updateLastRead = function() {
+    return this.lastRead = (new Date).valueOf();
+  };
+
+  Channel.prototype.toString = function() {
+    var connections;
+    connections = _.map(this.connections, function(val) {
+      return val.name;
+    }).join(',');
+    return "Channel(" + this.name + ", closed:" + this.isClosed + ", connections:[" + connections + "])";
+  };
+
+  return Channel;
+
+})());
+
+parseJSON = function(message) {
+  var e;
+  try {
+    return JSON.parse(message);
+  } catch (_error) {
+    e = _error;
+    return null;
+  }
+};
+
+genJSON = function(message) {
+  var e;
+  try {
+    return JSON.stringify(message);
+  } catch (_error) {
+    e = _error;
+    return null;
+  }
+};


[09/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/optparse.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/optparse.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/optparse.js
index d7fda40..6ec3604 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/optparse.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/optparse.js
@@ -1,9 +1,10 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
+  var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat;
 
-  exports.OptionParser = OptionParser = (function() {
+  repeat = require('./helpers').repeat;
 
+  exports.OptionParser = OptionParser = (function() {
     function OptionParser(rules, banner) {
       this.banner = banner;
       this.rules = buildRules(rules);
@@ -67,7 +68,7 @@
       for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         rule = _ref[_i];
         spaces = 15 - rule.longFlag.length;
-        spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+        spaces = spaces > 0 ? repeat(' ', spaces) : '';
         letPart = rule.shortFlag ? rule.shortFlag + ', ' : '    ';
         lines.push('  ' + letPart + rule.longFlag + spaces + rule.description);
       }


[06/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile
deleted file mode 100644
index 8945872..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-SHELL := /bin/bash
-
-test:
-	@./test/run.js
-
-build: npm test
-
-npm:
-	npm install .
-
-clean:
-	rm test/tmp/*
-
-.PHONY: test clean build

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md
index a5ca104..0f8cc61 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md
@@ -20,8 +20,299 @@ a large variety of clients and is considered production-ready.
 * Graceful error handling
 * Very high test coverage
 
+## Installation
+
+This is a low level package, and if you're using a high level framework such as Express, chances are it's already included in it. You can [read this discussion](http://stackoverflow.com/questions/11295554/how-to-disable-express-bodyparser-for-file-uploads-node-js) about how Formidable is integrated with Express.
+
+Via [npm](http://github.com/isaacs/npm):
+```
+npm install formidable@latest
+```
+Manually:
+```
+git clone git://github.com/felixge/node-formidable.git formidable
+vim my.js
+# var formidable = require('./formidable');
+```
+
+Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library.
+
+## Example
+
+Parse an incoming file upload.
+```javascript
+var formidable = require('formidable'),
+    http = require('http'),
+    util = require('util');
+
+http.createServer(function(req, res) {
+  if (req.url == '/upload' && req.method.toLowerCase() == 'post') {
+    // parse a file upload
+    var form = new formidable.IncomingForm();
+
+    form.parse(req, function(err, fields, files) {
+      res.writeHead(200, {'content-type': 'text/plain'});
+      res.write('received upload:\n\n');
+      res.end(util.inspect({fields: fields, files: files}));
+    });
+
+    return;
+  }
+
+  // show a file upload form
+  res.writeHead(200, {'content-type': 'text/html'});
+  res.end(
+    '<form action="/upload" enctype="multipart/form-data" method="post">'+
+    '<input type="text" name="title"><br>'+
+    '<input type="file" name="upload" multiple="multiple"><br>'+
+    '<input type="submit" value="Upload">'+
+    '</form>'
+  );
+}).listen(8080);
+```
+## API
+
+### Formidable.IncomingForm
+```javascript
+var form = new formidable.IncomingForm()
+```
+Creates a new incoming form.
+
+```javascript
+form.encoding = 'utf-8';
+```
+Sets encoding for incoming form fields.
+
+```javascript
+form.uploadDir = "/my/dir";
+```
+Sets the directory for placing file uploads in. You can move them later on using
+`fs.rename()`. The default is `os.tmpDir()`.
+
+```javascript
+form.keepExtensions = false;
+```
+If you want the files written to `form.uploadDir` to include the extensions of the original files, set this property to `true`.
+
+```javascript
+form.type
+```
+Either 'multipart' or 'urlencoded' depending on the incoming request.
+
+```javascript
+form.maxFieldsSize = 2 * 1024 * 1024;
+```
+Limits the amount of memory a field (not file) can allocate in bytes.
+If this value is exceeded, an `'error'` event is emitted. The default
+size is 2MB.
+
+```javascript
+form.maxFields = 1000;
+```
+Limits the number of fields that the querystring parser will decode. Defaults
+to 1000 (0 for unlimited).
+
+```javascript
+form.hash = false;
+```
+If you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`.
+
+```javascript
+form.multiples = false;
+```
+If this option is enabled, when you call `form.parse`, the `files` argument will contain arrays of files for inputs which submit multiple files using the HTML5 `multiple` attribute.
+
+```javascript
+form.bytesReceived
+```
+The amount of bytes received for this form so far.
+
+```javascript
+form.bytesExpected
+```
+The expected number of bytes in this form.
+
+```javascript
+form.parse(request, [cb]);
+```
+Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields and files are collected and passed to the callback:
+
+
+```javascript
+form.parse(req, function(err, fields, files) {
+  // ...
+});
+
+form.onPart(part);
+```
+You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events  processing which would occur otherwise, making you fully responsible for handling the processing.
+
+```javascript
+form.onPart = function(part) {
+  part.addListener('data', function() {
+    // ...
+  });
+}
+```
+If you want to use formidable to only handle certain parts for you, you can do so:
+```javascript
+form.onPart = function(part) {
+  if (!part.filename) {
+    // let formidable handle all non-file parts
+    form.handlePart(part);
+  }
+}
+```
+Check the code in this method for further inspiration.
+
+
+### Formidable.File
+```javascript
+file.size = 0
+```
+The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.
+```javascript
+file.path = null
+```
+The path this file is being written to. You can modify this in the `'fileBegin'` event in
+case you are unhappy with the way formidable generates a temporary path for your files.
+```javascript
+file.name = null
+```
+The name this file had according to the uploading client.
+```javascript
+file.type = null
+```
+The mime type of this file, according to the uploading client.
+```javascript
+file.lastModifiedDate = null
+```
+A date object (or `null`) containing the time this file was last written to. Mostly
+here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).
+```javascript
+file.hash = null
+```
+If hash calculation was set, you can read the hex digest out of this var.
+
+#### Formidable.File#toJSON()
+
+  This method returns a JSON-representation of the file, allowing you to
+  `JSON.stringify()` the file which is useful for logging and responding
+  to requests.
+
+### Events
+
+
+#### 'progress'
+```javascript
+form.on('progress', function(bytesReceived, bytesExpected) {
+});
+```
+Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.
+
+
+
+#### 'field'
+```javascript
+form.on('field', function(name, value) {
+});
+```
+
+#### 'fileBegin'
+
+Emitted whenever a field / value pair has been received.
+```javascript
+form.on('fileBegin', function(name, file) {
+});
+```
+
+#### 'file'
+
+Emitted whenever a new file is detected in the upload stream. Use this even if
+you want to stream the file to somewhere else while buffering the upload on
+the file system.
+
+Emitted whenever a field / file pair has been received. `file` is an instance of `File`.
+```javascript
+form.on('file', function(name, file) {
+});
+```
+
+#### 'error'
+
+Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.
+```javascript
+form.on('error', function(err) {
+});
+```
+
+#### 'aborted'
+
+
+Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core).
+```javascript
+form.on('aborted', function() {
+});
+```
+
+##### 'end'
+```javascript
+form.on('end', function() {
+});
+```
+Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.
+
+
+
 ## Changelog
 
+### v1.0.14
+
+* Add failing hash tests. (Ben Trask)
+* Enable hash calculation again (Eugene Girshov)
+* Test for immediate data events (Tim Smart)
+* Re-arrange IncomingForm#parse (Tim Smart)
+
+### v1.0.13
+
+* Only update hash if update method exists (Sven Lito)
+* According to travis v0.10 needs to go quoted (Sven Lito)
+* Bumping build node versions (Sven Lito)
+* Additional fix for empty requests (Eugene Girshov)
+* Change the default to 1000, to match the new Node behaviour. (OrangeDog)
+* Add ability to control maxKeys in the querystring parser. (OrangeDog)
+* Adjust test case to work with node 0.9.x (Eugene Girshov)
+* Update package.json (Sven Lito)
+* Path adjustment according to eb4468b (Markus Ast)
+
+### v1.0.12
+
+* Emit error on aborted connections (Eugene Girshov)
+* Add support for empty requests (Eugene Girshov)
+* Fix name/filename handling in Content-Disposition (jesperp)
+* Tolerate malformed closing boundary in multipart (Eugene Girshov)
+* Ignore preamble in multipart messages (Eugene Girshov)
+* Add support for application/json (Mike Frey, Carlos Rodriguez)
+* Add support for Base64 encoding (Elmer Bulthuis)
+* Add File#toJSON (TJ Holowaychuk)
+* Remove support for Node.js 0.4 & 0.6 (Andrew Kelley)
+* Documentation improvements (Sven Lito, Andre Azevedo)
+* Add support for application/octet-stream (Ion Lupascu, Chris Scribner)
+* Use os.tmpDir() to get tmp directory (Andrew Kelley)
+* Improve package.json (Andrew Kelley, Sven Lito)
+* Fix benchmark script (Andrew Kelley)
+* Fix scope issue in incoming_forms (Sven Lito)
+* Fix file handle leak on error (OrangeDog)
+
+### v1.0.11
+
+* Calculate checksums for incoming files (sreuter)
+* Add definition parameters to "IncomingForm" as an argument (Math-)
+
+### v1.0.10
+
+* Make parts to be proper Streams (Matt Robenolt)
+
 ### v1.0.9
 
 * Emit progress when content length header parsed (Tim Koschützki)
@@ -121,183 +412,6 @@ These releases were done before starting to maintain the above Changelog:
 * [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)
 * [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0)
 
-## Installation
-
-Via [npm](http://github.com/isaacs/npm):
-
-    npm install formidable@latest
-
-Manually:
-
-    git clone git://github.com/felixge/node-formidable.git formidable
-    vim my.js
-    # var formidable = require('./formidable');
-
-Note: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library.
-
-## Example
-
-Parse an incoming file upload.
-
-    var formidable = require('formidable'),
-        http = require('http'),
-
-        util = require('util');
-
-    http.createServer(function(req, res) {
-      if (req.url == '/upload' && req.method.toLowerCase() == 'post') {
-        // parse a file upload
-        var form = new formidable.IncomingForm();
-        form.parse(req, function(err, fields, files) {
-          res.writeHead(200, {'content-type': 'text/plain'});
-          res.write('received upload:\n\n');
-          res.end(util.inspect({fields: fields, files: files}));
-        });
-        return;
-      }
-
-      // show a file upload form
-      res.writeHead(200, {'content-type': 'text/html'});
-      res.end(
-        '<form action="/upload" enctype="multipart/form-data" method="post">'+
-        '<input type="text" name="title"><br>'+
-        '<input type="file" name="upload" multiple="multiple"><br>'+
-        '<input type="submit" value="Upload">'+
-        '</form>'
-      );
-    }).listen(80);
-
-## API
-
-### formidable.IncomingForm
-
-__new formidable.IncomingForm()__
-
-Creates a new incoming form.
-
-__incomingForm.encoding = 'utf-8'__
-
-The encoding to use for incoming form fields.
-
-__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__
-
-The directory for placing file uploads in. You can move them later on using
-`fs.rename()`. The default directory is picked at module load time depending on
-the first existing directory from those listed above.
-
-__incomingForm.keepExtensions = false__
-
-If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`.
-
-__incomingForm.type__
-
-Either 'multipart' or 'urlencoded' depending on the incoming request.
-
-__incomingForm.maxFieldsSize = 2 * 1024 * 1024__
-
-Limits the amount of memory a field (not file) can allocate in bytes.
-If this value is exceeded, an `'error'` event is emitted. The default
-size is 2MB.
-
-__incomingForm.hash = false__
-
-If you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`.
-
-__incomingForm.bytesReceived__
-
-The amount of bytes received for this form so far.
-
-__incomingForm.bytesExpected__
-
-The expected number of bytes in this form.
-
-__incomingForm.parse(request, [cb])__
-
-Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback:
-
-    incomingForm.parse(req, function(err, fields, files) {
-      // ...
-    });
-
-__incomingForm.onPart(part)__
-
-You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events  processing which would occur otherwise, making you fully responsible for handling the processing.
-
-    incomingForm.onPart = function(part) {
-      part.addListener('data', function() {
-        // ...
-      });
-    }
-
-If you want to use formidable to only handle certain parts for you, you can do so:
-
-    incomingForm.onPart = function(part) {
-      if (!part.filename) {
-        // let formidable handle all non-file parts
-        incomingForm.handlePart(part);
-      }
-    }
-
-Check the code in this method for further inspiration.
-
-__Event: 'progress' (bytesReceived, bytesExpected)__
-
-Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.
-
-__Event: 'field' (name, value)__
-
-Emitted whenever a field / value pair has been received.
-
-__Event: 'fileBegin' (name, file)__
-
-Emitted whenever a new file is detected in the upload stream. Use this even if
-you want to stream the file to somewhere else while buffering the upload on
-the file system.
-
-__Event: 'file' (name, file)__
-
-Emitted whenever a field / file pair has been received. `file` is an instance of `File`.
-
-__Event: 'error' (err)__
-
-Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.
-
-__Event: 'aborted'__
-
-Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core).
-
-__Event: 'end' ()__
-
-Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.
-
-### formidable.File
-
-__file.size = 0__
-
-The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.
-
-__file.path = null__
-
-The path this file is being written to. You can modify this in the `'fileBegin'` event in
-case you are unhappy with the way formidable generates a temporary path for your files.
-
-__file.name = null__
-
-The name this file had according to the uploading client.
-
-__file.type = null__
-
-The mime type of this file, according to the uploading client.
-
-__file.lastModifiedDate = null__
-
-A date object (or `null`) containing the time this file was last written to. Mostly
-here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).
-
-__file.hash = null__
-
-If hash calculation was set, you can read the hex digest out of this var.
-
 ## License
 
 Formidable is licensed under the MIT license.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/TODO
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/TODO b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/TODO
deleted file mode 100644
index e1107f2..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
-- Better bufferMaxSize handling approach
-- Add tests for JSON parser pull request and merge it
-- Implement QuerystringParser the same way as MultipartParser

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js
deleted file mode 100644
index bff41f1..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js
+++ /dev/null
@@ -1,70 +0,0 @@
-require('../test/common');
-var multipartParser = require('../lib/multipart_parser'),
-    MultipartParser = multipartParser.MultipartParser,
-    parser = new MultipartParser(),
-    Buffer = require('buffer').Buffer,
-    boundary = '-----------------------------168072824752491622650073',
-    mb = 100,
-    buffer = createMultipartBuffer(boundary, mb * 1024 * 1024),
-    callbacks =
-      { partBegin: -1,
-        partEnd: -1,
-        headerField: -1,
-        headerValue: -1,
-        partData: -1,
-        end: -1,
-      };
-
-
-parser.initWithBoundary(boundary);
-parser.onHeaderField = function() {
-  callbacks.headerField++;
-};
-
-parser.onHeaderValue = function() {
-  callbacks.headerValue++;
-};
-
-parser.onPartBegin = function() {
-  callbacks.partBegin++;
-};
-
-parser.onPartData = function() {
-  callbacks.partData++;
-};
-
-parser.onPartEnd = function() {
-  callbacks.partEnd++;
-};
-
-parser.onEnd = function() {
-  callbacks.end++;
-};
-
-var start = +new Date(),
-    nparsed = parser.write(buffer),
-    duration = +new Date - start,
-    mbPerSec = (mb / (duration / 1000)).toFixed(2);
-
-console.log(mbPerSec+' mb/sec');
-
-assert.equal(nparsed, buffer.length);
-
-function createMultipartBuffer(boundary, size) {
-  var head =
-        '--'+boundary+'\r\n'
-      + 'content-disposition: form-data; name="field1"\r\n'
-      + '\r\n'
-    , tail = '\r\n--'+boundary+'--\r\n'
-    , buffer = new Buffer(size);
-
-  buffer.write(head, 'ascii', 0);
-  buffer.write(tail, 'ascii', buffer.length - tail.length);
-  return buffer;
-}
-
-process.on('exit', function() {
-  for (var k in callbacks) {
-    assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]);
-  }
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js
deleted file mode 100644
index f6c15a6..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js
+++ /dev/null
@@ -1,43 +0,0 @@
-require('../test/common');
-var http = require('http'),
-    util = require('util'),
-    formidable = require('formidable'),
-    server;
-
-server = http.createServer(function(req, res) {
-  if (req.url == '/') {
-    res.writeHead(200, {'content-type': 'text/html'});
-    res.end(
-      '<form action="/post" method="post">'+
-      '<input type="text" name="title"><br>'+
-      '<input type="text" name="data[foo][]"><br>'+
-      '<input type="submit" value="Submit">'+
-      '</form>'
-    );
-  } else if (req.url == '/post') {
-    var form = new formidable.IncomingForm(),
-        fields = [];
-
-    form
-      .on('error', function(err) {
-        res.writeHead(200, {'content-type': 'text/plain'});
-        res.end('error:\n\n'+util.inspect(err));
-      })
-      .on('field', function(field, value) {
-        console.log(field, value);
-        fields.push([field, value]);
-      })
-      .on('end', function() {
-        console.log('-> post done');
-        res.writeHead(200, {'content-type': 'text/plain'});
-        res.end('received fields:\n\n '+util.inspect(fields));
-      });
-    form.parse(req);
-  } else {
-    res.writeHead(404, {'content-type': 'text/plain'});
-    res.end('404');
-  }
-});
-server.listen(TEST_PORT);
-
-console.log('listening on http://localhost:'+TEST_PORT+'/');

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js
deleted file mode 100644
index 050cdd9..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js
+++ /dev/null
@@ -1,48 +0,0 @@
-require('../test/common');
-var http = require('http'),
-    util = require('util'),
-    formidable = require('formidable'),
-    server;
-
-server = http.createServer(function(req, res) {
-  if (req.url == '/') {
-    res.writeHead(200, {'content-type': 'text/html'});
-    res.end(
-      '<form action="/upload" enctype="multipart/form-data" method="post">'+
-      '<input type="text" name="title"><br>'+
-      '<input type="file" name="upload" multiple="multiple"><br>'+
-      '<input type="submit" value="Upload">'+
-      '</form>'
-    );
-  } else if (req.url == '/upload') {
-    var form = new formidable.IncomingForm(),
-        files = [],
-        fields = [];
-
-    form.uploadDir = TEST_TMP;
-
-    form
-      .on('field', function(field, value) {
-        console.log(field, value);
-        fields.push([field, value]);
-      })
-      .on('file', function(field, file) {
-        console.log(field, file);
-        files.push([field, file]);
-      })
-      .on('end', function() {
-        console.log('-> upload done');
-        res.writeHead(200, {'content-type': 'text/plain'});
-        res.write('received fields:\n\n '+util.inspect(fields));
-        res.write('\n\n');
-        res.end('received files:\n\n '+util.inspect(files));
-      });
-    form.parse(req);
-  } else {
-    res.writeHead(404, {'content-type': 'text/plain'});
-    res.end('404');
-  }
-});
-server.listen(TEST_PORT);
-
-console.log('listening on http://localhost:'+TEST_PORT+'/');

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/index.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/index.js
index be41032..4cc88b3 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/index.js
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/index.js
@@ -1 +1 @@
-module.exports = require('./lib/formidable');
\ No newline at end of file
+module.exports = require('./lib');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js
index dad8d5f..e34c10e 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js
@@ -1,6 +1,6 @@
 if (global.GENTLY) require = GENTLY.hijack(require);
 
-var util = require('./util'),
+var util = require('util'),
     WriteStream = require('fs').WriteStream,
     EventEmitter = require('events').EventEmitter,
     crypto = require('crypto');
@@ -23,37 +23,36 @@ function File(properties) {
 
   if(typeof this.hash === 'string') {
     this.hash = crypto.createHash(properties.hash);
+  } else {
+    this.hash = null;
   }
-
-  this._backwardsCompatibility();
 }
 module.exports = File;
 util.inherits(File, EventEmitter);
 
-// @todo Next release: Show error messages when accessing these
-File.prototype._backwardsCompatibility = function() {
-  var self = this;
-  this.__defineGetter__('length', function() {
-    return self.size;
-  });
-  this.__defineGetter__('filename', function() {
-    return self.name;
-  });
-  this.__defineGetter__('mime', function() {
-    return self.type;
-  });
-};
-
 File.prototype.open = function() {
   this._writeStream = new WriteStream(this.path);
 };
 
+File.prototype.toJSON = function() {
+  return {
+    size: this.size,
+    path: this.path,
+    name: this.name,
+    type: this.type,
+    mtime: this.lastModifiedDate,
+    length: this.length,
+    filename: this.filename,
+    mime: this.mime
+  };
+};
+
 File.prototype.write = function(buffer, cb) {
   var self = this;
+  if (self.hash) {
+    self.hash.update(buffer);
+  }
   this._writeStream.write(buffer, function() {
-    if(self.hash) {
-      self.hash.update(buffer);
-    }
     self.lastModifiedDate = new Date();
     self.size += buffer.length;
     self.emit('progress', self.size);
@@ -63,10 +62,10 @@ File.prototype.write = function(buffer, cb) {
 
 File.prototype.end = function(cb) {
   var self = this;
+  if (self.hash) {
+    self.hash = self.hash.digest('hex');
+  }
   this._writeStream.end(function() {
-    if(self.hash) {
-      self.hash = self.hash.digest('hex');
-    }
     self.emit('end');
     cb();
   });

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js
index 060eac2..27b9aed 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js
@@ -1,31 +1,36 @@
 if (global.GENTLY) require = GENTLY.hijack(require);
 
 var fs = require('fs');
-var util = require('./util'),
+var util = require('util'),
     path = require('path'),
     File = require('./file'),
     MultipartParser = require('./multipart_parser').MultipartParser,
     QuerystringParser = require('./querystring_parser').QuerystringParser,
+    OctetParser       = require('./octet_parser').OctetParser,
+    JSONParser = require('./json_parser').JSONParser,
     StringDecoder = require('string_decoder').StringDecoder,
     EventEmitter = require('events').EventEmitter,
-    Stream = require('stream').Stream;
+    Stream = require('stream').Stream,
+    os = require('os');
 
-function IncomingForm(opts) {  
-  if (!(this instanceof IncomingForm)) return new IncomingForm;
+function IncomingForm(opts) {
+  if (!(this instanceof IncomingForm)) return new IncomingForm(opts);
   EventEmitter.call(this);
 
   opts=opts||{};
-  
+
   this.error = null;
   this.ended = false;
 
+  this.maxFields = opts.maxFields || 1000;
   this.maxFieldsSize = opts.maxFieldsSize || 2 * 1024 * 1024;
   this.keepExtensions = opts.keepExtensions || false;
-  this.uploadDir = opts.uploadDir || IncomingForm.UPLOAD_DIR;
+  this.uploadDir = opts.uploadDir || os.tmpDir();
   this.encoding = opts.encoding || 'utf-8';
   this.headers = null;
   this.type = null;
-  this.hash = false;
+  this.hash = opts.hash || false;
+  this.multiples = opts.multiples || false;
 
   this.bytesReceived = null;
   this.bytesExpected = null;
@@ -33,24 +38,13 @@ function IncomingForm(opts) {
   this._parser = null;
   this._flushing = 0;
   this._fieldsSize = 0;
-};
+  this.openedFiles = [];
+
+  return this;
+}
 util.inherits(IncomingForm, EventEmitter);
 exports.IncomingForm = IncomingForm;
 
-IncomingForm.UPLOAD_DIR = (function() {
-  var dirs = [process.env.TMP, '/tmp', process.cwd()];
-  for (var i = 0; i < dirs.length; i++) {
-    var dir = dirs[i];
-    var isDirectory = false;
-
-    try {
-      isDirectory = fs.statSync(dir).isDirectory();
-    } catch (e) {}
-
-    if (isDirectory) return dir;
-  }
-})();
-
 IncomingForm.prototype.parse = function(req, cb) {
   this.pause = function() {
     try {
@@ -81,8 +75,40 @@ IncomingForm.prototype.parse = function(req, cb) {
     return true;
   };
 
+  // Setup callback first, so we don't miss anything from data events emitted
+  // immediately.
+  if (cb) {
+    var fields = {}, files = {};
+    this
+      .on('field', function(name, value) {
+        fields[name] = value;
+      })
+      .on('file', function(name, file) {
+        if (this.multiples) {
+          if (files[name]) {
+            if (!Array.isArray(files[name])) {
+              files[name] = [files[name]];
+            }
+            files[name].push(file);
+          } else {
+            files[name] = file;
+          }
+        } else {
+          files[name] = file;
+        }
+      })
+      .on('error', function(err) {
+        cb(err, fields, files);
+      })
+      .on('end', function() {
+        cb(null, fields, files);
+      });
+  }
+
+  // Parse headers and setup the parser, ready to start listening for data.
   this.writeHeaders(req.headers);
 
+  // Start listening for data.
   var self = this;
   req
     .on('error', function(err) {
@@ -90,6 +116,7 @@ IncomingForm.prototype.parse = function(req, cb) {
     })
     .on('aborted', function() {
       self.emit('aborted');
+      self._error(new Error('Request aborted'));
     })
     .on('data', function(buffer) {
       self.write(buffer);
@@ -105,23 +132,6 @@ IncomingForm.prototype.parse = function(req, cb) {
       }
     });
 
-  if (cb) {
-    var fields = {}, files = {};
-    this
-      .on('field', function(name, value) {
-        fields[name] = value;
-      })
-      .on('file', function(name, file) {
-        files[name] = file;
-      })
-      .on('error', function(err) {
-        cb(err, fields, files);
-      })
-      .on('end', function() {
-        cb(null, fields, files);
-      });
-  }
-
   return this;
 };
 
@@ -132,8 +142,11 @@ IncomingForm.prototype.writeHeaders = function(headers) {
 };
 
 IncomingForm.prototype.write = function(buffer) {
+  if (this.error) {
+    return;
+  }
   if (!this._parser) {
-    this._error(new Error('unintialized parser'));
+    this._error(new Error('uninitialized parser'));
     return;
   }
 
@@ -197,8 +210,12 @@ IncomingForm.prototype.handlePart = function(part) {
   this.emit('fileBegin', part.name, file);
 
   file.open();
+  this.openedFiles.push(file);
 
   part.on('data', function(buffer) {
+    if (buffer.length == 0) {
+      return;
+    }
     self.pause();
     file.write(buffer, function() {
       self.resume();
@@ -214,20 +231,40 @@ IncomingForm.prototype.handlePart = function(part) {
   });
 };
 
+function dummyParser(self) {
+  return {
+    end: function () {
+      self.ended = true;
+      self._maybeEnd();
+      return null;
+    }
+  };
+}
+
 IncomingForm.prototype._parseContentType = function() {
+  if (this.bytesExpected === 0) {
+    this._parser = dummyParser(this);
+    return;
+  }
+
   if (!this.headers['content-type']) {
     this._error(new Error('bad content-type header, no content-type'));
     return;
   }
 
+  if (this.headers['content-type'].match(/octet-stream/i)) {
+    this._initOctetStream();
+    return;
+  }
+
   if (this.headers['content-type'].match(/urlencoded/i)) {
     this._initUrlencoded();
     return;
   }
 
   if (this.headers['content-type'].match(/multipart/i)) {
-    var m;
-    if (m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i)) {
+    var m = this.headers['content-type'].match(/boundary=(?:"([^"]+)"|([^;]+))/i);
+    if (m) {
       this._initMultipart(m[1] || m[2]);
     } else {
       this._error(new Error('bad content-type header, no multipart boundary'));
@@ -235,23 +272,39 @@ IncomingForm.prototype._parseContentType = function() {
     return;
   }
 
+  if (this.headers['content-type'].match(/json/i)) {
+    this._initJSONencoded();
+    return;
+  }
+
   this._error(new Error('bad content-type header, unknown content-type: '+this.headers['content-type']));
 };
 
 IncomingForm.prototype._error = function(err) {
-  if (this.error) {
+  if (this.error || this.ended) {
     return;
   }
 
   this.error = err;
-  this.pause();
   this.emit('error', err);
+
+  if (Array.isArray(this.openedFiles)) {
+    this.openedFiles.forEach(function(file) {
+      file._writeStream.destroy();
+      setTimeout(fs.unlink, 0, file.path, function(error) { });
+    });
+  }
 };
 
 IncomingForm.prototype._parseContentLength = function() {
+  this.bytesReceived = 0;
   if (this.headers['content-length']) {
-    this.bytesReceived = 0;
     this.bytesExpected = parseInt(this.headers['content-length'], 10);
+  } else if (this.headers['transfer-encoding'] === undefined) {
+    this.bytesExpected = 0;
+  }
+
+  if (this.bytesExpected !== null) {
     this.emit('progress', this.bytesReceived, this.bytesExpected);
   }
 };
@@ -278,6 +331,10 @@ IncomingForm.prototype._initMultipart = function(boundary) {
     part.name = null;
     part.filename = null;
     part.mime = null;
+
+    part.transferEncoding = 'binary';
+    part.transferBuffer = '';
+
     headerField = '';
     headerValue = '';
   };
@@ -294,15 +351,17 @@ IncomingForm.prototype._initMultipart = function(boundary) {
     headerField = headerField.toLowerCase();
     part.headers[headerField] = headerValue;
 
-    var m;
+    var m = headerValue.match(/\bname="([^"]+)"/i);
     if (headerField == 'content-disposition') {
-      if (m = headerValue.match(/name="([^"]+)"/i)) {
+      if (m) {
         part.name = m[1];
       }
 
       part.filename = self._fileName(headerValue);
     } else if (headerField == 'content-type') {
       part.mime = headerValue;
+    } else if (headerField == 'content-transfer-encoding') {
+      part.transferEncoding = headerValue.toLowerCase();
     }
 
     headerField = '';
@@ -310,16 +369,47 @@ IncomingForm.prototype._initMultipart = function(boundary) {
   };
 
   parser.onHeadersEnd = function() {
-    self.onPart(part);
-  };
+    switch(part.transferEncoding){
+      case 'binary':
+      case '7bit':
+      case '8bit':
+      parser.onPartData = function(b, start, end) {
+        part.emit('data', b.slice(start, end));
+      };
+
+      parser.onPartEnd = function() {
+        part.emit('end');
+      };
+      break;
+
+      case 'base64':
+      parser.onPartData = function(b, start, end) {
+        part.transferBuffer += b.slice(start, end).toString('ascii');
+
+        /*
+        four bytes (chars) in base64 converts to three bytes in binary
+        encoding. So we should always work with a number of bytes that
+        can be divided by 4, it will result in a number of buytes that
+        can be divided vy 3.
+        */
+        var offset = parseInt(part.transferBuffer.length / 4, 10) * 4;
+        part.emit('data', new Buffer(part.transferBuffer.substring(0, offset), 'base64'));
+        part.transferBuffer = part.transferBuffer.substring(offset);
+      };
+
+      parser.onPartEnd = function() {
+        part.emit('data', new Buffer(part.transferBuffer, 'base64'));
+        part.emit('end');
+      };
+      break;
+
+      default:
+      return self._error(new Error('unknown transfer-encoding'));
+    }
 
-  parser.onPartData = function(b, start, end) {
-    part.emit('data', b.slice(start, end));
+    self.onPart(part);
   };
 
-  parser.onPartEnd = function() {
-    part.emit('end');
-  };
 
   parser.onEnd = function() {
     self.ended = true;
@@ -330,7 +420,7 @@ IncomingForm.prototype._initMultipart = function(boundary) {
 };
 
 IncomingForm.prototype._fileName = function(headerValue) {
-  var m = headerValue.match(/filename="(.*?)"($|; )/i)
+  var m = headerValue.match(/\bfilename="(.*?)"($|; )/i);
   if (!m) return;
 
   var filename = m[1].substr(m[1].lastIndexOf('\\') + 1);
@@ -344,7 +434,7 @@ IncomingForm.prototype._fileName = function(headerValue) {
 IncomingForm.prototype._initUrlencoded = function() {
   this.type = 'urlencoded';
 
-  var parser = new QuerystringParser()
+  var parser = new QuerystringParser(this.maxFields)
     , self = this;
 
   parser.onField = function(key, val) {
@@ -359,6 +449,84 @@ IncomingForm.prototype._initUrlencoded = function() {
   this._parser = parser;
 };
 
+IncomingForm.prototype._initOctetStream = function() {
+  this.type = 'octet-stream';
+  var filename = this.headers['x-file-name'];
+  var mime = this.headers['content-type'];
+
+  var file = new File({
+    path: this._uploadPath(filename),
+    name: filename,
+    type: mime
+  });
+
+  this.emit('fileBegin', filename, file);
+  file.open();
+
+  this._flushing++;
+
+  var self = this;
+
+  self._parser = new OctetParser();
+
+  //Keep track of writes that haven't finished so we don't emit the file before it's done being written
+  var outstandingWrites = 0;
+
+  self._parser.on('data', function(buffer){
+    self.pause();
+    outstandingWrites++;
+
+    file.write(buffer, function() {
+      outstandingWrites--;
+      self.resume();
+
+      if(self.ended){
+        self._parser.emit('doneWritingFile');
+      }
+    });
+  });
+
+  self._parser.on('end', function(){
+    self._flushing--;
+    self.ended = true;
+
+    var done = function(){
+      file.end(function() {
+        self.emit('file', 'file', file);
+        self._maybeEnd();
+      });
+    };
+
+    if(outstandingWrites === 0){
+      done();
+    } else {
+      self._parser.once('doneWritingFile', done);
+    }
+  });
+};
+
+IncomingForm.prototype._initJSONencoded = function() {
+  this.type = 'json';
+
+  var parser = new JSONParser()
+    , self = this;
+
+  if (this.bytesExpected) {
+    parser.initWithLength(this.bytesExpected);
+  }
+
+  parser.onField = function(key, val) {
+    self.emit('field', key, val);
+  };
+
+  parser.onEnd = function() {
+    self.ended = true;
+    self._maybeEnd();
+  };
+
+  this._parser = parser;
+};
+
 IncomingForm.prototype._uploadPath = function(filename) {
   var name = '';
   for (var i = 0; i < 32; i++) {
@@ -367,7 +535,7 @@ IncomingForm.prototype._uploadPath = function(filename) {
 
   if (this.keepExtensions) {
     var ext = path.extname(filename);
-    ext     = ext.replace(/(\.[a-z0-9]+).*/, '$1')
+    ext     = ext.replace(/(\.[a-z0-9]+).*/i, '$1');
 
     name += ext;
   }
@@ -376,9 +544,10 @@ IncomingForm.prototype._uploadPath = function(filename) {
 };
 
 IncomingForm.prototype._maybeEnd = function() {
-  if (!this.ended || this._flushing) {
+  if (!this.ended || this._flushing || this.error) {
     return;
   }
 
   this.emit('end');
 };
+

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/json_parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/json_parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/json_parser.js
new file mode 100644
index 0000000..db39c31
--- /dev/null
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/json_parser.js
@@ -0,0 +1,35 @@
+if (global.GENTLY) require = GENTLY.hijack(require);
+
+var Buffer = require('buffer').Buffer;
+
+function JSONParser() {
+  this.data = new Buffer('');
+  this.bytesWritten = 0;
+}
+exports.JSONParser = JSONParser;
+
+JSONParser.prototype.initWithLength = function(length) {
+  this.data = new Buffer(length);
+};
+
+JSONParser.prototype.write = function(buffer) {
+  if (this.data.length >= this.bytesWritten + buffer.length) {
+    buffer.copy(this.data, this.bytesWritten);
+  } else {
+    this.data = Buffer.concat([this.data, buffer]);
+  }
+  this.bytesWritten += buffer.length;
+  return buffer.length;
+};
+
+JSONParser.prototype.end = function() {
+  try {
+    var fields = JSON.parse(this.data.toString('utf8'));
+    for (var field in fields) {
+      this.onField(field, fields[field]);
+    }
+  } catch (e) {}
+  this.data = null;
+
+  this.onEnd();
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js
index 9ca567c..d70dd4d 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js
@@ -13,13 +13,13 @@ var Buffer = require('buffer').Buffer,
       PART_DATA_START: s++,
       PART_DATA: s++,
       PART_END: s++,
-      END: s++,
+      END: s++
     },
 
     f = 1,
     F =
     { PART_BOUNDARY: f,
-      LAST_BOUNDARY: f *= 2,
+      LAST_BOUNDARY: f *= 2
     },
 
     LF = 10,
@@ -34,7 +34,7 @@ var Buffer = require('buffer').Buffer,
       return c | 0x20;
     };
 
-for (var s in S) {
+for (s in S) {
   exports[s] = S[s];
 }
 
@@ -46,7 +46,7 @@ function MultipartParser() {
 
   this.index = null;
   this.flags = 0;
-};
+}
 exports.MultipartParser = MultipartParser;
 
 MultipartParser.stateToString = function(stateNumber) {
@@ -127,25 +127,34 @@ MultipartParser.prototype.write = function(buffer) {
         state = S.START_BOUNDARY;
       case S.START_BOUNDARY:
         if (index == boundary.length - 2) {
-          if (c != CR) {
+          if (c == HYPHEN) {
+            flags |= F.LAST_BOUNDARY;
+          } else if (c != CR) {
             return i;
           }
           index++;
           break;
         } else if (index - 1 == boundary.length - 2) {
-          if (c != LF) {
+          if (flags & F.LAST_BOUNDARY && c == HYPHEN){
+            callback('end');
+            state = S.END;
+            flags = 0;
+          } else if (!(flags & F.LAST_BOUNDARY) && c == LF) {
+            index = 0;
+            callback('partBegin');
+            state = S.HEADER_FIELD_START;
+          } else {
             return i;
           }
-          index = 0;
-          callback('partBegin');
-          state = S.HEADER_FIELD_START;
           break;
         }
 
         if (c != boundary[index+2]) {
-          return i;
+          index = -2;
+        }
+        if (c == boundary[index+2]) {
+          index++;
         }
-        index++;
         break;
       case S.HEADER_FIELD_START:
         state = S.HEADER_FIELD;
@@ -207,12 +216,12 @@ MultipartParser.prototype.write = function(buffer) {
         state = S.PART_DATA_START;
         break;
       case S.PART_DATA_START:
-        state = S.PART_DATA
+        state = S.PART_DATA;
         mark('partData');
       case S.PART_DATA:
         prevIndex = index;
 
-        if (index == 0) {
+        if (index === 0) {
           // boyer-moore derrived algorithm to safely skip non-boundary data
           i += boundaryEnd;
           while (i < bufferLength && !(buffer[i] in boundaryChars)) {
@@ -224,7 +233,7 @@ MultipartParser.prototype.write = function(buffer) {
 
         if (index < boundary.length) {
           if (boundary[index] == c) {
-            if (index == 0) {
+            if (index === 0) {
               dataCallback('partData', true);
             }
             index++;
@@ -258,6 +267,7 @@ MultipartParser.prototype.write = function(buffer) {
               callback('partEnd');
               callback('end');
               state = S.END;
+              flags = 0;
             } else {
               index = 0;
             }
@@ -302,7 +312,17 @@ MultipartParser.prototype.write = function(buffer) {
 };
 
 MultipartParser.prototype.end = function() {
-  if (this.state != S.END) {
+  var callback = function(self, name) {
+    var callbackSymbol = 'on'+name.substr(0, 1).toUpperCase()+name.substr(1);
+    if (callbackSymbol in self) {
+      self[callbackSymbol]();
+    }
+  };
+  if ((this.state == S.HEADER_FIELD_START && this.index === 0) ||
+      (this.state == S.PART_DATA && this.index == this.boundary.length)) {
+    callback(this, 'partEnd');
+    callback(this, 'end');
+  } else if (this.state != S.END) {
     return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain());
   }
 };

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/octet_parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/octet_parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/octet_parser.js
new file mode 100644
index 0000000..6e8b551
--- /dev/null
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/octet_parser.js
@@ -0,0 +1,20 @@
+var EventEmitter = require('events').EventEmitter
+	, util = require('util');
+
+function OctetParser(options){
+	if(!(this instanceof OctetParser)) return new OctetParser(options);
+	EventEmitter.call(this);
+}
+
+util.inherits(OctetParser, EventEmitter);
+
+exports.OctetParser = OctetParser;
+
+OctetParser.prototype.write = function(buffer) {
+    this.emit('data', buffer);
+	return buffer.length;
+};
+
+OctetParser.prototype.end = function() {
+	this.emit('end');
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js
index 63f109e..fcaffe0 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js
@@ -4,9 +4,10 @@ if (global.GENTLY) require = GENTLY.hijack(require);
 // If I find time I'll rewrite this to be fully streaming as well
 var querystring = require('querystring');
 
-function QuerystringParser() {
+function QuerystringParser(maxKeys) {
+  this.maxKeys = maxKeys;
   this.buffer = '';
-};
+}
 exports.QuerystringParser = QuerystringParser;
 
 QuerystringParser.prototype.write = function(buffer) {
@@ -15,11 +16,12 @@ QuerystringParser.prototype.write = function(buffer) {
 };
 
 QuerystringParser.prototype.end = function() {
-  var fields = querystring.parse(this.buffer);
+  var fields = querystring.parse(this.buffer, '&', '=', { maxKeys: this.maxKeys });
   for (var field in fields) {
     this.onField(field, fields[field]);
   }
   this.buffer = '';
 
   this.onEnd();
-};
\ No newline at end of file
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js
deleted file mode 100644
index e9493e9..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Backwards compatibility ...
-try {
-  module.exports = require('util');
-} catch (e) {
-  module.exports = require('sys');
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Makefile
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Makefile b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Makefile
deleted file mode 100644
index 01f7140..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-test:
-	@find test/simple/test-*.js | xargs -n 1 -t node
-
-.PHONY: test
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md
deleted file mode 100644
index f8f0c66..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/Readme.md
+++ /dev/null
@@ -1,167 +0,0 @@
-# Gently
-
-## Purpose
-
-A node.js module that helps with stubbing and behavior verification. It allows you to test the most remote and nested corners of your code while keeping being fully unobtrusive.
-
-## Features
-
-* Overwrite and stub individual object functions
-* Verify that all expected calls have been made in the expected order
-* Restore stubbed functions to their original behavior
-* Detect object / class names from obj.constructor.name and obj.toString()
-* Hijack any required module function or class constructor
-
-## Installation
-
-Via [npm](http://github.com/isaacs/npm):
-
-    npm install gently@latest
-
-## Example
-
-Make sure your dog is working properly:
-
-    function Dog() {}
-
-    Dog.prototype.seeCat = function() {
-      this.bark('whuf, whuf');
-      this.run();
-    }
-
-    Dog.prototype.bark = function(bark) {
-      require('sys').puts(bark);
-    }
-
-    var gently = new (require('gently'))
-      , assert = require('assert')
-      , dog = new Dog();
-
-    gently.expect(dog, 'bark', function(bark) {
-      assert.equal(bark, 'whuf, whuf');
-    });
-    gently.expect(dog, 'run');
-
-    dog.seeCat();
-
-You can also easily test event emitters with this, for example a simple sequence of 2 events emitted by `fs.WriteStream`:
-
-    var gently = new (require('gently'))
-      , stream = new (require('fs').WriteStream)('my_file.txt');
-
-    gently.expect(stream, 'emit', function(event) {
-      assert.equal(event, 'open');
-    });
-
-    gently.expect(stream, 'emit', function(event) {
-      assert.equal(event, 'drain');
-    });
-
-For a full read world example, check out this test case: [test-incoming-form.js](http://github.com/felixge/node-formidable/blob/master/test/simple/test-incoming-form.js) (in [node-formdiable](http://github.com/felixge/node-formidable)).
-
-## API
-
-### Gently
-
-#### new Gently()
-
-Creates a new gently instance. It listens to the process `'exit'` event to make sure all expectations have been verified.
-
-#### gently.expect(obj, method, [[count], stubFn])
-
-Creates an expectation for an objects method to be called. You can optionally specify the call `count` you are expecting, as well as `stubFn` function that will run instead of the original function.
-
-Returns a reference to the function that is getting overwritten.
-
-#### gently.expect([count], stubFn)
-
-Returns a function that is supposed to be executed `count` times, delegating any calls to the provided `stubFn` function. Naming your stubFn closure will help to properly diagnose errors that are being thrown:
-
-    childProcess.exec('ls', gently.expect(function lsCallback(code) {
-      assert.equal(0, code);
-    }));
-
-#### gently.restore(obj, method)
-
-Restores an object method that has been previously overwritten using `gently.expect()`.
-
-#### gently.hijack(realRequire)
-
-Returns a new require functions that catches a reference to all required modules into `gently.hijacked`.
-
-To use this function, include a line like this in your `'my-module.js'`.
-
-    if (global.GENTLY) require = GENTLY.hijack(require);
-
-    var sys = require('sys');
-    exports.hello = function() {
-      sys.log('world');
-    };
-
-Now you can write a test for the module above:
-
-    var gently = global.GENTLY = new (require('gently'))
-      , myModule = require('./my-module');
-
-    gently.expect(gently.hijacked.sys, 'log', function(str) {
-      assert.equal(str, 'world');
-    });
-
-    myModule.hello();
-
-#### gently.stub(location, [exportsName])
-
-Returns a stub class that will be used instead of the real class from the module at `location` with the given `exportsName`.
-
-This allows to test an OOP version of the previous example, where `'my-module.js'`.
-
-    if (global.GENTLY) require = GENTLY.hijack(require);
-
-    var World = require('./world');
-
-    exports.hello = function() {
-      var world = new World();
-      world.hello();
-    }
-
-And `world.js` looks like this:
-
-    var sys = require('sys');
-
-    function World() {
-
-    }
-    module.exports = World;
-
-    World.prototype.hello = function() {
-      sys.log('world');
-    };
-
-Testing `'my-module.js'` can now easily be accomplished:
-
-    var gently = global.GENTLY = new (require('gently'))
-      , WorldStub = gently.stub('./world')
-      , myModule = require('./my-module')
-      , WORLD;
-
-    gently.expect(WorldStub, 'new', function() {
-      WORLD = this;
-    });
-
-    gently.expect(WORLD, 'hello');
-
-    myModule.hello();
-
-#### gently.hijacked
-
-An object that holds the references to all hijacked modules.
-
-#### gently.verify([msg])
-
-Verifies that all expectations of this gently instance have been satisfied. If not called manually, this method is called when the process `'exit'` event is fired.
-
-If `msg` is given, it will appear in any error that might be thrown.
-
-## License
-
-Gently is licensed under the MIT license.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js
deleted file mode 100644
index 022fae0..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/dog.js
+++ /dev/null
@@ -1,22 +0,0 @@
-require('../test/common');
-function Dog() {}
-
-Dog.prototype.seeCat = function() {
-  this.bark('whuf, whuf');
-  this.run();
-}
-
-Dog.prototype.bark = function(bark) {
-  require('sys').puts(bark);
-}
-
-var gently = new (require('gently'))
-  , assert = require('assert')
-  , dog = new Dog();
-
-gently.expect(dog, 'bark', function(bark) {
-  assert.equal(bark, 'whuf, whuf');
-});
-gently.expect(dog, 'run');
-
-dog.seeCat();
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/event_emitter.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/event_emitter.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/event_emitter.js
deleted file mode 100644
index 7def134..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/example/event_emitter.js
+++ /dev/null
@@ -1,11 +0,0 @@
-require('../test/common');
-var gently = new (require('gently'))
-  , stream = new (require('fs').WriteStream)('my_file.txt');
-
-gently.expect(stream, 'emit', function(event) {
-  assert.equal(event, 'open');
-});
-
-gently.expect(stream, 'emit', function(event) {
-  assert.equal(event, 'drain');
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/index.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/index.js
deleted file mode 100644
index 69122bd..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib/gently');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/gently.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/gently.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/gently.js
deleted file mode 100644
index 8af0e1e..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/gently.js
+++ /dev/null
@@ -1,184 +0,0 @@
-var path = require('path');
-
-function Gently() {
-  this.expectations = [];
-  this.hijacked = {};
-
-  var self = this;
-  process.addListener('exit', function() {
-    self.verify('process exit');
-  });
-};
-module.exports = Gently;
-
-Gently.prototype.stub = function(location, exportsName) {
-  function Stub() {
-    return Stub['new'].apply(this, arguments);
-  };
-
-  Stub['new'] = function () {};
-
-  var stubName = 'require('+JSON.stringify(location)+')';
-  if (exportsName) {
-    stubName += '.'+exportsName;
-  }
-
-  Stub.prototype.toString = Stub.toString = function() {
-    return stubName;
-  };
-
-  var exports = this.hijacked[location] || {};
-  if (exportsName) {
-    exports[exportsName] = Stub;
-  } else {
-    exports = Stub;
-  }
-
-  this.hijacked[location] = exports;
-  return Stub;
-};
-
-Gently.prototype.hijack = function(realRequire) {
-  var self = this;
-  return function(location) {
-    return self.hijacked[location] = (self.hijacked[location])
-      ? self.hijacked[location]
-      : realRequire(location);
-  };
-};
-
-Gently.prototype.expect = function(obj, method, count, stubFn) {
-  if (typeof obj != 'function' && typeof obj != 'object' && typeof obj != 'number') {
-    throw new Error
-      ( 'Bad 1st argument for gently.expect(), '
-      + 'object, function, or number expected, got: '+(typeof obj)
-      );
-  } else if (typeof obj == 'function' && (typeof method != 'string')) {
-    // expect(stubFn) interface
-    stubFn = obj;
-    obj = null;
-    method = null;
-    count = 1;
-  } else if (typeof method == 'function') {
-    // expect(count, stubFn) interface
-    count = obj;
-    stubFn = method;
-    obj = null;
-    method = null;
-  } else if (typeof count == 'function') {
-    // expect(obj, method, stubFn) interface
-    stubFn = count;
-    count = 1;
-  } else if (count === undefined) {
-    // expect(obj, method) interface
-    count = 1;
-  }
-
-  var name = this._name(obj, method, stubFn);
-  this.expectations.push({obj: obj, method: method, stubFn: stubFn, name: name, count: count});
-
-  var self = this;
-  function delegate() {
-    return self._stubFn(this, obj, method, name, Array.prototype.slice.call(arguments));
-  }
-
-  if (!obj) {
-    return delegate;
-  }
-
-  var original = (obj[method])
-    ? obj[method]._original || obj[method]
-    : undefined;
-
-  obj[method] = delegate;
-  return obj[method]._original = original;
-};
-
-Gently.prototype.restore = function(obj, method) {
-  if (!obj[method] || !obj[method]._original) {
-    throw new Error(this._name(obj, method)+' is not gently stubbed');
-  }
-  obj[method] = obj[method]._original;
-};
-
-Gently.prototype.verify = function(msg) {
-  if (!this.expectations.length) {
-    return;
-  }
-
-  var validExpectations = [];
-  for (var i = 0, l = this.expectations.length; i < l; i++) {
-    var expectation = this.expectations[i];
-
-    if (expectation.count > 0) {
-      validExpectations.push(expectation);
-    }
-  }
-
-  this.expectations = []; // reset so that no duplicate verification attempts are made
-
-  if (!validExpectations.length) {
-    return;
-  }
-
-  var expectation = validExpectations[0];
-
-  throw new Error
-    ( 'Expected call to '+expectation.name+' did not happen'
-    + ( (msg)
-        ? ' ('+msg+')'
-        : ''
-      )
-    );
-};
-
-Gently.prototype._stubFn = function(self, obj, method, name, args) {
-  var expectation = this.expectations[0], obj, method;
-
-  if (!expectation) {
-    throw new Error('Unexpected call to '+name+', no call was expected');
-  }
-
-  if (expectation.obj !== obj || expectation.method !== method) {
-    throw new Error('Unexpected call to '+name+', expected call to '+ expectation.name);
-  }
-
-  expectation.count -= 1;
-  if (expectation.count === 0) {
-    this.expectations.shift();
-
-    // autorestore original if its not a closure
-    // and no more expectations on that object
-    var has_more_expectations = this.expectations.reduce(function (memo, expectation) {
-      return memo || (expectation.obj === obj && expectation.method === method);
-    }, false);
-    if (obj !== null && method !== null && !has_more_expectations) {
-      if (typeof obj[method]._original !== 'undefined') {
-        obj[method] = obj[method]._original;
-        delete obj[method]._original;
-      } else {
-        delete obj[method];
-      }
-    }
-  }
-
-  if (expectation.stubFn) {
-    return expectation.stubFn.apply(self, args);
-  }
-};
-
-Gently.prototype._name = function(obj, method, stubFn) {
-  if (obj) {
-    var objectName = obj.toString();
-    if (objectName == '[object Object]' && obj.constructor.name) {
-      objectName = '['+obj.constructor.name+']';
-    }
-    return (objectName)+'.'+method+'()';
-  }
-
-  if (stubFn.name) {
-    return stubFn.name+'()';
-  }
-
-  return '>> '+stubFn.toString()+' <<';
-};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/index.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/index.js
deleted file mode 100644
index 64c1977..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/lib/gently/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./gently');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/package.json b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/package.json
deleted file mode 100644
index 9c1b7a0..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/package.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "name": "gently",
-  "version": "0.9.2",
-  "directories": {
-    "lib": "./lib/gently"
-  },
-  "main": "./lib/gently/index",
-  "dependencies": {},
-  "devDependencies": {},
-  "engines": {
-    "node": "*"
-  },
-  "optionalDependencies": {}
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js
deleted file mode 100644
index 978b5c5..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/common.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var path = require('path')
-  , sys = require('sys');
-
-require.paths.unshift(path.dirname(__dirname)+'/lib');
-
-global.puts = sys.puts;
-global.p = function() {sys.error(sys.inspect.apply(null, arguments))};;
-global.assert = require('assert');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/simple/test-gently.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/simple/test-gently.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/simple/test-gently.js
deleted file mode 100644
index 4f8fe2d..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/node-gently/test/simple/test-gently.js
+++ /dev/null
@@ -1,348 +0,0 @@
-require('../common');
-var Gently = require('gently')
-  , gently;
-
-function test(test) {
-  process.removeAllListeners('exit');
-  gently = new Gently();
-  test();
-}
-
-test(function constructor() {
-  assert.deepEqual(gently.expectations, []);
-  assert.deepEqual(gently.hijacked, {});
-  assert.equal(gently.constructor.name, 'Gently');
-});
-
-test(function expectBadArgs() {
-  var BAD_ARG = 'oh no';
-  try {
-    gently.expect(BAD_ARG);
-    assert.ok(false, 'throw needs to happen');
-  } catch (e) {
-    assert.equal(e.message, 'Bad 1st argument for gently.expect(), object, function, or number expected, got: '+(typeof BAD_ARG));
-  }
-});
-
-test(function expectObjMethod() {
-  var OBJ = {}, NAME = 'foobar';
-  OBJ.foo = function(x) {
-    return x;
-  };
-
-  gently._name = function() {
-    return NAME;
-  };
-
-  var original = OBJ.foo
-    , stubFn = function() {};
-
-  (function testAddOne() {
-    assert.strictEqual(gently.expect(OBJ, 'foo', stubFn), original);
-
-    assert.equal(gently.expectations.length, 1);
-    var expectation = gently.expectations[0];
-    assert.strictEqual(expectation.obj, OBJ);
-    assert.strictEqual(expectation.method, 'foo');
-    assert.strictEqual(expectation.stubFn, stubFn);
-    assert.strictEqual(expectation.name, NAME);
-    assert.strictEqual(OBJ.foo._original, original);
-  })();
-
-  (function testAddTwo() {
-    gently.expect(OBJ, 'foo', 2, stubFn);
-    assert.equal(gently.expectations.length, 2);
-    assert.strictEqual(OBJ.foo._original, original);
-  })();
-
-  (function testAddOneWithoutMock() {
-    gently.expect(OBJ, 'foo');
-    assert.equal(gently.expectations.length, 3);
-  })();
-
-  var stubFnCalled = 0, SELF = {};
-  gently._stubFn = function(self, obj, method, name, args) {
-    stubFnCalled++;
-    assert.strictEqual(self, SELF);
-    assert.strictEqual(obj, OBJ);
-    assert.strictEqual(method, 'foo');
-    assert.strictEqual(name, NAME);
-    assert.deepEqual(args, [1, 2]);
-    return 23;
-  };
-  assert.equal(OBJ.foo.apply(SELF, [1, 2]), 23);
-  assert.equal(stubFnCalled, 1);
-});
-
-test(function expectClosure() {
-  var NAME = 'MY CLOSURE';
-  function closureFn() {};
-
-  gently._name = function() {
-    return NAME;
-  };
-
-  var fn = gently.expect(closureFn);
-  assert.equal(gently.expectations.length, 1);
-  var expectation = gently.expectations[0];
-  assert.strictEqual(expectation.obj, null);
-  assert.strictEqual(expectation.method, null);
-  assert.strictEqual(expectation.stubFn, closureFn);
-  assert.strictEqual(expectation.name, NAME);
-
-  var stubFnCalled = 0, SELF = {};
-  gently._stubFn = function(self, obj, method, name, args) {
-    stubFnCalled++;
-    assert.strictEqual(self, SELF);
-    assert.strictEqual(obj, null);
-    assert.strictEqual(method, null);
-    assert.strictEqual(name, NAME);
-    assert.deepEqual(args, [1, 2]);
-    return 23;
-  };
-  assert.equal(fn.apply(SELF, [1, 2]), 23);
-  assert.equal(stubFnCalled, 1);
-});
-
-test(function expectClosureCount() {
-  var stubFnCalled = 0;
-  function closureFn() {stubFnCalled++};
-
-  var fn = gently.expect(2, closureFn);
-  assert.equal(gently.expectations.length, 1);
-  fn();
-  assert.equal(gently.expectations.length, 1);
-  fn();
-  assert.equal(stubFnCalled, 2);
-});
-
-test(function restore() {
-  var OBJ = {}, NAME = '[my object].myFn()';
-  OBJ.foo = function(x) {
-    return x;
-  };
-
-  gently._name = function() {
-    return NAME;
-  };
-
-  var original = OBJ.foo;
-  gently.expect(OBJ, 'foo');
-  gently.restore(OBJ, 'foo');
-  assert.strictEqual(OBJ.foo, original);
-
-  (function testError() {
-    try {
-      gently.restore(OBJ, 'foo');
-      assert.ok(false, 'throw needs to happen');
-    } catch (e) {
-      assert.equal(e.message, NAME+' is not gently stubbed');
-    }
-  })();
-});
-
-test(function _stubFn() {
-  var OBJ1 = {toString: function() {return '[OBJ 1]'}}
-    , OBJ2 = {toString: function() {return '[OBJ 2]'}, foo: function () {return 'bar';}}
-    , SELF = {};
-
-  gently.expect(OBJ1, 'foo', function(x) {
-    assert.strictEqual(this, SELF);
-    return x * 2;
-  });
-
-  assert.equal(gently._stubFn(SELF, OBJ1, 'foo', 'dummy_name', [5]), 10);
-
-  (function testAutorestore() {
-    assert.equal(OBJ2.foo(), 'bar');
-
-    gently.expect(OBJ2, 'foo', function() {
-      return 'stubbed foo';
-    });
-
-    gently.expect(OBJ2, 'foo', function() {
-      return "didn't restore yet";
-    });
-
-    assert.equal(gently._stubFn(SELF, OBJ2, 'foo', 'dummy_name', []), 'stubbed foo');
-    assert.equal(gently._stubFn(SELF, OBJ2, 'foo', 'dummy_name', []), "didn't restore yet");
-    assert.equal(OBJ2.foo(), 'bar');
-    assert.deepEqual(gently.expectations, []);
-  })();
-
-  (function testNoMoreCallExpected() {
-    try {
-      gently._stubFn(SELF, OBJ1, 'foo', 'dummy_name', [5]);
-      assert.ok(false, 'throw needs to happen');
-    } catch (e) {
-      assert.equal(e.message, 'Unexpected call to dummy_name, no call was expected');
-    }
-  })();
-
-  (function testDifferentCallExpected() {
-    gently.expect(OBJ2, 'bar');
-    try {
-      gently._stubFn(SELF, OBJ1, 'foo', 'dummy_name', [5]);
-      assert.ok(false, 'throw needs to happen');
-    } catch (e) {
-      assert.equal(e.message, 'Unexpected call to dummy_name, expected call to '+gently._name(OBJ2, 'bar'));
-    }
-
-    assert.equal(gently.expectations.length, 1);
-  })();
-
-  (function testNoMockCallback() {
-    OBJ2.bar();
-    assert.equal(gently.expectations.length, 0);
-  })();
-});
-
-test(function stub() {
-  var LOCATION = './my_class';
-
-  (function testRegular() {
-    var Stub = gently.stub(LOCATION);
-    assert.ok(Stub instanceof Function);
-    assert.strictEqual(gently.hijacked[LOCATION], Stub);
-    assert.ok(Stub['new'] instanceof Function);
-    assert.equal(Stub.toString(), 'require('+JSON.stringify(LOCATION)+')');
-
-    (function testConstructor() {
-      var newCalled = 0
-        , STUB
-        , ARGS = ['foo', 'bar'];
-
-      Stub['new'] = function(a, b) {
-        assert.equal(a, ARGS[0]);
-        assert.equal(b, ARGS[1]);
-        newCalled++;
-        STUB = this;
-      };
-
-      var stub = new Stub(ARGS[0], ARGS[1]);
-      assert.strictEqual(stub, STUB);
-      assert.equal(newCalled, 1);
-      assert.equal(stub.toString(), 'require('+JSON.stringify(LOCATION)+')');
-    })();
-
-    (function testUseReturnValueAsInstance() {
-      var R = {};
-
-      Stub['new'] = function() {
-        return R;
-      };
-
-      var stub = new Stub();
-      assert.strictEqual(stub, R);
-
-    })();
-  })();
-
-  var EXPORTS_NAME = 'MyClass';
-  test(function testExportsName() {
-    var Stub = gently.stub(LOCATION, EXPORTS_NAME);
-    assert.strictEqual(gently.hijacked[LOCATION][EXPORTS_NAME], Stub);
-    assert.equal(Stub.toString(), 'require('+JSON.stringify(LOCATION)+').'+EXPORTS_NAME);
-
-    (function testConstructor() {
-      var stub = new Stub();
-      assert.equal(Stub.toString(), 'require('+JSON.stringify(LOCATION)+').'+EXPORTS_NAME);
-    })();
-  });
-});
-
-test(function hijack() {
-  var LOCATION = './foo'
-    , REQUIRE_CALLS = 0
-    , EXPORTS = {}
-    , REQUIRE = function() {
-        REQUIRE_CALLS++;
-        return EXPORTS;
-      };
-
-  var hijackedRequire = gently.hijack(REQUIRE);
-  hijackedRequire(LOCATION);
-  assert.strictEqual(gently.hijacked[LOCATION], EXPORTS);
-
-  assert.equal(REQUIRE_CALLS, 1);
-
-  // make sure we are caching the hijacked module
-  hijackedRequire(LOCATION);
-  assert.equal(REQUIRE_CALLS, 1);
-});
-
-test(function verify() {
-  var OBJ = {toString: function() {return '[OBJ]'}};
-  gently.verify();
-
-  gently.expect(OBJ, 'foo');
-  try {
-    gently.verify();
-    assert.ok(false, 'throw needs to happen');
-  } catch (e) {
-    assert.equal(e.message, 'Expected call to [OBJ].foo() did not happen');
-  }
-
-  try {
-    gently.verify('foo');
-    assert.ok(false, 'throw needs to happen');
-  } catch (e) {
-    assert.equal(e.message, 'Expected call to [OBJ].foo() did not happen (foo)');
-  }
-});
-
-test(function processExit() {
-  var verifyCalled = 0;
-  gently.verify = function(msg) {
-    verifyCalled++;
-    assert.equal(msg, 'process exit');
-  };
-
-  process.emit('exit');
-  assert.equal(verifyCalled, 1);
-});
-
-test(function _name() {
-  (function testNamedClass() {
-    function Foo() {};
-    var foo = new Foo();
-    assert.equal(gently._name(foo, 'bar'), '[Foo].bar()');
-  })();
-
-  (function testToStringPreference() {
-    function Foo() {};
-    Foo.prototype.toString = function() {
-      return '[Superman 123]';
-    };
-    var foo = new Foo();
-    assert.equal(gently._name(foo, 'bar'), '[Superman 123].bar()');
-  })();
-
-  (function testUnamedClass() {
-    var Foo = function() {};
-    var foo = new Foo();
-    assert.equal(gently._name(foo, 'bar'), foo.toString()+'.bar()');
-  })();
-
-  (function testNamedClosure() {
-    function myClosure() {};
-    assert.equal(gently._name(null, null, myClosure), myClosure.name+'()');
-  })();
-
-  (function testUnamedClosure() {
-    var myClosure = function() {2+2 == 5};
-    assert.equal(gently._name(null, null, myClosure), '>> '+myClosure.toString()+' <<');
-  })();
-});
-
-test(function verifyExpectNone() {
-  var OBJ = {toString: function() {return '[OBJ]'}};
-  gently.verify();
-
-  gently.expect(OBJ, 'foo', 0);
-  try {
-    gently.verify();
-  } catch (e) {
-    assert.fail('Exception should not have been thrown');
-  }
-});
\ No newline at end of file


[07/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/register.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/register.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/register.js
new file mode 100644
index 0000000..b1d75ca
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/register.js
@@ -0,0 +1,66 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+  var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, loadFile, path, _i, _len, _ref;
+
+  CoffeeScript = require('./coffee-script');
+
+  child_process = require('child_process');
+
+  helpers = require('./helpers');
+
+  path = require('path');
+
+  loadFile = function(module, filename) {
+    var answer;
+    answer = CoffeeScript._compileFile(filename, false);
+    return module._compile(answer, filename);
+  };
+
+  if (require.extensions) {
+    _ref = CoffeeScript.FILE_EXTENSIONS;
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      ext = _ref[_i];
+      require.extensions[ext] = loadFile;
+    }
+    Module = require('module');
+    findExtension = function(filename) {
+      var curExtension, extensions;
+      extensions = path.basename(filename).split('.');
+      if (extensions[0] === '') {
+        extensions.shift();
+      }
+      while (extensions.shift()) {
+        curExtension = '.' + extensions.join('.');
+        if (Module._extensions[curExtension]) {
+          return curExtension;
+        }
+      }
+      return '.js';
+    };
+    Module.prototype.load = function(filename) {
+      var extension;
+      this.filename = filename;
+      this.paths = Module._nodeModulePaths(path.dirname(filename));
+      extension = findExtension(filename);
+      Module._extensions[extension](this, filename);
+      return this.loaded = true;
+    };
+  }
+
+  if (child_process) {
+    fork = child_process.fork;
+    binary = require.resolve('../../bin/coffee');
+    child_process.fork = function(path, args, options) {
+      if (helpers.isCoffee(path)) {
+        if (!Array.isArray(args)) {
+          options = args || {};
+          args = [];
+        }
+        args = [path].concat(args);
+        path = binary;
+      }
+      return fork(path, args, options);
+    };
+  }
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/repl.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/repl.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/repl.js
index b4a4765..9f06977 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/repl.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/repl.js
@@ -1,261 +1,176 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout;
+  var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, updateSyntaxError, vm, _ref;
 
-  stdin = process.openStdin();
+  fs = require('fs');
 
-  stdout = process.stdout;
+  path = require('path');
 
-  CoffeeScript = require('./coffee-script');
-
-  readline = require('readline');
-
-  inspect = require('util').inspect;
-
-  Script = require('vm').Script;
-
-  Module = require('module');
-
-  REPL_PROMPT = 'coffee> ';
-
-  REPL_PROMPT_MULTILINE = '------> ';
-
-  REPL_PROMPT_CONTINUATION = '......> ';
-
-  enableColours = false;
+  vm = require('vm');
 
-  if (process.platform !== 'win32') {
-    enableColours = !process.env.NODE_DISABLE_COLORS;
-  }
+  nodeREPL = require('repl');
 
-  error = function(err) {
-    return stdout.write((err.stack || err.toString()) + '\n');
-  };
-
-  ACCESSOR = /\s*([\w\.]+)(?:\.(\w*))$/;
-
-  SIMPLEVAR = /(\w+)$/i;
-
-  autocomplete = function(text) {
-    return completeAttribute(text) || completeVariable(text) || [[], text];
-  };
+  CoffeeScript = require('./coffee-script');
 
-  completeAttribute = function(text) {
-    var all, completions, key, match, obj, possibilities, prefix, val;
-    if (match = text.match(ACCESSOR)) {
-      all = match[0], obj = match[1], prefix = match[2];
+  _ref = require('./helpers'), merge = _ref.merge, updateSyntaxError = _ref.updateSyntaxError;
+
+  replDefaults = {
+    prompt: 'coffee> ',
+    historyFile: process.env.HOME ? path.join(process.env.HOME, '.coffee_history') : void 0,
+    historyMaxInputSize: 10240,
+    "eval": function(input, context, filename, cb) {
+      var Assign, Block, Literal, Value, ast, err, js, result, _ref1;
+      input = input.replace(/\uFF00/g, '\n');
+      input = input.replace(/^\(([\s\S]*)\n\)$/m, '$1');
+      _ref1 = require('./nodes'), Block = _ref1.Block, Assign = _ref1.Assign, Value = _ref1.Value, Literal = _ref1.Literal;
       try {
-        val = Script.runInThisContext(obj);
-      } catch (error) {
-        return;
-      }
-      val = Object(val);
-      possibilities = Object.getOwnPropertyNames(val);
-      for (key in val) {
-        if (~possibilities.indexOf(val)) {
-          possibilities.push(key);
-        }
+        ast = CoffeeScript.nodes(input);
+        ast = new Block([new Assign(new Value(new Literal('_')), ast, '=')]);
+        js = ast.compile({
+          bare: true,
+          locals: Object.keys(context)
+        });
+        result = context === global ? vm.runInThisContext(js, filename) : vm.runInContext(js, context, filename);
+        return cb(null, result);
+      } catch (_error) {
+        err = _error;
+        updateSyntaxError(err, input);
+        return cb(err);
       }
-      completions = getCompletions(prefix, possibilities);
-      return [completions, prefix];
     }
   };
 
-  completeVariable = function(text) {
-    var completions, free, keywords, possibilities, r, vars, _ref;
-    free = (_ref = text.match(SIMPLEVAR)) != null ? _ref[1] : void 0;
-    if (text === "") {
-      free = "";
-    }
-    if (free != null) {
-      vars = Script.runInThisContext('Object.getOwnPropertyNames(Object(this))');
-      keywords = (function() {
-        var _i, _len, _ref1, _results;
-        _ref1 = CoffeeScript.RESERVED;
-        _results = [];
-        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
-          r = _ref1[_i];
-          if (r.slice(0, 2) !== '__') {
-            _results.push(r);
-          }
+  addMultilineHandler = function(repl) {
+    var inputStream, multiline, nodeLineListener, origPrompt, outputStream, rli, _ref1;
+    rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream;
+    origPrompt = (_ref1 = repl._prompt) != null ? _ref1 : repl.prompt;
+    multiline = {
+      enabled: false,
+      initialPrompt: origPrompt.replace(/^[^> ]*/, function(x) {
+        return x.replace(/./g, '-');
+      }),
+      prompt: origPrompt.replace(/^[^> ]*>?/, function(x) {
+        return x.replace(/./g, '.');
+      }),
+      buffer: ''
+    };
+    nodeLineListener = rli.listeners('line')[0];
+    rli.removeListener('line', nodeLineListener);
+    rli.on('line', function(cmd) {
+      if (multiline.enabled) {
+        multiline.buffer += "" + cmd + "\n";
+        rli.setPrompt(multiline.prompt);
+        rli.prompt(true);
+      } else {
+        rli.setPrompt(origPrompt);
+        nodeLineListener(cmd);
+      }
+    });
+    return inputStream.on('keypress', function(char, key) {
+      if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'v')) {
+        return;
+      }
+      if (multiline.enabled) {
+        if (!multiline.buffer.match(/\n/)) {
+          multiline.enabled = !multiline.enabled;
+          rli.setPrompt(origPrompt);
+          rli.prompt(true);
+          return;
         }
-        return _results;
-      })();
-      possibilities = vars.concat(keywords);
-      completions = getCompletions(free, possibilities);
-      return [completions, free];
-    }
-  };
-
-  getCompletions = function(prefix, candidates) {
-    var el, _i, _len, _results;
-    _results = [];
-    for (_i = 0, _len = candidates.length; _i < _len; _i++) {
-      el = candidates[_i];
-      if (el.indexOf(prefix) === 0) {
-        _results.push(el);
+        if ((rli.line != null) && !rli.line.match(/^\s*$/)) {
+          return;
+        }
+        multiline.enabled = !multiline.enabled;
+        rli.line = '';
+        rli.cursor = 0;
+        rli.output.cursorTo(0);
+        rli.output.clearLine(1);
+        multiline.buffer = multiline.buffer.replace(/\n/g, '\uFF00');
+        rli.emit('line', multiline.buffer);
+        multiline.buffer = '';
+      } else {
+        multiline.enabled = !multiline.enabled;
+        rli.setPrompt(multiline.initialPrompt);
+        rli.prompt(true);
       }
-    }
-    return _results;
+    });
   };
 
-  process.on('uncaughtException', error);
-
-  backlog = '';
-
-  run = function(buffer) {
-    var code, returnValue, _;
-    buffer = buffer.replace(/(^|[\r\n]+)(\s*)##?(?:[^#\r\n][^\r\n]*|)($|[\r\n])/, "$1$2$3");
-    buffer = buffer.replace(/[\r\n]+$/, "");
-    if (multilineMode) {
-      backlog += "" + buffer + "\n";
-      repl.setPrompt(REPL_PROMPT_CONTINUATION);
-      repl.prompt();
-      return;
-    }
-    if (!buffer.toString().trim() && !backlog) {
-      repl.prompt();
-      return;
-    }
-    code = backlog += buffer;
-    if (code[code.length - 1] === '\\') {
-      backlog = "" + backlog.slice(0, -1) + "\n";
-      repl.setPrompt(REPL_PROMPT_CONTINUATION);
-      repl.prompt();
-      return;
-    }
-    repl.setPrompt(REPL_PROMPT);
-    backlog = '';
+  addHistory = function(repl, filename, maxSize) {
+    var buffer, fd, lastLine, readFd, size, stat;
+    lastLine = null;
     try {
-      _ = global._;
-      returnValue = CoffeeScript["eval"]("_=(" + code + "\n)", {
-        filename: 'repl',
-        modulename: 'repl'
-      });
-      if (returnValue === void 0) {
-        global._ = _;
+      stat = fs.statSync(filename);
+      size = Math.min(maxSize, stat.size);
+      readFd = fs.openSync(filename, 'r');
+      buffer = new Buffer(size);
+      fs.readSync(readFd, buffer, 0, size, stat.size - size);
+      repl.rli.history = buffer.toString().split('\n').reverse();
+      if (stat.size > maxSize) {
+        repl.rli.history.pop();
       }
-      repl.output.write("" + (inspect(returnValue, false, 2, enableColours)) + "\n");
-    } catch (err) {
-      error(err);
-    }
-    return repl.prompt();
-  };
-
-  if (stdin.readable) {
-    pipedInput = '';
-    repl = {
-      prompt: function() {
-        return stdout.write(this._prompt);
-      },
-      setPrompt: function(p) {
-        return this._prompt = p;
-      },
-      input: stdin,
-      output: stdout,
-      on: function() {}
-    };
-    stdin.on('data', function(chunk) {
-      var line, lines, _i, _len, _ref;
-      pipedInput += chunk;
-      if (!/\n/.test(pipedInput)) {
-        return;
+      if (repl.rli.history[0] === '') {
+        repl.rli.history.shift();
       }
-      lines = pipedInput.split("\n");
-      pipedInput = lines[lines.length - 1];
-      _ref = lines.slice(0, -1);
-      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-        line = _ref[_i];
-        if (!(line)) {
-          continue;
-        }
-        stdout.write("" + line + "\n");
-        run(line);
+      repl.rli.historyIndex = -1;
+      lastLine = repl.rli.history[0];
+    } catch (_error) {}
+    fd = fs.openSync(filename, 'a');
+    repl.rli.addListener('line', function(code) {
+      if (code && code.length && code !== '.history' && lastLine !== code) {
+        fs.write(fd, "" + code + "\n");
+        return lastLine = code;
       }
     });
-    stdin.on('end', function() {
-      var line, _i, _len, _ref;
-      _ref = pipedInput.trim().split("\n");
-      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-        line = _ref[_i];
-        if (!(line)) {
-          continue;
-        }
-        stdout.write("" + line + "\n");
-        run(line);
-      }
-      stdout.write('\n');
-      return process.exit(0);
+    repl.rli.on('exit', function() {
+      return fs.close(fd);
     });
-  } else {
-    if (readline.createInterface.length < 3) {
-      repl = readline.createInterface(stdin, autocomplete);
-      stdin.on('data', function(buffer) {
-        return repl.write(buffer);
-      });
-    } else {
-      repl = readline.createInterface(stdin, stdout, autocomplete);
-    }
-  }
-
-  multilineMode = false;
-
-  repl.input.on('keypress', function(char, key) {
-    var cursorPos, newPrompt;
-    if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'v')) {
-      return;
-    }
-    cursorPos = repl.cursor;
-    repl.output.cursorTo(0);
-    repl.output.clearLine(1);
-    multilineMode = !multilineMode;
-    if (!multilineMode && backlog) {
-      repl._line();
-    }
-    backlog = '';
-    repl.setPrompt((newPrompt = multilineMode ? REPL_PROMPT_MULTILINE : REPL_PROMPT));
-    repl.prompt();
-    return repl.output.cursorTo(newPrompt.length + (repl.cursor = cursorPos));
-  });
-
-  repl.input.on('keypress', function(char, key) {
-    if (!(multilineMode && repl.line)) {
-      return;
-    }
-    if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'd')) {
-      return;
-    }
-    multilineMode = false;
-    return repl._line();
-  });
+    return repl.commands[getCommandId(repl, 'history')] = {
+      help: 'Show command history',
+      action: function() {
+        repl.outputStream.write("" + (repl.rli.history.slice(0).reverse().join('\n')) + "\n");
+        return repl.displayPrompt();
+      }
+    };
+  };
 
-  repl.on('attemptClose', function() {
-    if (multilineMode) {
-      multilineMode = false;
-      repl.output.cursorTo(0);
-      repl.output.clearLine(1);
-      repl._onLine(repl.line);
-      return;
-    }
-    if (backlog) {
-      backlog = '';
-      repl.output.write('\n');
-      repl.setPrompt(REPL_PROMPT);
-      return repl.prompt();
+  getCommandId = function(repl, commandName) {
+    var commandsHaveLeadingDot;
+    commandsHaveLeadingDot = repl.commands['.help'] != null;
+    if (commandsHaveLeadingDot) {
+      return "." + commandName;
     } else {
-      return repl.close();
+      return commandName;
     }
-  });
-
-  repl.on('close', function() {
-    repl.output.write('\n');
-    return repl.input.destroy();
-  });
-
-  repl.on('line', run);
-
-  repl.setPrompt(REPL_PROMPT);
+  };
 
-  repl.prompt();
+  module.exports = {
+    start: function(opts) {
+      var build, major, minor, repl, _ref1;
+      if (opts == null) {
+        opts = {};
+      }
+      _ref1 = process.versions.node.split('.').map(function(n) {
+        return parseInt(n);
+      }), major = _ref1[0], minor = _ref1[1], build = _ref1[2];
+      if (major === 0 && minor < 8) {
+        console.warn("Node 0.8.0+ required for CoffeeScript REPL");
+        process.exit(1);
+      }
+      CoffeeScript.register();
+      process.argv = ['coffee'].concat(process.argv.slice(2));
+      opts = merge(replDefaults, opts);
+      repl = nodeREPL.start(opts);
+      repl.on('exit', function() {
+        return repl.outputStream.write('\n');
+      });
+      addMultilineHandler(repl);
+      if (opts.historyFile) {
+        addHistory(repl, opts.historyFile, opts.historyMaxInputSize);
+      }
+      repl.commands[getCommandId(repl, 'load')].help = 'Load code from a file into this REPL session';
+      return repl;
+    }
+  };
 
 }).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/rewriter.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/rewriter.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/rewriter.js
index d26133c..c5f228a 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/rewriter.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/rewriter.js
@@ -1,23 +1,31 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref,
+  var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref,
     __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
     __slice = [].slice;
 
-  exports.Rewriter = (function() {
+  generate = function(tag, value, origin) {
+    var tok;
+    tok = [tag, value];
+    tok.generated = true;
+    if (origin) {
+      tok.origin = origin;
+    }
+    return tok;
+  };
 
+  exports.Rewriter = (function() {
     function Rewriter() {}
 
     Rewriter.prototype.rewrite = function(tokens) {
       this.tokens = tokens;
       this.removeLeadingNewlines();
-      this.removeMidExpressionNewlines();
       this.closeOpenCalls();
       this.closeOpenIndexes();
-      this.addImplicitIndentation();
+      this.normalizeLines();
       this.tagPostfixConditionals();
-      this.addImplicitBraces();
-      this.addImplicitParentheses();
+      this.addImplicitBracesAndParens();
+      this.addLocationDataToGeneratedTokens();
       return this.tokens;
     };
 
@@ -66,17 +74,6 @@
       }
     };
 
-    Rewriter.prototype.removeMidExpressionNewlines = function() {
-      return this.scanTokens(function(token, i, tokens) {
-        var _ref;
-        if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) {
-          return 1;
-        }
-        tokens.splice(i, 1);
-        return 0;
-      });
-    };
-
     Rewriter.prototype.closeOpenCalls = function() {
       var action, condition;
       condition = function(token, i) {
@@ -111,144 +108,276 @@
       });
     };
 
-    Rewriter.prototype.addImplicitBraces = function() {
-      var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine;
-      stack = [];
-      start = null;
-      startsLine = null;
-      sameLine = true;
-      startIndent = 0;
-      startIndex = 0;
-      condition = function(token, i) {
-        var one, tag, three, two, _ref, _ref1;
-        _ref = this.tokens.slice(i + 1, (i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2];
-        if ('HERECOMMENT' === (one != null ? one[0] : void 0)) {
-          return false;
+    Rewriter.prototype.matchTags = function() {
+      var fuzz, i, j, pattern, _i, _ref, _ref1;
+      i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+      fuzz = 0;
+      for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) {
+        while (this.tag(i + j + fuzz) === 'HERECOMMENT') {
+          fuzz += 2;
         }
-        tag = token[0];
-        if (__indexOf.call(LINEBREAKS, tag) >= 0) {
-          sameLine = false;
+        if (pattern[j] == null) {
+          continue;
         }
-        return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT'));
-      };
-      action = function(token, i) {
-        var tok;
-        tok = this.generate('}', '}', token[2]);
-        return this.tokens.splice(i, 0, tok);
-      };
-      return this.scanTokens(function(token, i, tokens) {
-        var ago, idx, prevTag, tag, tok, value, _ref, _ref1;
-        if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) {
-          stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]);
-          return 1;
+        if (typeof pattern[j] === 'string') {
+          pattern[j] = [pattern[j]];
         }
-        if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
-          start = stack.pop();
-          return 1;
+        if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) {
+          return false;
         }
-        if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) {
-          return 1;
+      }
+      return true;
+    };
+
+    Rewriter.prototype.looksObjectish = function(j) {
+      return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':');
+    };
+
+    Rewriter.prototype.findTagsBackwards = function(i, tags) {
+      var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+      backStack = [];
+      while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) {
+        if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) {
+          backStack.push(this.tag(i));
         }
-        sameLine = true;
-        startIndex = i + 1;
-        stack.push(['{']);
-        idx = ago === '@' ? i - 2 : i - 1;
-        while (this.tag(idx - 2) === 'HERECOMMENT') {
-          idx -= 2;
+        if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) {
+          backStack.pop();
         }
-        prevTag = this.tag(idx - 1);
-        startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0);
-        value = new String('{');
-        value.generated = true;
-        tok = this.generate('{', value, token[2]);
-        tokens.splice(idx, 0, tok);
-        this.detectEnd(i + 2, condition, action);
-        return 2;
-      });
+        i -= 1;
+      }
+      return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0;
     };
 
-    Rewriter.prototype.addImplicitParentheses = function() {
-      var action, condition, noCall, seenControl, seenSingle;
-      noCall = seenSingle = seenControl = false;
-      condition = function(token, i) {
-        var post, tag, _ref, _ref1;
+    Rewriter.prototype.addImplicitBracesAndParens = function() {
+      var stack;
+      stack = [];
+      return this.scanTokens(function(token, i, tokens) {
+        var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, newLine, nextTag, offset, prevTag, prevToken, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
         tag = token[0];
-        if (!seenSingle && token.fromThen) {
-          return true;
+        prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0];
+        nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0];
+        stackTop = function() {
+          return stack[stack.length - 1];
+        };
+        startIdx = i;
+        forward = function(n) {
+          return i - startIdx + n;
+        };
+        inImplicit = function() {
+          var _ref, _ref1;
+          return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0;
+        };
+        inImplicitCall = function() {
+          var _ref;
+          return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '(';
+        };
+        inImplicitObject = function() {
+          var _ref;
+          return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{';
+        };
+        inImplicitControl = function() {
+          var _ref;
+          return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL';
+        };
+        startImplicitCall = function(j) {
+          var idx;
+          idx = j != null ? j : i;
+          stack.push([
+            '(', idx, {
+              ours: true
+            }
+          ]);
+          tokens.splice(idx, 0, generate('CALL_START', '('));
+          if (j == null) {
+            return i += 1;
+          }
+        };
+        endImplicitCall = function() {
+          stack.pop();
+          tokens.splice(i, 0, generate('CALL_END', ')'));
+          return i += 1;
+        };
+        startImplicitObject = function(j, startsLine) {
+          var idx;
+          if (startsLine == null) {
+            startsLine = true;
+          }
+          idx = j != null ? j : i;
+          stack.push([
+            '{', idx, {
+              sameLine: true,
+              startsLine: startsLine,
+              ours: true
+            }
+          ]);
+          tokens.splice(idx, 0, generate('{', generate(new String('{')), token));
+          if (j == null) {
+            return i += 1;
+          }
+        };
+        endImplicitObject = function(j) {
+          j = j != null ? j : i;
+          stack.pop();
+          tokens.splice(j, 0, generate('}', '}', token));
+          return i += 1;
+        };
+        if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) {
+          stack.push([
+            'CONTROL', i, {
+              ours: true
+            }
+          ]);
+          return forward(1);
         }
-        if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') {
-          seenSingle = true;
+        if (tag === 'INDENT' && inImplicit()) {
+          if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') {
+            while (inImplicitCall()) {
+              endImplicitCall();
+            }
+          }
+          if (inImplicitControl()) {
+            stack.pop();
+          }
+          stack.push([tag, i]);
+          return forward(1);
         }
-        if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') {
-          seenControl = true;
+        if (__indexOf.call(EXPRESSION_START, tag) >= 0) {
+          stack.push([tag, i]);
+          return forward(1);
         }
-        if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') {
-          return true;
+        if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
+          while (inImplicit()) {
+            if (inImplicitCall()) {
+              endImplicitCall();
+            } else if (inImplicitObject()) {
+              endImplicitObject();
+            } else {
+              stack.pop();
+            }
+          }
+          stack.pop();
         }
-        return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref1 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref1) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{')));
-      };
-      action = function(token, i) {
-        return this.tokens.splice(i, 0, this.generate('CALL_END', ')', token[2]));
-      };
-      return this.scanTokens(function(token, i, tokens) {
-        var callObject, current, next, prev, tag, _ref, _ref1, _ref2;
-        tag = token[0];
-        if (tag === 'CLASS' || tag === 'IF' || tag === 'FOR' || tag === 'WHILE') {
-          noCall = true;
+        if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced && !token.stringEnd || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) {
+          if (tag === '?') {
+            tag = token[0] = 'FUNC_EXIST';
+          }
+          startImplicitCall(i + 1);
+          return forward(2);
+        }
+        if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
+          startImplicitCall(i + 1);
+          stack.push(['INDENT', i + 2]);
+          return forward(3);
         }
-        _ref = tokens.slice(i - 1, (i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2];
-        callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref1 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref1) >= 0);
-        seenSingle = false;
-        seenControl = false;
-        if (__indexOf.call(LINEBREAKS, tag) >= 0) {
-          noCall = false;
+        if (tag === ':') {
+          if (this.tag(i - 2) === '@') {
+            s = i - 2;
+          } else {
+            s = i - 1;
+          }
+          while (this.tag(s - 2) === 'HERECOMMENT') {
+            s -= 2;
+          }
+          this.insideForDeclaration = nextTag === 'FOR';
+          startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine;
+          if (stackTop()) {
+            _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1];
+            if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) {
+              return forward(1);
+            }
+          }
+          startImplicitObject(s, !!startsLine);
+          return forward(2);
         }
-        if (prev && !prev.spaced && tag === '?') {
-          token.call = true;
+        if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) {
+          stackTop()[2].sameLine = false;
+        }
+        newLine = prevTag === 'OUTDENT' || prevToken.newLine;
+        if (__indexOf.call(IMPLICIT_END, tag) >= 0 || __indexOf.call(CALL_CLOSERS, tag) >= 0 && newLine) {
+          while (inImplicit()) {
+            _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine);
+            if (inImplicitCall() && prevTag !== ',') {
+              endImplicitCall();
+            } else if (inImplicitObject() && !this.insideForDeclaration && sameLine && tag !== 'TERMINATOR' && prevTag !== ':' && endImplicitObject()) {
+
+            } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
+              endImplicitObject();
+            } else {
+              break;
+            }
+          }
+        }
+        if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && !this.insideForDeclaration && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) {
+          offset = nextTag === 'OUTDENT' ? 1 : 0;
+          while (inImplicitObject()) {
+            endImplicitObject(i + offset);
+          }
         }
-        if (token.fromThen) {
+        return forward(1);
+      });
+    };
+
+    Rewriter.prototype.addLocationDataToGeneratedTokens = function() {
+      return this.scanTokens(function(token, i, tokens) {
+        var column, line, nextLocation, prevLocation, _ref, _ref1;
+        if (token[2]) {
           return 1;
         }
-        if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) {
+        if (!(token.generated || token.explicit)) {
           return 1;
         }
-        tokens.splice(i, 0, this.generate('CALL_START', '(', token[2]));
-        this.detectEnd(i + 1, condition, action);
-        if (prev[0] === '?') {
-          prev[0] = 'FUNC_EXIST';
+        if (token[0] === '{' && (nextLocation = (_ref = tokens[i + 1]) != null ? _ref[2] : void 0)) {
+          line = nextLocation.first_line, column = nextLocation.first_column;
+        } else if (prevLocation = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) {
+          line = prevLocation.last_line, column = prevLocation.last_column;
+        } else {
+          line = column = 0;
         }
-        return 2;
+        token[2] = {
+          first_line: line,
+          first_column: column,
+          last_line: line,
+          last_column: column
+        };
+        return 1;
       });
     };
 
-    Rewriter.prototype.addImplicitIndentation = function() {
+    Rewriter.prototype.normalizeLines = function() {
       var action, condition, indent, outdent, starter;
       starter = indent = outdent = null;
       condition = function(token, i) {
-        var _ref;
-        return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN'));
+        var _ref, _ref1, _ref2, _ref3;
+        return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'TERMINATOR' && (_ref1 = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref2 = token[0]) === 'CATCH' || _ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (_ref3 = token[0], __indexOf.call(CALL_CLOSERS, _ref3) >= 0) && this.tokens[i - 1].newLine;
       };
       action = function(token, i) {
         return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
       };
       return this.scanTokens(function(token, i, tokens) {
-        var tag, _ref, _ref1;
+        var j, tag, _i, _ref, _ref1, _ref2;
         tag = token[0];
-        if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') {
-          tokens.splice(i, 1);
-          return 0;
-        }
-        if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
-          tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token))));
-          return 2;
+        if (tag === 'TERMINATOR') {
+          if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
+            tokens.splice.apply(tokens, [i, 1].concat(__slice.call(this.indentation())));
+            return 1;
+          }
+          if (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0) {
+            tokens.splice(i, 1);
+            return 0;
+          }
         }
-        if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
-          tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token))));
-          return 4;
+        if (tag === 'CATCH') {
+          for (j = _i = 1; _i <= 2; j = ++_i) {
+            if (!((_ref1 = this.tag(i + j)) === 'OUTDENT' || _ref1 === 'TERMINATOR' || _ref1 === 'FINALLY')) {
+              continue;
+            }
+            tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation())));
+            return 2 + j;
+          }
         }
         if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
           starter = tag;
-          _ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1];
+          _ref2 = this.indentation(tokens[i]), indent = _ref2[0], outdent = _ref2[1];
           if (starter === 'THEN') {
             indent.fromThen = true;
           }
@@ -267,8 +396,10 @@
       var action, condition, original;
       original = null;
       condition = function(token, i) {
-        var _ref;
-        return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT';
+        var prevTag, tag;
+        tag = token[0];
+        prevTag = this.tokens[i - 1][0];
+        return tag === 'TERMINATOR' || (tag === 'INDENT' && __indexOf.call(SINGLE_LINERS, prevTag) < 0);
       };
       action = function(token, i) {
         if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) {
@@ -285,25 +416,20 @@
       });
     };
 
-    Rewriter.prototype.indentation = function(token, implicit) {
+    Rewriter.prototype.indentation = function(origin) {
       var indent, outdent;
-      if (implicit == null) {
-        implicit = false;
-      }
-      indent = ['INDENT', 2, token[2]];
-      outdent = ['OUTDENT', 2, token[2]];
-      if (implicit) {
+      indent = ['INDENT', 2];
+      outdent = ['OUTDENT', 2];
+      if (origin) {
         indent.generated = outdent.generated = true;
+        indent.origin = outdent.origin = origin;
+      } else {
+        indent.explicit = outdent.explicit = true;
       }
       return [indent, outdent];
     };
 
-    Rewriter.prototype.generate = function(tag, value, line) {
-      var tok;
-      tok = [tag, value, line];
-      tok.generated = true;
-      return tok;
-    };
+    Rewriter.prototype.generate = generate;
 
     Rewriter.prototype.tag = function(i) {
       var _ref;
@@ -328,16 +454,14 @@
     EXPRESSION_END.push(INVERSES[left] = rite);
   }
 
-  EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
+  EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
 
   IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
 
-  IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++'];
+  IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'UNARY_MATH', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++'];
 
   IMPLICIT_UNSPACED_CALL = ['+', '-'];
 
-  IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
-
   IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
 
   SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
@@ -346,4 +470,6 @@
 
   LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
 
+  CALL_CLOSERS = ['.', '?.', '::', '?::'];
+
 }).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/scope.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/scope.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/scope.js
index 3efc4ed..cb43b02 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/scope.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/scope.js
@@ -1,11 +1,10 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
   var Scope, extend, last, _ref;
 
   _ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
 
   exports.Scope = Scope = (function() {
-
     Scope.root = null;
 
     function Scope(parent, expressions, method) {
@@ -39,7 +38,8 @@
     };
 
     Scope.prototype.namedMethod = function() {
-      if (this.method.name || !this.parent) {
+      var _ref1;
+      if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) {
         return this.method;
       }
       return this.parent.namedMethod();

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/sourcemap.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/sourcemap.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/sourcemap.js
new file mode 100644
index 0000000..c94ebd1
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/sourcemap.js
@@ -0,0 +1,161 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+  var LineMap, SourceMap;
+
+  LineMap = (function() {
+    function LineMap(line) {
+      this.line = line;
+      this.columns = [];
+    }
+
+    LineMap.prototype.add = function(column, _arg, options) {
+      var sourceColumn, sourceLine;
+      sourceLine = _arg[0], sourceColumn = _arg[1];
+      if (options == null) {
+        options = {};
+      }
+      if (this.columns[column] && options.noReplace) {
+        return;
+      }
+      return this.columns[column] = {
+        line: this.line,
+        column: column,
+        sourceLine: sourceLine,
+        sourceColumn: sourceColumn
+      };
+    };
+
+    LineMap.prototype.sourceLocation = function(column) {
+      var mapping;
+      while (!((mapping = this.columns[column]) || (column <= 0))) {
+        column--;
+      }
+      return mapping && [mapping.sourceLine, mapping.sourceColumn];
+    };
+
+    return LineMap;
+
+  })();
+
+  SourceMap = (function() {
+    var BASE64_CHARS, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK;
+
+    function SourceMap() {
+      this.lines = [];
+    }
+
+    SourceMap.prototype.add = function(sourceLocation, generatedLocation, options) {
+      var column, line, lineMap, _base;
+      if (options == null) {
+        options = {};
+      }
+      line = generatedLocation[0], column = generatedLocation[1];
+      lineMap = ((_base = this.lines)[line] || (_base[line] = new LineMap(line)));
+      return lineMap.add(column, sourceLocation, options);
+    };
+
+    SourceMap.prototype.sourceLocation = function(_arg) {
+      var column, line, lineMap;
+      line = _arg[0], column = _arg[1];
+      while (!((lineMap = this.lines[line]) || (line <= 0))) {
+        line--;
+      }
+      return lineMap && lineMap.sourceLocation(column);
+    };
+
+    SourceMap.prototype.generate = function(options, code) {
+      var buffer, lastColumn, lastSourceColumn, lastSourceLine, lineMap, lineNumber, mapping, needComma, v3, writingline, _i, _j, _len, _len1, _ref, _ref1;
+      if (options == null) {
+        options = {};
+      }
+      if (code == null) {
+        code = null;
+      }
+      writingline = 0;
+      lastColumn = 0;
+      lastSourceLine = 0;
+      lastSourceColumn = 0;
+      needComma = false;
+      buffer = "";
+      _ref = this.lines;
+      for (lineNumber = _i = 0, _len = _ref.length; _i < _len; lineNumber = ++_i) {
+        lineMap = _ref[lineNumber];
+        if (lineMap) {
+          _ref1 = lineMap.columns;
+          for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+            mapping = _ref1[_j];
+            if (!(mapping)) {
+              continue;
+            }
+            while (writingline < mapping.line) {
+              lastColumn = 0;
+              needComma = false;
+              buffer += ";";
+              writingline++;
+            }
+            if (needComma) {
+              buffer += ",";
+              needComma = false;
+            }
+            buffer += this.encodeVlq(mapping.column - lastColumn);
+            lastColumn = mapping.column;
+            buffer += this.encodeVlq(0);
+            buffer += this.encodeVlq(mapping.sourceLine - lastSourceLine);
+            lastSourceLine = mapping.sourceLine;
+            buffer += this.encodeVlq(mapping.sourceColumn - lastSourceColumn);
+            lastSourceColumn = mapping.sourceColumn;
+            needComma = true;
+          }
+        }
+      }
+      v3 = {
+        version: 3,
+        file: options.generatedFile || '',
+        sourceRoot: options.sourceRoot || '',
+        sources: options.sourceFiles || [''],
+        names: [],
+        mappings: buffer
+      };
+      if (options.inline) {
+        v3.sourcesContent = [code];
+      }
+      return JSON.stringify(v3, null, 2);
+    };
+
+    VLQ_SHIFT = 5;
+
+    VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
+
+    VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
+
+    SourceMap.prototype.encodeVlq = function(value) {
+      var answer, nextChunk, signBit, valueToEncode;
+      answer = '';
+      signBit = value < 0 ? 1 : 0;
+      valueToEncode = (Math.abs(value) << 1) + signBit;
+      while (valueToEncode || !answer) {
+        nextChunk = valueToEncode & VLQ_VALUE_MASK;
+        valueToEncode = valueToEncode >> VLQ_SHIFT;
+        if (valueToEncode) {
+          nextChunk |= VLQ_CONTINUATION_BIT;
+        }
+        answer += this.encodeBase64(nextChunk);
+      }
+      return answer;
+    };
+
+    BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+    SourceMap.prototype.encodeBase64 = function(value) {
+      return BASE64_CHARS[value] || (function() {
+        throw new Error("Cannot Base64 encode value: " + value);
+      })();
+    };
+
+    return SourceMap;
+
+  })();
+
+  module.exports = SourceMap;
+
+}).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.npmignore
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.npmignore b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.npmignore
new file mode 100644
index 0000000..9303c34
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.travis.yml
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.travis.yml b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.travis.yml
new file mode 100644
index 0000000..84fd7ca
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - 0.6
+  - 0.8
+  - 0.9

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/LICENSE
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/LICENSE b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/LICENSE
new file mode 100644
index 0000000..432d1ae
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js
new file mode 100644
index 0000000..e692421
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/index.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/index.js
new file mode 100644
index 0000000..fda6de8
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/index.js
@@ -0,0 +1,82 @@
+var path = require('path');
+var fs = require('fs');
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, mode, f, made) {
+    if (typeof mode === 'function' || mode === undefined) {
+        f = mode;
+        mode = 0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    var cb = f || function () {};
+    if (typeof mode === 'string') mode = parseInt(mode, 8);
+    p = path.resolve(p);
+
+    fs.mkdir(p, mode, function (er) {
+        if (!er) {
+            made = made || p;
+            return cb(null, made);
+        }
+        switch (er.code) {
+            case 'ENOENT':
+                mkdirP(path.dirname(p), mode, function (er, made) {
+                    if (er) cb(er, made);
+                    else mkdirP(p, mode, cb, made);
+                });
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                fs.stat(p, function (er2, stat) {
+                    // if the stat fails, then that's super weird.
+                    // let the original error be the failure reason.
+                    if (er2 || !stat.isDirectory()) cb(er, made)
+                    else cb(null, made);
+                });
+                break;
+        }
+    });
+}
+
+mkdirP.sync = function sync (p, mode, made) {
+    if (mode === undefined) {
+        mode = 0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    if (typeof mode === 'string') mode = parseInt(mode, 8);
+    p = path.resolve(p);
+
+    try {
+        fs.mkdirSync(p, mode);
+        made = made || p;
+    }
+    catch (err0) {
+        switch (err0.code) {
+            case 'ENOENT' :
+                made = sync(path.dirname(p), mode, made);
+                sync(p, mode, made);
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                var stat;
+                try {
+                    stat = fs.statSync(p);
+                }
+                catch (err1) {
+                    throw err0;
+                }
+                if (!stat.isDirectory()) throw err0;
+                break;
+        }
+    }
+
+    return made;
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/package.json b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/package.json
new file mode 100644
index 0000000..221a22e
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/package.json
@@ -0,0 +1,34 @@
+{
+  "name": "mkdirp",
+  "description": "Recursively mkdir, like `mkdir -p`",
+  "version": "0.3.5",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "main": "./index",
+  "keywords": [
+    "mkdir",
+    "directory"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/substack/node-mkdirp.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "devDependencies": {
+    "tap": "~0.4.0"
+  },
+  "license": "MIT",
+  "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n    \nmkdirp('/tmp/foo/bar/baz', function (err) {\n    if (err) console.error(err)\n    else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it def
 aults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n",
+  "readmeFilename": "readme.markdown",
+  "bugs": {
+    "url": "https://github.com/substack/node-mkdirp/issues"
+  },
+  "homepage": "https://github.com/substack/node-mkdirp",
+  "_id": "mkdirp@0.3.5",
+  "_from": "mkdirp@~0.3.5"
+}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/readme.markdown b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
new file mode 100644
index 0000000..83b0216
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
@@ -0,0 +1,63 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+    
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, mode, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+## mkdirp.sync(dir, mode)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+# license
+
+MIT

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js
new file mode 100644
index 0000000..520dcb8
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+    var mode = 0744
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+            t.end();
+        });
+    });
+});
+
+test('chmod', function (t) {
+    var mode = 0755
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.end();
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js
new file mode 100644
index 0000000..0eb7099
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+    console.error("about to write to "+itw)
+    fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+    fs.stat(itw, function (er, stat) {
+        t.ifError(er)
+        t.ok(stat && stat.isFile(), 'should be file')
+        t.end()
+    })
+})
+
+test('clobber', function (t) {
+    t.plan(2);
+    mkdirp(file, 0755, function (err) {
+        t.ok(err);
+        t.equal(err.code, 'ENOTDIR');
+        t.end();
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js
new file mode 100644
index 0000000..b07cd70
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('woo', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm.js
new file mode 100644
index 0000000..23a7abb
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('async perm', function (t) {
+    t.plan(2);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});
+
+test('async root perm', function (t) {
+    mkdirp('/tmp', 0755, function (err) {
+        if (err) t.fail(err);
+        t.end();
+    });
+    t.end();
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js
new file mode 100644
index 0000000..f685f60
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js
@@ -0,0 +1,39 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync perm', function (t) {
+    t.plan(2);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+    
+    mkdirp.sync(file, 0755);
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, 0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        })
+    });
+});
+
+test('sync root perm', function (t) {
+    t.plan(1);
+    
+    var file = '/tmp';
+    mkdirp.sync(file, 0755);
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        })
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/race.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/race.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/race.js
new file mode 100644
index 0000000..96a0447
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/race.js
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('race', function (t) {
+    t.plan(4);
+    var ps = [ '', 'tmp' ];
+    
+    for (var i = 0; i < 25; i++) {
+        var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+        ps.push(dir);
+    }
+    var file = ps.join('/');
+    
+    var res = 2;
+    mk(file, function () {
+        if (--res === 0) t.end();
+    });
+    
+    mk(file, function () {
+        if (--res === 0) t.end();
+    });
+    
+    function mk (file, cb) {
+        mkdirp(file, 0755, function (err) {
+            if (err) t.fail(err);
+            else path.exists(file, function (ex) {
+                if (!ex) t.fail('file not created')
+                else fs.stat(file, function (err, stat) {
+                    if (err) t.fail(err)
+                    else {
+                        t.equal(stat.mode & 0777, 0755);
+                        t.ok(stat.isDirectory(), 'target not a directory');
+                        if (cb) cb();
+                    }
+                })
+            })
+        });
+    }
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/rel.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/rel.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/rel.js
new file mode 100644
index 0000000..7985824
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/rel.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('rel', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var cwd = process.cwd();
+    process.chdir('/tmp');
+    
+    var file = [x,y,z].join('/');
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    process.chdir(cwd);
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return.js
new file mode 100644
index 0000000..bce68e5
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return.js
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    mkdirp(file, function (err, made) {
+        t.ifError(err);
+        t.equal(made, '/tmp/' + x);
+        mkdirp(file, function (err, made) {
+          t.ifError(err);
+          t.equal(made, null);
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js
new file mode 100644
index 0000000..7c222d3
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    // Note that this will throw on failure, which will fail the test.
+    var made = mkdirp.sync(file);
+    t.equal(made, '/tmp/' + x);
+
+    // making the same file again should have no effect.
+    made = mkdirp.sync(file);
+    t.equal(made, null);
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/root.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/root.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/root.js
new file mode 100644
index 0000000..97ad7a2
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/root.js
@@ -0,0 +1,18 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('root', function (t) {
+    // '/' on unix, 'c:/' on windows.
+    var file = path.resolve('/');
+
+    mkdirp(file, 0755, function (err) {
+        if (err) throw err
+        fs.stat(file, function (er, stat) {
+            if (er) throw er
+            t.ok(stat.isDirectory(), 'target is a directory');
+            t.end();
+        })
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/sync.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/sync.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/sync.js
new file mode 100644
index 0000000..7530cad
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file, 0755);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, 0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask.js
new file mode 100644
index 0000000..64ccafe
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('implicit mode from umask', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js
new file mode 100644
index 0000000..35bd5cb
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('umask sync modes', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        });
+    });
+});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/package.json b/weinre.server/node_modules/coffee-script/package.json
index a8a9363..b266aa8 100644
--- a/weinre.server/node_modules/coffee-script/package.json
+++ b/weinre.server/node_modules/coffee-script/package.json
@@ -10,15 +10,10 @@
   "author": {
     "name": "Jeremy Ashkenas"
   },
-  "version": "1.3.3",
-  "licenses": [
-    {
-      "type": "MIT",
-      "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE"
-    }
-  ],
+  "version": "1.8.0",
+  "license": "MIT",
   "engines": {
-    "node": ">=0.4.0"
+    "node": ">=0.8.0"
   },
   "directories": {
     "lib": "./lib/coffee-script"
@@ -28,17 +23,30 @@
     "coffee": "./bin/coffee",
     "cake": "./bin/cake"
   },
+  "preferGlobal": true,
+  "scripts": {
+    "test": "node ./bin/cake test"
+  },
   "homepage": "http://coffeescript.org",
-  "bugs": "https://github.com/jashkenas/coffee-script/issues",
+  "bugs": {
+    "url": "https://github.com/jashkenas/coffeescript/issues"
+  },
   "repository": {
     "type": "git",
-    "url": "git://github.com/jashkenas/coffee-script.git"
+    "url": "git://github.com/jashkenas/coffeescript.git"
   },
   "devDependencies": {
-    "uglify-js": ">=1.0.0",
-    "jison": ">=0.2.0"
+    "uglify-js": "~2.2",
+    "jison": ">=0.2.0",
+    "highlight.js": "~8.0.0",
+    "underscore": "~1.5.2",
+    "docco": "~0.6.2"
+  },
+  "dependencies": {
+    "mkdirp": "~0.3.5"
   },
-  "readme": "\n            {\n         }   }   {\n        {   {  }  }\n         }   }{  {\n        {  }{  }  }                    _____       __  __\n       ( }{ }{  { )                   / ____|     / _|/ _|\n     .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___\n    (  ( } { } { } }  )              | |    / _ \\|  _|  _/ _ \\/ _ \\\n    |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/\n    |                 |               \\_____\\___/|_| |_| \\___|\\___|\n    |                 ;--.\n    |                (__  \\            _____           _       _\n    |                 | )  )          / ____|         (_)     | |\n    |                 |/  /          | (___   ___ _ __ _ _ __ | |_\n    |                 (  /            \\___ \\ / __| '__| | '_ \\| __|\n    |                 |/              ____) | (__| |  | | |_) | |_\n    |                 |              |_____/ \\___|_|  |_| .__/ \\__|\n     `-.._________..-'                                  | |\n   
                                                      |_|\n\n\n  CoffeeScript is a little language that compiles into JavaScript.\n\n  Install Node.js, and then the CoffeeScript compiler:\n  sudo bin/cake install\n\n  Or, if you have the Node Package Manager installed:\n  npm install -g coffee-script\n  (Leave off the -g if you don't wish to install globally.)\n\n  Execute a script:\n  coffee /path/to/script.coffee\n\n  Compile a script:\n  coffee -c /path/to/script.coffee\n\n  For documentation, usage, and examples, see:\n  http://coffeescript.org/\n\n  To suggest a feature, report a bug, or general discussion:\n  http://github.com/jashkenas/coffee-script/issues/\n\n  If you'd like to chat, drop by #coffeescript on Freenode IRC,\n  or on webchat.freenode.net.\n\n  The source repository:\n  git://github.com/jashkenas/coffee-script.git\n\n  All contributors are listed here:\n  http://github.com/jashkenas/coffee-script/contributors\n",
-  "_id": "coffee-script@1.3.3",
-  "_from": "coffee-script@1.3.x"
+  "readme": "            {\n         }   }   {\n        {   {  }  }\n         }   }{  {\n        {  }{  }  }                    _____       __  __\n       { }{ }{  { }                   / ____|     / _|/ _|\n     .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___\n    (  { } { } { } }  )              | |    / _ \\|  _|  _/ _ \\/ _ \\\n    |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/\n    |                 |               \\_____\\___/|_| |_| \\___|\\___|\n    |                 ;--.\n    |                (__  \\            _____           _       _\n    |                 | )  )          / ____|         (_)     | |\n    |                 |/  /          | (___   ___ _ __ _ _ __ | |_\n    |                 (  /            \\___ \\ / __| '__| | '_ \\| __|\n    |                 |/              ____) | (__| |  | | |_) | |_\n    |                 |              |_____/ \\___|_|  |_| .__/ \\__|\n     `-.._________..-'                                  | |\n     
                                                    |_|\n\n\n  CoffeeScript is a little language that compiles into JavaScript.\n\n  If you have the Node Package Manager installed:\n  npm install -g coffee-script\n  (Leave off the -g if you don't wish to install globally.)\n\n  Or, if you don't wish to use npm:\n  sudo bin/cake install\n\n  Execute a script:\n  coffee /path/to/script.coffee\n\n  Compile a script:\n  coffee -c /path/to/script.coffee\n\n  For documentation, usage, and examples, see:\n  http://coffeescript.org/\n\n  To suggest a feature, report a bug, or general discussion:\n  http://github.com/jashkenas/coffeescript/issues/\n\n  If you'd like to chat, drop by #coffeescript on Freenode IRC,\n  or on webchat.freenode.net.\n\n  The source repository:\n  git://github.com/jashkenas/coffeescript.git\n\n  Top 100 contributors are listed here:\n  http://github.com/jashkenas/coffeescript/contributors\n",
+  "readmeFilename": "README",
+  "_id": "coffee-script@1.8.0",
+  "_from": "coffee-script@1.8.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/register.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/register.js b/weinre.server/node_modules/coffee-script/register.js
new file mode 100644
index 0000000..97b33d7
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/register.js
@@ -0,0 +1 @@
+require('./lib/coffee-script/register');

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/repl.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/repl.js b/weinre.server/node_modules/coffee-script/repl.js
new file mode 100644
index 0000000..d2706a7
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/repl.js
@@ -0,0 +1 @@
+module.exports = require('./lib/coffee-script/repl');

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/History.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/History.md b/weinre.server/node_modules/express/History.md
index 5aae2d1..95ea466 100644
--- a/weinre.server/node_modules/express/History.md
+++ b/weinre.server/node_modules/express/History.md
@@ -1,4 +1,9 @@
 
+2.5.11 / 2012-06-29 
+==================
+
+  * Fixed backport of req.protocol
+
 2.5.10 / 2012-06-15 
 ==================
 

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/lib/express.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/lib/express.js b/weinre.server/node_modules/express/lib/express.js
index 1bae623..7ea451d 100644
--- a/weinre.server/node_modules/express/lib/express.js
+++ b/weinre.server/node_modules/express/lib/express.js
@@ -28,7 +28,7 @@ var exports = module.exports = connect.middleware;
  * Framework version.
  */
 
-exports.version = '2.5.10';
+exports.version = '2.5.11';
 
 /**
  * Shortcut for `new Server(...)`.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/lib/request.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/lib/request.js b/weinre.server/node_modules/express/lib/request.js
index 05ffa66..4138afe 100644
--- a/weinre.server/node_modules/express/lib/request.js
+++ b/weinre.server/node_modules/express/lib/request.js
@@ -323,8 +323,8 @@ req.__defineGetter__('isXMLHttpRequest', isxhr);
 req.__defineGetter__('xhr', isxhr);
 
 /**
- * Return the protocol string "http" or "https",
- * when requested with TLS. When the "trust proxy"
+ * Return the protocol string "http" or "https"
+ * when requested with TLS. When the "trust proxy" 
  * setting is enabled the "X-Forwarded-Proto" header
  * field will be trusted. If you're running behind
  * a reverse proxy that supplies https for you this
@@ -334,11 +334,24 @@ req.__defineGetter__('xhr', isxhr);
  * @api public
  */
 
-req.__defineGetter__('protocol', function(trustProxy){
-  var trustProxy = this.app.settings['trust proxy'];
-  return this.secure
+req.__defineGetter__('protocol', function(){
+  var trustProxy = this.app.set('trust proxy');
+  return this.connection.encrypted
     ? 'https'
     : trustProxy
       ? (this.header('X-Forwarded-Proto') || 'http')
       : 'http';
 });
+
+/**
+ * Short-hand for:
+ *
+ *    req.protocol == 'https'
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+req.__defineGetter__('secure', function(){
+  return 'https' == this.protocol;
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/lib/connect.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/lib/connect.js b/weinre.server/node_modules/express/node_modules/connect/lib/connect.js
index eb2b0ea..338d96f 100644
--- a/weinre.server/node_modules/express/node_modules/connect/lib/connect.js
+++ b/weinre.server/node_modules/express/node_modules/connect/lib/connect.js
@@ -26,7 +26,7 @@ exports = module.exports = createServer;
  * Framework version.
  */
 
-exports.version = '1.9.1';
+exports.version = '1.9.2';
 
 /**
  * Initialize a new `connect.HTTPServer` with the middleware

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/lib/middleware/csrf.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/lib/middleware/csrf.js b/weinre.server/node_modules/express/node_modules/connect/lib/middleware/csrf.js
index 1dcf0d1..53347e7 100644
--- a/weinre.server/node_modules/express/node_modules/connect/lib/middleware/csrf.js
+++ b/weinre.server/node_modules/express/node_modules/connect/lib/middleware/csrf.js
@@ -77,7 +77,7 @@ module.exports = function csrf(options) {
     var token = req.session._csrf || (req.session._csrf = utils.uid(24));
 
     // ignore GET (for now)
-    if ('GET' == req.method) return next();
+    if ('GET' == req.method || 'HEAD' == req.method || 'OPTIONS' == req.method) return next();
 
     // determine value
     var val = value(req);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore
index 4fbabb3..ed16858 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.npmignore
@@ -1,4 +1,7 @@
-/test/tmp/
+/test
+/tool
+/example
+/benchmark
 *.upload
 *.un~
 *.http

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml
index f1d0f13..e20bedc 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/.travis.yml
@@ -1,4 +1,5 @@
 language: node_js
 node_js:
-  - 0.4
-  - 0.6
+  - 0.8
+  - "0.10"
+  - 0.11

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/LICENSE
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/LICENSE b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/LICENSE
new file mode 100644
index 0000000..38d3c9c
--- /dev/null
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/LICENSE
@@ -0,0 +1,7 @@
+Copyright (C) 2011 Felix Geisendörfer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[05/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/package.json b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/package.json
index d2cec1f..0c67f7f 100644
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/package.json
+++ b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/package.json
@@ -1,25 +1,38 @@
 {
   "name": "formidable",
-  "version": "1.0.11",
-  "dependencies": {},
+  "description": "A node.js module for parsing form data, especially file uploads.",
+  "homepage": "https://github.com/felixge/node-formidable",
+  "version": "1.0.15",
   "devDependencies": {
     "gently": "0.8.0",
     "findit": "0.1.1",
     "hashish": "0.0.4",
-    "urun": "0.0.4",
-    "utest": "0.0.3"
+    "urun": "~0.0.6",
+    "utest": "0.0.3",
+    "request": "~2.11.4"
   },
   "directories": {
     "lib": "./lib"
   },
   "main": "./lib/index",
   "scripts": {
-    "test": "make test"
+    "test": "node test/run.js",
+    "clean": "rm test/tmp/*"
   },
   "engines": {
-    "node": "*"
+    "node": ">=0.8.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/felixge/node-formidable.git"
+  },
+  "bugs": {
+    "url": "http://github.com/felixge/node-formidable/issues"
   },
   "optionalDependencies": {},
-  "_id": "formidable@1.0.11",
+  "readme": "# Formidable\n\n[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable)\n\n## Purpose\n\nA node.js module for parsing form data, especially file uploads.\n\n## Current status\n\nThis module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading\nand encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from\na large variety of clients and is considered production-ready.\n\n## Features\n\n* Fast (~500mb/sec), non-buffering multipart parser\n* Automatically writing file uploads to disk\n* Low memory footprint\n* Graceful error handling\n* Very high test coverage\n\n## Installation\n\nThis is a low level package, and if you're using a high level framework such as Express, chances are it's already included in it. You can [read this discussion](http://stackoverflow.com/questions/11295554/how-to-disable-express-bodyparser-for
 -file-uploads-node-js) about how Formidable is integrated with Express.\n\nVia [npm](http://github.com/isaacs/npm):\n```\nnpm install formidable@latest\n```\nManually:\n```\ngit clone git://github.com/felixge/node-formidable.git formidable\nvim my.js\n# var formidable = require('./formidable');\n```\n\nNote: Formidable requires [gently](http://github.com/felixge/node-gently) to run the unit tests, but you won't need it for just using the library.\n\n## Example\n\nParse an incoming file upload.\n```javascript\nvar formidable = require('formidable'),\n    http = require('http'),\n    util = require('util');\n\nhttp.createServer(function(req, res) {\n  if (req.url == '/upload' && req.method.toLowerCase() == 'post') {\n    // parse a file upload\n    var form = new formidable.IncomingForm();\n\n    form.parse(req, function(err, fields, files) {\n      res.writeHead(200, {'content-type': 'text/plain'});\n      res.write('received upload:\\n\\n');\n      res.end(util.inspect({fields: fiel
 ds, files: files}));\n    });\n\n    return;\n  }\n\n  // show a file upload form\n  res.writeHead(200, {'content-type': 'text/html'});\n  res.end(\n    '<form action=\"/upload\" enctype=\"multipart/form-data\" method=\"post\">'+\n    '<input type=\"text\" name=\"title\"><br>'+\n    '<input type=\"file\" name=\"upload\" multiple=\"multiple\"><br>'+\n    '<input type=\"submit\" value=\"Upload\">'+\n    '</form>'\n  );\n}).listen(8080);\n```\n## API\n\n### Formidable.IncomingForm\n```javascript\nvar form = new formidable.IncomingForm()\n```\nCreates a new incoming form.\n\n```javascript\nform.encoding = 'utf-8';\n```\nSets encoding for incoming form fields.\n\n```javascript\nform.uploadDir = \"/my/dir\";\n```\nSets the directory for placing file uploads in. You can move them later on using\n`fs.rename()`. The default is `os.tmpDir()`.\n\n```javascript\nform.keepExtensions = false;\n```\nIf you want the files written to `form.uploadDir` to include the extensions of the original files, 
 set this property to `true`.\n\n```javascript\nform.type\n```\nEither 'multipart' or 'urlencoded' depending on the incoming request.\n\n```javascript\nform.maxFieldsSize = 2 * 1024 * 1024;\n```\nLimits the amount of memory a field (not file) can allocate in bytes.\nIf this value is exceeded, an `'error'` event is emitted. The default\nsize is 2MB.\n\n```javascript\nform.maxFields = 1000;\n```\nLimits the number of fields that the querystring parser will decode. Defaults\nto 1000 (0 for unlimited).\n\n```javascript\nform.hash = false;\n```\nIf you want checksums calculated for incoming files, set this to either `'sha1'` or `'md5'`.\n\n```javascript\nform.multiples = false;\n```\nIf this option is enabled, when you call `form.parse`, the `files` argument will contain arrays of files for inputs which submit multiple files using the HTML5 `multiple` attribute.\n\n```javascript\nform.bytesReceived\n```\nThe amount of bytes received for this form so far.\n\n```javascript\nform.bytesExpect
 ed\n```\nThe expected number of bytes in this form.\n\n```javascript\nform.parse(request, [cb]);\n```\nParses an incoming node.js `request` containing form data. If `cb` is provided, all fields and files are collected and passed to the callback:\n\n\n```javascript\nform.parse(req, function(err, fields, files) {\n  // ...\n});\n\nform.onPart(part);\n```\nYou may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events  processing which would occur otherwise, making you fully responsible for handling the processing.\n\n```javascript\nform.onPart = function(part) {\n  part.addListener('data', function() {\n    // ...\n  });\n}\n```\nIf you want to use formidable to only handle certain parts for you, you can do so:\n```javascript\nform.onPart = function(part) {\n  if (!part.filename) {\n    // let formidable handle all non-file parts\n    form.handlePart(part);\n  }\n}\n```\nCheck the code in this metho
 d for further inspiration.\n\n\n### Formidable.File\n```javascript\nfile.size = 0\n```\nThe size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.\n```javascript\nfile.path = null\n```\nThe path this file is being written to. You can modify this in the `'fileBegin'` event in\ncase you are unhappy with the way formidable generates a temporary path for your files.\n```javascript\nfile.name = null\n```\nThe name this file had according to the uploading client.\n```javascript\nfile.type = null\n```\nThe mime type of this file, according to the uploading client.\n```javascript\nfile.lastModifiedDate = null\n```\nA date object (or `null`) containing the time this file was last written to. Mostly\nhere for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).\n```javascript\nfile.hash = null\n```\nIf hash calculation was set, you can read t
 he hex digest out of this var.\n\n#### Formidable.File#toJSON()\n\n  This method returns a JSON-representation of the file, allowing you to\n  `JSON.stringify()` the file which is useful for logging and responding\n  to requests.\n\n### Events\n\n\n#### 'progress'\n```javascript\nform.on('progress', function(bytesReceived, bytesExpected) {\n});\n```\nEmitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.\n\n\n\n#### 'field'\n```javascript\nform.on('field', function(name, value) {\n});\n```\n\n#### 'fileBegin'\n\nEmitted whenever a field / value pair has been received.\n```javascript\nform.on('fileBegin', function(name, file) {\n});\n```\n\n#### 'file'\n\nEmitted whenever a new file is detected in the upload stream. Use this even if\nyou want to stream the file to somewhere else while buffering the upload on\nthe file system.\n\nEmitted whenever a field / file pair has been received. `file` is an instance of `File`.\n```javascript\n
 form.on('file', function(name, file) {\n});\n```\n\n#### 'error'\n\nEmitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.\n```javascript\nform.on('error', function(err) {\n});\n```\n\n#### 'aborted'\n\n\nEmitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core).\n```javascript\nform.on('aborted', function() {\n});\n```\n\n##### 'end'\n```javascript\nform.on('end', function() {\n});\n```\nEmitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.\n\n\n\n## Changelog\n\n### v1.0.14\n\n* Add failing hash tests. (Ben Trask)\n* Enable hash calculation again (Euge
 ne Girshov)\n* Test for immediate data events (Tim Smart)\n* Re-arrange IncomingForm#parse (Tim Smart)\n\n### v1.0.13\n\n* Only update hash if update method exists (Sven Lito)\n* According to travis v0.10 needs to go quoted (Sven Lito)\n* Bumping build node versions (Sven Lito)\n* Additional fix for empty requests (Eugene Girshov)\n* Change the default to 1000, to match the new Node behaviour. (OrangeDog)\n* Add ability to control maxKeys in the querystring parser. (OrangeDog)\n* Adjust test case to work with node 0.9.x (Eugene Girshov)\n* Update package.json (Sven Lito)\n* Path adjustment according to eb4468b (Markus Ast)\n\n### v1.0.12\n\n* Emit error on aborted connections (Eugene Girshov)\n* Add support for empty requests (Eugene Girshov)\n* Fix name/filename handling in Content-Disposition (jesperp)\n* Tolerate malformed closing boundary in multipart (Eugene Girshov)\n* Ignore preamble in multipart messages (Eugene Girshov)\n* Add support for application/json (Mike Frey, Carlos
  Rodriguez)\n* Add support for Base64 encoding (Elmer Bulthuis)\n* Add File#toJSON (TJ Holowaychuk)\n* Remove support for Node.js 0.4 & 0.6 (Andrew Kelley)\n* Documentation improvements (Sven Lito, Andre Azevedo)\n* Add support for application/octet-stream (Ion Lupascu, Chris Scribner)\n* Use os.tmpDir() to get tmp directory (Andrew Kelley)\n* Improve package.json (Andrew Kelley, Sven Lito)\n* Fix benchmark script (Andrew Kelley)\n* Fix scope issue in incoming_forms (Sven Lito)\n* Fix file handle leak on error (OrangeDog)\n\n### v1.0.11\n\n* Calculate checksums for incoming files (sreuter)\n* Add definition parameters to \"IncomingForm\" as an argument (Math-)\n\n### v1.0.10\n\n* Make parts to be proper Streams (Matt Robenolt)\n\n### v1.0.9\n\n* Emit progress when content length header parsed (Tim Koschützki)\n* Fix Readme syntax due to GitHub changes (goob)\n* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara)\n\n### v1.0.8\n\n* Strip potentially unsafe 
 characters when using `keepExtensions: true`.\n* Switch to utest / urun for testing\n* Add travis build\n\n### v1.0.7\n\n* Remove file from package that was causing problems when installing on windows. (#102)\n* Fix typos in Readme (Jason Davies).\n\n### v1.0.6\n\n* Do not default to the default to the field name for file uploads where\n  filename=\"\".\n\n### v1.0.5\n\n* Support filename=\"\" in multipart parts\n* Explain unexpected end() errors in parser better\n\n**Note:** Starting with this version, formidable emits 'file' events for empty\nfile input fields. Previously those were incorrectly emitted as regular file\ninput fields with value = \"\".\n\n### v1.0.4\n\n* Detect a good default tmp directory regardless of platform. (#88)\n\n### v1.0.3\n\n* Fix problems with utf8 characters (#84) / semicolons in filenames (#58)\n* Small performance improvements\n* New test suite and fixture system\n\n### v1.0.2\n\n* Exclude node\\_modules folder from git\n* Implement new `'aborted'` ev
 ent\n* Fix files in example folder to work with recent node versions\n* Make gently a devDependency\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.1...v1.0.2)\n\n### v1.0.1\n\n* Fix package.json to refer to proper main directory. (#68, Dean Landolt)\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v1.0.0...v1.0.1)\n\n### v1.0.0\n\n* Add support for multipart boundaries that are quoted strings. (Jeff Craig)\n\nThis marks the beginning of development on version 2.0 which will include\nseveral architectural improvements.\n\n[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0)\n\n### v0.9.11\n\n* Emit `'progress'` event when receiving data, regardless of parsing it. (Tim Koschützki)\n* Use [W3C FileAPI Draft](http://dev.w3.org/2006/webapi/FileAPI/) properties for File class\n\n**Important:** The old property names of the File class will be removed in a\nfuture release.\n\n[See Commits](https://github.com/felixge
 /node-formidable/compare/v0.9.10...v0.9.11)\n\n### Older releases\n\nThese releases were done before starting to maintain the above Changelog:\n\n* [v0.9.10](https://github.com/felixge/node-formidable/compare/v0.9.9...v0.9.10)\n* [v0.9.9](https://github.com/felixge/node-formidable/compare/v0.9.8...v0.9.9)\n* [v0.9.8](https://github.com/felixge/node-formidable/compare/v0.9.7...v0.9.8)\n* [v0.9.7](https://github.com/felixge/node-formidable/compare/v0.9.6...v0.9.7)\n* [v0.9.6](https://github.com/felixge/node-formidable/compare/v0.9.5...v0.9.6)\n* [v0.9.5](https://github.com/felixge/node-formidable/compare/v0.9.4...v0.9.5)\n* [v0.9.4](https://github.com/felixge/node-formidable/compare/v0.9.3...v0.9.4)\n* [v0.9.3](https://github.com/felixge/node-formidable/compare/v0.9.2...v0.9.3)\n* [v0.9.2](https://github.com/felixge/node-formidable/compare/v0.9.1...v0.9.2)\n* [v0.9.1](https://github.com/felixge/node-formidable/compare/v0.9.0...v0.9.1)\n* [v0.9.0](https://github.com/felixge/node-formid
 able/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.9.0](https://github.com/felixge/node-formidable/compare/v0.8.0...v0.9.0)\n* [v0.1.0](https://github.com/felixge/node-formidable/commits/v0.1.0)\n\n## License\n\nFormidable is licensed under the MIT license.\n\n## Ports\n\n* [multipart-parser](http://github.com/FooBarWidget/multipart-parser): a C++ parser based on formidable\n\n## Credits\n\n* [Ryan Dahl](http://twitter.com/ryah) for his work on [http-parser](http://github.com/ry/http-parser) which heavily inspired multipart_p
 arser.js\n",
+  "readmeFilename": "Readme.md",
+  "dependencies": {},
+  "_id": "formidable@1.0.15",
   "_from": "formidable@1.0.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js
deleted file mode 100644
index eb432ad..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var mysql = require('..');
-var path = require('path');
-
-var root = path.join(__dirname, '../');
-exports.dir = {
-  root    : root,
-  lib     : root + '/lib',
-  fixture : root + '/test/fixture',
-  tmp     : root + '/test/tmp',
-};
-
-exports.port = 13532;
-
-exports.formidable = require('..');
-exports.assert     = require('assert');
-
-exports.require = function(lib) {
-  return require(exports.dir.lib + '/' + lib);
-};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt
deleted file mode 100644
index e7a4785..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt
+++ /dev/null
@@ -1 +0,0 @@
-I am a text file with a funky name!

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt
deleted file mode 100644
index 9b6903e..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt
+++ /dev/null
@@ -1 +0,0 @@
-I am a plain text file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md
deleted file mode 100644
index 3c9dbe3..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md
+++ /dev/null
@@ -1,3 +0,0 @@
-* Opera does not allow submitting this file, it shows a warning to the
-  user that the file could not be found instead. Tested in 9.8, 11.51 on OSX.
-  Reported to Opera on 08.09.2011 (tracking email DSK-346009@bugs.opera.com).

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js
deleted file mode 100644
index 0bae449..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports['generic.http'] = [
-  {type: 'file', name: 'upload', filename: '', fixture: 'plain.txt'},
-];

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js
deleted file mode 100644
index eb76fdc..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var properFilename = 'funkyfilename.txt';
-
-function expect(filename) {
-  return [
-    {type: 'field', name: 'title', value: 'Weird filename'},
-    {type: 'file', name: 'upload', filename: filename, fixture: properFilename},
-  ];
-};
-
-var webkit = " ? % * | \" < > . ? ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt";
-var ffOrIe = " ? % * | \" < > . ☃ ; ' @ # $ ^ & ( ) - _ = + { } [ ] ` ~.txt";
-
-module.exports = {
-  'osx-chrome-13.http'   : expect(webkit),
-  'osx-firefox-3.6.http' : expect(ffOrIe),
-  'osx-safari-5.http'    : expect(webkit),
-  'xp-chrome-12.http'    : expect(webkit),
-  'xp-ie-7.http'         : expect(ffOrIe),
-  'xp-ie-8.http'         : expect(ffOrIe),
-  'xp-safari-5.http'     : expect(webkit),
-};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js
deleted file mode 100644
index a476169..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multipart.js
+++ /dev/null
@@ -1,72 +0,0 @@
-exports['rfc1867'] =
-  { boundary: 'AaB03x',
-    raw:
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="field1"\r\n'+
-      '\r\n'+
-      'Joe Blow\r\nalmost tricked you!\r\n'+
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
-      'Content-Type: text/plain\r\n'+
-      '\r\n'+
-      '... contents of file1.txt ...\r\r\n'+
-      '--AaB03x--\r\n',
-    parts:
-    [ { headers: {
-          'content-disposition': 'form-data; name="field1"',
-        },
-        data: 'Joe Blow\r\nalmost tricked you!',
-      },
-      { headers: {
-          'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
-          'Content-Type': 'text/plain',
-        },
-        data: '... contents of file1.txt ...\r',
-      }
-    ]
-  };
-
-exports['noTrailing\r\n'] =
-  { boundary: 'AaB03x',
-    raw:
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="field1"\r\n'+
-      '\r\n'+
-      'Joe Blow\r\nalmost tricked you!\r\n'+
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
-      'Content-Type: text/plain\r\n'+
-      '\r\n'+
-      '... contents of file1.txt ...\r\r\n'+
-      '--AaB03x--',
-    parts:
-    [ { headers: {
-          'content-disposition': 'form-data; name="field1"',
-        },
-        data: 'Joe Blow\r\nalmost tricked you!',
-      },
-      { headers: {
-          'content-disposition': 'form-data; name="pics"; filename="file1.txt"',
-          'Content-Type': 'text/plain',
-        },
-        data: '... contents of file1.txt ...\r',
-      }
-    ]
-  };
-
-exports['emptyHeader'] =
-  { boundary: 'AaB03x',
-    raw:
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="field1"\r\n'+
-      ': foo\r\n'+
-      '\r\n'+
-      'Joe Blow\r\nalmost tricked you!\r\n'+
-      '--AaB03x\r\n'+
-      'content-disposition: form-data; name="pics"; filename="file1.txt"\r\n'+
-      'Content-Type: text/plain\r\n'+
-      '\r\n'+
-      '... contents of file1.txt ...\r\r\n'+
-      '--AaB03x--\r\n',
-    expectError: true,
-  };

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js
deleted file mode 100644
index 66ad259..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js
+++ /dev/null
@@ -1,89 +0,0 @@
-var hashish = require('hashish');
-var fs = require('fs');
-var findit = require('findit');
-var path = require('path');
-var http = require('http');
-var net = require('net');
-var assert = require('assert');
-
-var common = require('../common');
-var formidable = common.formidable;
-
-var server = http.createServer();
-server.listen(common.port, findFixtures);
-
-function findFixtures() {
-  var fixtures = [];
-  findit
-    .sync(common.dir.fixture + '/js')
-    .forEach(function(jsPath) {
-      if (!/\.js$/.test(jsPath)) return;
-
-      var group = path.basename(jsPath, '.js');
-      hashish.forEach(require(jsPath), function(fixture, name) {
-        fixtures.push({
-          name    : group + '/' + name,
-          fixture : fixture,
-        });
-      });
-    });
-
-  testNext(fixtures);
-}
-
-function testNext(fixtures) {
-  var fixture = fixtures.shift();
-  if (!fixture) return server.close();
-
-  var name    = fixture.name;
-  var fixture = fixture.fixture;
-
-  uploadFixture(name, function(err, parts) {
-    if (err) throw err;
-
-    fixture.forEach(function(expectedPart, i) {
-      var parsedPart = parts[i];
-      assert.equal(parsedPart.type, expectedPart.type);
-      assert.equal(parsedPart.name, expectedPart.name);
-
-      if (parsedPart.type === 'file') {
-        var filename = parsedPart.value.name;
-        assert.equal(filename, expectedPart.filename);
-      }
-    });
-
-    testNext(fixtures);
-  });
-};
-
-function uploadFixture(name, cb) {
-  server.once('request', function(req, res) {
-    var form = new formidable.IncomingForm();
-    form.uploadDir = common.dir.tmp;
-    form.parse(req);
-
-    function callback() {
-      var realCallback = cb;
-      cb = function() {};
-      realCallback.apply(null, arguments);
-    }
-
-    var parts = [];
-    form
-      .on('error', callback)
-      .on('fileBegin', function(name, value) {
-        parts.push({type: 'file', name: name, value: value});
-      })
-      .on('field', function(name, value) {
-        parts.push({type: 'field', name: name, value: value});
-      })
-      .on('end', function() {
-        callback(null, parts);
-      });
-  });
-
-  var socket = net.createConnection(common.port);
-  var file = fs.createReadStream(common.dir.fixture + '/http/' + name);
-
-  file.pipe(socket);
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js
deleted file mode 100644
index 2b98598..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var path = require('path'),
-    fs = require('fs');
-
-try {
-  global.Gently = require('gently');
-} catch (e) {
-  throw new Error('this test suite requires node-gently');
-}
-
-exports.lib = path.join(__dirname, '../../lib');
-
-global.GENTLY = new Gently();
-
-global.assert = require('assert');
-global.TEST_PORT = 13532;
-global.TEST_FIXTURES = path.join(__dirname, '../fixture');
-global.TEST_TMP = path.join(__dirname, '../tmp');
-
-// Stupid new feature in node that complains about gently attaching too many
-// listeners to process 'exit'. This is a workaround until I can think of a
-// better way to deal with this.
-if (process.setMaxListeners) {
-  process.setMaxListeners(10000);
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js
deleted file mode 100644
index 75232aa..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js
+++ /dev/null
@@ -1,80 +0,0 @@
-var common = require('../common');
-var CHUNK_LENGTH = 10,
-    multipartParser = require(common.lib + '/multipart_parser'),
-    MultipartParser = multipartParser.MultipartParser,
-    parser = new MultipartParser(),
-    fixtures = require(TEST_FIXTURES + '/multipart'),
-    Buffer = require('buffer').Buffer;
-
-Object.keys(fixtures).forEach(function(name) {
-  var fixture = fixtures[name],
-      buffer = new Buffer(Buffer.byteLength(fixture.raw, 'binary')),
-      offset = 0,
-      chunk,
-      nparsed,
-
-      parts = [],
-      part = null,
-      headerField,
-      headerValue,
-      endCalled = '';
-
-  parser.initWithBoundary(fixture.boundary);
-  parser.onPartBegin = function() {
-    part = {headers: {}, data: ''};
-    parts.push(part);
-    headerField = '';
-    headerValue = '';
-  };
-
-  parser.onHeaderField = function(b, start, end) {
-    headerField += b.toString('ascii', start, end);
-  };
-
-  parser.onHeaderValue = function(b, start, end) {
-    headerValue += b.toString('ascii', start, end);
-  }
-
-  parser.onHeaderEnd = function() {
-    part.headers[headerField] = headerValue;
-    headerField = '';
-    headerValue = '';
-  };
-
-  parser.onPartData = function(b, start, end) {
-    var str = b.toString('ascii', start, end);
-    part.data += b.slice(start, end);
-  }
-
-  parser.onEnd = function() {
-    endCalled = true;
-  }
-
-  buffer.write(fixture.raw, 'binary', 0);
-
-  while (offset < buffer.length) {
-    if (offset + CHUNK_LENGTH < buffer.length) {
-      chunk = buffer.slice(offset, offset+CHUNK_LENGTH);
-    } else {
-      chunk = buffer.slice(offset, buffer.length);
-    }
-    offset = offset + CHUNK_LENGTH;
-
-    nparsed = parser.write(chunk);
-    if (nparsed != chunk.length) {
-      if (fixture.expectError) {
-        return;
-      }
-      puts('-- ERROR --');
-      p(chunk.toString('ascii'));
-      throw new Error(chunk.length+' bytes written, but only '+nparsed+' bytes parsed!');
-    }
-  }
-
-  if (fixture.expectError) {
-    throw new Error('expected parse error did not happen');
-  }
-
-  assert.ok(endCalled);
-  assert.deepEqual(parts, fixture.parts);
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js
deleted file mode 100644
index 52ceedb..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js
+++ /dev/null
@@ -1,104 +0,0 @@
-var common = require('../common');
-var WriteStreamStub = GENTLY.stub('fs', 'WriteStream');
-
-var File = require(common.lib + '/file'),
-    EventEmitter = require('events').EventEmitter,
-    file,
-    gently;
-
-function test(test) {
-  gently = new Gently();
-  file = new File();
-  test();
-  gently.verify(test.name);
-}
-
-test(function constructor() {
-  assert.ok(file instanceof EventEmitter);
-  assert.strictEqual(file.size, 0);
-  assert.strictEqual(file.path, null);
-  assert.strictEqual(file.name, null);
-  assert.strictEqual(file.type, null);
-  assert.strictEqual(file.lastModifiedDate, null);
-
-  assert.strictEqual(file._writeStream, null);
-
-  (function testSetProperties() {
-    var file2 = new File({foo: 'bar'});
-    assert.equal(file2.foo, 'bar');
-  })();
-});
-
-test(function open() {
-  var WRITE_STREAM;
-  file.path = '/foo';
-
-  gently.expect(WriteStreamStub, 'new', function (path) {
-    WRITE_STREAM = this;
-    assert.strictEqual(path, file.path);
-  });
-
-  file.open();
-  assert.strictEqual(file._writeStream, WRITE_STREAM);
-});
-
-test(function write() {
-  var BUFFER = {length: 10},
-      CB_STUB,
-      CB = function() {
-        CB_STUB.apply(this, arguments);
-      };
-
-  file._writeStream = {};
-
-  gently.expect(file._writeStream, 'write', function (buffer, cb) {
-    assert.strictEqual(buffer, BUFFER);
-
-    gently.expect(file, 'emit', function (event, bytesWritten) {
-      assert.ok(file.lastModifiedDate instanceof Date);
-      assert.equal(event, 'progress');
-      assert.equal(bytesWritten, file.size);
-    });
-
-    CB_STUB = gently.expect(function writeCb() {
-      assert.equal(file.size, 10);
-    });
-
-    cb();
-
-    gently.expect(file, 'emit', function (event, bytesWritten) {
-      assert.equal(event, 'progress');
-      assert.equal(bytesWritten, file.size);
-    });
-
-    CB_STUB = gently.expect(function writeCb() {
-      assert.equal(file.size, 20);
-    });
-
-    cb();
-  });
-
-  file.write(BUFFER, CB);
-});
-
-test(function end() {
-  var CB_STUB,
-      CB = function() {
-        CB_STUB.apply(this, arguments);
-      };
-
-  file._writeStream = {};
-
-  gently.expect(file._writeStream, 'end', function (cb) {
-    gently.expect(file, 'emit', function (event) {
-      assert.equal(event, 'end');
-    });
-
-    CB_STUB = gently.expect(function endCb() {
-    });
-
-    cb();
-  });
-
-  file.end(CB);
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js
deleted file mode 100644
index 84de439..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js
+++ /dev/null
@@ -1,727 +0,0 @@
-var common = require('../common');
-var MultipartParserStub = GENTLY.stub('./multipart_parser', 'MultipartParser'),
-    QuerystringParserStub = GENTLY.stub('./querystring_parser', 'QuerystringParser'),
-    EventEmitterStub = GENTLY.stub('events', 'EventEmitter'),
-    StreamStub = GENTLY.stub('stream', 'Stream'),
-    FileStub = GENTLY.stub('./file');
-
-var formidable = require(common.lib + '/index'),
-    IncomingForm = formidable.IncomingForm,
-    events = require('events'),
-    fs = require('fs'),
-    path = require('path'),
-    Buffer = require('buffer').Buffer,
-    fixtures = require(TEST_FIXTURES + '/multipart'),
-    form,
-    gently;
-
-function test(test) {
-  gently = new Gently();
-  gently.expect(EventEmitterStub, 'call');
-  form = new IncomingForm();
-  test();
-  gently.verify(test.name);
-}
-
-test(function constructor() {
-  assert.strictEqual(form.error, null);
-  assert.strictEqual(form.ended, false);
-  assert.strictEqual(form.type, null);
-  assert.strictEqual(form.headers, null);
-  assert.strictEqual(form.keepExtensions, false);
-  assert.strictEqual(form.uploadDir, '/tmp');
-  assert.strictEqual(form.encoding, 'utf-8');
-  assert.strictEqual(form.bytesReceived, null);
-  assert.strictEqual(form.bytesExpected, null);
-  assert.strictEqual(form.maxFieldsSize, 2 * 1024 * 1024);
-  assert.strictEqual(form._parser, null);
-  assert.strictEqual(form._flushing, 0);
-  assert.strictEqual(form._fieldsSize, 0);
-  assert.ok(form instanceof EventEmitterStub);
-  assert.equal(form.constructor.name, 'IncomingForm');
-
-  (function testSimpleConstructor() {
-    gently.expect(EventEmitterStub, 'call');
-    var form = IncomingForm();
-    assert.ok(form instanceof IncomingForm);
-  })();
-
-  (function testSimpleConstructorShortcut() {
-    gently.expect(EventEmitterStub, 'call');
-    var form = formidable();
-    assert.ok(form instanceof IncomingForm);
-  })();
-});
-
-test(function parse() {
-  var REQ = {headers: {}}
-    , emit = {};
-
-  gently.expect(form, 'writeHeaders', function(headers) {
-    assert.strictEqual(headers, REQ.headers);
-  });
-
-  var events = ['error', 'aborted', 'data', 'end'];
-  gently.expect(REQ, 'on', events.length, function(event, fn) {
-    assert.equal(event, events.shift());
-    emit[event] = fn;
-    return this;
-  });
-
-  form.parse(REQ);
-
-  (function testPause() {
-    gently.expect(REQ, 'pause');
-    assert.strictEqual(form.pause(), true);
-  })();
-
-  (function testPauseCriticalException() {
-    form.ended = false;
-
-    var ERR = new Error('dasdsa');
-    gently.expect(REQ, 'pause', function() {
-      throw ERR;
-    });
-
-    gently.expect(form, '_error', function(err) {
-      assert.strictEqual(err, ERR);
-    });
-
-    assert.strictEqual(form.pause(), false);
-  })();
-
-  (function testPauseHarmlessException() {
-    form.ended = true;
-
-    var ERR = new Error('dasdsa');
-    gently.expect(REQ, 'pause', function() {
-      throw ERR;
-    });
-
-    assert.strictEqual(form.pause(), false);
-  })();
-
-  (function testResume() {
-    gently.expect(REQ, 'resume');
-    assert.strictEqual(form.resume(), true);
-  })();
-
-  (function testResumeCriticalException() {
-    form.ended = false;
-
-    var ERR = new Error('dasdsa');
-    gently.expect(REQ, 'resume', function() {
-      throw ERR;
-    });
-
-    gently.expect(form, '_error', function(err) {
-      assert.strictEqual(err, ERR);
-    });
-
-    assert.strictEqual(form.resume(), false);
-  })();
-
-  (function testResumeHarmlessException() {
-    form.ended = true;
-
-    var ERR = new Error('dasdsa');
-    gently.expect(REQ, 'resume', function() {
-      throw ERR;
-    });
-
-    assert.strictEqual(form.resume(), false);
-  })();
-
-  (function testEmitError() {
-    var ERR = new Error('something bad happened');
-    gently.expect(form, '_error',function(err) {
-      assert.strictEqual(err, ERR);
-    });
-    emit.error(ERR);
-  })();
-
-  (function testEmitAborted() {
-    gently.expect(form, 'emit',function(event) {
-      assert.equal(event, 'aborted');
-    });
-
-    emit.aborted();
-  })();
-
-
-  (function testEmitData() {
-    var BUFFER = [1, 2, 3];
-    gently.expect(form, 'write', function(buffer) {
-      assert.strictEqual(buffer, BUFFER);
-    });
-    emit.data(BUFFER);
-  })();
-
-  (function testEmitEnd() {
-    form._parser = {};
-
-    (function testWithError() {
-      var ERR = new Error('haha');
-      gently.expect(form._parser, 'end', function() {
-        return ERR;
-      });
-
-      gently.expect(form, '_error', function(err) {
-        assert.strictEqual(err, ERR);
-      });
-
-      emit.end();
-    })();
-
-    (function testWithoutError() {
-      gently.expect(form._parser, 'end');
-      emit.end();
-    })();
-
-    (function testAfterError() {
-      form.error = true;
-      emit.end();
-    })();
-  })();
-
-  (function testWithCallback() {
-    gently.expect(EventEmitterStub, 'call');
-    var form = new IncomingForm(),
-        REQ = {headers: {}},
-        parseCalled = 0;
-
-    gently.expect(form, 'writeHeaders');
-    gently.expect(REQ, 'on', 4, function() {
-      return this;
-    });
-
-    gently.expect(form, 'on', 4, function(event, fn) {
-      if (event == 'field') {
-        fn('field1', 'foo');
-        fn('field1', 'bar');
-        fn('field2', 'nice');
-      }
-
-      if (event == 'file') {
-        fn('file1', '1');
-        fn('file1', '2');
-        fn('file2', '3');
-      }
-
-      if (event == 'end') {
-        fn();
-      }
-      return this;
-    });
-
-    form.parse(REQ, gently.expect(function parseCbOk(err, fields, files) {
-      assert.deepEqual(fields, {field1: 'bar', field2: 'nice'});
-      assert.deepEqual(files, {file1: '2', file2: '3'});
-    }));
-
-    gently.expect(form, 'writeHeaders');
-    gently.expect(REQ, 'on', 4, function() {
-      return this;
-    });
-
-    var ERR = new Error('test');
-    gently.expect(form, 'on', 3, function(event, fn) {
-      if (event == 'field') {
-        fn('foo', 'bar');
-      }
-
-      if (event == 'error') {
-        fn(ERR);
-        gently.expect(form, 'on');
-      }
-      return this;
-    });
-
-    form.parse(REQ, gently.expect(function parseCbErr(err, fields, files) {
-      assert.strictEqual(err, ERR);
-      assert.deepEqual(fields, {foo: 'bar'});
-    }));
-  })();
-});
-
-test(function pause() {
-  assert.strictEqual(form.pause(), false);
-});
-
-test(function resume() {
-  assert.strictEqual(form.resume(), false);
-});
-
-
-test(function writeHeaders() {
-  var HEADERS = {};
-  gently.expect(form, '_parseContentLength');
-  gently.expect(form, '_parseContentType');
-
-  form.writeHeaders(HEADERS);
-  assert.strictEqual(form.headers, HEADERS);
-});
-
-test(function write() {
-  var parser = {},
-      BUFFER = [1, 2, 3];
-
-  form._parser = parser;
-  form.bytesExpected = 523423;
-
-  (function testBasic() {
-    gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {
-      assert.equal(event, 'progress');
-      assert.equal(bytesReceived, BUFFER.length);
-      assert.equal(bytesExpected, form.bytesExpected);
-    });
-
-    gently.expect(parser, 'write', function(buffer) {
-      assert.strictEqual(buffer, BUFFER);
-      return buffer.length;
-    });
-
-    assert.equal(form.write(BUFFER), BUFFER.length);
-    assert.equal(form.bytesReceived, BUFFER.length);
-  })();
-
-  (function testParserError() {
-    gently.expect(form, 'emit');
-
-    gently.expect(parser, 'write', function(buffer) {
-      assert.strictEqual(buffer, BUFFER);
-      return buffer.length - 1;
-    });
-
-    gently.expect(form, '_error', function(err) {
-      assert.ok(err.message.match(/parser error/i));
-    });
-
-    assert.equal(form.write(BUFFER), BUFFER.length - 1);
-    assert.equal(form.bytesReceived, BUFFER.length + BUFFER.length);
-  })();
-
-  (function testUninitialized() {
-    delete form._parser;
-
-    gently.expect(form, '_error', function(err) {
-      assert.ok(err.message.match(/unintialized parser/i));
-    });
-    form.write(BUFFER);
-  })();
-});
-
-test(function parseContentType() {
-  var HEADERS = {};
-
-  form.headers = {'content-type': 'application/x-www-form-urlencoded'};
-  gently.expect(form, '_initUrlencoded');
-  form._parseContentType();
-
-  // accept anything that has 'urlencoded' in it
-  form.headers = {'content-type': 'broken-client/urlencoded-stupid'};
-  gently.expect(form, '_initUrlencoded');
-  form._parseContentType();
-
-  var BOUNDARY = '---------------------------57814261102167618332366269';
-  form.headers = {'content-type': 'multipart/form-data; boundary='+BOUNDARY};
-
-  gently.expect(form, '_initMultipart', function(boundary) {
-    assert.equal(boundary, BOUNDARY);
-  });
-  form._parseContentType();
-
-  (function testQuotedBoundary() {
-    form.headers = {'content-type': 'multipart/form-data; boundary="' + BOUNDARY + '"'};
-
-    gently.expect(form, '_initMultipart', function(boundary) {
-      assert.equal(boundary, BOUNDARY);
-    });
-    form._parseContentType();
-  })();
-
-  (function testNoBoundary() {
-    form.headers = {'content-type': 'multipart/form-data'};
-
-    gently.expect(form, '_error', function(err) {
-      assert.ok(err.message.match(/no multipart boundary/i));
-    });
-    form._parseContentType();
-  })();
-
-  (function testNoContentType() {
-    form.headers = {};
-
-    gently.expect(form, '_error', function(err) {
-      assert.ok(err.message.match(/no content-type/i));
-    });
-    form._parseContentType();
-  })();
-
-  (function testUnknownContentType() {
-    form.headers = {'content-type': 'invalid'};
-
-    gently.expect(form, '_error', function(err) {
-      assert.ok(err.message.match(/unknown content-type/i));
-    });
-    form._parseContentType();
-  })();
-});
-
-test(function parseContentLength() {
-  var HEADERS = {};
-
-  form.headers = {};
-  form._parseContentLength();
-  assert.strictEqual(form.bytesReceived, null);
-  assert.strictEqual(form.bytesExpected, null);
-
-  form.headers['content-length'] = '8';
-  gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {
-    assert.equal(event, 'progress');
-    assert.equal(bytesReceived, 0);
-    assert.equal(bytesExpected, 8);
-  });
-  form._parseContentLength();
-  assert.strictEqual(form.bytesReceived, 0);
-  assert.strictEqual(form.bytesExpected, 8);
-
-  // JS can be evil, lets make sure we are not
-  form.headers['content-length'] = '08';
-  gently.expect(form, 'emit', function(event, bytesReceived, bytesExpected) {
-    assert.equal(event, 'progress');
-    assert.equal(bytesReceived, 0);
-    assert.equal(bytesExpected, 8);
-  });
-  form._parseContentLength();
-  assert.strictEqual(form.bytesExpected, 8);
-});
-
-test(function _initMultipart() {
-  var BOUNDARY = '123',
-      PARSER;
-
-  gently.expect(MultipartParserStub, 'new', function() {
-    PARSER = this;
-  });
-
-  gently.expect(MultipartParserStub.prototype, 'initWithBoundary', function(boundary) {
-    assert.equal(boundary, BOUNDARY);
-  });
-
-  form._initMultipart(BOUNDARY);
-  assert.equal(form.type, 'multipart');
-  assert.strictEqual(form._parser, PARSER);
-
-  (function testRegularField() {
-    var PART;
-    gently.expect(StreamStub, 'new', function() {
-      PART = this;
-    });
-
-    gently.expect(form, 'onPart', function(part) {
-      assert.strictEqual(part, PART);
-      assert.deepEqual
-        ( part.headers
-        , { 'content-disposition': 'form-data; name="field1"'
-          , 'foo': 'bar'
-          }
-        );
-      assert.equal(part.name, 'field1');
-
-      var strings = ['hello', ' world'];
-      gently.expect(part, 'emit', 2, function(event, b) {
-          assert.equal(event, 'data');
-          assert.equal(b.toString(), strings.shift());
-      });
-
-      gently.expect(part, 'emit', function(event, b) {
-          assert.equal(event, 'end');
-      });
-    });
-
-    PARSER.onPartBegin();
-    PARSER.onHeaderField(new Buffer('content-disposition'), 0, 10);
-    PARSER.onHeaderField(new Buffer('content-disposition'), 10, 19);
-    PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 0, 14);
-    PARSER.onHeaderValue(new Buffer('form-data; name="field1"'), 14, 24);
-    PARSER.onHeaderEnd();
-    PARSER.onHeaderField(new Buffer('foo'), 0, 3);
-    PARSER.onHeaderValue(new Buffer('bar'), 0, 3);
-    PARSER.onHeaderEnd();
-    PARSER.onHeadersEnd();
-    PARSER.onPartData(new Buffer('hello world'), 0, 5);
-    PARSER.onPartData(new Buffer('hello world'), 5, 11);
-    PARSER.onPartEnd();
-  })();
-
-  (function testFileField() {
-    var PART;
-    gently.expect(StreamStub, 'new', function() {
-      PART = this;
-    });
-
-    gently.expect(form, 'onPart', function(part) {
-      assert.deepEqual
-        ( part.headers
-        , { 'content-disposition': 'form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'
-          , 'content-type': 'text/plain'
-          }
-        );
-      assert.equal(part.name, 'field2');
-      assert.equal(part.filename, 'Sun"et.jpg');
-      assert.equal(part.mime, 'text/plain');
-
-      gently.expect(part, 'emit', function(event, b) {
-        assert.equal(event, 'data');
-        assert.equal(b.toString(), '... contents of file1.txt ...');
-      });
-
-      gently.expect(part, 'emit', function(event, b) {
-          assert.equal(event, 'end');
-      });
-    });
-
-    PARSER.onPartBegin();
-    PARSER.onHeaderField(new Buffer('content-disposition'), 0, 19);
-    PARSER.onHeaderValue(new Buffer('form-data; name="field2"; filename="C:\\Documents and Settings\\IE\\Must\\Die\\Sun"et.jpg"'), 0, 85);
-    PARSER.onHeaderEnd();
-    PARSER.onHeaderField(new Buffer('Content-Type'), 0, 12);
-    PARSER.onHeaderValue(new Buffer('text/plain'), 0, 10);
-    PARSER.onHeaderEnd();
-    PARSER.onHeadersEnd();
-    PARSER.onPartData(new Buffer('... contents of file1.txt ...'), 0, 29);
-    PARSER.onPartEnd();
-  })();
-
-  (function testEnd() {
-    gently.expect(form, '_maybeEnd');
-    PARSER.onEnd();
-    assert.ok(form.ended);
-  })();
-});
-
-test(function _fileName() {
-  // TODO
-  return;
-});
-
-test(function _initUrlencoded() {
-  var PARSER;
-
-  gently.expect(QuerystringParserStub, 'new', function() {
-    PARSER = this;
-  });
-
-  form._initUrlencoded();
-  assert.equal(form.type, 'urlencoded');
-  assert.strictEqual(form._parser, PARSER);
-
-  (function testOnField() {
-    var KEY = 'KEY', VAL = 'VAL';
-    gently.expect(form, 'emit', function(field, key, val) {
-      assert.equal(field, 'field');
-      assert.equal(key, KEY);
-      assert.equal(val, VAL);
-    });
-
-    PARSER.onField(KEY, VAL);
-  })();
-
-  (function testOnEnd() {
-    gently.expect(form, '_maybeEnd');
-
-    PARSER.onEnd();
-    assert.equal(form.ended, true);
-  })();
-});
-
-test(function _error() {
-  var ERR = new Error('bla');
-
-  gently.expect(form, 'pause');
-  gently.expect(form, 'emit', function(event, err) {
-    assert.equal(event, 'error');
-    assert.strictEqual(err, ERR);
-  });
-
-  form._error(ERR);
-  assert.strictEqual(form.error, ERR);
-
-  // make sure _error only does its thing once
-  form._error(ERR);
-});
-
-test(function onPart() {
-  var PART = {};
-  gently.expect(form, 'handlePart', function(part) {
-    assert.strictEqual(part, PART);
-  });
-
-  form.onPart(PART);
-});
-
-test(function handlePart() {
-  (function testUtf8Field() {
-    var PART = new events.EventEmitter();
-    PART.name = 'my_field';
-
-    gently.expect(form, 'emit', function(event, field, value) {
-      assert.equal(event, 'field');
-      assert.equal(field, 'my_field');
-      assert.equal(value, 'hello world: €');
-    });
-
-    form.handlePart(PART);
-    PART.emit('data', new Buffer('hello'));
-    PART.emit('data', new Buffer(' world: '));
-    PART.emit('data', new Buffer([0xE2]));
-    PART.emit('data', new Buffer([0x82, 0xAC]));
-    PART.emit('end');
-  })();
-
-  (function testBinaryField() {
-    var PART = new events.EventEmitter();
-    PART.name = 'my_field2';
-
-    gently.expect(form, 'emit', function(event, field, value) {
-      assert.equal(event, 'field');
-      assert.equal(field, 'my_field2');
-      assert.equal(value, 'hello world: '+new Buffer([0xE2, 0x82, 0xAC]).toString('binary'));
-    });
-
-    form.encoding = 'binary';
-    form.handlePart(PART);
-    PART.emit('data', new Buffer('hello'));
-    PART.emit('data', new Buffer(' world: '));
-    PART.emit('data', new Buffer([0xE2]));
-    PART.emit('data', new Buffer([0x82, 0xAC]));
-    PART.emit('end');
-  })();
-
-  (function testFieldSize() {
-    form.maxFieldsSize = 8;
-    var PART = new events.EventEmitter();
-    PART.name = 'my_field';
-
-    gently.expect(form, '_error', function(err) {
-      assert.equal(err.message, 'maxFieldsSize exceeded, received 9 bytes of field data');
-    });
-
-    form.handlePart(PART);
-    form._fieldsSize = 1;
-    PART.emit('data', new Buffer(7));
-    PART.emit('data', new Buffer(1));
-  })();
-
-  (function testFilePart() {
-    var PART = new events.EventEmitter(),
-        FILE = new events.EventEmitter(),
-        PATH = '/foo/bar';
-
-    PART.name = 'my_file';
-    PART.filename = 'sweet.txt';
-    PART.mime = 'sweet.txt';
-
-    gently.expect(form, '_uploadPath', function(filename) {
-      assert.equal(filename, PART.filename);
-      return PATH;
-    });
-
-    gently.expect(FileStub, 'new', function(properties) {
-      assert.equal(properties.path, PATH);
-      assert.equal(properties.name, PART.filename);
-      assert.equal(properties.type, PART.mime);
-      FILE = this;
-
-      gently.expect(form, 'emit', function (event, field, file) {
-        assert.equal(event, 'fileBegin');
-        assert.strictEqual(field, PART.name);
-        assert.strictEqual(file, FILE);
-      });
-
-      gently.expect(FILE, 'open');
-    });
-
-    form.handlePart(PART);
-    assert.equal(form._flushing, 1);
-
-    var BUFFER;
-    gently.expect(form, 'pause');
-    gently.expect(FILE, 'write', function(buffer, cb) {
-      assert.strictEqual(buffer, BUFFER);
-      gently.expect(form, 'resume');
-      // @todo handle cb(new Err)
-      cb();
-    });
-
-    PART.emit('data', BUFFER = new Buffer('test'));
-
-    gently.expect(FILE, 'end', function(cb) {
-      gently.expect(form, 'emit', function(event, field, file) {
-        assert.equal(event, 'file');
-        assert.strictEqual(file, FILE);
-      });
-
-      gently.expect(form, '_maybeEnd');
-
-      cb();
-      assert.equal(form._flushing, 0);
-    });
-
-    PART.emit('end');
-  })();
-});
-
-test(function _uploadPath() {
-  (function testUniqueId() {
-    var UUID_A, UUID_B;
-    gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) {
-      assert.equal(uploadDir, form.uploadDir);
-      UUID_A = uuid;
-    });
-    form._uploadPath();
-
-    gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, uuid) {
-      UUID_B = uuid;
-    });
-    form._uploadPath();
-
-    assert.notEqual(UUID_A, UUID_B);
-  })();
-
-  (function testFileExtension() {
-    form.keepExtensions = true;
-    var FILENAME = 'foo.jpg',
-        EXT = '.bar';
-
-    gently.expect(GENTLY.hijacked.path, 'extname', function(filename) {
-      assert.equal(filename, FILENAME);
-      gently.restore(path, 'extname');
-
-      return EXT;
-    });
-
-    gently.expect(GENTLY.hijacked.path, 'join', function(uploadDir, name) {
-      assert.equal(path.extname(name), EXT);
-    });
-    form._uploadPath(FILENAME);
-  })();
-});
-
-test(function _maybeEnd() {
-  gently.expect(form, 'emit', 0);
-  form._maybeEnd();
-
-  form.ended = true;
-  form._flushing = 1;
-  form._maybeEnd();
-
-  gently.expect(form, 'emit', function(event) {
-    assert.equal(event, 'end');
-  });
-
-  form.ended = true;
-  form._flushing = 0;
-  form._maybeEnd();
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js
deleted file mode 100644
index d8dc968..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js
+++ /dev/null
@@ -1,50 +0,0 @@
-var common = require('../common');
-var multipartParser = require(common.lib + '/multipart_parser'),
-    MultipartParser = multipartParser.MultipartParser,
-    events = require('events'),
-    Buffer = require('buffer').Buffer,
-    parser;
-
-function test(test) {
-  parser = new MultipartParser();
-  test();
-}
-
-test(function constructor() {
-  assert.equal(parser.boundary, null);
-  assert.equal(parser.state, 0);
-  assert.equal(parser.flags, 0);
-  assert.equal(parser.boundaryChars, null);
-  assert.equal(parser.index, null);
-  assert.equal(parser.lookbehind, null);
-  assert.equal(parser.constructor.name, 'MultipartParser');
-});
-
-test(function initWithBoundary() {
-  var boundary = 'abc';
-  parser.initWithBoundary(boundary);
-  assert.deepEqual(Array.prototype.slice.call(parser.boundary), [13, 10, 45, 45, 97, 98, 99]);
-  assert.equal(parser.state, multipartParser.START);
-
-  assert.deepEqual(parser.boundaryChars, {10: true, 13: true, 45: true, 97: true, 98: true, 99: true});
-});
-
-test(function parserError() {
-  var boundary = 'abc',
-      buffer = new Buffer(5);
-
-  parser.initWithBoundary(boundary);
-  buffer.write('--ad', 'ascii', 0);
-  assert.equal(parser.write(buffer), 3);
-});
-
-test(function end() {
-  (function testError() {
-    assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain());
-  })();
-
-  (function testRegular() {
-    parser.state = multipartParser.END;
-    assert.strictEqual(parser.end(), undefined);
-  })();
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js
deleted file mode 100644
index 54d3e2d..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var common = require('../common');
-var QuerystringParser = require(common.lib + '/querystring_parser').QuerystringParser,
-    Buffer = require('buffer').Buffer,
-    gently,
-    parser;
-
-function test(test) {
-  gently = new Gently();
-  parser = new QuerystringParser();
-  test();
-  gently.verify(test.name);
-}
-
-test(function constructor() {
-  assert.equal(parser.buffer, '');
-  assert.equal(parser.constructor.name, 'QuerystringParser');
-});
-
-test(function write() {
-  var a = new Buffer('a=1');
-  assert.equal(parser.write(a), a.length);
-
-  var b = new Buffer('&b=2');
-  parser.write(b);
-  assert.equal(parser.buffer, a + b);
-});
-
-test(function end() {
-  var FIELDS = {a: ['b', {c: 'd'}], e: 'f'};
-
-  gently.expect(GENTLY.hijacked.querystring, 'parse', function(str) {
-    assert.equal(str, parser.buffer);
-    return FIELDS;
-  });
-
-  gently.expect(parser, 'onField', Object.keys(FIELDS).length, function(key, val) {
-    assert.deepEqual(FIELDS[key], val);
-  });
-
-  gently.expect(parser, 'onEnd');
-
-  parser.buffer = 'my buffer';
-  parser.end();
-  assert.equal(parser.buffer, '');
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js
deleted file mode 100644
index 479e46d..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js
+++ /dev/null
@@ -1,75 +0,0 @@
-var common = require('../common');
-var BOUNDARY = '---------------------------10102754414578508781458777923',
-    FIXTURE = TEST_FIXTURES+'/multi_video.upload',
-    fs = require('fs'),
-    util = require(common.lib + '/util'),
-    http = require('http'),
-    formidable = require(common.lib + '/index'),
-    server = http.createServer();
-
-server.on('request', function(req, res) {
-  var form = new formidable.IncomingForm(),
-      uploads = {};
-
-  form.uploadDir = TEST_TMP;
-  form.hash = 'sha1';
-  form.parse(req);
-
-  form
-    .on('fileBegin', function(field, file) {
-      assert.equal(field, 'upload');
-
-      var tracker = {file: file, progress: [], ended: false};
-      uploads[file.filename] = tracker;
-      file
-        .on('progress', function(bytesReceived) {
-          tracker.progress.push(bytesReceived);
-          assert.equal(bytesReceived, file.length);
-        })
-        .on('end', function() {
-          tracker.ended = true;
-        });
-    })
-    .on('field', function(field, value) {
-      assert.equal(field, 'title');
-      assert.equal(value, '');
-    })
-    .on('file', function(field, file) {
-      assert.equal(field, 'upload');
-      assert.strictEqual(uploads[file.filename].file, file);
-    })
-    .on('end', function() {
-      assert.ok(uploads['shortest_video.flv']);
-      assert.ok(uploads['shortest_video.flv'].ended);
-      assert.ok(uploads['shortest_video.flv'].progress.length > 3);
-      assert.equal(uploads['shortest_video.flv'].file.hash, 'd6a17616c7143d1b1438ceeef6836d1a09186b3a');
-      assert.equal(uploads['shortest_video.flv'].progress.slice(-1), uploads['shortest_video.flv'].file.length);
-      assert.ok(uploads['shortest_video.mp4']);
-      assert.ok(uploads['shortest_video.mp4'].ended);
-      assert.ok(uploads['shortest_video.mp4'].progress.length > 3);
-      assert.equal(uploads['shortest_video.mp4'].file.hash, '937dfd4db263f4887ceae19341dcc8d63bcd557f');
-
-      server.close();
-      res.writeHead(200);
-      res.end('good');
-    });
-});
-
-server.listen(TEST_PORT, function() {
-  var client = http.createClient(TEST_PORT),
-      stat = fs.statSync(FIXTURE),
-      headers = {
-        'content-type': 'multipart/form-data; boundary='+BOUNDARY,
-        'content-length': stat.size,
-      }
-      request = client.request('POST', '/', headers),
-      fixture = new fs.ReadStream(FIXTURE);
-
-  fixture
-    .on('data', function(b) {
-      request.write(b);
-    })
-    .on('end', function() {
-      request.end();
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js
deleted file mode 100755
index 50b2361..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/env node
-require('urun')(__dirname)

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js
deleted file mode 100644
index fe2ac1c..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js
+++ /dev/null
@@ -1,63 +0,0 @@
-var common       = require('../common');
-var test         = require('utest');
-var assert       = common.assert;
-var IncomingForm = common.require('incoming_form').IncomingForm;
-var path         = require('path');
-
-var form;
-test('IncomingForm', {
-  before: function() {
-    form = new IncomingForm();
-  },
-
-  '#_fileName with regular characters': function() {
-    var filename = 'foo.txt';
-    assert.equal(form._fileName(makeHeader(filename)), 'foo.txt');
-  },
-
-  '#_fileName with unescaped quote': function() {
-    var filename = 'my".txt';
-    assert.equal(form._fileName(makeHeader(filename)), 'my".txt');
-  },
-
-  '#_fileName with escaped quote': function() {
-    var filename = 'my%22.txt';
-    assert.equal(form._fileName(makeHeader(filename)), 'my".txt');
-  },
-
-  '#_fileName with bad quote and additional sub-header': function() {
-    var filename = 'my".txt';
-    var header = makeHeader(filename) + '; foo="bar"';
-    assert.equal(form._fileName(header), filename);
-  },
-
-  '#_fileName with semicolon': function() {
-    var filename = 'my;.txt';
-    assert.equal(form._fileName(makeHeader(filename)), 'my;.txt');
-  },
-
-  '#_fileName with utf8 character': function() {
-    var filename = 'my&#9731;.txt';
-    assert.equal(form._fileName(makeHeader(filename)), 'my☃.txt');
-  },
-
-  '#_uploadPath strips harmful characters from extension when keepExtensions': function() {
-    form.keepExtensions = true;
-
-    var ext = path.extname(form._uploadPath('fine.jpg?foo=bar'));
-    assert.equal(ext, '.jpg');
-
-    var ext = path.extname(form._uploadPath('fine?foo=bar'));
-    assert.equal(ext, '');
-
-    var ext = path.extname(form._uploadPath('super.cr2+dsad'));
-    assert.equal(ext, '.cr2');
-
-    var ext = path.extname(form._uploadPath('super.bar'));
-    assert.equal(ext, '.bar');
-  },
-});
-
-function makeHeader(filename) {
-  return 'Content-Disposition: form-data; name="upload"; filename="' + filename + '"';
-}

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js b/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js
deleted file mode 100644
index 9f1cef8..0000000
--- a/weinre.server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js
+++ /dev/null
@@ -1,47 +0,0 @@
-var http = require('http');
-var fs = require('fs');
-var connections = 0;
-
-var server = http.createServer(function(req, res) {
-  var socket = req.socket;
-  console.log('Request: %s %s -> %s', req.method, req.url, socket.filename);
-
-  req.on('end', function() {
-    if (req.url !== '/') {
-      res.end(JSON.stringify({
-        method: req.method,
-        url: req.url,
-        filename: socket.filename,
-      }));
-      return;
-    }
-
-    res.writeHead(200, {'content-type': 'text/html'});
-    res.end(
-      '<form action="/upload" enctype="multipart/form-data" method="post">'+
-      '<input type="text" name="title"><br>'+
-      '<input type="file" name="upload" multiple="multiple"><br>'+
-      '<input type="submit" value="Upload">'+
-      '</form>'
-    );
-  });
-});
-
-server.on('connection', function(socket) {
-  connections++;
-
-  socket.id = connections;
-  socket.filename = 'connection-' + socket.id + '.http';
-  socket.file = fs.createWriteStream(socket.filename);
-  socket.pipe(socket.file);
-
-  console.log('--> %s', socket.filename);
-  socket.on('close', function() {
-    console.log('<-- %s', socket.filename);
-  });
-});
-
-var port = process.env.PORT || 8080;
-server.listen(port, function() {
-  console.log('Recording connections on port %s', port);
-});

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/package.json b/weinre.server/node_modules/express/node_modules/connect/package.json
index 50ef2b3..806713e 100644
--- a/weinre.server/node_modules/express/node_modules/connect/package.json
+++ b/weinre.server/node_modules/express/node_modules/connect/package.json
@@ -1,6 +1,6 @@
 {
   "name": "connect",
-  "version": "1.9.1",
+  "version": "1.9.2",
   "description": "High performance middleware framework",
   "keywords": [
     "framework",
@@ -36,6 +36,11 @@
     "tag": "1.8"
   },
   "main": "index",
-  "_id": "connect@1.9.1",
+  "bugs": {
+    "url": "https://github.com/senchalabs/connect/issues"
+  },
+  "readme": "ERROR: No README data found!",
+  "homepage": "https://github.com/senchalabs/connect",
+  "_id": "connect@1.9.2",
   "_from": "connect@1.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/connect/test.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/connect/test.js b/weinre.server/node_modules/express/node_modules/connect/test.js
index ff020e1..106ddd1 100644
--- a/weinre.server/node_modules/express/node_modules/connect/test.js
+++ b/weinre.server/node_modules/express/node_modules/connect/test.js
@@ -1,30 +1,15 @@
-var connect = require('./');
-var app = connect();
-
-function delay(ms) {
-  return function(req, res, next){
-    setTimeout(next, ms);
-  }
-}
 
-var set = true
-setTimeout(function(){
-  set = false;
-  console.log('setting');
-}, 3000);
-app.use(connect.logger('dev'));
-app.use(connect.staticCache());
-app.use(function(req, res, next){
-  if (set) {
-    console.log('setting cookie');
-    res.setHeader('Set-Cookie', 'name=tj');
-  }
-  next();
-});
-app.use(connect.static(__dirname, { maxAge: 100000 }));
+/**
+ * Module dependencies.
+ */
 
-app.listen(3000);
+var connect = require('./');
 
-// 8500 without
-// 8300 with
-// 6100 with cookie 7500 without signed check
\ No newline at end of file
+var app = connect()
+  .use(connect.logger('dev'))
+  .use(function(req, res){
+    var body = Array(3222).join('hey');
+    res.setHeader('Content-Length', body.length);
+    res.end(body);
+  })
+  .listen(3000);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/mime/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/mime/package.json b/weinre.server/node_modules/express/node_modules/mime/package.json
index 0c6ca5a..3767a4e 100644
--- a/weinre.server/node_modules/express/node_modules/mime/package.json
+++ b/weinre.server/node_modules/express/node_modules/mime/package.json
@@ -28,9 +28,15 @@
   },
   "version": "1.2.4",
   "readme": "# mime\n\nSupport for mapping between file extensions and MIME types.  This module uses the latest version of the Apache \"mime.types\" file (maps over 620 types to 800+ extensions).  It is also trivially easy to add your own types and extensions, should you need to do that.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n    npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file. This is method is case-insensitive. Everything in path up to and including the last '/' or '.' is ignored, so you can pass it paths, filenames, or extensions, like so:\n\n    var mime = require('mime');\n\n    mime.lookup('/path/to/file.txt');         // => 'text/plain'\n    mime.lookup('file.txt');                  // => 'text/plain'\n    mime.lookup('.txt');                      // => 'text/plain'\n    mime.lookup('htm');                       // => 'text/html'\n\n### mime.extension(type) - lookup the default extension fo
 r type\n\n    mime.extension('text/html');                 // => 'html'\n    mime.extension('application/octet-stream');  // => 'bin'\n\n### mime.charsets.lookup() - map mime-type to charset\n\n    mime.charsets.lookup('text/plain');        // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)\n\n## API - Customizing\n\nThe following APIs allow you to add your own type mappings within your project.  If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/bentomas/node-mime/wiki/Requesting-New-Types).\n### mime.define() - Add custom mime/extension mappings\n\n    mime.define({\n        'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n        'application/x-my-type': ['x-mt', 'x-mtt'],\n        // etc ...\n    });\n\n    mime.lookup('x-sft');                 // => 'text/x-some-format'\n    mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath) - Load mappin
 gs from an Apache \".types\" format file\n\n    mime.load('./my_project.types');\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/bentomas/node-mime/issues"
+  },
+  "homepage": "https://github.com/bentomas/node-mime",
   "_id": "mime@1.2.4",
   "dist": {
-    "shasum": "708279b96036d1c56908f9d9ad04cae489690c19"
+    "shasum": "0f1a0da8e2ce35e5da7d1993f07528448e4af08f"
   },
-  "_from": "mime@1.2.4"
+  "_from": "mime@1.2.4",
+  "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.4.tgz"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/mkdirp/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/mkdirp/package.json b/weinre.server/node_modules/express/node_modules/mkdirp/package.json
index fb0c993..7863886 100644
--- a/weinre.server/node_modules/express/node_modules/mkdirp/package.json
+++ b/weinre.server/node_modules/express/node_modules/mkdirp/package.json
@@ -27,9 +27,11 @@
     "node": "*"
   },
   "readme": "mkdirp\n======\n\nLike `mkdir -p`, but in node.js!\n\nexample\n=======\n\npow.js\n------\n    var mkdirp = require('mkdirp');\n    \n    mkdirp('/tmp/foo/bar/baz', function (err) {\n        if (err) console.error(err)\n        else console.log('pow!')\n    });\n\nOutput\n    pow!\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\nmethods\n=======\n\nvar mkdirp = require('mkdirp');\n\nmkdirp(dir, mode, cb)\n---------------------\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nmkdirp.sync(dir, mode)\n----------------------\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n    npm install mkdirp\n\nlicense\n=======\n\nMIT/X11\n",
-  "_id": "mkdirp@0.3.0",
-  "dist": {
-    "shasum": "d42b304feca2923700b59953afc6b802be335daa"
+  "readmeFilename": "README.markdown",
+  "bugs": {
+    "url": "https://github.com/substack/node-mkdirp/issues"
   },
+  "homepage": "https://github.com/substack/node-mkdirp",
+  "_id": "mkdirp@0.3.0",
   "_from": "mkdirp@0.3.0"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/node_modules/qs/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/node_modules/qs/package.json b/weinre.server/node_modules/express/node_modules/qs/package.json
index 3a488f1..706b904 100644
--- a/weinre.server/node_modules/express/node_modules/qs/package.json
+++ b/weinre.server/node_modules/express/node_modules/qs/package.json
@@ -19,6 +19,12 @@
   "engines": {
     "node": "*"
   },
+  "readme": "# node-querystring\n\n  query string parser for node supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n    $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n    $ npm install -d\n\nand execute:\n\n    $ make test\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated 
 documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/visionmedia/node-querystring/issues"
+  },
+  "homepage": "https://github.com/visionmedia/node-querystring",
   "_id": "qs@0.4.2",
   "_from": "qs@0.4.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/package.json b/weinre.server/node_modules/express/package.json
index 9445014..3b8ab64 100644
--- a/weinre.server/node_modules/express/package.json
+++ b/weinre.server/node_modules/express/package.json
@@ -1,7 +1,7 @@
 {
   "name": "express",
   "description": "Sinatra inspired web development framework",
-  "version": "2.5.10",
+  "version": "2.5.11",
   "author": {
     "name": "TJ Holowaychuk",
     "email": "tj@vision-media.ca"
@@ -61,6 +61,12 @@
     "test": "make test",
     "prepublish": "npm prune"
   },
-  "_id": "express@2.5.10",
+  "readme": "\n# Express\n      \n  Insanely fast (and small) server-side JavaScript web development framework\n  built on [node](http://nodejs.org) and [Connect](http://github.com/senchalabs/connect).\n  \n     var app = express.createServer();\n     \n     app.get('/', function(req, res){\n       res.send('Hello World');\n     });\n     \n     app.listen(3000);\n\n## Installation\n\n    $ npm install express\n\nor to access the `express(1)` executable install globally:\n\n    $ npm install -g express\n\n## Quick Start\n\n The quickest way to get started with express is to utilize the executable `express(1)` to generate an application as shown below:\n\n Create the app:\n\n    $ npm install -g express\n    $ express /tmp/foo && cd /tmp/foo\n\n Install dependencies:\n\n    $ npm install -d\n\n Start the server:\n\n    $ node app.js\n\n## Features\n\n  * Robust routing\n  * Redirection helpers\n  * Dynamic view helpers\n  * Content negotiation\n  * Focus on high performance\n  * View
  rendering and partials support\n  * Environment based configuration\n  * Session based flash notifications\n  * Built on [Connect](http://github.com/senchalabs/connect)\n  * High test coverage\n  * Executable for generating applications quickly\n  * Application level view options\n\nVia Connect:\n\n  * Session support\n  * Cache API\n  * Mime helpers\n  * ETag support\n  * Persistent flash notifications\n  * Cookie support\n  * JSON-RPC\n  * Logging\n  * and _much_ more!\n\n## Contributors\n\nThe following are the major contributors of Express (in no specific order).\n\n  * TJ Holowaychuk ([visionmedia](http://github.com/visionmedia))\n  * Ciaran Jessup ([ciaranj](http://github.com/ciaranj))\n  * Aaron Heckmann ([aheckmann](http://github.com/aheckmann))\n  * Guillermo Rauch ([guille](http://github.com/guille))\n\n## More Information\n\n  * #express on freenode\n  * [express-expose](http://github.com/visionmedia/express-expose) expose objects, functions, modules and more to client-s
 ide js with ease\n  * [express-configure](http://github.com/visionmedia/express-configuration) async configuration support\n  * [express-messages](http://github.com/visionmedia/express-messages) flash notification rendering helper\n  * [express-namespace](http://github.com/visionmedia/express-namespace) namespaced route support\n  * [express-params](https://github.com/visionmedia/express-params) param pre-condition functions\n  * [express-mongoose](https://github.com/LearnBoost/express-mongoose) plugin for easy rendering of Mongoose async Query results\n  * Follow [tjholowaychuk](http://twitter.com/tjholowaychuk) on twitter for updates\n  * [Google Group](http://groups.google.com/group/express-js) for discussion\n  * Visit the [Wiki](http://github.com/visionmedia/express/wiki)\n  * [日本語ドキュメンテーション](http://hideyukisaito.com/doc/expressjs/) by [hideyukisaito](https://github.com/hideyukisaito)\n  * Screencast - [Introduction](http://bit.ly/eRYu0O)\n  * Screenca
 st - [View Partials](http://bit.ly/dU13Fx)\n  * Screencast - [Route Specific Middleware](http://bit.ly/hX4IaH)\n  * Screencast - [Route Path Placeholder Preconditions](http://bit.ly/eNqmVs)\n\n## Node Compatibility\n\nExpress 1.x is compatible with node 0.2.x and connect < 1.0.\n\nExpress 2.x is compatible with node 0.4.x or 0.6.x, and connect 1.x\n\nExpress 3.x (master) will be compatible with node 0.6.x and connect 2.x\n\n## Viewing Examples\n\nFirst install the dev dependencies to install all the example / test suite deps:\n\n    $ npm install\n\nthen run whichever tests you want:\n\n    $ node examples/jade/app.js\n\n## Running Tests\n\nTo run the test suite first invoke the following command within the repo, installing the development dependencies:\n\n    $ npm install\n\nthen run the tests:\n\n    $ make test\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2009-2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person ob
 taining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/visionmedia/express/issues"
+  },
+  "homepage": "https://github.com/visionmedia/express",
+  "_id": "express@2.5.11",
   "_from": "express@2.5.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/express/test.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/express/test.js b/weinre.server/node_modules/express/test.js
index 925d270..1f5ac01 100644
--- a/weinre.server/node_modules/express/test.js
+++ b/weinre.server/node_modules/express/test.js
@@ -2,7 +2,10 @@
 var express = require('./');
 var app = express.createServer();
 
+app.use(express.logger('dev'));
+
 app.get('/', function(req, res){
+  console.log(req.protocol);
   res.send('hello');
 });
 

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/.npmignore
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/.npmignore b/weinre.server/node_modules/nopt/.npmignore
index e69de29..3c3629e 100644
--- a/weinre.server/node_modules/nopt/.npmignore
+++ b/weinre.server/node_modules/nopt/.npmignore
@@ -0,0 +1 @@
+node_modules

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/README.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/README.md b/weinre.server/node_modules/nopt/README.md
index eeddfd4..5aba088 100644
--- a/weinre.server/node_modules/nopt/README.md
+++ b/weinre.server/node_modules/nopt/README.md
@@ -61,12 +61,12 @@ $ node my-program.js -fp --foofoo
 $ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.
 { foo: "Mr. Foo", argv: { remain: ["-fp"] } }
 
-$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.
-{ blatzk: 1000, flag: true, pick: true }
-
-$ node my-program.js --blatzk true -fp # but they need a value
+$ node my-program.js --blatzk -fp # unknown opts are ok.
 { blatzk: true, flag: true, pick: true }
 
+$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
+{ blatzk: 1000, flag: true, pick: true }
+
 $ node my-program.js --no-blatzk -fp # unless they start with "no-"
 { blatzk: false, flag: true, pick: true }
 
@@ -116,12 +116,13 @@ considered valid values.  For instance, in the example above, the
 and any other value will be rejected.
 
 When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
-interpreted as their JavaScript equivalents, and numeric values will be
-interpreted as a number.
+interpreted as their JavaScript equivalents.
 
 You can also mix types and values, or multiple types, in a list.  For
 instance `{ blah: [Number, null] }` would allow a value to be set to
-either a Number or null.
+either a Number or null.  When types are ordered, this implies a
+preference, and the first type that can be used to properly interpret
+the value will be used.
 
 To define a new type, add it to `nopt.typeDefs`.  Each item in that
 hash is an object with a `type` member and a `validate` method.  The

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/nopt/bin/nopt.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/nopt/bin/nopt.js b/weinre.server/node_modules/nopt/bin/nopt.js
index df90c72..3232d4c 100755
--- a/weinre.server/node_modules/nopt/bin/nopt.js
+++ b/weinre.server/node_modules/nopt/bin/nopt.js
@@ -1,5 +1,6 @@
 #!/usr/bin/env node
 var nopt = require("../lib/nopt")
+  , path = require("path")
   , types = { num: Number
             , bool: Boolean
             , help: Boolean
@@ -7,7 +8,12 @@ var nopt = require("../lib/nopt")
             , "num-list": [Number, Array]
             , "str-list": [String, Array]
             , "bool-list": [Boolean, Array]
-            , str: String }
+            , str: String
+            , clear: Boolean
+            , config: Boolean
+            , length: Number
+            , file: path
+            }
   , shorthands = { s: [ "--str", "astring" ]
                  , b: [ "--bool" ]
                  , nb: [ "--no-bool" ]
@@ -15,7 +21,11 @@ var nopt = require("../lib/nopt")
                  , "?": ["--help"]
                  , h: ["--help"]
                  , H: ["--help"]
-                 , n: [ "--num", "125" ] }
+                 , n: [ "--num", "125" ]
+                 , c: ["--config"]
+                 , l: ["--length"]
+                 , f: ["--file"]
+                 }
   , parsed = nopt( types
                  , shorthands
                  , process.argv


[12/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/weinre.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/weinre.coffee b/weinre.server/lib/weinre.coffee
deleted file mode 100644
index 8b7945d..0000000
--- a/weinre.server/lib/weinre.coffee
+++ /dev/null
@@ -1,186 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-fs   = require 'fs'
-net  = require 'net'
-dns  = require 'dns'
-path = require 'path'
-
-_       = require 'underscore'
-express = require 'express'
-
-utils              = require './utils'
-jsonBodyParser     = require './jsonBodyParser'
-HttpChannelHandler = require './HttpChannelHandler'
-dumpingHandler     = require './dumpingHandler'
-channelManager     = require './channelManager'
-serviceManager     = require './serviceManager'
-
-#-------------------------------------------------------------------------------
-exports.run = (options) ->
-    processOptions(options, run2)
-
-#-------------------------------------------------------------------------------
-run2 = ->
-    options = utils.options
-    
-    serviceManager.registerProxyClass 'WeinreClientEvents'
-    serviceManager.registerProxyClass 'WeinreTargetEvents'
-    serviceManager.registerLocalClass 'WeinreClientCommands'
-    serviceManager.registerLocalClass 'WeinreTargetCommands'
-    
-    startDeathWatcher options.deathTimeout
-    
-    startServer()    
-
-#-------------------------------------------------------------------------------
-processOptions = (options, cb) ->
-    options.httpPort     = utils.ensureInteger( options.httpPort,     'the value of the option httpPort is not a number')
-    options.boundHost    = utils.ensureString(  options.boundHost,    'the value of the option boundHost is not a string')
-    options.verbose      = utils.ensureBoolean( options.verbose,      'the value of the option verbose is not a boolean')
-    options.debug        = utils.ensureBoolean( options.debug,        'the value of the option debug is not a boolean')
-    options.readTimeout  = utils.ensureInteger( options.readTimeout,  'the value of the option readTimeout is not a number')
-    options.deathTimeout = utils.ensureInteger( options.deathTimeout, 'the value of the option deathTimeout is not a number')
-
-    options.verbose = true if options.debug
-    
-    options.staticWebDir = getStaticWebDir()
-    
-    utils.logVerbose "pid:                 #{process.pid}"
-    utils.logVerbose "version:             #{getVersion()}"
-    utils.logVerbose "node versions:"
-    
-    names   = _.keys(process.versions)
-    reducer = (memo, name) -> Math.max(memo, name.length)
-    nameLen = _.reduce(names, reducer, 0)
-    
-    for name in names
-        utils.logVerbose "   #{utils.alignLeft(name, nameLen)}: #{process.versions[name]}"
-    
-    utils.logVerbose "options:"
-    utils.logVerbose "   httpPort:     #{options.httpPort}"
-    utils.logVerbose "   boundHost:    #{options.boundHost}"
-    utils.logVerbose "   verbose:      #{options.verbose}"
-    utils.logVerbose "   debug:        #{options.debug}"
-    utils.logVerbose "   readTimeout:  #{options.readTimeout}"
-    utils.logVerbose "   deathTimeout: #{options.deathTimeout}"
-
-    utils.setOptions options
-
-    checkHost options.boundHost, (err) ->
-        if err
-            utils.exit "unable to resolve boundHost address: #{options.boundHost}"
-
-        cb()
-
-#-------------------------------------------------------------------------------
-checkHost = (hostName, cb) ->
-    return cb() if hostName == '-all-'
-    return cb() if hostName == 'localhost'
-    
-    return cb() if net.isIP(hostName)
-    
-    dns.lookup hostName, cb
-
-#-------------------------------------------------------------------------------
-deathTimeout = null
-
-#-------------------------------------------------------------------------------
-startDeathWatcher = (timeout) ->
-    deathTimeout = utils.options.deathTimeout * 1000
-    
-    setInterval checkForDeath, 1000
-
-#-------------------------------------------------------------------------------
-checkForDeath = ->
-    now = (new Date).valueOf()
-    for channel in channelManager.getChannels()
-        if now - channel.lastRead > deathTimeout
-            channel.close()
-
-#-------------------------------------------------------------------------------
-startServer = () ->
-    options = utils.options
-
-    clientHandler = new HttpChannelHandler('/ws/client')
-    targetHandler = new HttpChannelHandler('/ws/target')
-    
-    channelManager.initialize()
-    
-    favIcon = "#{options.staticWebDir}/images/weinre-icon-32x32.png"
-
-    staticCacheOptions =
-        maxObjects: 500
-        maxLength:  32 * 1024 * 1024
-        
-    app = express.createServer()
-    
-    app.on 'error', (error) ->
-        utils.exit "error running server: #{error}"
-
-    app.use express.favicon(favIcon)
-
-    app.use jsonBodyParser()
-
-    app.all /^\/ws\/client(.*)/, (request, response, next) ->
-        uri = request.params[0]
-        uri = '/' if uri == ''
-        
-        dumpingHandler(request, response, uri) if options.debug
-        clientHandler.handle(request, response, uri)
-
-    app.all /^\/ws\/target(.*)/, (request, response, next) ->
-        uri = request.params[0]
-        uri = '/' if uri == ''
-
-        dumpingHandler(request, response, uri) if options.debug
-        targetHandler.handle(request, response, uri)
-
-    app.use express.errorHandler(dumpExceptions: true)
-
-    app.use express.staticCache(staticCacheOptions)
-    app.use express.static(options.staticWebDir)
-    
-    if options.boundHost == '-all-'
-        utils.log "starting server at http://localhost:#{options.httpPort}"
-        app.listen options.httpPort
-        
-    else
-        utils.log "starting server at http://#{options.boundHost}:#{options.httpPort}"
-        app.listen options.httpPort, options.boundHost
-
-#-------------------------------------------------------------------------------
-getStaticWebDir = () ->
-    webDir = path.normalize path.join(__dirname,'../web')
-    return webDir if utils.fileExistsSync webDir
-    
-    utils.exit 'unable to find static files to serve in #{webDir}; did you do a build?'
-    
-#-------------------------------------------------------------------------------
-Version = null
-getVersion = exports.getVersion = () ->
-    return Version if Version 
-
-    packageJsonName  = path.join(path.dirname(fs.realpathSync(__filename)), '../package.json')
-
-    json = fs.readFileSync(packageJsonName, 'utf8')
-    values = JSON.parse(json)
-
-    Version = values.version
-    return Version

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/weinre.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/weinre.js b/weinre.server/lib/weinre.js
new file mode 100644
index 0000000..a4ca11c
--- /dev/null
+++ b/weinre.server/lib/weinre.js
@@ -0,0 +1,193 @@
+// Generated by CoffeeScript 1.8.0
+var HttpChannelHandler, Version, channelManager, checkForDeath, checkHost, deathTimeout, dns, dumpingHandler, express, fs, getStaticWebDir, getVersion, jsonBodyParser, net, path, processOptions, run2, serviceManager, startDeathWatcher, startServer, utils, _;
+
+fs = require('fs');
+
+net = require('net');
+
+dns = require('dns');
+
+path = require('path');
+
+_ = require('underscore');
+
+express = require('express');
+
+utils = require('./utils');
+
+jsonBodyParser = require('./jsonBodyParser');
+
+HttpChannelHandler = require('./HttpChannelHandler');
+
+dumpingHandler = require('./dumpingHandler');
+
+channelManager = require('./channelManager');
+
+serviceManager = require('./serviceManager');
+
+exports.run = function(options) {
+  return processOptions(options, run2);
+};
+
+run2 = function() {
+  var options;
+  options = utils.options;
+  serviceManager.registerProxyClass('WeinreClientEvents');
+  serviceManager.registerProxyClass('WeinreTargetEvents');
+  serviceManager.registerLocalClass('WeinreClientCommands');
+  serviceManager.registerLocalClass('WeinreTargetCommands');
+  startDeathWatcher(options.deathTimeout);
+  return startServer();
+};
+
+processOptions = function(options, cb) {
+  var name, nameLen, names, reducer, _i, _len;
+  options.httpPort = utils.ensureInteger(options.httpPort, 'the value of the option httpPort is not a number');
+  options.boundHost = utils.ensureString(options.boundHost, 'the value of the option boundHost is not a string');
+  options.verbose = utils.ensureBoolean(options.verbose, 'the value of the option verbose is not a boolean');
+  options.debug = utils.ensureBoolean(options.debug, 'the value of the option debug is not a boolean');
+  options.readTimeout = utils.ensureInteger(options.readTimeout, 'the value of the option readTimeout is not a number');
+  options.deathTimeout = utils.ensureInteger(options.deathTimeout, 'the value of the option deathTimeout is not a number');
+  if (options.debug) {
+    options.verbose = true;
+  }
+  options.staticWebDir = getStaticWebDir();
+  utils.logVerbose("pid:                 " + process.pid);
+  utils.logVerbose("version:             " + (getVersion()));
+  utils.logVerbose("node versions:");
+  names = _.keys(process.versions);
+  reducer = function(memo, name) {
+    return Math.max(memo, name.length);
+  };
+  nameLen = _.reduce(names, reducer, 0);
+  for (_i = 0, _len = names.length; _i < _len; _i++) {
+    name = names[_i];
+    utils.logVerbose("   " + (utils.alignLeft(name, nameLen)) + ": " + process.versions[name]);
+  }
+  utils.logVerbose("options:");
+  utils.logVerbose("   httpPort:     " + options.httpPort);
+  utils.logVerbose("   boundHost:    " + options.boundHost);
+  utils.logVerbose("   verbose:      " + options.verbose);
+  utils.logVerbose("   debug:        " + options.debug);
+  utils.logVerbose("   readTimeout:  " + options.readTimeout);
+  utils.logVerbose("   deathTimeout: " + options.deathTimeout);
+  utils.setOptions(options);
+  return checkHost(options.boundHost, function(err) {
+    if (err) {
+      utils.exit("unable to resolve boundHost address: " + options.boundHost);
+    }
+    return cb();
+  });
+};
+
+checkHost = function(hostName, cb) {
+  if (hostName === '-all-') {
+    return cb();
+  }
+  if (hostName === 'localhost') {
+    return cb();
+  }
+  if (net.isIP(hostName)) {
+    return cb();
+  }
+  return dns.lookup(hostName, cb);
+};
+
+deathTimeout = null;
+
+startDeathWatcher = function(timeout) {
+  deathTimeout = utils.options.deathTimeout * 1000;
+  return setInterval(checkForDeath, 1000);
+};
+
+checkForDeath = function() {
+  var channel, now, _i, _len, _ref, _results;
+  now = (new Date).valueOf();
+  _ref = channelManager.getChannels();
+  _results = [];
+  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+    channel = _ref[_i];
+    if (now - channel.lastRead > deathTimeout) {
+      _results.push(channel.close());
+    } else {
+      _results.push(void 0);
+    }
+  }
+  return _results;
+};
+
+startServer = function() {
+  var app, clientHandler, favIcon, options, staticCacheOptions, targetHandler;
+  options = utils.options;
+  clientHandler = new HttpChannelHandler('/ws/client');
+  targetHandler = new HttpChannelHandler('/ws/target');
+  channelManager.initialize();
+  favIcon = "" + options.staticWebDir + "/images/weinre-icon-32x32.png";
+  staticCacheOptions = {
+    maxObjects: 500,
+    maxLength: 32 * 1024 * 1024
+  };
+  app = express.createServer();
+  app.on('error', function(error) {
+    return utils.exit("error running server: " + error);
+  });
+  app.use(express.favicon(favIcon));
+  app.use(jsonBodyParser());
+  app.all(/^\/ws\/client(.*)/, function(request, response, next) {
+    var uri;
+    uri = request.params[0];
+    if (uri === '') {
+      uri = '/';
+    }
+    if (options.debug) {
+      dumpingHandler(request, response, uri);
+    }
+    return clientHandler.handle(request, response, uri);
+  });
+  app.all(/^\/ws\/target(.*)/, function(request, response, next) {
+    var uri;
+    uri = request.params[0];
+    if (uri === '') {
+      uri = '/';
+    }
+    if (options.debug) {
+      dumpingHandler(request, response, uri);
+    }
+    return targetHandler.handle(request, response, uri);
+  });
+  app.use(express.errorHandler({
+    dumpExceptions: true
+  }));
+  app.use(express.staticCache(staticCacheOptions));
+  app.use(express["static"](options.staticWebDir));
+  if (options.boundHost === '-all-') {
+    utils.log("starting server at http://localhost:" + options.httpPort);
+    return app.listen(options.httpPort);
+  } else {
+    utils.log("starting server at http://" + options.boundHost + ":" + options.httpPort);
+    return app.listen(options.httpPort, options.boundHost);
+  }
+};
+
+getStaticWebDir = function() {
+  var webDir;
+  webDir = path.normalize(path.join(__dirname, '../web'));
+  if (utils.fileExistsSync(webDir)) {
+    return webDir;
+  }
+  return utils.exit('unable to find static files to serve in #{webDir}; did you do a build?');
+};
+
+Version = null;
+
+getVersion = exports.getVersion = function() {
+  var json, packageJsonName, values;
+  if (Version) {
+    return Version;
+  }
+  packageJsonName = path.join(path.dirname(fs.realpathSync(__filename)), '../package.json');
+  json = fs.readFileSync(packageJsonName, 'utf8');
+  values = JSON.parse(json);
+  Version = values.version;
+  return Version;
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/.bin/cake
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/.bin/cake b/weinre.server/node_modules/.bin/cake
index 0b37b91..d95f32a 120000
--- a/weinre.server/node_modules/.bin/cake
+++ b/weinre.server/node_modules/.bin/cake
@@ -1 +1 @@
-/Users/pmuellr/Projects/incubator-cordova-weinre/weinre.server/node_modules/coffee-script/bin/cake
\ No newline at end of file
+../coffee-script/bin/cake
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/.bin/coffee
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/.bin/coffee b/weinre.server/node_modules/.bin/coffee
index 70a193a..b57f275 120000
--- a/weinre.server/node_modules/.bin/coffee
+++ b/weinre.server/node_modules/.bin/coffee
@@ -1 +1 @@
-/Users/pmuellr/Projects/incubator-cordova-weinre/weinre.server/node_modules/coffee-script/bin/coffee
\ No newline at end of file
+../coffee-script/bin/coffee
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/.bin/express
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/.bin/express b/weinre.server/node_modules/.bin/express
index 57a31fa..b741d99 120000
--- a/weinre.server/node_modules/.bin/express
+++ b/weinre.server/node_modules/.bin/express
@@ -1 +1 @@
-/Users/pmuellr/Projects/incubator-cordova-weinre/weinre.server/node_modules/express/bin/express
\ No newline at end of file
+../express/bin/express
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/.bin/nopt
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/.bin/nopt b/weinre.server/node_modules/.bin/nopt
index f50226a..6b6566e 120000
--- a/weinre.server/node_modules/.bin/nopt
+++ b/weinre.server/node_modules/.bin/nopt
@@ -1 +1 @@
-/Users/pmuellr/Projects/incubator-cordova-weinre/weinre.server/node_modules/nopt/bin/nopt.js
\ No newline at end of file
+../nopt/bin/nopt.js
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/CONTRIBUTING.md b/weinre.server/node_modules/coffee-script/CONTRIBUTING.md
new file mode 100644
index 0000000..5ea4c5f
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/CONTRIBUTING.md
@@ -0,0 +1,9 @@
+## How to contribute to CoffeeScript
+
+* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffeescript/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
+
+* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
+
+* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
+
+* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/LICENSE
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/LICENSE b/weinre.server/node_modules/coffee-script/LICENSE
index dbe6b4e..4d09b4d 100644
--- a/weinre.server/node_modules/coffee-script/LICENSE
+++ b/weinre.server/node_modules/coffee-script/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009-2012 Jeremy Ashkenas
+Copyright (c) 2009-2014 Jeremy Ashkenas
 
 Permission is hereby granted, free of charge, to any person
 obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/README
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/README b/weinre.server/node_modules/coffee-script/README
index 69ee6f4..37d7bbf 100644
--- a/weinre.server/node_modules/coffee-script/README
+++ b/weinre.server/node_modules/coffee-script/README
@@ -1,12 +1,11 @@
-
             {
          }   }   {
         {   {  }  }
          }   }{  {
         {  }{  }  }                    _____       __  __
-       ( }{ }{  { )                   / ____|     / _|/ _|
+       { }{ }{  { }                   / ____|     / _|/ _|
      .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
-    (  ( } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
+    (  { } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
     |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
     |                 |               \_____\___/|_| |_| \___|\___|
     |                 ;--.
@@ -22,13 +21,13 @@
 
   CoffeeScript is a little language that compiles into JavaScript.
 
-  Install Node.js, and then the CoffeeScript compiler:
-  sudo bin/cake install
-
-  Or, if you have the Node Package Manager installed:
+  If you have the Node Package Manager installed:
   npm install -g coffee-script
   (Leave off the -g if you don't wish to install globally.)
 
+  Or, if you don't wish to use npm:
+  sudo bin/cake install
+
   Execute a script:
   coffee /path/to/script.coffee
 
@@ -39,13 +38,13 @@
   http://coffeescript.org/
 
   To suggest a feature, report a bug, or general discussion:
-  http://github.com/jashkenas/coffee-script/issues/
+  http://github.com/jashkenas/coffeescript/issues/
 
   If you'd like to chat, drop by #coffeescript on Freenode IRC,
   or on webchat.freenode.net.
 
   The source repository:
-  git://github.com/jashkenas/coffee-script.git
+  git://github.com/jashkenas/coffeescript.git
 
-  All contributors are listed here:
-  http://github.com/jashkenas/coffee-script/contributors
+  Top 100 contributors are listed here:
+  http://github.com/jashkenas/coffeescript/contributors

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/README.md
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/README.md b/weinre.server/node_modules/coffee-script/README.md
new file mode 100644
index 0000000..90f6788
--- /dev/null
+++ b/weinre.server/node_modules/coffee-script/README.md
@@ -0,0 +1,60 @@
+            {
+         }   }   {
+        {   {  }  }
+         }   }{  {
+        {  }{  }  }                    _____       __  __
+       { }{ }{  { }                   / ____|     / _|/ _|
+     .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
+    (  { } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
+    |`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
+    |                 |               \_____\___/|_| |_| \___|\___|
+    |                 ;--.
+    |                (__  \            _____           _       _
+    |                 | )  )          / ____|         (_)     | |
+    |                 |/  /          | (___   ___ _ __ _ _ __ | |_
+    |                 (  /            \___ \ / __| '__| | '_ \| __|
+    |                 |/              ____) | (__| |  | | |_) | |_
+    |                 |              |_____/ \___|_|  |_| .__/ \__|
+     `-.._________..-'                                  | |
+                                                        |_|
+
+CoffeeScript is a little language that compiles into JavaScript.
+
+## Installation
+
+If you have the node package manager, npm, installed:
+
+```shell
+npm install -g coffee-script
+```
+
+Leave off the `-g` if you don't wish to install globally. If you don't wish to use npm:
+
+```shell
+git clone https://github.com/jashkenas/coffeescript.git
+sudo coffeescript/bin/cake install
+```
+
+## Getting Started
+
+Execute a script:
+
+```shell
+coffee /path/to/script.coffee
+```
+
+Compile a script:
+
+```shell
+coffee -c /path/to/script.coffee
+```
+
+For documentation, usage, and examples, see: http://coffeescript.org/
+
+To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues
+
+If you'd like to chat, drop by #coffeescript on Freenode IRC.
+
+The source repository: https://github.com/jashkenas/coffeescript.git
+
+Our lovely and talented contributors are listed here: http://github.com/jashkenas/coffeescript/contributors

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/Rakefile
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/Rakefile b/weinre.server/node_modules/coffee-script/Rakefile
deleted file mode 100644
index dfb85da..0000000
--- a/weinre.server/node_modules/coffee-script/Rakefile
+++ /dev/null
@@ -1,78 +0,0 @@
-require 'rubygems'
-require 'erb'
-require 'fileutils'
-require 'rake/testtask'
-require 'json'
-
-desc "Build the documentation page"
-task :doc do
-  source = 'documentation/index.html.erb'
-  child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" }
-  at_exit { Process.kill("INT", child) }
-  Signal.trap("INT") { exit }
-  loop do
-    mtime = File.stat(source).mtime
-    if !@mtime || mtime > @mtime
-      rendered = ERB.new(File.read(source)).result(binding)
-      File.open('index.html', 'w+') {|f| f.write(rendered) }
-    end
-    @mtime = mtime
-    sleep 1
-  end
-end
-
-desc "Build coffee-script-source gem"
-task :gem do
-  require 'rubygems'
-  require 'rubygems/package'
-
-  gemspec = Gem::Specification.new do |s|
-    s.name      = 'coffee-script-source'
-    s.version   = JSON.parse(File.read('package.json'))["version"]
-    s.date      = Time.now.strftime("%Y-%m-%d")
-
-    s.homepage    = "http://jashkenas.github.com/coffee-script/"
-    s.summary     = "The CoffeeScript Compiler"
-    s.description = <<-EOS
-      CoffeeScript is a little language that compiles into JavaScript.
-      Underneath all of those embarrassing braces and semicolons,
-      JavaScript has always had a gorgeous object model at its heart.
-      CoffeeScript is an attempt to expose the good parts of JavaScript
-      in a simple way.
-    EOS
-
-    s.files = [
-      'lib/coffee_script/coffee-script.js',
-      'lib/coffee_script/source.rb'
-    ]
-
-    s.authors           = ['Jeremy Ashkenas']
-    s.email             = 'jashkenas@gmail.com'
-    s.rubyforge_project = 'coffee-script-source'
-  end
-
-  file = File.open("coffee-script-source.gem", "w")
-  Gem::Package.open(file, 'w') do |pkg|
-    pkg.metadata = gemspec.to_yaml
-
-    path = "lib/coffee_script/source.rb"
-    contents = <<-ERUBY
-module CoffeeScript
-  module Source
-    def self.bundled_path
-      File.expand_path("../coffee-script.js", __FILE__)
-    end
-  end
-end
-    ERUBY
-    pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
-      tar_io.write(contents)
-    end
-
-    contents = File.read("extras/coffee-script.js")
-    path = "lib/coffee_script/coffee-script.js"
-    pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
-      tar_io.write(contents)
-    end
-  end
-end

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/extras/jsl.conf
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/extras/jsl.conf b/weinre.server/node_modules/coffee-script/extras/jsl.conf
deleted file mode 100644
index 1190da5..0000000
--- a/weinre.server/node_modules/coffee-script/extras/jsl.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-# JavaScriptLint configuration file for CoffeeScript.
-
-+no_return_value              # function {0} does not always return a value
-+duplicate_formal             # duplicate formal argument {0}
--equal_as_assign              # test for equality (==) mistyped as assignment (=)?{0}
-+var_hides_arg                # variable {0} hides argument
-+redeclared_var               # redeclaration of {0} {1}
--anon_no_return_value         # anonymous function does not always return a value
-+missing_semicolon            # missing semicolon
-+meaningless_block            # meaningless block; curly braces have no impact
--comma_separated_stmts        # multiple statements separated by commas (use semicolons?)
-+unreachable_code             # unreachable code
-+missing_break                # missing break statement
--missing_break_for_last_case  # missing break statement for last case in switch
--comparison_type_conv         # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
--inc_dec_within_stmt          # increment (++) and decrement (--) operators used as part of greater statement
--useless_void                 # use of the void type may be unnecessary (void is always undefined)
-+multiple_plus_minus          # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
-+use_of_label                 # use of label
--block_without_braces         # block statement without curly braces
-+leading_decimal_point        # leading decimal point may indicate a number or an object member
-+trailing_decimal_point       # trailing decimal point may indicate a number or an object member
-+octal_number                 # leading zeros make an octal number
-+nested_comment               # nested comment
-+misplaced_regex              # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
-+ambiguous_newline            # unexpected end of line; it is ambiguous whether these lines are part of the same statement
-+empty_statement              # empty statement or extra semicolon
--missing_option_explicit      # the "option explicit" control comment is missing
-+partial_option_explicit      # the "option explicit" control comment, if used, must be in the first script tag
-+dup_option_explicit          # duplicate "option explicit" control comment
-+useless_assign               # useless assignment
-+ambiguous_nested_stmt        # block statements containing block statements should use curly braces to resolve ambiguity
-+ambiguous_else_stmt          # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
--missing_default_case         # missing default case in switch statement
-+duplicate_case_in_switch     # duplicate case in switch statements
-+default_not_at_end           # the default case is not at the end of the switch statement
-+legacy_cc_not_understood     # couldn't understand control comment using /*@keyword@*/ syntax
-+jsl_cc_not_understood        # couldn't understand control comment using /*jsl:keyword*/ syntax
-+useless_comparison           # useless comparison; comparing identical expressions
-+with_statement               # with statement hides undeclared variables; use temporary variable instead
-+trailing_comma_in_array      # extra comma is not recommended in array initializers
-+assign_to_function_call      # assignment to a function call
-+parseint_missing_radix       # parseInt missing radix parameter
-+lambda_assign_requires_semicolon

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/browser.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/browser.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/browser.js
index 825cbf3..da2830d 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/browser.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/browser.js
@@ -1,20 +1,22 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var CoffeeScript, runScripts;
+  var CoffeeScript, compile, runScripts,
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
   CoffeeScript = require('./coffee-script');
 
   CoffeeScript.require = require;
 
+  compile = CoffeeScript.compile;
+
   CoffeeScript["eval"] = function(code, options) {
-    var _ref;
     if (options == null) {
       options = {};
     }
-    if ((_ref = options.bare) == null) {
+    if (options.bare == null) {
       options.bare = true;
     }
-    return eval(CoffeeScript.compile(code, options));
+    return eval(compile(code, options));
   };
 
   CoffeeScript.run = function(code, options) {
@@ -22,30 +24,54 @@
       options = {};
     }
     options.bare = true;
-    return Function(CoffeeScript.compile(code, options))();
+    options.shiftLine = true;
+    return Function(compile(code, options))();
   };
 
   if (typeof window === "undefined" || window === null) {
     return;
   }
 
-  CoffeeScript.load = function(url, callback) {
+  if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
+    compile = function(code, options) {
+      var js, v3SourceMap, _ref;
+      if (options == null) {
+        options = {};
+      }
+      options.sourceMap = true;
+      options.inline = true;
+      _ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
+      return "" + js + "\n//# sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//# sourceURL=coffeescript";
+    };
+  }
+
+  CoffeeScript.load = function(url, callback, options, hold) {
     var xhr;
-    xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP');
+    if (options == null) {
+      options = {};
+    }
+    if (hold == null) {
+      hold = false;
+    }
+    options.sourceFiles = [url];
+    xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
     xhr.open('GET', url, true);
     if ('overrideMimeType' in xhr) {
       xhr.overrideMimeType('text/plain');
     }
     xhr.onreadystatechange = function() {
-      var _ref;
+      var param, _ref;
       if (xhr.readyState === 4) {
         if ((_ref = xhr.status) === 0 || _ref === 200) {
-          CoffeeScript.run(xhr.responseText);
+          param = [xhr.responseText, options];
+          if (!hold) {
+            CoffeeScript.run.apply(CoffeeScript, param);
+          }
         } else {
           throw new Error("Could not load " + url);
         }
         if (callback) {
-          return callback();
+          return callback(param);
         }
       }
     };
@@ -53,40 +79,56 @@
   };
 
   runScripts = function() {
-    var coffees, execute, index, length, s, scripts;
-    scripts = document.getElementsByTagName('script');
+    var coffees, coffeetypes, execute, i, index, s, script, scripts, _fn, _i, _len;
+    scripts = window.document.getElementsByTagName('script');
+    coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
     coffees = (function() {
-      var _i, _len, _results;
+      var _i, _len, _ref, _results;
       _results = [];
       for (_i = 0, _len = scripts.length; _i < _len; _i++) {
         s = scripts[_i];
-        if (s.type === 'text/coffeescript') {
+        if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
           _results.push(s);
         }
       }
       return _results;
     })();
     index = 0;
-    length = coffees.length;
-    (execute = function() {
-      var script;
-      script = coffees[index++];
-      if ((script != null ? script.type : void 0) === 'text/coffeescript') {
-        if (script.src) {
-          return CoffeeScript.load(script.src, execute);
-        } else {
-          CoffeeScript.run(script.innerHTML);
+    execute = function() {
+      var param;
+      param = coffees[index];
+      if (param instanceof Array) {
+        CoffeeScript.run.apply(CoffeeScript, param);
+        index++;
+        return execute();
+      }
+    };
+    _fn = function(script, i) {
+      var options;
+      options = {
+        literate: script.type === coffeetypes[1]
+      };
+      if (script.src) {
+        return CoffeeScript.load(script.src, function(param) {
+          coffees[i] = param;
           return execute();
-        }
+        }, options, true);
+      } else {
+        options.sourceFiles = ['embedded'];
+        return coffees[i] = [script.innerHTML, options];
       }
-    })();
-    return null;
+    };
+    for (i = _i = 0, _len = coffees.length; _i < _len; i = ++_i) {
+      script = coffees[i];
+      _fn(script, i);
+    }
+    return execute();
   };
 
   if (window.addEventListener) {
-    addEventListener('DOMContentLoaded', runScripts, false);
+    window.addEventListener('DOMContentLoaded', runScripts, false);
   } else {
-    attachEvent('onload', runScripts);
+    window.attachEvent('onload', runScripts);
   }
 
 }).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/cake.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/cake.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/cake.js
index 1523418..94ecd4c 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/cake.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/cake.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
   var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
 
@@ -12,6 +12,8 @@
 
   CoffeeScript = require('./coffee-script');
 
+  CoffeeScript.register();
+
   tasks = {};
 
   options = {};
@@ -44,7 +46,7 @@
   });
 
   exports.run = function() {
-    var arg, args, _i, _len, _ref, _results;
+    var arg, args, e, _i, _len, _ref, _results;
     global.__originalDirname = fs.realpathSync('.');
     process.chdir(cakefileDirectory(__originalDirname));
     args = process.argv.slice(2);
@@ -57,7 +59,8 @@
     }
     try {
       options = oparse.parse(args);
-    } catch (e) {
+    } catch (_error) {
+      e = _error;
       return fatalError("" + e);
     }
     _ref = options["arguments"];
@@ -98,7 +101,7 @@
 
   cakefileDirectory = function(dir) {
     var parent;
-    if (path.existsSync(path.join(dir, 'Cakefile'))) {
+    if (fs.existsSync(path.join(dir, 'Cakefile'))) {
       return dir;
     }
     parent = path.normalize(path.join(dir, '..'));

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/coffee-script.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/coffee-script.js
index c43fa49..9061c7e 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/coffee-script.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/coffee-script.js
@@ -1,89 +1,126 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var Lexer, RESERVED, compile, fs, lexer, parser, path, vm, _ref,
-    __hasProp = {}.hasOwnProperty;
+  var Lexer, SourceMap, compile, ext, formatSourcePosition, fs, getSourceMap, helpers, lexer, parser, path, sourceMaps, vm, withPrettyErrors, _base, _i, _len, _ref,
+    __hasProp = {}.hasOwnProperty,
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
   fs = require('fs');
 
+  vm = require('vm');
+
   path = require('path');
 
-  _ref = require('./lexer'), Lexer = _ref.Lexer, RESERVED = _ref.RESERVED;
+  Lexer = require('./lexer').Lexer;
 
   parser = require('./parser').parser;
 
-  vm = require('vm');
+  helpers = require('./helpers');
 
-  if (require.extensions) {
-    require.extensions['.coffee'] = function(module, filename) {
-      var content;
-      content = compile(fs.readFileSync(filename, 'utf8'), {
-        filename: filename
-      });
-      return module._compile(content, filename);
-    };
-  } else if (require.registerExtension) {
-    require.registerExtension('.coffee', function(content) {
-      return compile(content);
-    });
-  }
+  SourceMap = require('./sourcemap');
 
-  exports.VERSION = '1.3.3';
+  exports.VERSION = '1.8.0';
 
-  exports.RESERVED = RESERVED;
+  exports.FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md'];
 
-  exports.helpers = require('./helpers');
+  exports.helpers = helpers;
 
-  exports.compile = compile = function(code, options) {
-    var header, js, merge;
-    if (options == null) {
-      options = {};
-    }
-    merge = exports.helpers.merge;
-    try {
-      js = (parser.parse(lexer.tokenize(code))).compile(options);
-      if (!options.header) {
-        return js;
+  withPrettyErrors = function(fn) {
+    return function(code, options) {
+      var err;
+      if (options == null) {
+        options = {};
       }
-    } catch (err) {
-      if (options.filename) {
-        err.message = "In " + options.filename + ", " + err.message;
+      try {
+        return fn.call(this, code, options);
+      } catch (_error) {
+        err = _error;
+        throw helpers.updateSyntaxError(err, code, options.filename);
       }
-      throw err;
-    }
-    header = "Generated by CoffeeScript " + this.VERSION;
-    return "// " + header + "\n" + js;
+    };
   };
 
-  exports.tokens = function(code, options) {
+  exports.compile = compile = withPrettyErrors(function(code, options) {
+    var answer, currentColumn, currentLine, extend, fragment, fragments, header, js, map, merge, newLines, _i, _len;
+    merge = helpers.merge, extend = helpers.extend;
+    options = extend({}, options);
+    if (options.sourceMap) {
+      map = new SourceMap;
+    }
+    fragments = parser.parse(lexer.tokenize(code, options)).compileToFragments(options);
+    currentLine = 0;
+    if (options.header) {
+      currentLine += 1;
+    }
+    if (options.shiftLine) {
+      currentLine += 1;
+    }
+    currentColumn = 0;
+    js = "";
+    for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+      fragment = fragments[_i];
+      if (options.sourceMap) {
+        if (fragment.locationData) {
+          map.add([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
+            noReplace: true
+          });
+        }
+        newLines = helpers.count(fragment.code, "\n");
+        currentLine += newLines;
+        if (newLines) {
+          currentColumn = fragment.code.length - (fragment.code.lastIndexOf("\n") + 1);
+        } else {
+          currentColumn += fragment.code.length;
+        }
+      }
+      js += fragment.code;
+    }
+    if (options.header) {
+      header = "Generated by CoffeeScript " + this.VERSION;
+      js = "// " + header + "\n" + js;
+    }
+    if (options.sourceMap) {
+      answer = {
+        js: js
+      };
+      answer.sourceMap = map;
+      answer.v3SourceMap = map.generate(options, code);
+      return answer;
+    } else {
+      return js;
+    }
+  });
+
+  exports.tokens = withPrettyErrors(function(code, options) {
     return lexer.tokenize(code, options);
-  };
+  });
 
-  exports.nodes = function(source, options) {
+  exports.nodes = withPrettyErrors(function(source, options) {
     if (typeof source === 'string') {
       return parser.parse(lexer.tokenize(source, options));
     } else {
       return parser.parse(source);
     }
-  };
+  });
 
   exports.run = function(code, options) {
-    var mainModule;
+    var answer, dir, mainModule, _ref;
     if (options == null) {
       options = {};
     }
     mainModule = require.main;
     mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
     mainModule.moduleCache && (mainModule.moduleCache = {});
-    mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename)));
-    if (path.extname(mainModule.filename) !== '.coffee' || require.extensions) {
-      return mainModule._compile(compile(code, options), mainModule.filename);
-    } else {
-      return mainModule._compile(code, mainModule.filename);
+    dir = options.filename ? path.dirname(fs.realpathSync(options.filename)) : fs.realpathSync('.');
+    mainModule.paths = require('module')._nodeModulePaths(dir);
+    if (!helpers.isCoffee(mainModule.filename) || require.extensions) {
+      answer = compile(code, options);
+      code = (_ref = answer.js) != null ? _ref : answer;
     }
+    return mainModule._compile(code, mainModule.filename);
   };
 
   exports["eval"] = function(code, options) {
-    var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref1, _ref2, _require;
+    var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require;
     if (options == null) {
       options = {};
     }
@@ -97,10 +134,10 @@
           sandbox = options.sandbox;
         } else {
           sandbox = Script.createContext();
-          _ref1 = options.sandbox;
-          for (k in _ref1) {
-            if (!__hasProp.call(_ref1, k)) continue;
-            v = _ref1[k];
+          _ref = options.sandbox;
+          for (k in _ref) {
+            if (!__hasProp.call(_ref, k)) continue;
+            v = _ref[k];
             sandbox[k] = v;
           }
         }
@@ -117,9 +154,9 @@
           return Module._load(path, _module, true);
         };
         _module.filename = sandbox.__filename;
-        _ref2 = Object.getOwnPropertyNames(require);
-        for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-          r = _ref2[_i];
+        _ref1 = Object.getOwnPropertyNames(require);
+        for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+          r = _ref1[_i];
           if (r !== 'paths') {
             _require[r] = require[r];
           }
@@ -145,12 +182,55 @@
     }
   };
 
+  exports.register = function() {
+    return require('./register');
+  };
+
+  if (require.extensions) {
+    _ref = this.FILE_EXTENSIONS;
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      ext = _ref[_i];
+      if ((_base = require.extensions)[ext] == null) {
+        _base[ext] = function() {
+          throw new Error("Use CoffeeScript.register() or require the coffee-script/register module to require " + ext + " files.");
+        };
+      }
+    }
+  }
+
+  exports._compileFile = function(filename, sourceMap) {
+    var answer, err, raw, stripped;
+    if (sourceMap == null) {
+      sourceMap = false;
+    }
+    raw = fs.readFileSync(filename, 'utf8');
+    stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
+    try {
+      answer = compile(stripped, {
+        filename: filename,
+        sourceMap: sourceMap,
+        literate: helpers.isLiterate(filename)
+      });
+    } catch (_error) {
+      err = _error;
+      throw helpers.updateSyntaxError(err, stripped, filename);
+    }
+    return answer;
+  };
+
   lexer = new Lexer;
 
   parser.lexer = {
     lex: function() {
-      var tag, _ref1;
-      _ref1 = this.tokens[this.pos++] || [''], tag = _ref1[0], this.yytext = _ref1[1], this.yylineno = _ref1[2];
+      var tag, token;
+      token = this.tokens[this.pos++];
+      if (token) {
+        tag = token[0], this.yytext = token[1], this.yylloc = token[2];
+        this.errorToken = token.origin || token;
+        this.yylineno = this.yylloc.first_line;
+      } else {
+        tag = '';
+      }
       return tag;
     },
     setInput: function(tokens) {
@@ -164,4 +244,104 @@
 
   parser.yy = require('./nodes');
 
+  parser.yy.parseError = function(message, _arg) {
+    var errorLoc, errorTag, errorText, errorToken, token, tokens, _ref1;
+    token = _arg.token;
+    _ref1 = parser.lexer, errorToken = _ref1.errorToken, tokens = _ref1.tokens;
+    errorTag = errorToken[0], errorText = errorToken[1], errorLoc = errorToken[2];
+    errorText = errorToken === tokens[tokens.length - 1] ? 'end of input' : errorTag === 'INDENT' || errorTag === 'OUTDENT' ? 'indentation' : helpers.nameWhitespaceCharacter(errorText);
+    return helpers.throwSyntaxError("unexpected " + errorText, errorLoc);
+  };
+
+  formatSourcePosition = function(frame, getSourceMapping) {
+    var as, column, fileLocation, fileName, functionName, isConstructor, isMethodCall, line, methodName, source, tp, typeName;
+    fileName = void 0;
+    fileLocation = '';
+    if (frame.isNative()) {
+      fileLocation = "native";
+    } else {
+      if (frame.isEval()) {
+        fileName = frame.getScriptNameOrSourceURL();
+        if (!fileName) {
+          fileLocation = "" + (frame.getEvalOrigin()) + ", ";
+        }
+      } else {
+        fileName = frame.getFileName();
+      }
+      fileName || (fileName = "<anonymous>");
+      line = frame.getLineNumber();
+      column = frame.getColumnNumber();
+      source = getSourceMapping(fileName, line, column);
+      fileLocation = source ? "" + fileName + ":" + source[0] + ":" + source[1] : "" + fileName + ":" + line + ":" + column;
+    }
+    functionName = frame.getFunctionName();
+    isConstructor = frame.isConstructor();
+    isMethodCall = !(frame.isToplevel() || isConstructor);
+    if (isMethodCall) {
+      methodName = frame.getMethodName();
+      typeName = frame.getTypeName();
+      if (functionName) {
+        tp = as = '';
+        if (typeName && functionName.indexOf(typeName)) {
+          tp = "" + typeName + ".";
+        }
+        if (methodName && functionName.indexOf("." + methodName) !== functionName.length - methodName.length - 1) {
+          as = " [as " + methodName + "]";
+        }
+        return "" + tp + functionName + as + " (" + fileLocation + ")";
+      } else {
+        return "" + typeName + "." + (methodName || '<anonymous>') + " (" + fileLocation + ")";
+      }
+    } else if (isConstructor) {
+      return "new " + (functionName || '<anonymous>') + " (" + fileLocation + ")";
+    } else if (functionName) {
+      return "" + functionName + " (" + fileLocation + ")";
+    } else {
+      return fileLocation;
+    }
+  };
+
+  sourceMaps = {};
+
+  getSourceMap = function(filename) {
+    var answer, _ref1;
+    if (sourceMaps[filename]) {
+      return sourceMaps[filename];
+    }
+    if (_ref1 = path != null ? path.extname(filename) : void 0, __indexOf.call(exports.FILE_EXTENSIONS, _ref1) < 0) {
+      return;
+    }
+    answer = exports._compileFile(filename, true);
+    return sourceMaps[filename] = answer.sourceMap;
+  };
+
+  Error.prepareStackTrace = function(err, stack) {
+    var frame, frames, getSourceMapping;
+    getSourceMapping = function(filename, line, column) {
+      var answer, sourceMap;
+      sourceMap = getSourceMap(filename);
+      if (sourceMap) {
+        answer = sourceMap.sourceLocation([line - 1, column - 1]);
+      }
+      if (answer) {
+        return [answer[0] + 1, answer[1] + 1];
+      } else {
+        return null;
+      }
+    };
+    frames = (function() {
+      var _j, _len1, _results;
+      _results = [];
+      for (_j = 0, _len1 = stack.length; _j < _len1; _j++) {
+        frame = stack[_j];
+        if (frame.getFunction() === exports.run) {
+          break;
+        }
+        _results.push("  at " + (formatSourcePosition(frame, getSourceMapping)));
+      }
+      return _results;
+    })();
+    return "" + (err.toString()) + "\n" + (frames.join('\n')) + "\n";
+  };
+
 }).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/command.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/command.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/command.js
index e02da9f..357653b 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/command.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/command.js
@@ -1,6 +1,7 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, forkNode, fs, helpers, hidden, joinTimeout, lint, loadRequires, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref;
+  var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, findDirectoryIndex, forkNode, fs, helpers, hidden, joinTimeout, mkdirp, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, removeSourceDir, silentUnlink, sourceCode, sources, spawn, timeLog, usage, useWinPathSep, version, wait, watch, watchDir, watchedDirs, writeJs, _ref,
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
   fs = require('fs');
 
@@ -12,10 +13,14 @@
 
   CoffeeScript = require('./coffee-script');
 
+  mkdirp = require('mkdirp');
+
   _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
 
   EventEmitter = require('events').EventEmitter;
 
+  useWinPathSep = path.sep === '\\';
+
   helpers.extend(CoffeeScript, new EventEmitter);
 
   printLine = function(line) {
@@ -32,7 +37,7 @@
 
   BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
 
-  SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [FILE*]', 'require a library before executing your script'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'dis
 play the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
+  SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewrite
 r produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
 
   opts = {};
 
@@ -42,13 +47,16 @@
 
   notSources = {};
 
-  watchers = {};
+  watchedDirs = {};
 
   optionParser = null;
 
   exports.run = function() {
-    var literals, source, _i, _len, _results;
+    var literals, replCliOpts, source, _i, _len, _ref1, _results;
     parseOptions();
+    replCliOpts = {
+      useGlobal: true
+    };
     if (opts.nodejs) {
       return forkNode();
     }
@@ -58,108 +66,132 @@
     if (opts.version) {
       return version();
     }
-    if (opts.require) {
-      loadRequires();
-    }
     if (opts.interactive) {
-      return require('./repl');
-    }
-    if (opts.watch && !fs.watch) {
-      return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + ".");
+      return require('./repl').start(replCliOpts);
     }
     if (opts.stdio) {
       return compileStdio();
     }
     if (opts["eval"]) {
-      return compileScript(null, sources[0]);
+      return compileScript(null, opts["arguments"][0]);
     }
-    if (!sources.length) {
-      return require('./repl');
+    if (!opts["arguments"].length) {
+      return require('./repl').start(replCliOpts);
     }
-    literals = opts.run ? sources.splice(1) : [];
+    literals = opts.run ? opts["arguments"].splice(1) : [];
     process.argv = process.argv.slice(0, 2).concat(literals);
     process.argv[0] = 'coffee';
-    process.execPath = require.main.filename;
+    if (opts.output) {
+      opts.output = path.resolve(opts.output);
+    }
+    if (opts.join) {
+      opts.join = path.resolve(opts.join);
+      console.error('\nThe --join option is deprecated and will be removed in a future version.\n\nIf for some reason it\'s necessary to share local variables between files,\nreplace...\n\n    $ coffee --compile --join bundle.js -- a.coffee b.coffee c.coffee\n\nwith...\n\n    $ cat a.coffee b.coffee c.coffee | coffee --compile --stdio > bundle.js\n');
+    }
+    _ref1 = opts["arguments"];
     _results = [];
-    for (_i = 0, _len = sources.length; _i < _len; _i++) {
-      source = sources[_i];
-      _results.push(compilePath(source, true, path.normalize(source)));
+    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+      source = _ref1[_i];
+      source = path.resolve(source);
+      _results.push(compilePath(source, true, source));
     }
     return _results;
   };
 
   compilePath = function(source, topLevel, base) {
-    return fs.stat(source, function(err, stats) {
-      if (err && err.code !== 'ENOENT') {
-        throw err;
+    var code, err, file, files, stats, _i, _len, _results;
+    if (__indexOf.call(sources, source) >= 0 || watchedDirs[source] || !topLevel && (notSources[source] || hidden(source))) {
+      return;
+    }
+    try {
+      stats = fs.statSync(source);
+    } catch (_error) {
+      err = _error;
+      if (err.code === 'ENOENT') {
+        console.error("File not found: " + source);
+        process.exit(1);
+      }
+      throw err;
+    }
+    if (stats.isDirectory()) {
+      if (path.basename(source) === 'node_modules') {
+        notSources[source] = true;
+        return;
       }
-      if ((err != null ? err.code : void 0) === 'ENOENT') {
-        if (topLevel && source.slice(-7) !== '.coffee') {
-          source = sources[sources.indexOf(source)] = "" + source + ".coffee";
-          return compilePath(source, topLevel, base);
+      if (opts.run) {
+        compilePath(findDirectoryIndex(source), topLevel, base);
+        return;
+      }
+      if (opts.watch) {
+        watchDir(source, base);
+      }
+      try {
+        files = fs.readdirSync(source);
+      } catch (_error) {
+        err = _error;
+        if (err.code === 'ENOENT') {
+          return;
+        } else {
+          throw err;
         }
-        if (topLevel) {
-          console.error("File not found: " + source);
-          process.exit(1);
+      }
+      _results = [];
+      for (_i = 0, _len = files.length; _i < _len; _i++) {
+        file = files[_i];
+        _results.push(compilePath(path.join(source, file), false, base));
+      }
+      return _results;
+    } else if (topLevel || helpers.isCoffee(source)) {
+      sources.push(source);
+      sourceCode.push(null);
+      delete notSources[source];
+      if (opts.watch) {
+        watch(source, base);
+      }
+      try {
+        code = fs.readFileSync(source);
+      } catch (_error) {
+        err = _error;
+        if (err.code === 'ENOENT') {
+          return;
+        } else {
+          throw err;
         }
-        return;
       }
-      if (stats.isDirectory()) {
-        if (opts.watch) {
-          watchDir(source, base);
+      return compileScript(source, code.toString(), base);
+    } else {
+      return notSources[source] = true;
+    }
+  };
+
+  findDirectoryIndex = function(source) {
+    var err, ext, index, _i, _len, _ref1;
+    _ref1 = CoffeeScript.FILE_EXTENSIONS;
+    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+      ext = _ref1[_i];
+      index = path.join(source, "index" + ext);
+      try {
+        if ((fs.statSync(index)).isFile()) {
+          return index;
         }
-        return fs.readdir(source, function(err, files) {
-          var file, index, _ref1, _ref2;
-          if (err && err.code !== 'ENOENT') {
-            throw err;
-          }
-          if ((err != null ? err.code : void 0) === 'ENOENT') {
-            return;
-          }
-          index = sources.indexOf(source);
-          files = files.filter(function(file) {
-            return !hidden(file);
-          });
-          [].splice.apply(sources, [index, index - index + 1].concat(_ref1 = (function() {
-            var _i, _len, _results;
-            _results = [];
-            for (_i = 0, _len = files.length; _i < _len; _i++) {
-              file = files[_i];
-              _results.push(path.join(source, file));
-            }
-            return _results;
-          })())), _ref1;
-          [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() {
-            return null;
-          }))), _ref2;
-          return files.forEach(function(file) {
-            return compilePath(path.join(source, file), false, base);
-          });
-        });
-      } else if (topLevel || path.extname(source) === '.coffee') {
-        if (opts.watch) {
-          watch(source, base);
+      } catch (_error) {
+        err = _error;
+        if (err.code !== 'ENOENT') {
+          throw err;
         }
-        return fs.readFile(source, function(err, code) {
-          if (err && err.code !== 'ENOENT') {
-            throw err;
-          }
-          if ((err != null ? err.code : void 0) === 'ENOENT') {
-            return;
-          }
-          return compileScript(source, code.toString(), base);
-        });
-      } else {
-        notSources[source] = true;
-        return removeSource(source, base);
       }
-    });
+    }
+    console.error("Missing index.coffee or index.litcoffee in " + source);
+    return process.exit(1);
   };
 
   compileScript = function(file, input, base) {
-    var o, options, t, task;
+    var compiled, err, message, o, options, t, task;
+    if (base == null) {
+      base = null;
+    }
     o = opts;
-    options = compileOptions(file);
+    options = compileOptions(file, base);
     try {
       t = task = {
         file: file,
@@ -168,35 +200,45 @@
       };
       CoffeeScript.emit('compile', task);
       if (o.tokens) {
-        return printTokens(CoffeeScript.tokens(t.input));
+        return printTokens(CoffeeScript.tokens(t.input, t.options));
       } else if (o.nodes) {
-        return printLine(CoffeeScript.nodes(t.input).toString().trim());
+        return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim());
       } else if (o.run) {
+        CoffeeScript.register();
         return CoffeeScript.run(t.input, t.options);
       } else if (o.join && t.file !== o.join) {
+        if (helpers.isLiterate(file)) {
+          t.input = helpers.invertLiterate(t.input);
+        }
         sourceCode[sources.indexOf(t.file)] = t.input;
         return compileJoin();
       } else {
-        t.output = CoffeeScript.compile(t.input, t.options);
+        compiled = CoffeeScript.compile(t.input, t.options);
+        t.output = compiled;
+        if (o.map) {
+          t.output = compiled.js;
+          t.sourceMap = compiled.v3SourceMap;
+        }
         CoffeeScript.emit('success', task);
         if (o.print) {
           return printLine(t.output.trim());
-        } else if (o.compile) {
-          return writeJs(t.file, t.output, base);
-        } else if (o.lint) {
-          return lint(t.file, t.output);
+        } else if (o.compile || o.map) {
+          return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap);
         }
       }
-    } catch (err) {
+    } catch (_error) {
+      err = _error;
       CoffeeScript.emit('failure', err, task);
       if (CoffeeScript.listeners('failure').length) {
         return;
       }
+      message = err.stack || ("" + err);
       if (o.watch) {
-        return printLine(err.message + '\x07');
+        return printLine(message + '\x07');
+      } else {
+        printWarn(message);
+        return process.exit(1);
       }
-      printWarn(err instanceof Error && err.stack || ("ERROR: " + err));
-      return process.exit(1);
     }
   };
 
@@ -230,36 +272,24 @@
     }
   };
 
-  loadRequires = function() {
-    var realFilename, req, _i, _len, _ref1;
-    realFilename = module.filename;
-    module.filename = '.';
-    _ref1 = opts.require;
-    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
-      req = _ref1[_i];
-      require(req);
-    }
-    return module.filename = realFilename;
-  };
-
   watch = function(source, base) {
-    var compile, compileTimeout, prevStats, rewatch, watchErr, watcher;
+    var compile, compileTimeout, err, prevStats, rewatch, startWatcher, watchErr, watcher;
+    watcher = null;
     prevStats = null;
     compileTimeout = null;
-    watchErr = function(e) {
-      if (e.code === 'ENOENT') {
-        if (sources.indexOf(source) === -1) {
-          return;
-        }
-        try {
-          rewatch();
-          return compile();
-        } catch (e) {
-          removeSource(source, base, true);
-          return compileJoin();
-        }
-      } else {
-        throw e;
+    watchErr = function(err) {
+      if (err.code !== 'ENOENT') {
+        throw err;
+      }
+      if (__indexOf.call(sources, source) < 0) {
+        return;
+      }
+      try {
+        rewatch();
+        return compile();
+      } catch (_error) {
+        removeSource(source, base);
+        return compileJoin();
       }
     };
     compile = function() {
@@ -283,138 +313,171 @@
         });
       });
     };
-    try {
-      watcher = fs.watch(source, compile);
-    } catch (e) {
-      watchErr(e);
-    }
-    return rewatch = function() {
+    startWatcher = function() {
+      return watcher = fs.watch(source).on('change', compile).on('error', function(err) {
+        if (err.code !== 'EPERM') {
+          throw err;
+        }
+        return removeSource(source, base);
+      });
+    };
+    rewatch = function() {
       if (watcher != null) {
         watcher.close();
       }
-      return watcher = fs.watch(source, compile);
+      return startWatcher();
     };
+    try {
+      return startWatcher();
+    } catch (_error) {
+      err = _error;
+      return watchErr(err);
+    }
   };
 
   watchDir = function(source, base) {
-    var readdirTimeout, watcher;
+    var err, readdirTimeout, startWatcher, stopWatcher, watcher;
+    watcher = null;
     readdirTimeout = null;
-    try {
-      return watcher = fs.watch(source, function() {
+    startWatcher = function() {
+      return watcher = fs.watch(source).on('error', function(err) {
+        if (err.code !== 'EPERM') {
+          throw err;
+        }
+        return stopWatcher();
+      }).on('change', function() {
         clearTimeout(readdirTimeout);
         return readdirTimeout = wait(25, function() {
-          return fs.readdir(source, function(err, files) {
-            var file, _i, _len, _results;
-            if (err) {
-              if (err.code !== 'ENOENT') {
-                throw err;
-              }
-              watcher.close();
-              return unwatchDir(source, base);
-            }
-            _results = [];
-            for (_i = 0, _len = files.length; _i < _len; _i++) {
-              file = files[_i];
-              if (!(!hidden(file) && !notSources[file])) {
-                continue;
-              }
-              file = path.join(source, file);
-              if (sources.some(function(s) {
-                return s.indexOf(file) >= 0;
-              })) {
-                continue;
-              }
-              sources.push(file);
-              sourceCode.push(null);
-              _results.push(compilePath(file, false, base));
+          var err, file, files, _i, _len, _results;
+          try {
+            files = fs.readdirSync(source);
+          } catch (_error) {
+            err = _error;
+            if (err.code !== 'ENOENT') {
+              throw err;
             }
-            return _results;
-          });
+            return stopWatcher();
+          }
+          _results = [];
+          for (_i = 0, _len = files.length; _i < _len; _i++) {
+            file = files[_i];
+            _results.push(compilePath(path.join(source, file), false, base));
+          }
+          return _results;
         });
       });
-    } catch (e) {
-      if (e.code !== 'ENOENT') {
-        throw e;
+    };
+    stopWatcher = function() {
+      watcher.close();
+      return removeSourceDir(source, base);
+    };
+    watchedDirs[source] = true;
+    try {
+      return startWatcher();
+    } catch (_error) {
+      err = _error;
+      if (err.code !== 'ENOENT') {
+        throw err;
       }
     }
   };
 
-  unwatchDir = function(source, base) {
-    var file, prevSources, toRemove, _i, _len;
-    prevSources = sources.slice(0);
-    toRemove = (function() {
-      var _i, _len, _results;
-      _results = [];
-      for (_i = 0, _len = sources.length; _i < _len; _i++) {
-        file = sources[_i];
-        if (file.indexOf(source) >= 0) {
-          _results.push(file);
-        }
+  removeSourceDir = function(source, base) {
+    var file, sourcesChanged, _i, _len;
+    delete watchedDirs[source];
+    sourcesChanged = false;
+    for (_i = 0, _len = sources.length; _i < _len; _i++) {
+      file = sources[_i];
+      if (!(source === path.dirname(file))) {
+        continue;
       }
-      return _results;
-    })();
-    for (_i = 0, _len = toRemove.length; _i < _len; _i++) {
-      file = toRemove[_i];
-      removeSource(file, base, true);
+      removeSource(file, base);
+      sourcesChanged = true;
     }
-    if (!sources.some(function(s, i) {
-      return prevSources[i] !== s;
-    })) {
-      return;
+    if (sourcesChanged) {
+      return compileJoin();
     }
-    return compileJoin();
   };
 
-  removeSource = function(source, base, removeJs) {
-    var index, jsPath;
+  removeSource = function(source, base) {
+    var index;
     index = sources.indexOf(source);
     sources.splice(index, 1);
     sourceCode.splice(index, 1);
-    if (removeJs && !opts.join) {
-      jsPath = outputPath(source, base);
-      return path.exists(jsPath, function(exists) {
-        if (exists) {
-          return fs.unlink(jsPath, function(err) {
-            if (err && err.code !== 'ENOENT') {
-              throw err;
-            }
-            return timeLog("removed " + source);
-          });
-        }
-      });
+    if (!opts.join) {
+      silentUnlink(outputPath(source, base));
+      silentUnlink(outputPath(source, base, '.js.map'));
+      return timeLog("removed " + source);
+    }
+  };
+
+  silentUnlink = function(path) {
+    var err, _ref1;
+    try {
+      return fs.unlinkSync(path);
+    } catch (_error) {
+      err = _error;
+      if ((_ref1 = err.code) !== 'ENOENT' && _ref1 !== 'EPERM') {
+        throw err;
+      }
     }
   };
 
-  outputPath = function(source, base) {
-    var baseDir, dir, filename, srcDir;
-    filename = path.basename(source, path.extname(source)) + '.js';
+  outputPath = function(source, base, extension) {
+    var basename, dir, srcDir;
+    if (extension == null) {
+      extension = ".js";
+    }
+    basename = helpers.baseFileName(source, true, useWinPathSep);
     srcDir = path.dirname(source);
-    baseDir = base === '.' ? srcDir : srcDir.substring(base.length);
-    dir = opts.output ? path.join(opts.output, baseDir) : srcDir;
-    return path.join(dir, filename);
+    if (!opts.output) {
+      dir = srcDir;
+    } else if (source === base) {
+      dir = opts.output;
+    } else {
+      dir = path.join(opts.output, path.relative(base, srcDir));
+    }
+    return path.join(dir, basename + extension);
   };
 
-  writeJs = function(source, js, base) {
-    var compile, jsDir, jsPath;
-    jsPath = outputPath(source, base);
+  writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) {
+    var compile, jsDir, sourceMapPath;
+    if (generatedSourceMap == null) {
+      generatedSourceMap = null;
+    }
+    sourceMapPath = outputPath(sourcePath, base, ".js.map");
     jsDir = path.dirname(jsPath);
     compile = function() {
-      if (js.length <= 0) {
-        js = ' ';
-      }
-      return fs.writeFile(jsPath, js, function(err) {
-        if (err) {
-          return printLine(err.message);
-        } else if (opts.compile && opts.watch) {
-          return timeLog("compiled " + source);
+      if (opts.compile) {
+        if (js.length <= 0) {
+          js = ' ';
         }
-      });
+        if (generatedSourceMap) {
+          js = "" + js + "\n//# sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, useWinPathSep)) + "\n";
+        }
+        fs.writeFile(jsPath, js, function(err) {
+          if (err) {
+            printLine(err.message);
+            return process.exit(1);
+          } else if (opts.compile && opts.watch) {
+            return timeLog("compiled " + sourcePath);
+          }
+        });
+      }
+      if (generatedSourceMap) {
+        return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) {
+          if (err) {
+            printLine("Could not write source map: " + err.message);
+            return process.exit(1);
+          }
+        });
+      }
     };
-    return path.exists(jsDir, function(exists) {
-      if (exists) {
+    return fs.exists(jsDir, function(itExists) {
+      if (itExists) {
         return compile();
       } else {
-        return exec("mkdir -p " + jsDir, compile);
+        return mkdirp(jsDir, compile);
       }
     });
   };
@@ -427,27 +490,15 @@
     return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message);
   };
 
-  lint = function(file, js) {
-    var conf, jsl, printIt;
-    printIt = function(buffer) {
-      return printLine(file + ':\t' + buffer.toString().trim());
-    };
-    conf = __dirname + '/../../extras/jsl.conf';
-    jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]);
-    jsl.stdout.on('data', printIt);
-    jsl.stderr.on('data', printIt);
-    jsl.stdin.write(js);
-    return jsl.stdin.end();
-  };
-
   printTokens = function(tokens) {
     var strings, tag, token, value;
     strings = (function() {
-      var _i, _len, _ref1, _results;
+      var _i, _len, _results;
       _results = [];
       for (_i = 0, _len = tokens.length; _i < _len; _i++) {
         token = tokens[_i];
-        _ref1 = [token[0], token[1].toString().replace(/\n/, '\\n')], tag = _ref1[0], value = _ref1[1];
+        tag = token[0];
+        value = token[1].toString().replace(/\n/, '\\n');
         _results.push("[" + tag + " " + value + "]");
       }
       return _results;
@@ -456,37 +507,58 @@
   };
 
   parseOptions = function() {
-    var i, o, source, _i, _len;
+    var o;
     optionParser = new optparse.OptionParser(SWITCHES, BANNER);
     o = opts = optionParser.parse(process.argv.slice(2));
     o.compile || (o.compile = !!o.output);
-    o.run = !(o.compile || o.print || o.lint);
-    o.print = !!(o.print || (o["eval"] || o.stdio && o.compile));
-    sources = o["arguments"];
-    for (i = _i = 0, _len = sources.length; _i < _len; i = ++_i) {
-      source = sources[i];
-      sourceCode[i] = null;
-    }
+    o.run = !(o.compile || o.print || o.map);
+    return o.print = !!(o.print || (o["eval"] || o.stdio && o.compile));
   };
 
-  compileOptions = function(filename) {
-    return {
+  compileOptions = function(filename, base) {
+    var answer, cwd, jsDir, jsPath;
+    answer = {
       filename: filename,
+      literate: opts.literate || helpers.isLiterate(filename),
       bare: opts.bare,
-      header: opts.compile
+      header: opts.compile && !opts['no-header'],
+      sourceMap: opts.map
     };
+    if (filename) {
+      if (base) {
+        cwd = process.cwd();
+        jsPath = outputPath(filename, base);
+        jsDir = path.dirname(jsPath);
+        answer = helpers.merge(answer, {
+          jsPath: jsPath,
+          sourceRoot: path.relative(jsDir, cwd),
+          sourceFiles: [path.relative(cwd, filename)],
+          generatedFile: helpers.baseFileName(jsPath, false, useWinPathSep)
+        });
+      } else {
+        answer = helpers.merge(answer, {
+          sourceRoot: "",
+          sourceFiles: [helpers.baseFileName(filename, false, useWinPathSep)],
+          generatedFile: helpers.baseFileName(filename, true, useWinPathSep) + ".js"
+        });
+      }
+    }
+    return answer;
   };
 
   forkNode = function() {
-    var args, nodeArgs;
+    var args, nodeArgs, p;
     nodeArgs = opts.nodejs.split(/\s+/);
     args = process.argv.slice(1);
     args.splice(args.indexOf('--nodejs'), 2);
-    return spawn(process.execPath, nodeArgs.concat(args), {
+    p = spawn(process.execPath, nodeArgs.concat(args), {
       cwd: process.cwd(),
       env: process.env,
       customFds: [0, 1, 2]
     });
+    return p.on('exit', function(code) {
+      return process.exit(code);
+    });
   };
 
   usage = function() {

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/grammar.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/grammar.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/grammar.js
index 5662138..cfcab24 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/grammar.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/grammar.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
   var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
 
@@ -7,22 +7,32 @@
   unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
 
   o = function(patternString, action, options) {
-    var match;
+    var addLocationDataFn, match, patternCount;
     patternString = patternString.replace(/\s{2,}/g, ' ');
+    patternCount = patternString.split(' ').length;
     if (!action) {
       return [patternString, '$$ = $1;', options];
     }
     action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())";
     action = action.replace(/\bnew /g, '$&yy.');
     action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&');
-    return [patternString, "$$ = " + action + ";", options];
+    addLocationDataFn = function(first, last) {
+      if (!last) {
+        return "yy.addLocationDataFn(@" + first + ")";
+      } else {
+        return "yy.addLocationDataFn(@" + first + ", @" + last + ")";
+      }
+    };
+    action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1'));
+    action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2'));
+    return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options];
   };
 
   grammar = {
     Root: [
       o('', function() {
         return new Block;
-      }), o('Body'), o('Block TERMINATOR')
+      }), o('Body')
     ],
     Body: [
       o('Line', function() {
@@ -85,10 +95,9 @@
       o('ObjAssignable', function() {
         return new Value($1);
       }), o('ObjAssignable : Expression', function() {
-        return new Assign(new Value($1), $3, 'object');
-      }), o('ObjAssignable :\
-       INDENT Expression OUTDENT', function() {
-        return new Assign(new Value($1), $4, 'object');
+        return new Assign(LOC(1)(new Value($1)), $3, 'object');
+      }), o('ObjAssignable : INDENT Expression OUTDENT', function() {
+        return new Assign(LOC(1)(new Value($1)), $4, 'object');
       }), o('Comment')
     ],
     ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')],
@@ -139,6 +148,8 @@
         return new Param($1, null, true);
       }), o('ParamVar = Expression', function() {
         return new Param($1, $3);
+      }), o('...', function() {
+        return new Expansion;
       })
     ],
     ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')],
@@ -178,7 +189,9 @@
       }), o('?. Identifier', function() {
         return new Access($2, 'soak');
       }), o(':: Identifier', function() {
-        return [new Access(new Literal('prototype')), new Access($2)];
+        return [LOC(1)(new Access(new Literal('prototype'))), LOC(2)(new Access($2))];
+      }), o('?:: Identifier', function() {
+        return [LOC(1)(new Access(new Literal('prototype'), 'soak')), LOC(2)(new Access($2))];
       }), o('::', function() {
         return new Access(new Literal('prototype'));
       }), o('Index')
@@ -270,7 +283,7 @@
     ],
     ThisProperty: [
       o('@ Identifier', function() {
-        return new Value(new Literal('this'), [new Access($2)], 'this');
+        return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this');
       })
     ],
     Array: [
@@ -316,7 +329,11 @@
         return $1.concat($4);
       })
     ],
-    Arg: [o('Expression'), o('Splat')],
+    Arg: [
+      o('Expression'), o('Splat'), o('...', function() {
+        return new Expansion;
+      })
+    ],
     SimpleArgs: [
       o('Expression'), o('SimpleArgs , Expression', function() {
         return [].concat($1, $3);
@@ -336,6 +353,10 @@
     Catch: [
       o('CATCH Identifier Block', function() {
         return [$2, $3];
+      }), o('CATCH Object Block', function() {
+        return [LOC(2)(new Value($2)), $3];
+      }), o('CATCH Block', function() {
+        return [null, $2];
       })
     ],
     Throw: [
@@ -372,18 +393,18 @@
       o('WhileSource Block', function() {
         return $1.addBody($2);
       }), o('Statement  WhileSource', function() {
-        return $2.addBody(Block.wrap([$1]));
+        return $2.addBody(LOC(1)(Block.wrap([$1])));
       }), o('Expression WhileSource', function() {
-        return $2.addBody(Block.wrap([$1]));
+        return $2.addBody(LOC(1)(Block.wrap([$1])));
       }), o('Loop', function() {
         return $1;
       })
     ],
     Loop: [
       o('LOOP Block', function() {
-        return new While(new Literal('true')).addBody($2);
+        return new While(LOC(1)(new Literal('true'))).addBody($2);
       }), o('LOOP Expression', function() {
-        return new While(new Literal('true')).addBody(Block.wrap([$2]));
+        return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2])));
       })
     ],
     For: [
@@ -398,7 +419,7 @@
     ForBody: [
       o('FOR Range', function() {
         return {
-          source: new Value($2)
+          source: LOC(2)(new Value($2))
         };
       }), o('ForStart ForSource', function() {
         $2.own = $1.own;
@@ -498,21 +519,21 @@
           type: $1
         });
       }), o('IfBlock ELSE IF Expression Block', function() {
-        return $1.addElse(new If($4, $5, {
+        return $1.addElse(LOC(3, 5)(new If($4, $5, {
           type: $3
-        }));
+        })));
       })
     ],
     If: [
       o('IfBlock'), o('IfBlock ELSE Block', function() {
         return $1.addElse($3);
       }), o('Statement  POST_IF Expression', function() {
-        return new If($3, Block.wrap([$1]), {
+        return new If($3, LOC(1)(Block.wrap([$1])), {
           type: $2,
           statement: true
         });
       }), o('Expression POST_IF Expression', function() {
-        return new If($3, Block.wrap([$1]), {
+        return new If($3, LOC(1)(Block.wrap([$1])), {
           type: $2,
           statement: true
         });
@@ -521,14 +542,16 @@
     Operation: [
       o('UNARY Expression', function() {
         return new Op($1, $2);
+      }), o('UNARY_MATH Expression', function() {
+        return new Op($1, $2);
       }), o('-     Expression', (function() {
         return new Op('-', $2);
       }), {
-        prec: 'UNARY'
+        prec: 'UNARY_MATH'
       }), o('+     Expression', (function() {
         return new Op('+', $2);
       }), {
-        prec: 'UNARY'
+        prec: 'UNARY_MATH'
       }), o('-- SimpleAssignable', function() {
         return new Op('--', $2);
       }), o('++ SimpleAssignable', function() {
@@ -545,6 +568,8 @@
         return new Op('-', $1, $3);
       }), o('Expression MATH     Expression', function() {
         return new Op($2, $1, $3);
+      }), o('Expression **       Expression', function() {
+        return new Op($2, $1, $3);
       }), o('Expression SHIFT    Expression', function() {
         return new Op($2, $1, $3);
       }), o('Expression COMPARE  Expression', function() {
@@ -557,11 +582,11 @@
         } else {
           return new Op($2, $1, $3);
         }
-      }), o('SimpleAssignable COMPOUND_ASSIGN\
-       Expression', function() {
+      }), o('SimpleAssignable COMPOUND_ASSIGN Expression', function() {
         return new Assign($1, $3, $2);
-      }), o('SimpleAssignable COMPOUND_ASSIGN\
-       INDENT Expression OUTDENT', function() {
+      }), o('SimpleAssignable COMPOUND_ASSIGN INDENT Expression OUTDENT', function() {
+        return new Assign($1, $4, $2);
+      }), o('SimpleAssignable COMPOUND_ASSIGN TERMINATOR Expression', function() {
         return new Assign($1, $4, $2);
       }), o('SimpleAssignable EXTENDS Expression', function() {
         return new Extends($1, $3);
@@ -569,7 +594,7 @@
     ]
   };
 
-  operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']];
+  operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['right', '**'], ['right', 'UNARY_MATH'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['left', 'POST_IF']];
 
   tokens = [];
 


[11/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/helpers.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/helpers.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/helpers.js
index b0a997b..049f757 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/helpers.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/helpers.js
@@ -1,6 +1,6 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var extend, flatten;
+  var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref;
 
   exports.starts = function(string, literal, start) {
     return literal === string.substr(start, literal.length);
@@ -12,6 +12,19 @@
     return literal === string.substr(string.length - len - (back || 0), len);
   };
 
+  exports.repeat = repeat = function(str, n) {
+    var res;
+    res = '';
+    while (n > 0) {
+      if (n & 1) {
+        res += str;
+      }
+      n >>>= 1;
+      str += str;
+    }
+    return res;
+  };
+
   exports.compact = function(array) {
     var item, _i, _len, _results;
     _results = [];
@@ -70,8 +83,170 @@
     return val;
   };
 
-  exports.last = function(array, back) {
+  exports.last = last = function(array, back) {
     return array[array.length - (back || 0) - 1];
   };
 
+  exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) {
+    var e, _i, _len;
+    for (_i = 0, _len = this.length; _i < _len; _i++) {
+      e = this[_i];
+      if (fn(e)) {
+        return true;
+      }
+    }
+    return false;
+  };
+
+  exports.invertLiterate = function(code) {
+    var line, lines, maybe_code;
+    maybe_code = true;
+    lines = (function() {
+      var _i, _len, _ref1, _results;
+      _ref1 = code.split('\n');
+      _results = [];
+      for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+        line = _ref1[_i];
+        if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) {
+          _results.push(line);
+        } else if (maybe_code = /^\s*$/.test(line)) {
+          _results.push(line);
+        } else {
+          _results.push('# ' + line);
+        }
+      }
+      return _results;
+    })();
+    return lines.join('\n');
+  };
+
+  buildLocationData = function(first, last) {
+    if (!last) {
+      return first;
+    } else {
+      return {
+        first_line: first.first_line,
+        first_column: first.first_column,
+        last_line: last.last_line,
+        last_column: last.last_column
+      };
+    }
+  };
+
+  exports.addLocationDataFn = function(first, last) {
+    return function(obj) {
+      if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) {
+        obj.updateLocationDataIfMissing(buildLocationData(first, last));
+      }
+      return obj;
+    };
+  };
+
+  exports.locationDataToString = function(obj) {
+    var locationData;
+    if (("2" in obj) && ("first_line" in obj[2])) {
+      locationData = obj[2];
+    } else if ("first_line" in obj) {
+      locationData = obj;
+    }
+    if (locationData) {
+      return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1));
+    } else {
+      return "No location data";
+    }
+  };
+
+  exports.baseFileName = function(file, stripExt, useWinPathSep) {
+    var parts, pathSep;
+    if (stripExt == null) {
+      stripExt = false;
+    }
+    if (useWinPathSep == null) {
+      useWinPathSep = false;
+    }
+    pathSep = useWinPathSep ? /\\|\// : /\//;
+    parts = file.split(pathSep);
+    file = parts[parts.length - 1];
+    if (!(stripExt && file.indexOf('.') >= 0)) {
+      return file;
+    }
+    parts = file.split('.');
+    parts.pop();
+    if (parts[parts.length - 1] === 'coffee' && parts.length > 1) {
+      parts.pop();
+    }
+    return parts.join('.');
+  };
+
+  exports.isCoffee = function(file) {
+    return /\.((lit)?coffee|coffee\.md)$/.test(file);
+  };
+
+  exports.isLiterate = function(file) {
+    return /\.(litcoffee|coffee\.md)$/.test(file);
+  };
+
+  exports.throwSyntaxError = function(message, location) {
+    var error;
+    error = new SyntaxError(message);
+    error.location = location;
+    error.toString = syntaxErrorToString;
+    error.stack = error.toString();
+    throw error;
+  };
+
+  exports.updateSyntaxError = function(error, code, filename) {
+    if (error.toString === syntaxErrorToString) {
+      error.code || (error.code = code);
+      error.filename || (error.filename = filename);
+      error.stack = error.toString();
+    }
+    return error;
+  };
+
+  syntaxErrorToString = function() {
+    var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, start, _ref1, _ref2;
+    if (!(this.code && this.location)) {
+      return Error.prototype.toString.call(this);
+    }
+    _ref1 = this.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column;
+    if (last_line == null) {
+      last_line = first_line;
+    }
+    if (last_column == null) {
+      last_column = first_column;
+    }
+    filename = this.filename || '[stdin]';
+    codeLine = this.code.split('\n')[first_line];
+    start = first_column;
+    end = first_line === last_line ? last_column + 1 : codeLine.length;
+    marker = codeLine.slice(0, start).replace(/[^\s]/g, ' ') + repeat('^', end - start);
+    if (typeof process !== "undefined" && process !== null) {
+      colorsEnabled = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS;
+    }
+    if ((_ref2 = this.colorful) != null ? _ref2 : colorsEnabled) {
+      colorize = function(str) {
+        return "\x1B[1;31m" + str + "\x1B[0m";
+      };
+      codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end);
+      marker = colorize(marker);
+    }
+    return "" + filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker;
+  };
+
+  exports.nameWhitespaceCharacter = function(string) {
+    switch (string) {
+      case ' ':
+        return 'space';
+      case '\n':
+        return 'newline';
+      case '\r':
+        return 'carriage return';
+      case '\t':
+        return 'tab';
+      default:
+        return string;
+    }
+  };
+
 }).call(this);

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/index.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/index.js
index d344c41..46c97ea 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/index.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/index.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
   var key, val, _ref;
 

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/lexer.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/lexer.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/lexer.js
index f80a443..0f3cef8 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/lexer.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/lexer.js
@@ -1,36 +1,36 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1,
+  var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDENTABLE_CLOSERS, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, UNARY_MATH, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, repeat, starts, throwSyntaxError, _ref, _ref1,
     __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
   _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES;
 
-  _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last;
+  _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, repeat = _ref1.repeat, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
 
   exports.Lexer = Lexer = (function() {
-
     function Lexer() {}
 
     Lexer.prototype.tokenize = function(code, opts) {
-      var i, tag;
+      var consumed, i, tag, _ref2;
       if (opts == null) {
         opts = {};
       }
-      if (WHITESPACE.test(code)) {
-        code = "\n" + code;
-      }
-      code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
-      this.code = code;
-      this.line = opts.line || 0;
+      this.literate = opts.literate;
       this.indent = 0;
+      this.baseIndent = 0;
       this.indebt = 0;
       this.outdebt = 0;
       this.indents = [];
       this.ends = [];
       this.tokens = [];
+      this.chunkLine = opts.line || 0;
+      this.chunkColumn = opts.column || 0;
+      code = this.clean(code);
       i = 0;
       while (this.chunk = code.slice(i)) {
-        i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+        consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+        _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1];
+        i += consumed;
       }
       this.closeIndentation();
       if (tag = this.ends.pop()) {
@@ -42,17 +42,34 @@
       return (new Rewriter).rewrite(this.tokens);
     };
 
+    Lexer.prototype.clean = function(code) {
+      if (code.charCodeAt(0) === BOM) {
+        code = code.slice(1);
+      }
+      code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
+      if (WHITESPACE.test(code)) {
+        code = "\n" + code;
+        this.chunkLine--;
+      }
+      if (this.literate) {
+        code = invertLiterate(code);
+      }
+      return code;
+    };
+
     Lexer.prototype.identifierToken = function() {
-      var colon, forcedIdentifier, id, input, match, prev, tag, _ref2, _ref3;
+      var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4;
       if (!(match = IDENTIFIER.exec(this.chunk))) {
         return 0;
       }
       input = match[0], id = match[1], colon = match[2];
+      idLength = id.length;
+      poppedToken = void 0;
       if (id === 'own' && this.tag() === 'FOR') {
         this.token('OWN', id);
         return id.length;
       }
-      forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::') || !prev.spaced && prev[0] === '@');
+      forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@');
       tag = 'IDENTIFIER';
       if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
         tag = id.toUpperCase();
@@ -71,7 +88,7 @@
           } else {
             tag = 'RELATION';
             if (this.value() === '!') {
-              this.tokens.pop();
+              poppedToken = this.tokens.pop();
               id = '!' + id;
             }
           }
@@ -111,9 +128,13 @@
           }
         })();
       }
-      this.token(tag, id);
+      tagToken = this.token(tag, id, 0, idLength);
+      if (poppedToken) {
+        _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1];
+      }
       if (colon) {
-        this.token(':', ':');
+        colonOffset = input.lastIndexOf(':');
+        this.token(':', ':', colonOffset, colon.length);
       }
       return input.length;
     };
@@ -135,46 +156,50 @@
       }
       lexedLength = number.length;
       if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
-        number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16);
+        number = '0x' + parseInt(octalLiteral[1], 8).toString(16);
       }
       if (binaryLiteral = /^0b([01]+)/.exec(number)) {
-        number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16);
+        number = '0x' + parseInt(binaryLiteral[1], 2).toString(16);
       }
-      this.token('NUMBER', number);
+      this.token('NUMBER', number, 0, lexedLength);
       return lexedLength;
     };
 
     Lexer.prototype.stringToken = function() {
-      var match, octalEsc, string;
-      switch (this.chunk.charAt(0)) {
+      var inner, innerLen, numBreak, octalEsc, pos, quote, string, trimmed;
+      switch (quote = this.chunk.charAt(0)) {
         case "'":
-          if (!(match = SIMPLESTR.exec(this.chunk))) {
-            return 0;
-          }
-          this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n'));
+          string = (SIMPLESTR.exec(this.chunk) || [])[0];
           break;
         case '"':
-          if (!(string = this.balancedString(this.chunk, '"'))) {
-            return 0;
-          }
-          if (0 < string.indexOf('#{', 1)) {
-            this.interpolateString(string.slice(1, -1));
-          } else {
-            this.token('STRING', this.escapeLines(string));
-          }
-          break;
-        default:
-          return 0;
+          string = this.balancedString(this.chunk, '"');
+      }
+      if (!string) {
+        return 0;
+      }
+      inner = string.slice(1, -1);
+      trimmed = this.removeNewlines(inner);
+      if (quote === '"' && 0 < string.indexOf('#{', 1)) {
+        numBreak = pos = 0;
+        innerLen = inner.length;
+        while (inner.charAt(pos++) === '\n' && pos < innerLen) {
+          numBreak++;
+        }
+        this.interpolateString(trimmed, {
+          strOffset: 1 + numBreak,
+          lexedLength: string.length
+        });
+      } else {
+        this.token('STRING', quote + this.escapeLines(trimmed) + quote, 0, string.length);
       }
       if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
         this.error("octal escape sequences " + string + " are not allowed");
       }
-      this.line += count(string, '\n');
       return string.length;
     };
 
     Lexer.prototype.heredocToken = function() {
-      var doc, heredoc, match, quote;
+      var doc, heredoc, match, quote, strOffset;
       if (!(match = HEREDOC.exec(this.chunk))) {
         return 0;
       }
@@ -185,13 +210,15 @@
         indent: null
       });
       if (quote === '"' && 0 <= doc.indexOf('#{')) {
+        strOffset = match[2].charAt(0) === '\n' ? 4 : 3;
         this.interpolateString(doc, {
-          heredoc: true
+          heredoc: true,
+          strOffset: strOffset,
+          lexedLength: heredoc.length
         });
       } else {
-        this.token('STRING', this.makeString(doc, quote, true));
+        this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length);
       }
-      this.line += count(heredoc, '\n');
       return heredoc.length;
     };
 
@@ -204,10 +231,9 @@
       if (here) {
         this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
           herecomment: true,
-          indent: Array(this.indent + 1).join(' ')
-        }));
+          indent: repeat(' ', this.indent)
+        }), 0, comment.length);
       }
-      this.line += count(comment, '\n');
       return comment.length;
     };
 
@@ -216,7 +242,7 @@
       if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
         return 0;
       }
-      this.token('JS', (script = match[0]).slice(1, -1));
+      this.token('JS', (script = match[0]).slice(1, -1), 0, script.length);
       return script.length;
     };
 
@@ -225,9 +251,7 @@
       if (this.chunk.charAt(0) !== '/') {
         return 0;
       }
-      if (match = HEREGEX.exec(this.chunk)) {
-        length = this.heregexToken(match);
-        this.line += count(match[0], '\n');
+      if (length = this.heregexToken()) {
         return length;
       }
       prev = last(this.tokens);
@@ -238,74 +262,87 @@
         return 0;
       }
       _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2];
+      if (regex === '//') {
+        return 0;
+      }
       if (regex.slice(0, 2) === '/*') {
         this.error('regular expressions cannot begin with `*`');
       }
-      if (regex === '//') {
-        regex = '/(?:)/';
-      }
-      this.token('REGEX', "" + regex + flags);
+      this.token('REGEX', "" + regex + flags, 0, match.length);
       return match.length;
     };
 
-    Lexer.prototype.heregexToken = function(match) {
-      var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4, _ref5;
+    Lexer.prototype.heregexToken = function() {
+      var body, flags, flagsOffset, heregex, match, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+      if (!(match = HEREGEX.exec(this.chunk))) {
+        return 0;
+      }
       heregex = match[0], body = match[1], flags = match[2];
       if (0 > body.indexOf('#{')) {
-        re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
+        re = this.escapeLines(body.replace(HEREGEX_OMIT, '$1$2').replace(/\//g, '\\/'), true);
         if (re.match(/^\*/)) {
           this.error('regular expressions cannot begin with `*`');
         }
-        this.token('REGEX', "/" + (re || '(?:)') + "/" + flags);
+        this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length);
         return heregex.length;
       }
-      this.token('IDENTIFIER', 'RegExp');
-      this.tokens.push(['CALL_START', '(']);
+      this.token('IDENTIFIER', 'RegExp', 0, 0);
+      this.token('CALL_START', '(', 0, 0);
       tokens = [];
       _ref2 = this.interpolateString(body, {
-        regex: true
+        regex: true,
+        strOffset: 3
       });
       for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-        _ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1];
+        token = _ref2[_i];
+        tag = token[0], value = token[1];
         if (tag === 'TOKENS') {
           tokens.push.apply(tokens, value);
-        } else {
-          if (!(value = value.replace(HEREGEX_OMIT, ''))) {
+        } else if (tag === 'NEOSTRING') {
+          if (!(value = value.replace(HEREGEX_OMIT, '$1$2'))) {
             continue;
           }
           value = value.replace(/\\/g, '\\\\');
-          tokens.push(['STRING', this.makeString(value, '"', true)]);
+          token[0] = 'STRING';
+          token[1] = this.makeString(value, '"', true);
+          tokens.push(token);
+        } else {
+          this.error("Unexpected " + tag);
         }
-        tokens.push(['+', '+']);
+        prev = last(this.tokens);
+        plusToken = ['+', '+'];
+        plusToken[2] = prev[2];
+        tokens.push(plusToken);
       }
       tokens.pop();
-      if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') {
-        this.tokens.push(['STRING', '""'], ['+', '+']);
+      if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') {
+        this.token('STRING', '""', 0, 0);
+        this.token('+', '+', 0, 0);
       }
-      (_ref5 = this.tokens).push.apply(_ref5, tokens);
+      (_ref4 = this.tokens).push.apply(_ref4, tokens);
       if (flags) {
-        this.tokens.push([',', ','], ['STRING', '"' + flags + '"']);
+        flagsOffset = heregex.lastIndexOf(flags);
+        this.token(',', ',', flagsOffset, 0);
+        this.token('STRING', '"' + flags + '"', flagsOffset, flags.length);
       }
-      this.token(')', ')');
+      this.token(')', ')', heregex.length - 1, 0);
       return heregex.length;
     };
 
     Lexer.prototype.lineToken = function() {
-      var diff, indent, match, noNewlines, prev, size;
+      var diff, indent, match, noNewlines, size;
       if (!(match = MULTI_DENT.exec(this.chunk))) {
         return 0;
       }
       indent = match[0];
-      this.line += count(indent, '\n');
       this.seenFor = false;
-      prev = last(this.tokens, 1);
       size = indent.length - 1 - indent.lastIndexOf('\n');
       noNewlines = this.unfinished();
       if (size - this.indebt === this.indent) {
         if (noNewlines) {
           this.suppressNewlines();
         } else {
-          this.newlineToken();
+          this.newlineToken(0);
         }
         return indent.length;
       }
@@ -315,37 +352,48 @@
           this.suppressNewlines();
           return indent.length;
         }
+        if (!this.tokens.length) {
+          this.baseIndent = this.indent = size;
+          return indent.length;
+        }
         diff = size - this.indent + this.outdebt;
-        this.token('INDENT', diff);
+        this.token('INDENT', diff, indent.length - size, size);
         this.indents.push(diff);
         this.ends.push('OUTDENT');
         this.outdebt = this.indebt = 0;
+        this.indent = size;
+      } else if (size < this.baseIndent) {
+        this.error('missing indentation', indent.length);
       } else {
         this.indebt = 0;
-        this.outdentToken(this.indent - size, noNewlines);
+        this.outdentToken(this.indent - size, noNewlines, indent.length);
       }
-      this.indent = size;
       return indent.length;
     };
 
-    Lexer.prototype.outdentToken = function(moveOut, noNewlines) {
-      var dent, len;
+    Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
+      var decreasedIndent, dent, lastIndent, _ref2;
+      decreasedIndent = this.indent - moveOut;
       while (moveOut > 0) {
-        len = this.indents.length - 1;
-        if (this.indents[len] === void 0) {
+        lastIndent = this.indents[this.indents.length - 1];
+        if (!lastIndent) {
           moveOut = 0;
-        } else if (this.indents[len] === this.outdebt) {
+        } else if (lastIndent === this.outdebt) {
           moveOut -= this.outdebt;
           this.outdebt = 0;
-        } else if (this.indents[len] < this.outdebt) {
-          this.outdebt -= this.indents[len];
-          moveOut -= this.indents[len];
+        } else if (lastIndent < this.outdebt) {
+          this.outdebt -= lastIndent;
+          moveOut -= lastIndent;
         } else {
-          dent = this.indents.pop() - this.outdebt;
-          moveOut -= dent;
+          dent = this.indents.pop() + this.outdebt;
+          if (outdentLength && (_ref2 = this.chunk[outdentLength], __indexOf.call(INDENTABLE_CLOSERS, _ref2) >= 0)) {
+            decreasedIndent -= dent - moveOut;
+            moveOut = dent;
+          }
           this.outdebt = 0;
           this.pair('OUTDENT');
-          this.token('OUTDENT', dent);
+          this.token('OUTDENT', moveOut, 0, outdentLength);
+          moveOut -= dent;
         }
       }
       if (dent) {
@@ -355,8 +403,9 @@
         this.tokens.pop();
       }
       if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
-        this.token('TERMINATOR', '\n');
+        this.token('TERMINATOR', '\n', outdentLength, 0);
       }
+      this.indent = decreasedIndent;
       return this;
     };
 
@@ -376,12 +425,12 @@
       }
     };
 
-    Lexer.prototype.newlineToken = function() {
+    Lexer.prototype.newlineToken = function(offset) {
       while (this.value() === ';') {
         this.tokens.pop();
       }
       if (this.tag() !== 'TERMINATOR') {
-        this.token('TERMINATOR', '\n');
+        this.token('TERMINATOR', '\n', offset, 0);
       }
       return this;
     };
@@ -426,6 +475,8 @@
         tag = 'COMPOUND_ASSIGN';
       } else if (__indexOf.call(UNARY, value) >= 0) {
         tag = 'UNARY';
+      } else if (__indexOf.call(UNARY_MATH, value) >= 0) {
+        tag = 'UNARY_MATH';
       } else if (__indexOf.call(SHIFT, value) >= 0) {
         tag = 'SHIFT';
       } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
@@ -466,7 +517,7 @@
         if (HEREDOC_ILLEGAL.test(doc)) {
           this.error("block comment cannot contain \"*/\", starting");
         }
-        if (doc.indexOf('\n') <= 0) {
+        if (doc.indexOf('\n') < 0) {
           return doc;
         }
       } else {
@@ -535,7 +586,7 @@
           case end:
             stack.pop();
             if (!stack.length) {
-              return str.slice(0, i + 1 || 9e9);
+              return str.slice(0, +i + 1 || 9e9);
             }
             end = stack[stack.length - 1];
             continue;
@@ -555,11 +606,14 @@
     };
 
     Lexer.prototype.interpolateString = function(str, options) {
-      var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+      var column, errorToken, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
       if (options == null) {
         options = {};
       }
-      heredoc = options.heredoc, regex = options.regex;
+      heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength;
+      offsetInChunk || (offsetInChunk = 0);
+      strOffset || (strOffset = 0);
+      lexedLength || (lexedLength = str.length);
       tokens = [];
       pi = 0;
       i = -1;
@@ -572,22 +626,27 @@
           continue;
         }
         if (pi < i) {
-          tokens.push(['NEOSTRING', str.slice(pi, i)]);
+          tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi));
+        }
+        if (!errorToken) {
+          errorToken = this.makeToken('', 'string interpolation', offsetInChunk + i + 1, 2);
         }
         inner = expr.slice(1, -1);
         if (inner.length) {
+          _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 2), line = _ref2[0], column = _ref2[1];
           nested = new Lexer().tokenize(inner, {
-            line: this.line,
+            line: line,
+            column: column,
             rewrite: false
           });
-          nested.pop();
-          if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') {
-            nested.shift();
+          popped = nested.pop();
+          if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') {
+            popped = nested.shift();
           }
           if (len = nested.length) {
             if (len > 1) {
-              nested.unshift(['(', '(', this.line]);
-              nested.push([')', ')', this.line]);
+              nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0));
+              nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0));
             }
             tokens.push(['TOKENS', nested]);
           }
@@ -596,52 +655,110 @@
         pi = i + 1;
       }
       if ((i > pi && pi < str.length)) {
-        tokens.push(['NEOSTRING', str.slice(pi)]);
+        tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi));
       }
       if (regex) {
         return tokens;
       }
       if (!tokens.length) {
-        return this.token('STRING', '""');
+        return this.token('STRING', '""', offsetInChunk, lexedLength);
       }
       if (tokens[0][0] !== 'NEOSTRING') {
-        tokens.unshift(['', '']);
+        tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk));
       }
       if (interpolated = tokens.length > 1) {
-        this.token('(', '(');
+        this.token('(', '(', offsetInChunk, 0, errorToken);
       }
       for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) {
-        _ref3 = tokens[i], tag = _ref3[0], value = _ref3[1];
+        token = tokens[i];
+        tag = token[0], value = token[1];
         if (i) {
-          this.token('+', '+');
+          if (i) {
+            plusToken = this.token('+', '+');
+          }
+          locationToken = tag === 'TOKENS' ? value[0] : token;
+          plusToken[2] = {
+            first_line: locationToken[2].first_line,
+            first_column: locationToken[2].first_column,
+            last_line: locationToken[2].first_line,
+            last_column: locationToken[2].first_column
+          };
         }
         if (tag === 'TOKENS') {
           (_ref4 = this.tokens).push.apply(_ref4, value);
+        } else if (tag === 'NEOSTRING') {
+          token[0] = 'STRING';
+          token[1] = this.makeString(value, '"', heredoc);
+          this.tokens.push(token);
         } else {
-          this.token('STRING', this.makeString(value, '"', heredoc));
+          this.error("Unexpected " + tag);
         }
       }
       if (interpolated) {
-        this.token(')', ')');
+        rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0);
+        rparen.stringEnd = true;
+        this.tokens.push(rparen);
       }
       return tokens;
     };
 
     Lexer.prototype.pair = function(tag) {
-      var size, wanted;
+      var wanted;
       if (tag !== (wanted = last(this.ends))) {
         if ('OUTDENT' !== wanted) {
           this.error("unmatched " + tag);
         }
-        this.indent -= size = last(this.indents);
-        this.outdentToken(size, true);
+        this.outdentToken(last(this.indents), true);
         return this.pair(tag);
       }
       return this.ends.pop();
     };
 
-    Lexer.prototype.token = function(tag, value) {
-      return this.tokens.push([tag, value, this.line]);
+    Lexer.prototype.getLineAndColumnFromChunk = function(offset) {
+      var column, lineCount, lines, string;
+      if (offset === 0) {
+        return [this.chunkLine, this.chunkColumn];
+      }
+      if (offset >= this.chunk.length) {
+        string = this.chunk;
+      } else {
+        string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);
+      }
+      lineCount = count(string, '\n');
+      column = this.chunkColumn;
+      if (lineCount > 0) {
+        lines = string.split('\n');
+        column = last(lines).length;
+      } else {
+        column += string.length;
+      }
+      return [this.chunkLine + lineCount, column];
+    };
+
+    Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) {
+      var lastCharacter, locationData, token, _ref2, _ref3;
+      if (offsetInChunk == null) {
+        offsetInChunk = 0;
+      }
+      if (length == null) {
+        length = value.length;
+      }
+      locationData = {};
+      _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1];
+      lastCharacter = Math.max(0, length - 1);
+      _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1];
+      token = [tag, value, locationData];
+      return token;
+    };
+
+    Lexer.prototype.token = function(tag, value, offsetInChunk, length, origin) {
+      var token;
+      token = this.makeToken(tag, value, offsetInChunk, length);
+      if (origin) {
+        token.origin = origin;
+      }
+      this.tokens.push(token);
+      return token;
     };
 
     Lexer.prototype.tag = function(index, tag) {
@@ -656,19 +773,34 @@
 
     Lexer.prototype.unfinished = function() {
       var _ref2;
-      return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
+      return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === 'UNARY_MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === '**' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
+    };
+
+    Lexer.prototype.removeNewlines = function(str) {
+      return str.replace(/^\s*\n\s*/, '').replace(/([^\\]|\\\\)\s*\n\s*$/, '$1');
     };
 
     Lexer.prototype.escapeLines = function(str, heredoc) {
-      return str.replace(MULTILINER, heredoc ? '\\n' : '');
+      str = str.replace(/\\[^\S\n]*(\n|\\)\s*/g, function(escaped, character) {
+        if (character === '\n') {
+          return '';
+        } else {
+          return escaped;
+        }
+      });
+      if (heredoc) {
+        return str.replace(MULTILINER, '\\n');
+      } else {
+        return str.replace(/\s*\n\s*/g, ' ');
+      }
     };
 
     Lexer.prototype.makeString = function(body, quote, heredoc) {
       if (!body) {
         return quote + quote;
       }
-      body = body.replace(/\\([\s\S])/g, function(match, contents) {
-        if (contents === '\n' || contents === quote) {
+      body = body.replace(RegExp("\\\\(" + quote + "|\\\\)", "g"), function(match, contents) {
+        if (contents === quote) {
           return contents;
         } else {
           return match;
@@ -678,8 +810,16 @@
       return quote + this.escapeLines(body, heredoc) + quote;
     };
 
-    Lexer.prototype.error = function(message) {
-      throw SyntaxError("" + message + " on line " + (this.line + 1));
+    Lexer.prototype.error = function(message, offset) {
+      var first_column, first_line, _ref2;
+      if (offset == null) {
+        offset = 0;
+      }
+      _ref2 = this.getLineAndColumnFromChunk(offset), first_line = _ref2[0], first_column = _ref2[1];
+      return throwSyntaxError(message, {
+        first_line: first_line,
+        first_column: first_column
+      });
     };
 
     return Lexer;
@@ -713,7 +853,7 @@
 
   COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES);
 
-  RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield'];
+  RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield'];
 
   STRICT_PROSCRIBED = ['arguments', 'eval'];
 
@@ -723,31 +863,33 @@
 
   exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED;
 
+  BOM = 65279;
+
   IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
 
   NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;
 
-  HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
+  HEREDOC = /^("""|''')((?:\\[\s\S]|[^\\])*?)(?:\n[^\n\S]*)?\1/;
 
-  OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
+  OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/;
 
   WHITESPACE = /^[^\n\S]+/;
 
-  COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/;
+  COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/;
 
   CODE = /^[-=]>/;
 
   MULTI_DENT = /^(?:\n[^\n\S]*)+/;
 
-  SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
+  SIMPLESTR = /^'[^\\']*(?:\\[\s\S][^\\']*)*'/;
 
   JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
 
   REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/;
 
-  HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/;
+  HEREGEX = /^\/{3}((?:\\?[\s\S])+?)\/{3}([imgy]{0,4})(?!\w)/;
 
-  HEREGEX_OMIT = /\s+(?:#.*)?/g;
+  HEREGEX_OMIT = /((?:\\\\)+)|\\(\s|\/)|\s+(?:#.*)?/g;
 
   MULTILINER = /\n/g;
 
@@ -759,9 +901,11 @@
 
   TRAILING_SPACES = /\s+$/;
 
-  COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
+  COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=', '**=', '//=', '%%='];
 
-  UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO'];
+  UNARY = ['NEW', 'TYPEOF', 'DELETE', 'DO'];
+
+  UNARY_MATH = ['!', '~'];
 
   LOGIC = ['&&', '||', '&', '|', '^'];
 
@@ -769,15 +913,15 @@
 
   COMPARE = ['==', '!=', '<', '>', '<=', '>='];
 
-  MATH = ['*', '/', '%'];
+  MATH = ['*', '/', '%', '//', '%%'];
 
   RELATION = ['IN', 'OF', 'INSTANCEOF'];
 
   BOOL = ['TRUE', 'FALSE'];
 
-  NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']'];
+  NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--'];
 
-  NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
+  NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']');
 
   CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
 
@@ -785,4 +929,6 @@
 
   LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
 
+  INDENTABLE_CLOSERS = [')', '}', ']'];
+
 }).call(this);


[10/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/coffee-script/lib/coffee-script/nodes.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/coffee-script/lib/coffee-script/nodes.js b/weinre.server/node_modules/coffee-script/lib/coffee-script/nodes.js
index 799b68e..52c99a9 100644
--- a/weinre.server/node_modules/coffee-script/lib/coffee-script/nodes.js
+++ b/weinre.server/node_modules/coffee-script/lib/coffee-script/nodes.js
@@ -1,18 +1,23 @@
-// Generated by CoffeeScript 1.3.3
+// Generated by CoffeeScript 1.8.0
 (function() {
-  var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, starts, unfoldSoak, utility, _ref, _ref1,
+  var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Expansion, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1,
     __hasProp = {}.hasOwnProperty,
     __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
-    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+    __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+    __slice = [].slice;
+
+  Error.stackTraceLimit = Infinity;
 
   Scope = require('./scope').Scope;
 
   _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
 
-  _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last;
+  _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
 
   exports.extend = extend;
 
+  exports.addLocationDataFn = addLocationDataFn;
+
   YES = function() {
     return true;
   };
@@ -30,11 +35,43 @@
     return this;
   };
 
-  exports.Base = Base = (function() {
+  exports.CodeFragment = CodeFragment = (function() {
+    function CodeFragment(parent, code) {
+      var _ref2;
+      this.code = "" + code;
+      this.locationData = parent != null ? parent.locationData : void 0;
+      this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown';
+    }
 
+    CodeFragment.prototype.toString = function() {
+      return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : '');
+    };
+
+    return CodeFragment;
+
+  })();
+
+  fragmentsToText = function(fragments) {
+    var fragment;
+    return ((function() {
+      var _i, _len, _results;
+      _results = [];
+      for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+        fragment = fragments[_i];
+        _results.push(fragment.code);
+      }
+      return _results;
+    })()).join('');
+  };
+
+  exports.Base = Base = (function() {
     function Base() {}
 
     Base.prototype.compile = function(o, lvl) {
+      return fragmentsToText(this.compileToFragments(o, lvl));
+    };
+
+    Base.prototype.compileToFragments = function(o, lvl) {
       var node;
       o = extend({}, o);
       if (lvl) {
@@ -50,36 +87,44 @@
     };
 
     Base.prototype.compileClosure = function(o) {
-      if (this.jumps()) {
-        throw SyntaxError('cannot use a pure statement in an expression.');
+      var args, argumentsNode, func, jumpNode, meth;
+      if (jumpNode = this.jumps()) {
+        jumpNode.error('cannot use a pure statement in an expression');
       }
       o.sharedScope = true;
-      return Closure.wrap(this).compileNode(o);
+      func = new Code([], Block.wrap([this]));
+      args = [];
+      if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) {
+        args = [new Literal('this')];
+        if (argumentsNode) {
+          meth = 'apply';
+          args.push(new Literal('arguments'));
+        } else {
+          meth = 'call';
+        }
+        func = new Value(func, [new Access(new Literal(meth))]);
+      }
+      return (new Call(func, args)).compileNode(o);
     };
 
     Base.prototype.cache = function(o, level, reused) {
       var ref, sub;
       if (!this.isComplex()) {
-        ref = level ? this.compile(o, level) : this;
+        ref = level ? this.compileToFragments(o, level) : this;
         return [ref, ref];
       } else {
         ref = new Literal(reused || o.scope.freeVariable('ref'));
         sub = new Assign(ref, this);
         if (level) {
-          return [sub.compile(o, level), ref.value];
+          return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]];
         } else {
           return [sub, ref];
         }
       }
     };
 
-    Base.prototype.compileLoopReference = function(o, name) {
-      var src, tmp;
-      src = tmp = this.compile(o, LEVEL_LIST);
-      if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) {
-        src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src;
-      }
-      return [src, tmp];
+    Base.prototype.cacheToCodeFragments = function(cacheValues) {
+      return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])];
     };
 
     Base.prototype.makeReturn = function(res) {
@@ -93,21 +138,15 @@
     };
 
     Base.prototype.contains = function(pred) {
-      var contains;
-      contains = false;
-      this.traverseChildren(false, function(node) {
-        if (pred(node)) {
-          contains = true;
+      var node;
+      node = void 0;
+      this.traverseChildren(false, function(n) {
+        if (pred(n)) {
+          node = n;
           return false;
         }
       });
-      return contains;
-    };
-
-    Base.prototype.containsType = function(type) {
-      return this instanceof type || this.contains(function(node) {
-        return node instanceof type;
-      });
+      return node;
     };
 
     Base.prototype.lastNonComment = function(list) {
@@ -162,10 +201,11 @@
 
     Base.prototype.traverseChildren = function(crossScope, func) {
       return this.eachChild(function(child) {
-        if (func(child) === false) {
-          return false;
+        var recur;
+        recur = func(child);
+        if (recur !== false) {
+          return child.traverseChildren(crossScope, func);
         }
-        return child.traverseChildren(crossScope, func);
       });
     };
 
@@ -200,12 +240,46 @@
 
     Base.prototype.assigns = NO;
 
+    Base.prototype.updateLocationDataIfMissing = function(locationData) {
+      if (this.locationData) {
+        return this;
+      }
+      this.locationData = locationData;
+      return this.eachChild(function(child) {
+        return child.updateLocationDataIfMissing(locationData);
+      });
+    };
+
+    Base.prototype.error = function(message) {
+      return throwSyntaxError(message, this.locationData);
+    };
+
+    Base.prototype.makeCode = function(code) {
+      return new CodeFragment(this, code);
+    };
+
+    Base.prototype.wrapInBraces = function(fragments) {
+      return [].concat(this.makeCode('('), fragments, this.makeCode(')'));
+    };
+
+    Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) {
+      var answer, fragments, i, _i, _len;
+      answer = [];
+      for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) {
+        fragments = fragmentsList[i];
+        if (i) {
+          answer.push(this.makeCode(joinStr));
+        }
+        answer = answer.concat(fragments);
+      }
+      return answer;
+    };
+
     return Base;
 
   })();
 
   exports.Block = Block = (function(_super) {
-
     __extends(Block, _super);
 
     function Block(nodes) {
@@ -253,12 +327,12 @@
     };
 
     Block.prototype.jumps = function(o) {
-      var exp, _i, _len, _ref2;
+      var exp, jumpNode, _i, _len, _ref2;
       _ref2 = this.expressions;
       for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
         exp = _ref2[_i];
-        if (exp.jumps(o)) {
-          return exp;
+        if (jumpNode = exp.jumps(o)) {
+          return jumpNode;
         }
       }
     };
@@ -279,72 +353,79 @@
       return this;
     };
 
-    Block.prototype.compile = function(o, level) {
+    Block.prototype.compileToFragments = function(o, level) {
       if (o == null) {
         o = {};
       }
       if (o.scope) {
-        return Block.__super__.compile.call(this, o, level);
+        return Block.__super__.compileToFragments.call(this, o, level);
       } else {
         return this.compileRoot(o);
       }
     };
 
     Block.prototype.compileNode = function(o) {
-      var code, codes, node, top, _i, _len, _ref2;
+      var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2;
       this.tab = o.indent;
       top = o.level === LEVEL_TOP;
-      codes = [];
+      compiledNodes = [];
       _ref2 = this.expressions;
-      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-        node = _ref2[_i];
+      for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) {
+        node = _ref2[index];
         node = node.unwrapAll();
         node = node.unfoldSoak(o) || node;
         if (node instanceof Block) {
-          codes.push(node.compileNode(o));
+          compiledNodes.push(node.compileNode(o));
         } else if (top) {
           node.front = true;
-          code = node.compile(o);
+          fragments = node.compileToFragments(o);
           if (!node.isStatement(o)) {
-            code = "" + this.tab + code + ";";
-            if (node instanceof Literal) {
-              code = "" + code + "\n";
-            }
+            fragments.unshift(this.makeCode("" + this.tab));
+            fragments.push(this.makeCode(";"));
           }
-          codes.push(code);
+          compiledNodes.push(fragments);
         } else {
-          codes.push(node.compile(o, LEVEL_LIST));
+          compiledNodes.push(node.compileToFragments(o, LEVEL_LIST));
         }
       }
       if (top) {
         if (this.spaced) {
-          return "\n" + (codes.join('\n\n')) + "\n";
+          return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n"));
         } else {
-          return codes.join('\n');
+          return this.joinFragmentArrays(compiledNodes, '\n');
         }
       }
-      code = codes.join(', ') || 'void 0';
-      if (codes.length > 1 && o.level >= LEVEL_LIST) {
-        return "(" + code + ")";
+      if (compiledNodes.length) {
+        answer = this.joinFragmentArrays(compiledNodes, ', ');
+      } else {
+        answer = [this.makeCode("void 0")];
+      }
+      if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) {
+        return this.wrapInBraces(answer);
       } else {
-        return code;
+        return answer;
       }
     };
 
     Block.prototype.compileRoot = function(o) {
-      var code, exp, i, prelude, preludeExps, rest;
+      var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2;
       o.indent = o.bare ? '' : TAB;
-      o.scope = new Scope(null, this, null);
       o.level = LEVEL_TOP;
       this.spaced = true;
-      prelude = "";
+      o.scope = new Scope(null, this, null);
+      _ref2 = o.locals || [];
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        name = _ref2[_i];
+        o.scope.parameter(name);
+      }
+      prelude = [];
       if (!o.bare) {
         preludeExps = (function() {
-          var _i, _len, _ref2, _results;
-          _ref2 = this.expressions;
+          var _j, _len1, _ref3, _results;
+          _ref3 = this.expressions;
           _results = [];
-          for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
-            exp = _ref2[i];
+          for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) {
+            exp = _ref3[i];
             if (!(exp.unwrap() instanceof Comment)) {
               break;
             }
@@ -355,22 +436,24 @@
         rest = this.expressions.slice(preludeExps.length);
         this.expressions = preludeExps;
         if (preludeExps.length) {
-          prelude = "" + (this.compileNode(merge(o, {
+          prelude = this.compileNode(merge(o, {
             indent: ''
-          }))) + "\n";
+          }));
+          prelude.push(this.makeCode("\n"));
         }
         this.expressions = rest;
       }
-      code = this.compileWithDeclarations(o);
+      fragments = this.compileWithDeclarations(o);
       if (o.bare) {
-        return code;
+        return fragments;
       }
-      return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n";
+      return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n"));
     };
 
     Block.prototype.compileWithDeclarations = function(o) {
-      var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
-      code = post = '';
+      var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
+      fragments = [];
+      post = [];
       _ref2 = this.expressions;
       for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
         exp = _ref2[i];
@@ -385,7 +468,7 @@
       if (i) {
         rest = this.expressions.splice(i, 9e9);
         _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
-        _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1];
+        _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1];
         this.expressions = rest;
       }
       post = this.compileNode(o);
@@ -395,22 +478,24 @@
         assigns = scope.hasAssignments;
         if (declars || assigns) {
           if (i) {
-            code += '\n';
+            fragments.push(this.makeCode('\n'));
           }
-          code += "" + this.tab + "var ";
+          fragments.push(this.makeCode("" + this.tab + "var "));
           if (declars) {
-            code += scope.declaredVariables().join(', ');
+            fragments.push(this.makeCode(scope.declaredVariables().join(', ')));
           }
           if (assigns) {
             if (declars) {
-              code += ",\n" + (this.tab + TAB);
+              fragments.push(this.makeCode(",\n" + (this.tab + TAB)));
             }
-            code += scope.assignedVariables().join(",\n" + (this.tab + TAB));
+            fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB))));
           }
-          code += ';\n';
+          fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : '')));
+        } else if (fragments.length && post.length) {
+          fragments.push(this.makeCode("\n"));
         }
       }
-      return code + post;
+      return fragments.concat(post);
     };
 
     Block.wrap = function(nodes) {
@@ -425,7 +510,6 @@
   })(Base);
 
   exports.Literal = Literal = (function(_super) {
-
     __extends(Literal, _super);
 
     function Literal(value) {
@@ -465,13 +549,10 @@
     };
 
     Literal.prototype.compileNode = function(o) {
-      var code, _ref2;
+      var answer, code, _ref2;
       code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value;
-      if (this.isStatement()) {
-        return "" + this.tab + code + ";";
-      } else {
-        return code;
-      }
+      answer = this.isStatement() ? "" + this.tab + code + ";" : code;
+      return [this.makeCode(answer)];
     };
 
     Literal.prototype.toString = function() {
@@ -483,7 +564,6 @@
   })(Base);
 
   exports.Undefined = (function(_super) {
-
     __extends(Undefined, _super);
 
     function Undefined() {
@@ -495,11 +575,7 @@
     Undefined.prototype.isComplex = NO;
 
     Undefined.prototype.compileNode = function(o) {
-      if (o.level >= LEVEL_ACCESS) {
-        return '(void 0)';
-      } else {
-        return 'void 0';
-      }
+      return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')];
     };
 
     return Undefined;
@@ -507,7 +583,6 @@
   })(Base);
 
   exports.Null = (function(_super) {
-
     __extends(Null, _super);
 
     function Null() {
@@ -519,7 +594,7 @@
     Null.prototype.isComplex = NO;
 
     Null.prototype.compileNode = function() {
-      return "null";
+      return [this.makeCode("null")];
     };
 
     return Null;
@@ -527,7 +602,6 @@
   })(Base);
 
   exports.Bool = (function(_super) {
-
     __extends(Bool, _super);
 
     Bool.prototype.isAssignable = NO;
@@ -535,7 +609,7 @@
     Bool.prototype.isComplex = NO;
 
     Bool.prototype.compileNode = function() {
-      return this.val;
+      return [this.makeCode(this.val)];
     };
 
     function Bool(val) {
@@ -547,13 +621,10 @@
   })(Base);
 
   exports.Return = Return = (function(_super) {
-
     __extends(Return, _super);
 
-    function Return(expr) {
-      if (expr && !expr.unwrap().isUndefined) {
-        this.expression = expr;
-      }
+    function Return(expression) {
+      this.expression = expression;
     }
 
     Return.prototype.children = ['expression'];
@@ -564,18 +635,25 @@
 
     Return.prototype.jumps = THIS;
 
-    Return.prototype.compile = function(o, level) {
+    Return.prototype.compileToFragments = function(o, level) {
       var expr, _ref2;
       expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
       if (expr && !(expr instanceof Return)) {
-        return expr.compile(o, level);
+        return expr.compileToFragments(o, level);
       } else {
-        return Return.__super__.compile.call(this, o, level);
+        return Return.__super__.compileToFragments.call(this, o, level);
       }
     };
 
     Return.prototype.compileNode = function(o) {
-      return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";");
+      var answer;
+      answer = [];
+      answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : ""))));
+      if (this.expression) {
+        answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN));
+      }
+      answer.push(this.makeCode(";"));
+      return answer;
     };
 
     return Return;
@@ -583,7 +661,6 @@
   })(Base);
 
   exports.Value = Value = (function(_super) {
-
     __extends(Value, _super);
 
     function Value(base, props, tag) {
@@ -609,8 +686,16 @@
       return !!this.properties.length;
     };
 
+    Value.prototype.bareLiteral = function(type) {
+      return !this.properties.length && this.base instanceof type;
+    };
+
     Value.prototype.isArray = function() {
-      return !this.properties.length && this.base instanceof Arr;
+      return this.bareLiteral(Arr);
+    };
+
+    Value.prototype.isRange = function() {
+      return this.bareLiteral(Range);
     };
 
     Value.prototype.isComplex = function() {
@@ -622,11 +707,15 @@
     };
 
     Value.prototype.isSimpleNumber = function() {
-      return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
+      return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value);
     };
 
     Value.prototype.isString = function() {
-      return this.base instanceof Literal && IS_STRING.test(this.base.value);
+      return this.bareLiteral(Literal) && IS_STRING.test(this.base.value);
+    };
+
+    Value.prototype.isRegex = function() {
+      return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value);
     };
 
     Value.prototype.isAtomic = function() {
@@ -641,6 +730,10 @@
       return true;
     };
 
+    Value.prototype.isNotCallable = function() {
+      return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject();
+    };
+
     Value.prototype.isStatement = function(o) {
       return !this.properties.length && this.base.isStatement(o);
     };
@@ -664,6 +757,11 @@
       return last(this.properties) instanceof Slice;
     };
 
+    Value.prototype.looksStatic = function(className) {
+      var _ref2;
+      return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype';
+    };
+
     Value.prototype.unwrap = function() {
       if (this.properties.length) {
         return this;
@@ -695,53 +793,49 @@
     };
 
     Value.prototype.compileNode = function(o) {
-      var code, prop, props, _i, _len;
+      var fragments, prop, props, _i, _len;
       this.base.front = this.front;
       props = this.properties;
-      code = this.base.compile(o, props.length ? LEVEL_ACCESS : null);
-      if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) {
-        code = "" + code + ".";
+      fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null));
+      if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) {
+        fragments.push(this.makeCode('.'));
       }
       for (_i = 0, _len = props.length; _i < _len; _i++) {
         prop = props[_i];
-        code += prop.compile(o);
+        fragments.push.apply(fragments, prop.compileToFragments(o));
       }
-      return code;
+      return fragments;
     };
 
     Value.prototype.unfoldSoak = function(o) {
-      var result,
-        _this = this;
-      if (this.unfoldedSoak != null) {
-        return this.unfoldedSoak;
-      }
-      result = (function() {
-        var fst, i, ifn, prop, ref, snd, _i, _len, _ref2;
-        if (ifn = _this.base.unfoldSoak(o)) {
-          Array.prototype.push.apply(ifn.body.properties, _this.properties);
-          return ifn;
-        }
-        _ref2 = _this.properties;
-        for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
-          prop = _ref2[i];
-          if (!prop.soak) {
-            continue;
+      return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) {
+        return function() {
+          var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3;
+          if (ifn = _this.base.unfoldSoak(o)) {
+            (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties);
+            return ifn;
           }
-          prop.soak = false;
-          fst = new Value(_this.base, _this.properties.slice(0, i));
-          snd = new Value(_this.base, _this.properties.slice(i));
-          if (fst.isComplex()) {
-            ref = new Literal(o.scope.freeVariable('ref'));
-            fst = new Parens(new Assign(ref, fst));
-            snd.base = ref;
+          _ref3 = _this.properties;
+          for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
+            prop = _ref3[i];
+            if (!prop.soak) {
+              continue;
+            }
+            prop.soak = false;
+            fst = new Value(_this.base, _this.properties.slice(0, i));
+            snd = new Value(_this.base, _this.properties.slice(i));
+            if (fst.isComplex()) {
+              ref = new Literal(o.scope.freeVariable('ref'));
+              fst = new Parens(new Assign(ref, fst));
+              snd.base = ref;
+            }
+            return new If(new Existence(fst), snd, {
+              soak: true
+            });
           }
-          return new If(new Existence(fst), snd, {
-            soak: true
-          });
-        }
-        return null;
-      })();
-      return this.unfoldedSoak = result || false;
+          return false;
+        };
+      })(this)();
     };
 
     return Value;
@@ -749,7 +843,6 @@
   })(Base);
 
   exports.Comment = Comment = (function(_super) {
-
     __extends(Comment, _super);
 
     function Comment(comment) {
@@ -761,12 +854,13 @@
     Comment.prototype.makeReturn = THIS;
 
     Comment.prototype.compileNode = function(o, level) {
-      var code;
-      code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
+      var code, comment;
+      comment = this.comment.replace(/^(\s*)#/gm, "$1 *");
+      code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */";
       if ((level || o.level) === LEVEL_TOP) {
         code = o.indent + code;
       }
-      return code;
+      return [this.makeCode("\n"), this.makeCode(code)];
     };
 
     return Comment;
@@ -774,7 +868,6 @@
   })(Base);
 
   exports.Call = Call = (function(_super) {
-
     __extends(Call, _super);
 
     function Call(variable, args, soak) {
@@ -783,6 +876,9 @@
       this.isNew = false;
       this.isSuper = variable === 'super';
       this.variable = this.isSuper ? null : variable;
+      if (variable instanceof Value && variable.isNotCallable()) {
+        variable.error("literal is not a function");
+      }
     }
 
     Call.prototype.children = ['variable', 'args'];
@@ -799,24 +895,19 @@
     };
 
     Call.prototype.superReference = function(o) {
-      var accesses, method, name;
+      var accesses, method;
       method = o.scope.namedMethod();
-      if (!method) {
-        throw SyntaxError('cannot call super outside of a function.');
-      }
-      name = method.name;
-      if (name == null) {
-        throw SyntaxError('cannot call super on an anonymous function.');
-      }
-      if (method.klass) {
+      if (method != null ? method.klass : void 0) {
         accesses = [new Access(new Literal('__super__'))];
         if (method["static"]) {
           accesses.push(new Access(new Literal('constructor')));
         }
-        accesses.push(new Access(new Literal(name)));
+        accesses.push(new Access(new Literal(method.name)));
         return (new Value(new Literal(method.klass), accesses)).compile(o);
+      } else if (method != null ? method.ctor : void 0) {
+        return "" + method.name + ".__super__.constructor";
       } else {
-        return "" + name + ".__super__.constructor";
+        return this.error('cannot call super outside of an instance method.');
       }
     };
 
@@ -876,88 +967,71 @@
       return ifn;
     };
 
-    Call.prototype.filterImplicitObjects = function(list) {
-      var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2;
-      nodes = [];
-      for (_i = 0, _len = list.length; _i < _len; _i++) {
-        node = list[_i];
-        if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) {
-          nodes.push(node);
-          continue;
-        }
-        obj = null;
-        _ref2 = node.base.properties;
-        for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
-          prop = _ref2[_j];
-          if (prop instanceof Assign || prop instanceof Comment) {
-            if (!obj) {
-              nodes.push(obj = new Obj(properties = [], true));
-            }
-            properties.push(prop);
-          } else {
-            nodes.push(prop);
-            obj = null;
-          }
-        }
-      }
-      return nodes;
-    };
-
     Call.prototype.compileNode = function(o) {
-      var arg, args, code, _ref2;
+      var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3;
       if ((_ref2 = this.variable) != null) {
         _ref2.front = this.front;
       }
-      if (code = Splat.compileSplattedArray(o, this.args, true)) {
-        return this.compileSplat(o, code);
+      compiledArray = Splat.compileSplattedArray(o, this.args, true);
+      if (compiledArray.length) {
+        return this.compileSplat(o, compiledArray);
       }
-      args = this.filterImplicitObjects(this.args);
-      args = ((function() {
-        var _i, _len, _results;
-        _results = [];
-        for (_i = 0, _len = args.length; _i < _len; _i++) {
-          arg = args[_i];
-          _results.push(arg.compile(o, LEVEL_LIST));
+      compiledArgs = [];
+      _ref3 = this.args;
+      for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) {
+        arg = _ref3[argIndex];
+        if (argIndex) {
+          compiledArgs.push(this.makeCode(", "));
         }
-        return _results;
-      })()).join(', ');
+        compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST));
+      }
+      fragments = [];
       if (this.isSuper) {
-        return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")");
+        preface = this.superReference(o) + (".call(" + (this.superThis(o)));
+        if (compiledArgs.length) {
+          preface += ", ";
+        }
+        fragments.push(this.makeCode(preface));
       } else {
-        return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")");
+        if (this.isNew) {
+          fragments.push(this.makeCode('new '));
+        }
+        fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS));
+        fragments.push(this.makeCode("("));
       }
-    };
-
-    Call.prototype.compileSuper = function(args, o) {
-      return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")";
+      fragments.push.apply(fragments, compiledArgs);
+      fragments.push(this.makeCode(")"));
+      return fragments;
     };
 
     Call.prototype.compileSplat = function(o, splatArgs) {
-      var base, fun, idt, name, ref;
+      var answer, base, fun, idt, name, ref;
       if (this.isSuper) {
-        return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")";
+        return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")"));
       }
       if (this.isNew) {
         idt = this.tab + TAB;
-        return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args), t = typeof result;\n" + idt + "return t == \"object\" || t == \"function\" ? result || child : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})";
+        return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})"));
       }
+      answer = [];
       base = new Value(this.variable);
       if ((name = base.properties.pop()) && base.isComplex()) {
         ref = o.scope.freeVariable('ref');
-        fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
+        answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o));
       } else {
-        fun = base.compile(o, LEVEL_ACCESS);
-        if (SIMPLENUM.test(fun)) {
-          fun = "(" + fun + ")";
+        fun = base.compileToFragments(o, LEVEL_ACCESS);
+        if (SIMPLENUM.test(fragmentsToText(fun))) {
+          fun = this.wrapInBraces(fun);
         }
         if (name) {
-          ref = fun;
-          fun += name.compile(o);
+          ref = fragmentsToText(fun);
+          fun.push.apply(fun, name.compileToFragments(o));
         } else {
           ref = 'null';
         }
+        answer = answer.concat(fun);
       }
-      return "" + fun + ".apply(" + ref + ", " + splatArgs + ")";
+      return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")"));
     };
 
     return Call;
@@ -965,7 +1039,6 @@
   })(Base);
 
   exports.Extends = Extends = (function(_super) {
-
     __extends(Extends, _super);
 
     function Extends(child, parent) {
@@ -975,8 +1048,8 @@
 
     Extends.prototype.children = ['child', 'parent'];
 
-    Extends.prototype.compile = function(o) {
-      return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o);
+    Extends.prototype.compileToFragments = function(o) {
+      return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o);
     };
 
     return Extends;
@@ -984,7 +1057,6 @@
   })(Base);
 
   exports.Access = Access = (function(_super) {
-
     __extends(Access, _super);
 
     function Access(name, tag) {
@@ -995,14 +1067,16 @@
 
     Access.prototype.children = ['name'];
 
-    Access.prototype.compile = function(o) {
+    Access.prototype.compileToFragments = function(o) {
       var name;
-      name = this.name.compile(o);
-      if (IDENTIFIER.test(name)) {
-        return "." + name;
+      name = this.name.compileToFragments(o);
+      if (IDENTIFIER.test(fragmentsToText(name))) {
+        name.unshift(this.makeCode("."));
       } else {
-        return "[" + name + "]";
+        name.unshift(this.makeCode("["));
+        name.push(this.makeCode("]"));
       }
+      return name;
     };
 
     Access.prototype.isComplex = NO;
@@ -1012,7 +1086,6 @@
   })(Base);
 
   exports.Index = Index = (function(_super) {
-
     __extends(Index, _super);
 
     function Index(index) {
@@ -1021,8 +1094,8 @@
 
     Index.prototype.children = ['index'];
 
-    Index.prototype.compile = function(o) {
-      return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]";
+    Index.prototype.compileToFragments = function(o) {
+      return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]"));
     };
 
     Index.prototype.isComplex = function() {
@@ -1034,7 +1107,6 @@
   })(Base);
 
   exports.Range = Range = (function(_super) {
-
     __extends(Range, _super);
 
     Range.prototype.children = ['from', 'to'];
@@ -1051,14 +1123,14 @@
       o = merge(o, {
         top: true
       });
-      _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1];
-      _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1];
+      _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1];
+      _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1];
       if (step = del(o, 'step')) {
-        _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1];
+        _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1];
       }
-      _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
+      _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
       if (this.stepVar) {
-        return this.stepNum = this.stepVar.match(SIMPLENUM);
+        return this.stepNum = this.stepVar.match(NUMBER);
       }
     };
 
@@ -1082,7 +1154,7 @@
         varPart += ", " + this.step;
       }
       _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
-      condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
+      condPart = this.stepNum ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
       stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
       if (namedIndex) {
         varPart = "" + idxName + " = " + varPart;
@@ -1090,7 +1162,7 @@
       if (namedIndex) {
         stepPart = "" + idxName + " = " + stepPart;
       }
-      return "" + varPart + "; " + condPart + "; " + stepPart;
+      return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)];
     };
 
     Range.prototype.compileArray = function(o) {
@@ -1104,7 +1176,7 @@
         if (this.exclusive) {
           range.pop();
         }
-        return "[" + (range.join(', ')) + "]";
+        return [this.makeCode("[" + (range.join(', ')) + "]")];
       }
       idt = this.tab + TAB;
       i = o.scope.freeVariable('i');
@@ -1112,7 +1184,7 @@
       pre = "\n" + idt + result + " = [];";
       if (this.fromNum && this.toNum) {
         o.index = i;
-        body = this.compileNode(o);
+        body = fragmentsToText(this.compileNode(o));
       } else {
         vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
         cond = "" + this.fromVar + " <= " + this.toVar;
@@ -1120,14 +1192,12 @@
       }
       post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
       hasArgs = function(node) {
-        return node != null ? node.contains(function(n) {
-          return n instanceof Literal && n.value === 'arguments' && !n.asKey;
-        }) : void 0;
+        return node != null ? node.contains(isLiteralArguments) : void 0;
       };
       if (hasArgs(this.from) || hasArgs(this.to)) {
         args = ', arguments';
       }
-      return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")";
+      return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")];
     };
 
     return Range;
@@ -1135,7 +1205,6 @@
   })(Base);
 
   exports.Slice = Slice = (function(_super) {
-
     __extends(Slice, _super);
 
     Slice.prototype.children = ['range'];
@@ -1146,14 +1215,17 @@
     }
 
     Slice.prototype.compileNode = function(o) {
-      var compiled, from, fromStr, to, toStr, _ref2;
+      var compiled, compiledText, from, fromCompiled, to, toStr, _ref2;
       _ref2 = this.range, to = _ref2.to, from = _ref2.from;
-      fromStr = from && from.compile(o, LEVEL_PAREN) || '0';
-      compiled = to && to.compile(o, LEVEL_PAREN);
-      if (to && !(!this.range.exclusive && +compiled === -1)) {
-        toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "" + compiled + " + 1 || 9e9"));
+      fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')];
+      if (to) {
+        compiled = to.compileToFragments(o, LEVEL_PAREN);
+        compiledText = fragmentsToText(compiled);
+        if (!(!this.range.exclusive && +compiledText === -1)) {
+          toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9"));
+        }
       }
-      return ".slice(" + fromStr + (toStr || '') + ")";
+      return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")];
     };
 
     return Slice;
@@ -1161,7 +1233,6 @@
   })(Base);
 
   exports.Obj = Obj = (function(_super) {
-
     __extends(Obj, _super);
 
     function Obj(props, generated) {
@@ -1172,62 +1243,52 @@
     Obj.prototype.children = ['properties'];
 
     Obj.prototype.compileNode = function(o) {
-      var i, idt, indent, join, lastNoncom, node, obj, prop, propName, propNames, props, _i, _j, _len, _len1, _ref2;
+      var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1;
       props = this.properties;
-      propNames = [];
-      _ref2 = this.properties;
-      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-        prop = _ref2[_i];
-        if (prop.isComplex()) {
-          prop = prop.variable;
-        }
-        if (prop != null) {
-          propName = prop.unwrapAll().value.toString();
-          if (__indexOf.call(propNames, propName) >= 0) {
-            throw SyntaxError("multiple object literal properties named \"" + propName + "\"");
-          }
-          propNames.push(propName);
-        }
-      }
       if (!props.length) {
-        return (this.front ? '({})' : '{}');
+        return [this.makeCode(this.front ? '({})' : '{}')];
       }
       if (this.generated) {
-        for (_j = 0, _len1 = props.length; _j < _len1; _j++) {
-          node = props[_j];
+        for (_i = 0, _len = props.length; _i < _len; _i++) {
+          node = props[_i];
           if (node instanceof Value) {
-            throw new Error('cannot have an implicit value in an implicit object');
+            node.error('cannot have an implicit value in an implicit object');
           }
         }
       }
       idt = o.indent += TAB;
       lastNoncom = this.lastNonComment(this.properties);
-      props = (function() {
-        var _k, _len2, _results;
-        _results = [];
-        for (i = _k = 0, _len2 = props.length; _k < _len2; i = ++_k) {
-          prop = props[i];
-          join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
-          indent = prop instanceof Comment ? '' : idt;
-          if (prop instanceof Value && prop["this"]) {
-            prop = new Assign(prop.properties[0].name, prop, 'object');
-          }
-          if (!(prop instanceof Comment)) {
-            if (!(prop instanceof Assign)) {
-              prop = new Assign(prop, prop, 'object');
-            }
-            (prop.variable.base || prop.variable).asKey = true;
+      answer = [];
+      for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
+        prop = props[i];
+        join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
+        indent = prop instanceof Comment ? '' : idt;
+        if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) {
+          prop.variable.error('Invalid object key');
+        }
+        if (prop instanceof Value && prop["this"]) {
+          prop = new Assign(prop.properties[0].name, prop, 'object');
+        }
+        if (!(prop instanceof Comment)) {
+          if (!(prop instanceof Assign)) {
+            prop = new Assign(prop, prop, 'object');
           }
-          _results.push(indent + prop.compile(o, LEVEL_TOP) + join);
+          (prop.variable.base || prop.variable).asKey = true;
         }
-        return _results;
-      })();
-      props = props.join('');
-      obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
+        if (indent) {
+          answer.push(this.makeCode(indent));
+        }
+        answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP));
+        if (join) {
+          answer.push(this.makeCode(join));
+        }
+      }
+      answer.unshift(this.makeCode("{" + (props.length && '\n')));
+      answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}"));
       if (this.front) {
-        return "(" + obj + ")";
+        return this.wrapInBraces(answer);
       } else {
-        return obj;
+        return answer;
       }
     };
 
@@ -1248,7 +1309,6 @@
   })(Base);
 
   exports.Arr = Arr = (function(_super) {
-
     __extends(Arr, _super);
 
     function Arr(objs) {
@@ -1257,32 +1317,42 @@
 
     Arr.prototype.children = ['objects'];
 
-    Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects;
-
     Arr.prototype.compileNode = function(o) {
-      var code, obj, objs;
+      var answer, compiledObjs, fragments, index, obj, _i, _len;
       if (!this.objects.length) {
-        return '[]';
+        return [this.makeCode('[]')];
       }
       o.indent += TAB;
-      objs = this.filterImplicitObjects(this.objects);
-      if (code = Splat.compileSplattedArray(o, objs)) {
-        return code;
-      }
-      code = ((function() {
-        var _i, _len, _results;
+      answer = Splat.compileSplattedArray(o, this.objects);
+      if (answer.length) {
+        return answer;
+      }
+      answer = [];
+      compiledObjs = (function() {
+        var _i, _len, _ref2, _results;
+        _ref2 = this.objects;
         _results = [];
-        for (_i = 0, _len = objs.length; _i < _len; _i++) {
-          obj = objs[_i];
-          _results.push(obj.compile(o, LEVEL_LIST));
+        for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+          obj = _ref2[_i];
+          _results.push(obj.compileToFragments(o, LEVEL_LIST));
         }
         return _results;
-      })()).join(', ');
-      if (code.indexOf('\n') >= 0) {
-        return "[\n" + o.indent + code + "\n" + this.tab + "]";
+      }).call(this);
+      for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) {
+        fragments = compiledObjs[index];
+        if (index) {
+          answer.push(this.makeCode(", "));
+        }
+        answer.push.apply(answer, fragments);
+      }
+      if (fragmentsToText(answer).indexOf('\n') >= 0) {
+        answer.unshift(this.makeCode("[\n" + o.indent));
+        answer.push(this.makeCode("\n" + this.tab + "]"));
       } else {
-        return "[" + code + "]";
+        answer.unshift(this.makeCode("["));
+        answer.push(this.makeCode("]"));
       }
+      return answer;
     };
 
     Arr.prototype.assigns = function(name) {
@@ -1302,7 +1372,6 @@
   })(Base);
 
   exports.Class = Class = (function(_super) {
-
     __extends(Class, _super);
 
     function Class(variable, parent, body) {
@@ -1322,7 +1391,7 @@
       }
       decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
       if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
-        throw SyntaxError("variable name may not be " + decl);
+        this.variable.error("class variable name may not be " + decl);
       }
       return decl && (decl = IDENTIFIER.test(decl) && decl);
     };
@@ -1344,16 +1413,12 @@
     };
 
     Class.prototype.addBoundFunctions = function(o) {
-      var bvar, lhs, _i, _len, _ref2, _results;
-      if (this.boundFuncs.length) {
-        _ref2 = this.boundFuncs;
-        _results = [];
-        for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-          bvar = _ref2[_i];
-          lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
-          _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")));
-        }
-        return _results;
+      var bvar, lhs, _i, _len, _ref2;
+      _ref2 = this.boundFuncs;
+      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+        bvar = _ref2[_i];
+        lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
+        this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"));
       }
     };
 
@@ -1370,23 +1435,20 @@
             func = assign.value;
             if (base.value === 'constructor') {
               if (this.ctor) {
-                throw new Error('cannot define more than one constructor in a class');
+                assign.error('cannot define more than one constructor in a class');
               }
               if (func.bound) {
-                throw new Error('cannot define a constructor as a bound function');
+                assign.error('cannot define a constructor as a bound function');
               }
               if (func instanceof Code) {
                 assign = this.ctor = func;
               } else {
-                this.externalCtor = o.scope.freeVariable('class');
+                this.externalCtor = o.classScope.freeVariable('class');
                 assign = new Assign(new Literal(this.externalCtor), func);
               }
             } else {
               if (assign.variable["this"]) {
                 func["static"] = true;
-                if (func.bound) {
-                  func.context = name;
-                }
               } else {
                 assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
                 if (func instanceof Code && func.bound) {
@@ -1404,23 +1466,29 @@
     };
 
     Class.prototype.walkBody = function(name, o) {
-      var _this = this;
-      return this.traverseChildren(false, function(child) {
-        var exps, i, node, _i, _len, _ref2;
-        if (child instanceof Class) {
-          return false;
-        }
-        if (child instanceof Block) {
-          _ref2 = exps = child.expressions;
-          for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
-            node = _ref2[i];
-            if (node instanceof Value && node.isObject(true)) {
-              exps[i] = _this.addProperties(node, name, o);
+      return this.traverseChildren(false, (function(_this) {
+        return function(child) {
+          var cont, exps, i, node, _i, _len, _ref2;
+          cont = true;
+          if (child instanceof Class) {
+            return false;
+          }
+          if (child instanceof Block) {
+            _ref2 = exps = child.expressions;
+            for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
+              node = _ref2[i];
+              if (node instanceof Assign && node.variable.looksStatic(name)) {
+                node.value["static"] = true;
+              } else if (node instanceof Value && node.isObject(true)) {
+                cont = false;
+                exps[i] = _this.addProperties(node, name, o);
+              }
             }
+            child.expressions = exps = flatten(exps);
           }
-          return child.expressions = exps = flatten(exps);
-        }
-      });
+          return cont && !(child instanceof Class);
+        };
+      })(this));
     };
 
     Class.prototype.hoistDirectivePrologue = function() {
@@ -1436,11 +1504,10 @@
     Class.prototype.ensureConstructor = function(name) {
       if (!this.ctor) {
         this.ctor = new Code;
-        if (this.parent) {
-          this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
-        }
         if (this.externalCtor) {
           this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
+        } else if (this.parent) {
+          this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
         }
         this.ctor.body.makeReturn();
         this.body.expressions.unshift(this.ctor);
@@ -1451,37 +1518,40 @@
     };
 
     Class.prototype.compileNode = function(o) {
-      var call, decl, klass, lname, name, params, _ref2;
-      decl = this.determineName();
-      name = decl || '_Class';
+      var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2;
+      if (jumpNode = this.body.jumps()) {
+        jumpNode.error('Class bodies cannot contain pure statements');
+      }
+      if (argumentsNode = this.body.contains(isLiteralArguments)) {
+        argumentsNode.error("Class bodies shouldn't reference arguments");
+      }
+      name = this.determineName() || '_Class';
       if (name.reserved) {
         name = "_" + name;
       }
       lname = new Literal(name);
+      func = new Code([], Block.wrap([this.body]));
+      args = [];
+      o.classScope = func.makeScope(o.scope);
       this.hoistDirectivePrologue();
       this.setContext(name);
       this.walkBody(name, o);
       this.ensureConstructor(name);
+      this.addBoundFunctions(o);
       this.body.spaced = true;
-      if (!(this.ctor instanceof Code)) {
-        this.body.expressions.unshift(this.ctor);
-      }
       this.body.expressions.push(lname);
-      (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
-      this.addBoundFunctions(o);
-      call = Closure.wrap(this.body);
       if (this.parent) {
-        this.superClass = new Literal(o.scope.freeVariable('super', false));
-        this.body.expressions.unshift(new Extends(lname, this.superClass));
-        call.args.push(this.parent);
-        params = call.variable.params || call.variable.base.params;
-        params.push(new Param(this.superClass));
+        superClass = new Literal(o.classScope.freeVariable('super', false));
+        this.body.expressions.unshift(new Extends(lname, superClass));
+        func.params.push(new Param(superClass));
+        args.push(this.parent);
       }
-      klass = new Parens(call, true);
+      (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
+      klass = new Parens(new Call(func, args));
       if (this.variable) {
         klass = new Assign(this.variable, klass);
       }
-      return klass.compile(o);
+      return klass.compileToFragments(o);
     };
 
     return Class;
@@ -1489,7 +1559,6 @@
   })(Base);
 
   exports.Assign = Assign = (function(_super) {
-
     __extends(Assign, _super);
 
     function Assign(variable, value, context, options) {
@@ -1501,7 +1570,7 @@
       this.subpattern = options && options.subpattern;
       forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0);
       if (forbidden && this.context !== 'object') {
-        throw SyntaxError("variable name may not be \"" + name + "\"");
+        this.variable.error("variable name may not be \"" + name + "\"");
       }
     }
 
@@ -1520,7 +1589,7 @@
     };
 
     Assign.prototype.compileNode = function(o) {
-      var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
+      var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
       if (isValue = this.variable instanceof Value) {
         if (this.variable.isArray() || this.variable.isObject()) {
           return this.compilePatternMatch(o);
@@ -1531,11 +1600,16 @@
         if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') {
           return this.compileConditional(o);
         }
+        if ((_ref3 = this.context) === '**=' || _ref3 === '//=' || _ref3 === '%%=') {
+          return this.compileSpecialMath(o);
+        }
       }
-      name = this.variable.compile(o, LEVEL_LIST);
+      compiledName = this.variable.compileToFragments(o, LEVEL_LIST);
+      name = fragmentsToText(compiledName);
       if (!this.context) {
-        if (!(varBase = this.variable.unwrapAll()).isAssignable()) {
-          throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned.");
+        varBase = this.variable.unwrapAll();
+        if (!varBase.isAssignable()) {
+          this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned");
         }
         if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
           if (this.param) {
@@ -1546,32 +1620,32 @@
         }
       }
       if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
-        if (match[1]) {
+        if (match[2]) {
           this.value.klass = match[1];
         }
-        this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
+        this.value.name = (_ref4 = (_ref5 = match[3]) != null ? _ref5 : match[4]) != null ? _ref4 : match[5];
       }
-      val = this.value.compile(o, LEVEL_LIST);
+      val = this.value.compileToFragments(o, LEVEL_LIST);
       if (this.context === 'object') {
-        return "" + name + ": " + val;
+        return compiledName.concat(this.makeCode(": "), val);
       }
-      val = name + (" " + (this.context || '=') + " ") + val;
+      answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val);
       if (o.level <= LEVEL_LIST) {
-        return val;
+        return answer;
       } else {
-        return "(" + val + ")";
+        return this.wrapInBraces(answer);
       }
     };
 
     Assign.prototype.compilePatternMatch = function(o) {
-      var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
+      var acc, assigns, code, expandedIdx, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
       top = o.level === LEVEL_TOP;
       value = this.value;
       objects = this.variable.base.objects;
       if (!(olen = objects.length)) {
-        code = value.compile(o);
+        code = value.compileToFragments(o);
         if (o.level >= LEVEL_OP) {
-          return "(" + code + ")";
+          return this.wrapInBraces(code);
         } else {
           return code;
         }
@@ -1581,108 +1655,136 @@
         if (obj instanceof Assign) {
           _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value;
         } else {
-          if (obj.base instanceof Parens) {
-            _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1];
-          } else {
-            idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
-          }
+          idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
         }
         acc = IDENTIFIER.test(idx.unwrap().value || 0);
         value = new Value(value);
         value.properties.push(new (acc ? Access : Index)(idx));
-        if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) {
-          throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o)));
+        if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) {
+          obj.error("assignment to a reserved word: " + (obj.compile(o)));
         }
         return new Assign(obj, value, null, {
           param: this.param
-        }).compile(o, LEVEL_TOP);
+        }).compileToFragments(o, LEVEL_TOP);
       }
-      vvar = value.compile(o, LEVEL_LIST);
+      vvar = value.compileToFragments(o, LEVEL_LIST);
+      vvarText = fragmentsToText(vvar);
       assigns = [];
-      splat = false;
-      if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) {
-        assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar);
-        vvar = ref;
+      expandedIdx = false;
+      if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) {
+        assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar)));
+        vvar = [this.makeCode(ref)];
+        vvarText = ref;
       }
       for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
         obj = objects[i];
         idx = i;
         if (isObject) {
           if (obj instanceof Assign) {
-            _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value;
+            _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value;
           } else {
             if (obj.base instanceof Parens) {
-              _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1];
+              _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1];
             } else {
               idx = obj["this"] ? obj.properties[0].name : obj;
             }
           }
         }
-        if (!splat && obj instanceof Splat) {
+        if (!expandedIdx && obj instanceof Splat) {
           name = obj.name.unwrap().value;
           obj = obj.unwrap();
-          val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i;
+          val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i;
           if (rest = olen - i - 1) {
             ivar = o.scope.freeVariable('i');
-            val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
+            val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
           } else {
             val += ") : []";
           }
           val = new Literal(val);
-          splat = "" + ivar + "++";
+          expandedIdx = "" + ivar + "++";
+        } else if (!expandedIdx && obj instanceof Expansion) {
+          if (rest = olen - i - 1) {
+            if (rest === 1) {
+              expandedIdx = "" + vvarText + ".length - 1";
+            } else {
+              ivar = o.scope.freeVariable('i');
+              val = new Literal("" + ivar + " = " + vvarText + ".length - " + rest);
+              expandedIdx = "" + ivar + "++";
+              assigns.push(val.compileToFragments(o, LEVEL_LIST));
+            }
+          }
+          continue;
         } else {
           name = obj.unwrap().value;
-          if (obj instanceof Splat) {
-            obj = obj.name.compile(o);
-            throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "...");
+          if (obj instanceof Splat || obj instanceof Expansion) {
+            obj.error("multiple splats/expansions are disallowed in an assignment");
           }
           if (typeof idx === 'number') {
-            idx = new Literal(splat || idx);
+            idx = new Literal(expandedIdx || idx);
             acc = false;
           } else {
             acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
           }
-          val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]);
+          val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]);
         }
         if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
-          throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o)));
+          obj.error("assignment to a reserved word: " + (obj.compile(o)));
         }
         assigns.push(new Assign(obj, val, null, {
           param: this.param,
           subpattern: true
-        }).compile(o, LEVEL_LIST));
+        }).compileToFragments(o, LEVEL_LIST));
       }
       if (!(top || this.subpattern)) {
         assigns.push(vvar);
       }
-      code = assigns.join(', ');
+      fragments = this.joinFragmentArrays(assigns, ', ');
       if (o.level < LEVEL_LIST) {
-        return code;
+        return fragments;
       } else {
-        return "(" + code + ")";
+        return this.wrapInBraces(fragments);
       }
     };
 
     Assign.prototype.compileConditional = function(o) {
-      var left, right, _ref2;
+      var fragments, left, right, _ref2;
       _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
       if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
-        throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined.");
+        this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before");
       }
       if (__indexOf.call(this.context, "?") >= 0) {
         o.isExistentialEquals = true;
+        return new If(new Existence(left), right, {
+          type: 'if'
+        }).addElse(new Assign(right, this.value, '=')).compileToFragments(o);
+      } else {
+        fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o);
+        if (o.level <= LEVEL_LIST) {
+          return fragments;
+        } else {
+          return this.wrapInBraces(fragments);
+        }
       }
-      return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o);
+    };
+
+    Assign.prototype.compileSpecialMath = function(o) {
+      var left, right, _ref2;
+      _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
+      return new Assign(left, new Op(this.context.slice(0, -1), right, this.value)).compileToFragments(o);
     };
 
     Assign.prototype.compileSplice = function(o) {
-      var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
+      var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
       _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
       name = this.variable.compile(o);
-      _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1];
+      if (from) {
+        _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1];
+      } else {
+        fromDecl = fromRef = '0';
+      }
       if (to) {
-        if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
-          to = +to.compile(o) - +fromRef;
+        if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) {
+          to = to.compile(o) - fromRef;
           if (!exclusive) {
             to += 1;
           }
@@ -1696,11 +1798,11 @@
         to = "9e9";
       }
       _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
-      code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef;
+      answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef);
       if (o.level > LEVEL_TOP) {
-        return "(" + code + ")";
+        return this.wrapInBraces(answer);
       } else {
-        return code;
+        return answer;
       }
     };
 
@@ -1709,16 +1811,12 @@
   })(Base);
 
   exports.Code = Code = (function(_super) {
-
     __extends(Code, _super);
 
     function Code(params, body, tag) {
       this.params = params || [];
       this.body = body || new Block;
       this.bound = tag === 'boundfunc';
-      if (this.bound) {
-        this.context = '_this';
-      }
     }
 
     Code.prototype.children = ['params', 'body'];
@@ -1729,31 +1827,48 @@
 
     Code.prototype.jumps = NO;
 
+    Code.prototype.makeScope = function(parentScope) {
+      return new Scope(parentScope, this.body, this);
+    };
+
     Code.prototype.compileNode = function(o) {
-      var code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
-      o.scope = new Scope(o.scope, this.body, this);
+      var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+      if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) {
+        this.context = o.scope.method.context;
+      }
+      if (this.bound && !this.context) {
+        this.context = '_this';
+        wrapper = new Code([new Param(new Literal(this.context))], new Block([this]));
+        boundfunc = new Call(wrapper, [new Literal('this')]);
+        boundfunc.updateLocationDataIfMissing(this.locationData);
+        return boundfunc.compileNode(o);
+      }
+      o.scope = del(o, 'classScope') || this.makeScope(o.scope);
       o.scope.shared = del(o, 'sharedScope');
       o.indent += TAB;
       delete o.bare;
       delete o.isExistentialEquals;
       params = [];
       exprs = [];
-      _ref2 = this.paramNames();
-      for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
-        name = _ref2[_i];
-        if (!o.scope.check(name)) {
-          o.scope.parameter(name);
+      _ref3 = this.params;
+      for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+        param = _ref3[_i];
+        if (!(param instanceof Expansion)) {
+          o.scope.parameter(param.asReference(o));
         }
       }
-      _ref3 = this.params;
-      for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
-        param = _ref3[_j];
-        if (!param.splat) {
+      _ref4 = this.params;
+      for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
+        param = _ref4[_j];
+        if (!(param.splat || param instanceof Expansion)) {
           continue;
         }
-        _ref4 = this.params;
-        for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
-          p = _ref4[_k].name;
+        _ref5 = this.params;
+        for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) {
+          p = _ref5[_k].name;
+          if (!(!(param instanceof Expansion))) {
+            continue;
+          }
           if (p["this"]) {
             p = p.properties[0].name;
           }
@@ -1762,20 +1877,20 @@
           }
         }
         splats = new Assign(new Value(new Arr((function() {
-          var _l, _len3, _ref5, _results;
-          _ref5 = this.params;
+          var _l, _len3, _ref6, _results;
+          _ref6 = this.params;
           _results = [];
-          for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
-            p = _ref5[_l];
+          for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
+            p = _ref6[_l];
             _results.push(p.asReference(o));
           }
           return _results;
         }).call(this))), new Value(new Literal('arguments')));
         break;
       }
-      _ref5 = this.params;
-      for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
-        param = _ref5[_l];
+      _ref6 = this.params;
+      for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
+        param = _ref6[_l];
         if (param.isComplex()) {
           val = ref = param.asReference(o);
           if (param.value) {
@@ -1801,60 +1916,60 @@
         exprs.unshift(splats);
       }
       if (exprs.length) {
-        (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs);
+        (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs);
       }
       for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
         p = params[i];
-        o.scope.parameter(params[i] = p.compile(o));
+        params[i] = p.compileToFragments(o);
+        o.scope.parameter(fragmentsToText(params[i]));
       }
       uniqs = [];
-      _ref7 = this.paramNames();
-      for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) {
-        name = _ref7[_n];
+      this.eachParamName(function(name, node) {
         if (__indexOf.call(uniqs, name) >= 0) {
-          throw SyntaxError("multiple parameters named '" + name + "'");
+          node.error("multiple parameters named '" + name + "'");
         }
-        uniqs.push(name);
-      }
+        return uniqs.push(name);
+      });
       if (!(wasEmpty || this.noReturn)) {
         this.body.makeReturn();
       }
-      if (this.bound) {
-        if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) {
-          this.bound = this.context = o.scope.parent.method.context;
-        } else if (!this["static"]) {
-          o.scope.parent.assign('_this', 'this');
-        }
-      }
-      idt = o.indent;
       code = 'function';
       if (this.ctor) {
         code += ' ' + this.name;
       }
-      code += '(' + params.join(', ') + ') {';
+      code += '(';
+      answer = [this.makeCode(code)];
+      for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) {
+        p = params[i];
+        if (i) {
+          answer.push(this.makeCode(", "));
+        }
+        answer.push.apply(answer, p);
+      }
+      answer.push(this.makeCode(') {'));
       if (!this.body.isEmpty()) {
-        code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab;
+        answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab));
       }
-      code += '}';
+      answer.push(this.makeCode('}'));
       if (this.ctor) {
-        return this.tab + code;
+        return [this.makeCode(this.tab)].concat(__slice.call(answer));
       }
       if (this.front || (o.level >= LEVEL_ACCESS)) {
-        return "(" + code + ")";
+        return this.wrapInBraces(answer);
       } else {
-        return code;
+        return answer;
       }
     };
 
-    Code.prototype.paramNames = function() {
-      var names, param, _i, _len, _ref2;
-      names = [];
+    Code.prototype.eachParamName = function(iterator) {
+      var param, _i, _len, _ref2, _results;
       _ref2 = this.params;
+      _results = [];
       for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
         param = _ref2[_i];
-        names.push.apply(names, param.names());
+        _results.push(param.eachName(iterator));
       }
-      return names;
+      return _results;
     };
 
     Code.prototype.traverseChildren = function(crossScope, func) {
@@ -1868,7 +1983,6 @@
   })(Base);
 
   exports.Param = Param = (function(_super) {
-
     __extends(Param, _super);
 
     function Param(name, value, splat) {
@@ -1877,14 +1991,14 @@
       this.value = value;
       this.splat = splat;
       if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
-        throw SyntaxError("parameter name \"" + name + "\" is not allowed");
+        this.name.error("parameter name \"" + name + "\" is not allowed");
       }
     }
 
     Param.prototype.children = ['name', 'value'];
 
-    Param.prototype.compile = function(o) {
-      return this.name.compile(o, LEVEL_LIST);
+    Param.prototype.compileToFragments = function(o) {
+      return this.name.compileToFragments(o, LEVEL_LIST);
     };
 
     Param.prototype.asReference = function(o) {
@@ -1905,6 +2019,7 @@
       if (this.splat) {
         node = new Splat(node);
       }
+      node.updateLocationDataIfMissing(this.locationData);
       return this.reference = node;
     };
 
@@ -1912,47 +2027,44 @@
       return this.name.isComplex();
     };
 
-    Param.prototype.names = function(name) {
-      var atParam, names, obj, _i, _len, _ref2;
+    Param.prototype.eachName = function(iterator, name) {
+      var atParam, node, obj, _i, _len, _ref2;
       if (name == null) {
         name = this.name;
       }
       atParam = function(obj) {
-        var value;
-        value = obj.properties[0].name.value;
-        if (value.reserved) {
-          return [];
-        } else {
-          return [value];
+        var node;
+        node = obj.properties[0].name;
+        if (!node.value.reserved) {
+          return iterator(node.value, node);
         }
       };
       if (name instanceof Literal) {
-        return [name.value];
+        return iterator(name.value, name);
       }
       if (name instanceof Value) {
         return atParam(name);
       }
-      names = [];
       _ref2 = name.objects;
       for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
         obj = _ref2[_i];
         if (obj instanceof Assign) {
-          names.push(obj.value.unwrap().value);
+          this.eachName(iterator, obj.value.unwrap());
         } else if (obj instanceof Splat) {
-          names.push(obj.name.unwrap().value);
+          node = obj.name.unwrap();
+          iterator(node.value, node);
         } else if (obj instanceof Value) {
           if (obj.isArray() || obj.isObject()) {
-            names.push.apply(names, this.names(obj.base));
+            this.eachName(iterator, obj.base);
           } else if (obj["this"]) {
-            names.push.apply(names, atParam(obj));
+            atParam(obj);
           } else {
-            names.push(obj.base.value);
+            iterator(obj.base.value, obj.base);
           }
-        } else {
-          throw SyntaxError("illegal parameter " + (obj.compile()));
+        } else if (!(obj instanceof Expansion)) {
+          obj.error("illegal parameter " + (obj.compile()));
         }
       }
-      return names;
     };
 
     return Param;
@@ -1960,7 +2072,6 @@
   })(Base);
 
   exports.Splat = Splat = (function(_super) {
-
     __extends(Splat, _super);
 
     Splat.prototype.children = ['name'];
@@ -1975,12 +2086,8 @@
       return this.name.assigns(name);
     };
 
-    Splat.prototype.compile = function(o) {
-      if (this.index != null) {
-        return this.compileParam(o);
-      } else {
-        return this.name.compile(o);
-      }
+    Splat.prototype.compileToFragments = function(o) {
+      return this.name.compileToFragments(o);
     };
 
     Splat.prototype.unwrap = function() {
@@ -1988,29 +2095,32 @@
     };
 
     Splat.compileSplattedArray = function(o, list, apply) {
-      var args, base, code, i, index, node, _i, _len;
+      var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len;
       index = -1;
       while ((node = list[++index]) && !(node instanceof Splat)) {
         continue;
       }
       if (index >= list.length) {
-        return '';
+        return [];
       }
       if (list.length === 1) {
-        code = list[0].compile(o, LEVEL_LIST);
+        node = list[0];
+        fragments = node.compileToFragments(o, LEVEL_LIST);
         if (apply) {
-          return code;
+          return fragments;
         }
-        return "" + (utility('slice')) + ".call(" + code + ")";
+        return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")"));
       }
       args = list.slice(index);
       for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
         node = args[i];
-        code = node.compile(o, LEVEL_LIST);
-        args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]";
+        compiledNode = node.compileToFragments(o, LEVEL_LIST);
+        args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]"));
       }
       if (index === 0) {
-        return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
+        node = list[0];
+        concatPart = node.joinFragmentArrays(args.slice(1), ', ');
+        return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")"));
       }
       base = (function() {
         var _j, _len1, _ref2, _results;
@@ -2018,19 +2128,43 @@
         _results = [];
         for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
           node = _ref2[_j];
-          _results.push(node.compile(o, LEVEL_LIST));
+          _results.push(node.compileToFragments(o, LEVEL_LIST));
         }
         return _results;
       })();
-      return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
+      base = list[0].joinFragmentArrays(base, ', ');
+      concatPart = list[index].joinFragmentArrays(args, ', ');
+      return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")"));
     };
 
     return Splat;
 
   })(Base);
 
-  exports.While = While = (function(_super) {
+  exports.Expansion = Expansion = (function(_super) {
+    __extends(Expansion, _super);
+
+    function Expansion() {
+      return Expansion.__super__.constructor.apply(this, arguments);
+    }
+
+    Expansion.prototype.isComplex = NO;
+
+    Expansion.prototype.compileNode = function(o) {
+      return this.error('Expansion must be used inside a destructuring assignment or parameter list');
+    };
+
+    Expansion.prototype.asReference = function(o) {
+      return this;
+    };
+
+    Expansion.prototype.eachName = function(iterator) {};
+
+    return Expansion;
+
+  })(Base);
 
+  exports.While = While = (function(_super) {
     __extends(While, _super);
 
     function While(condition, options) {
@@ -2059,29 +2193,29 @@
     };
 
     While.prototype.jumps = function() {
-      var expressions, node, _i, _len;
+      var expressions, jumpNode, node, _i, _len;
       expressions = this.body.expressions;
       if (!expressions.length) {
         return false;
       }
       for (_i = 0, _len = expressions.length; _i < _len; _i++) {
         node = expressions[_i];
-        if (node.jumps({
+        if (jumpNode = node.jumps({
           loop: true
         })) {
-          return node;
+          return jumpNode;
         }
       }
       return false;
     };
 
     While.prototype.compileNode = function(o) {
-      var body, code, rvar, set;
+      var answer, body, rvar, set;
       o.indent += TAB;
       set = '';
       body = this.body;
       if (body.isEmpty()) {
-        body = '';
+        body = this.makeCode('');
       } else {
         if (this.returns) {
           body.makeReturn(rvar = o.scope.freeVariable('results'));
@@ -2096,13 +2230,13 @@
             }
           }
         }
-        body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab;
+        body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab));
       }
-      code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}");
+      answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}"));
       if (this.returns) {
-        code += "\n" + this.tab + "return " + rvar + ";";
+        answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";"));
       }
-      return code;
+      return answer;
     };
 
     return While;
@@ -2224,16 +2358,16 @@
     };
 
     Op.prototype.compileNode = function(o) {
-      var code, isChain, _ref2, _ref3;
+      var answer, isChain, lhs, rhs, _ref2, _ref3;
       isChain = this.isChainable() && this.first.isChainable();
       if (!isChain) {
         this.first.front = this.front;
       }
       if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
-        throw SyntaxError('delete operand may not be argument or var');
+        this.error('delete operand may not be argument or var');
       }
       if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
-        throw SyntaxError('prefix increment/decrement may not have eval or arguments operand');
+        this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\"");
       }
       if (this.isUnary()) {
         return this.compileUnary(o);
@@ -2241,23 +2375,33 @@
       if (isChain) {
         return this.compileChain(o);
       }
-      if (this.operator === '?') {
-        return this.compileExistence(o);
-      }
-      code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
-      if (o.level <= LEVEL_OP) {
-        return code;
-      } else {
-        return "(" + code + ")";
+      switch (this.operator) {
+        case '?':
+          return this.compileExistence(o);
+        case '**':
+          return this.compilePower(o);
+        case '//':
+          return this.compileFloorDivision(o);
+        case '%%':
+          return this.compileModulo(o);
+        default:
+          lhs = this.first.compileToFragments(o, LEVEL_OP);
+          rhs = this.second.compileToFragments(o, LEVEL_OP);
+          answer = [].concat(lhs, this.makeCode(" " + this.operator + " "), rhs);
+          if (o.level <= LEVEL_OP) {
+            return answer;
+          } else {
+            return this.wrapInBraces(answer);
+          }
       }
     };
 
     Op.prototype.compileChain = function(o) {
-      var code, fst, shared, _ref2;
+      var fragments, fst, shared, _ref2;
       _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
-      fst = this.first.compile(o, LEVEL_OP);
-      code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
-      return "(" + code + ")";
+      fst = this.first.compileToFragments(o, LEVEL_OP);
+      fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP));
+      return this.wrapInBraces(fragments);
     };
 
     Op.prototype.compileExistence = function(o) {
@@ -2271,27 +2415,52 @@
       }
       return new If(new Existence(fst), ref, {
         type: 'if'
-      }).addElse(this.second).compile(o);
+      }).addElse(this.second).compileToFragments(o);
     };
 
     Op.prototype.compileUnary = function(o) {
       var op, parts, plusMinus;
+      parts = [];
+      op = this.operator;
+      parts.push([this.makeCode(op)]);
+      if (op === '!' && this.first instanceof Existence) {
+        this.first.negated = !this.first.negated;
+        return this.first.compileToFragments(o);
+      }
       if (o.level >= LEVEL_ACCESS) {
-        return (new Parens(this)).compile(o);
+        return (new Parens(this)).compileToFragments(o);
       }
-      parts = [op = this.operator];
       plusMinus = op === '+' || op === '-';
       if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
-        parts.push(' ');
+        parts.push([this.makeCode(' ')]);
       }
       if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
         this.first = new Parens(this.first);
       }
-      parts.push(this.first.compile(o, LEVEL_OP));
+      parts.push(this.first.compileToFragments(o, LEVEL_OP));
       if (this.flip) {
         parts.reverse();
       }
-      return parts.join('');
+      return this.joinFragmentArrays(parts, '');
+    };
+
+    Op.prototype.compilePower = function(o) {
+      var pow;
+      pow = new Value(new Literal('Math'), [new Access(new Literal('pow'))]);
+      return new Call(pow, [this.first, this.second]).compileToFragments(o);
+    };
+
+    Op.prototype.compileFloorDivision = function(o) {
+      var div, floor;
+      floor = new Value(new Literal('Math'), [new Access(new Literal('floor'))]);
+      div = new Op('/', this.first, this.second);
+      return new Call(floor, [div]).compileToFragments(o);
+    };
+
+    Op.prototype.compileModulo = function(o) {
+      var mod;
+      mod = new Value(new Literal(utility('modulo')));
+      return new Call(mod, [this.first, this.second]).compileToFragments(o);
     };
 
     Op.prototype.toString = function(idt) {
@@ -2303,7 +2472,6 @@
   })(Base);
 
   exports.In = In = (function(_super) {
-
     __extends(In, _super);
 
     function In(object, array) {
@@ -2317,7 +2485,7 @@
 
     In.prototype.compileNode = function(o) {
       var hasSplat, obj, _i, _len, _ref2;
-      if (this.array instanceof Value && this.array.isArray()) {
+      if (this.array instanceof Value && this.array.isArray() && this.array.base.objects.length) {
         _ref2 = this.array.base.objects;
         for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
           obj = _ref2[_i];
@@ -2335,42 +2503,37 @@
     };
 
     In.prototype.compileOrTest = function(o) {
-      var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3;
-      if (this.array.base.objects.length === 0) {
-        return "" + (!!this.negated);
-      }
+      var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4;
       _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], 

<TRUNCATED>

[03/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/index.html
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/index.html b/weinre.server/node_modules/underscore/index.html
deleted file mode 100644
index 01c18ac..0000000
--- a/weinre.server/node_modules/underscore/index.html
+++ /dev/null
@@ -1,2109 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-  <meta http-equiv="X-UA-Compatible" content="chrome=1">
-  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-  <title>Underscore.js</title>
-  <style>
-    body {
-      font-size: 14px;
-      line-height: 22px;
-      background: #f4f4f4 url(docs/images/background.png);
-      color: #000;
-      font-family: Helvetica Neue, Helvetica, Arial;
-    }
-    .interface {
-      font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif !important;
-    }
-    div#sidebar {
-      background: #fff;
-      position: fixed;
-      top: 0; left: 0; bottom: 0;
-      width: 200px;
-      overflow-y: auto;
-      overflow-x: hidden;
-      -webkit-overflow-scrolling: touch;
-      padding: 15px 0 30px 30px;
-      border-right: 1px solid #bbb;
-      box-shadow: 0 0 20px #ccc; -webkit-box-shadow: 0 0 20px #ccc; -moz-box-shadow: 0 0 20px #ccc;
-    }
-    a.toc_title, a.toc_title:visited {
-      display: block;
-      color: black;
-      font-weight: bold;
-      margin-top: 15px;
-    }
-      a.toc_title:hover {
-        text-decoration: underline;
-      }
-      #sidebar .version {
-        font-size: 10px;
-        font-weight: normal;
-      }
-    ul.toc_section {
-      font-size: 11px;
-      line-height: 14px;
-      margin: 5px 0 0 0;
-      padding-left: 0px;
-      list-style-type: none;
-      font-family: Lucida Grande;
-    }
-      .toc_section li {
-        cursor: pointer;
-        margin: 0 0 3px 0;
-      }
-        .toc_section li a {
-          text-decoration: none;
-          color: black;
-        }
-          .toc_section li a:hover {
-            text-decoration: underline;
-          }
-    div.container {
-      width: 550px;
-      margin: 40px 0 50px 260px;
-    }
-    div.warning {
-      margin-top: 15px;
-      font: bold 11px Arial;
-      color: #770000;
-    }
-    p {
-      margin: 20px 0;
-      width: 550px;
-    }
-    a, a:visited {
-      color: #444;
-    }
-    a:active, a:hover {
-      color: #000;
-    }
-    h1, h2, h3, h4, h5, h6 {
-      padding-top: 20px;
-    }
-      h2 {
-        font-size: 20px;
-      }
-    b.header {
-      font-size: 16px;
-      line-height: 30px;
-    }
-    span.alias {
-      font-size: 14px;
-      font-style: italic;
-      margin-left: 20px;
-    }
-    table, tr, td {
-      margin: 0; padding: 0;
-    }
-      td {
-        padding: 2px 12px 2px 0;
-      }
-    ul {
-      list-style-type: circle;
-      padding: 0 0 0 20px;
-    }
-      li {
-        width: 500px;
-        margin-bottom: 10px;
-      }
-      code, pre, tt {
-        font-family: Monaco, Consolas, "Lucida Console", monospace;
-        font-size: 12px;
-        line-height: 18px;
-        font-style: normal;
-      }
-        tt {
-          padding: 0px 3px;
-          background: #fff;
-          border: 1px solid #ddd;
-          zoom: 1;
-        }
-        code {
-          margin-left: 20px;
-        }
-        pre {
-          font-size: 12px;
-          padding: 2px 0 2px 15px;
-          border-left: 5px solid #bbb;
-          margin: 0px 0 30px;
-        }
-  </style>
-</head>
-<body>
-
-  <div id="sidebar" class="interface">
-
-    <a class="toc_title" href="#">
-      Underscore.js <span class="version">(1.3.3)</span>
-    </a>
-
-    <a class="toc_title" href="#">
-      Introduction
-    </a>
-
-    <a class="toc_title" href="#collections">
-      Collections
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#each">each</a></li>
-      <li>- <a href="#map">map</a></li>
-      <li>- <a href="#reduce">reduce</a></li>
-      <li>- <a href="#reduceRight">reduceRight</a></li>
-      <li>- <a href="#find">find</a></li>
-      <li>- <a href="#filter">filter</a></li>
-      <li>- <a href="#reject">reject</a></li>
-      <li>- <a href="#all">all</a></li>
-      <li>- <a href="#any">any</a></li>
-      <li>- <a href="#include">include</a></li>
-      <li>- <a href="#invoke">invoke</a></li>
-      <li>- <a href="#pluck">pluck</a></li>
-      <li>- <a href="#max">max</a></li>
-      <li>- <a href="#min">min</a></li>
-      <li>- <a href="#sortBy">sortBy</a></li>
-      <li>- <a href="#groupBy">groupBy</a></li>
-      <li>- <a href="#sortedIndex">sortedIndex</a></li>
-      <li>- <a href="#shuffle">shuffle</a></li>
-      <li>- <a href="#toArray">toArray</a></li>
-      <li>- <a href="#size">size</a></li>
-    </ul>
-
-    <a class="toc_title" href="#arrays">
-      Arrays
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#first">first</a></li>
-      <li>- <a href="#initial">initial</a></li>
-      <li>- <a href="#last">last</a></li>
-      <li>- <a href="#rest">rest</a></li>
-      <li>- <a href="#compact">compact</a></li>
-      <li>- <a href="#flatten">flatten</a></li>
-      <li>- <a href="#without">without</a></li>
-      <li>- <a href="#union">union</a></li>
-      <li>- <a href="#intersection">intersection</a></li>
-      <li>- <a href="#difference">difference</a></li>
-      <li>- <a href="#uniq">uniq</a></li>
-      <li>- <a href="#zip">zip</a></li>
-      <li>- <a href="#indexOf">indexOf</a></li>
-      <li>- <a href="#lastIndexOf">lastIndexOf</a></li>
-      <li>- <a href="#range">range</a></li>
-    </ul>
-
-    <a class="toc_title" href="#functions">
-      Functions
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#bind">bind</a></li>
-      <li>- <a href="#bindAll">bindAll</a></li>
-      <li>- <a href="#memoize">memoize</a></li>
-      <li>- <a href="#delay">delay</a></li>
-      <li>- <a href="#defer">defer</a></li>
-      <li>- <a href="#throttle">throttle</a></li>
-      <li>- <a href="#debounce">debounce</a></li>
-      <li>- <a href="#once">once</a></li>
-      <li>- <a href="#after">after</a></li>
-      <li>- <a href="#wrap">wrap</a></li>
-      <li>- <a href="#compose">compose</a></li>
-    </ul>
-
-    <a class="toc_title" href="#objects">
-      Objects
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#keys">keys</a></li>
-      <li>- <a href="#values">values</a></li>
-      <li>- <a href="#object-functions">functions</a></li>
-      <li>- <a href="#extend">extend</a></li>
-      <li>- <a href="#pick">pick</a></li>
-      <li>- <a href="#defaults">defaults</a></li>
-      <li>- <a href="#clone">clone</a></li>
-      <li>- <a href="#tap">tap</a></li>
-      <li>- <a href="#has">has</a></li>
-      <li>- <a href="#isEqual">isEqual</a></li>
-      <li>- <a href="#isEmpty">isEmpty</a></li>
-      <li>- <a href="#isElement">isElement</a></li>
-      <li>- <a href="#isArray">isArray</a></li>
-      <li>- <a href="#isObject">isObject</a></li>
-      <li>- <a href="#isArguments">isArguments</a></li>
-      <li>- <a href="#isFunction">isFunction</a></li>
-      <li>- <a href="#isString">isString</a></li>
-      <li>- <a href="#isNumber">isNumber</a></li>
-      <li>- <a href="#isFinite">isFinite</a></li>
-      <li>- <a href="#isBoolean">isBoolean</a></li>
-      <li>- <a href="#isDate">isDate</a></li>
-      <li>- <a href="#isRegExp">isRegExp</a></li>
-      <li>- <a href="#isNaN">isNaN</a></li>
-      <li>- <a href="#isNull">isNull</a></li>
-      <li>- <a href="#isUndefined">isUndefined</a></li>
-    </ul>
-
-    <a class="toc_title" href="#utility">
-      Utility
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#noConflict">noConflict</a></li>
-      <li>- <a href="#identity">identity</a></li>
-      <li>- <a href="#times">times</a></li>
-      <li>- <a href="#mixin">mixin</a></li>
-      <li>- <a href="#uniqueId">uniqueId</a></li>
-      <li>- <a href="#escape">escape</a></li>
-      <li>- <a href="#result">result</a></li>
-      <li>- <a href="#template">template</a></li>
-    </ul>
-
-    <a class="toc_title" href="#chaining">
-      Chaining
-    </a>
-    <ul class="toc_section">
-      <li>- <a href="#chain">chain</a></li>
-      <li>- <a href="#value">value</a></li>
-    </ul>
-
-    <a class="toc_title" href="#links">
-      Links
-    </a>
-
-    <a class="toc_title" href="#changelog">
-      Change Log
-    </a>
-
-  </div>
-
-  <div class="container">
-
-    <p id="introduction">
-      <img style="width: 396px; height: 69px;" src="docs/images/underscore.png" alt="Underscore.js" />
-    </p>
-
-    <p>
-      <a href="http://github.com/documentcloud/underscore/">Underscore</a> is a
-      utility-belt library for JavaScript that provides a lot of the
-      functional programming support that you would expect in
-      <a href="http://prototypejs.org/api">Prototype.js</a>
-      (or <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">Ruby</a>),
-      but without extending any of the built-in JavaScript objects. It's the
-      tie to go along with <a href="http://docs.jquery.com">jQuery</a>'s tux,
-      and <a href="http://backbonejs.org">Backbone.js</a>'s suspenders.
-    </p>
-
-    <p>
-      Underscore provides 60-odd functions that support both the usual
-      functional suspects: <b>map</b>, <b>select</b>, <b>invoke</b> &mdash;
-      as well as more specialized helpers: function binding, javascript
-      templating, deep equality testing, and so on. It delegates to built-in
-      functions, if present, so modern browsers will use the
-      native implementations of <b>forEach</b>, <b>map</b>, <b>reduce</b>,
-      <b>filter</b>, <b>every</b>, <b>some</b> and <b>indexOf</b>.
-    </p>
-
-    <p>
-      A complete <a href="test/test.html">Test &amp; Benchmark Suite</a>
-      is included for your perusal.
-    </p>
-
-    <p>
-      You may also read through the <a href="docs/underscore.html">annotated source code</a>.
-    </p>
-
-    <p>
-      The project is
-      <a href="http://github.com/documentcloud/underscore/">hosted on GitHub</a>.
-      You can report bugs and discuss features on the
-      <a href="http://github.com/documentcloud/underscore/issues">issues page</a>,
-      on Freenode in the <tt>#documentcloud</tt> channel,
-      or send tweets to <a href="http://twitter.com/documentcloud">@documentcloud</a>.
-    </p>
-
-    <p>
-      <i>Underscore is an open-source component of <a href="http://documentcloud.org/">DocumentCloud</a>.</i>
-    </p>
-
-    <h2>Downloads <i style="padding-left: 12px; font-size:12px;">(Right-click, and use "Save As")</i></h2>
-
-    <table>
-      <tr>
-        <td><a href="underscore.js">Development Version (1.3.3)</a></td>
-        <td><i>37kb, Uncompressed with Plentiful Comments</i></td>
-      </tr>
-      <tr>
-        <td><a href="underscore-min.js">Production Version (1.3.3)</a></td>
-        <td><i>4kb, Minified and Gzipped</i></td>
-      </tr>
-    </table>
-
-    <div class="warning">Upgrade warning: versions 1.3.0 and higher remove AMD (RequireJS) support.</div>
-
-    <div id="documentation">
-
-      <h2 id="collections">Collection Functions (Arrays or Objects)</h2>
-
-      <p id="each">
-        <b class="header">each</b><code>_.each(list, iterator, [context])</code>
-        <span class="alias">Alias: <b>forEach</b></span>
-        <br />
-        Iterates over a <b>list</b> of elements, yielding each in turn to an <b>iterator</b>
-        function. The <b>iterator</b> is bound to the <b>context</b> object, if one is
-        passed. Each invocation of <b>iterator</b> is called with three arguments:
-        <tt>(element, index, list)</tt>. If <b>list</b> is a JavaScript object, <b>iterator</b>'s
-        arguments will be <tt>(value, key, list)</tt>. Delegates to the native
-        <b>forEach</b> function if it exists.
-      </p>
-      <pre>
-_.each([1, 2, 3], function(num){ alert(num); });
-=&gt; alerts each number in turn...
-_.each({one : 1, two : 2, three : 3}, function(num, key){ alert(num); });
-=&gt; alerts each number in turn...</pre>
-
-      <p id="map">
-        <b class="header">map</b><code>_.map(list, iterator, [context])</code>
-        <span class="alias">Alias: <b>collect</b></span>
-        <br />
-        Produces a new array of values by mapping each value in <b>list</b>
-        through a transformation function (<b>iterator</b>). If the native <b>map</b> method
-        exists, it will be used instead. If <b>list</b> is a JavaScript object,
-        <b>iterator</b>'s arguments will be <tt>(value, key, list)</tt>.
-      </p>
-      <pre>
-_.map([1, 2, 3], function(num){ return num * 3; });
-=&gt; [3, 6, 9]
-_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
-=&gt; [3, 6, 9]</pre>
-
-      <p id="reduce">
-        <b class="header">reduce</b><code>_.reduce(list, iterator, memo, [context])</code>
-        <span class="alias">Aliases: <b>inject, foldl</b></span>
-        <br />
-        Also known as <b>inject</b> and <b>foldl</b>, <b>reduce</b> boils down a
-        <b>list</b> of values into a single value. <b>Memo</b> is the initial state
-        of the reduction, and each successive step of it should be returned by
-        <b>iterator</b>.
-      </p>
-      <pre>
-var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
-=&gt; 6
-</pre>
-
-      <p id="reduceRight">
-        <b class="header">reduceRight</b><code>_.reduceRight(list, iterator, memo, [context])</code>
-        <span class="alias">Alias: <b>foldr</b></span>
-        <br />
-        The right-associative version of <b>reduce</b>. Delegates to the
-        JavaScript 1.8 version of <b>reduceRight</b>, if it exists. <b>Foldr</b>
-        is not as useful in JavaScript as it would be in a language with lazy
-        evaluation.
-      </p>
-      <pre>
-var list = [[0, 1], [2, 3], [4, 5]];
-var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
-=&gt; [4, 5, 2, 3, 0, 1]
-</pre>
-
-      <p id="find">
-        <b class="header">find</b><code>_.find(list, iterator, [context])</code>
-        <span class="alias">Alias: <b>detect</b></span>
-        <br />
-        Looks through each value in the <b>list</b>, returning the first one that
-        passes a truth test (<b>iterator</b>). The function returns as
-        soon as it finds an acceptable element, and doesn't traverse the
-        entire list.
-      </p>
-      <pre>
-var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=&gt; 2
-</pre>
-
-      <p id="filter">
-        <b class="header">filter</b><code>_.filter(list, iterator, [context])</code>
-        <span class="alias">Alias: <b>select</b></span>
-        <br />
-        Looks through each value in the <b>list</b>, returning an array of all
-        the values that pass a truth test (<b>iterator</b>). Delegates to the
-        native <b>filter</b> method, if it exists.
-      </p>
-      <pre>
-var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=&gt; [2, 4, 6]
-</pre>
-
-      <p id="reject">
-        <b class="header">reject</b><code>_.reject(list, iterator, [context])</code>
-        <br />
-        Returns the values in <b>list</b> without the elements that the truth
-        test (<b>iterator</b>) passes. The opposite of <b>filter</b>.
-      </p>
-      <pre>
-var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=&gt; [1, 3, 5]
-</pre>
-
-      <p id="all">
-        <b class="header">all</b><code>_.all(list, iterator, [context])</code>
-        <span class="alias">Alias: <b>every</b></span>
-        <br />
-        Returns <i>true</i> if all of the values in the <b>list</b> pass the <b>iterator</b>
-        truth test. Delegates to the native method <b>every</b>, if present.
-      </p>
-      <pre>
-_.all([true, 1, null, 'yes'], _.identity);
-=&gt; false
-</pre>
-
-      <p id="any">
-        <b class="header">any</b><code>_.any(list, [iterator], [context])</code>
-        <span class="alias">Alias: <b>some</b></span>
-        <br />
-        Returns <i>true</i> if any of the values in the <b>list</b> pass the
-        <b>iterator</b> truth test. Short-circuits and stops traversing the list
-        if a true element is found. Delegates to the native method <b>some</b>,
-        if present.
-      </p>
-      <pre>
-_.any([null, 0, 'yes', false]);
-=&gt; true
-</pre>
-
-      <p id="include">
-        <b class="header">include</b><code>_.include(list, value)</code>
-        <span class="alias">Alias: <b>contains</b></span>
-        <br />
-        Returns <i>true</i> if the <b>value</b> is present in the <b>list</b>, using
-        <i>===</i> to test equality. Uses <b>indexOf</b> internally, if <b>list</b>
-        is an Array.
-      </p>
-      <pre>
-_.include([1, 2, 3], 3);
-=&gt; true
-</pre>
-
-      <p id="invoke">
-        <b class="header">invoke</b><code>_.invoke(list, methodName, [*arguments])</code>
-        <br />
-        Calls the method named by <b>methodName</b> on each value in the <b>list</b>.
-        Any extra arguments passed to <b>invoke</b> will be forwarded on to the
-        method invocation.
-      </p>
-      <pre>
-_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
-=&gt; [[1, 5, 7], [1, 2, 3]]
-</pre>
-
-      <p id="pluck">
-        <b class="header">pluck</b><code>_.pluck(list, propertyName)</code>
-        <br />
-        A convenient version of what is perhaps the most common use-case for
-        <b>map</b>: extracting a list of property values.
-      </p>
-      <pre>
-var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
-_.pluck(stooges, 'name');
-=&gt; ["moe", "larry", "curly"]
-</pre>
-
-      <p id="max">
-        <b class="header">max</b><code>_.max(list, [iterator], [context])</code>
-        <br />
-        Returns the maximum value in <b>list</b>. If <b>iterator</b> is passed,
-        it will be used on each value to generate the criterion by which the
-        value is ranked.
-      </p>
-      <pre>
-var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
-_.max(stooges, function(stooge){ return stooge.age; });
-=&gt; {name : 'curly', age : 60};
-</pre>
-
-      <p id="min">
-        <b class="header">min</b><code>_.min(list, [iterator], [context])</code>
-        <br />
-        Returns the minimum value in <b>list</b>. If <b>iterator</b> is passed,
-        it will be used on each value to generate the criterion by which the
-        value is ranked.
-      </p>
-      <pre>
-var numbers = [10, 5, 100, 2, 1000];
-_.min(numbers);
-=&gt; 2
-</pre>
-
-      <p id="sortBy">
-        <b class="header">sortBy</b><code>_.sortBy(list, iterator, [context])</code>
-        <br />
-        Returns a sorted copy of <b>list</b>, ranked in ascending order by the
-        results of running each value through <b>iterator</b>. Iterator may
-        also be the string name of the property to sort by (eg. <tt>length</tt>).
-      </p>
-      <pre>
-_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
-=&gt; [5, 4, 6, 3, 1, 2]
-</pre>
-
-      <p id="groupBy">
-        <b class="header">groupBy</b><code>_.groupBy(list, iterator)</code>
-        <br />
-        Splits a collection into sets, grouped by the result of running each
-        value through <b>iterator</b>. If <b>iterator</b> is a string instead of
-        a function, groups by the property named by <b>iterator</b> on each of
-        the values.
-      </p>
-      <pre>
-_.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
-=&gt; {1: [1.3], 2: [2.1, 2.4]}
-
-_.groupBy(['one', 'two', 'three'], 'length');
-=&gt; {3: ["one", "two"], 5: ["three"]}
-</pre>
-
-      <p id="sortedIndex">
-        <b class="header">sortedIndex</b><code>_.sortedIndex(list, value, [iterator])</code>
-        <br />
-        Uses a binary search to determine the index at which the <b>value</b>
-        <i>should</i> be inserted into the <b>list</b> in order to maintain the <b>list</b>'s
-        sorted order. If an <b>iterator</b> is passed, it will be used to compute
-        the sort ranking of each value.
-      </p>
-      <pre>
-_.sortedIndex([10, 20, 30, 40, 50], 35);
-=&gt; 3
-</pre>
-
-      <p id="shuffle">
-        <b class="header">shuffle</b><code>_.shuffle(list)</code>
-        <br />
-        Returns a shuffled copy of the <b>list</b>, using a version of the
-        <a href="http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle</a>.
-      </p>
-      <pre>
-_.shuffle([1, 2, 3, 4, 5, 6]);
-=&gt; [4, 1, 6, 3, 5, 2]
-</pre>
-
-      <p id="toArray">
-        <b class="header">toArray</b><code>_.toArray(list)</code>
-        <br />
-        Converts the <b>list</b> (anything that can be iterated over), into a
-        real Array. Useful for transmuting the <b>arguments</b> object.
-      </p>
-      <pre>
-(function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
-=&gt; [2, 3, 4]
-</pre>
-
-      <p id="size">
-        <b class="header">size</b><code>_.size(list)</code>
-        <br />
-        Return the number of values in the <b>list</b>.
-      </p>
-      <pre>
-_.size({one : 1, two : 2, three : 3});
-=&gt; 3
-</pre>
-
-      <h2 id="arrays">Array Functions</h2>
-
-      <p>
-        <i>Note: All array functions will also work on the <b>arguments</b> object.</i>
-      </p>
-
-      <p id="first">
-        <b class="header">first</b><code>_.first(array, [n])</code>
-        <span class="alias">Alias: <b>head</b></span>
-        <br />
-        Returns the first element of an <b>array</b>. Passing <b>n</b> will
-        return the first <b>n</b> elements of the array.
-      </p>
-      <pre>
-_.first([5, 4, 3, 2, 1]);
-=&gt; 5
-</pre>
-
-      <p id="initial">
-        <b class="header">initial</b><code>_.initial(array, [n])</code>
-        <br />
-        Returns everything but the last entry of the array. Especially useful on
-        the arguments object. Pass <b>n</b> to exclude the last <b>n</b> elements
-        from the result.
-      </p>
-      <pre>
-_.initial([5, 4, 3, 2, 1]);
-=&gt; [5, 4, 3, 2]
-</pre>
-
-      <p id="last">
-        <b class="header">last</b><code>_.last(array, [n])</code>
-        <br />
-        Returns the last element of an <b>array</b>. Passing <b>n</b> will return
-        the last <b>n</b> elements of the array.
-      </p>
-      <pre>
-_.last([5, 4, 3, 2, 1]);
-=&gt; 1
-</pre>
-
-      <p id="rest">
-        <b class="header">rest</b><code>_.rest(array, [index])</code>
-        <span class="alias">Alias: <b>tail</b></span>
-        <br />
-        Returns the <b>rest</b> of the elements in an array. Pass an <b>index</b>
-        to return the values of the array from that index onward.
-      </p>
-      <pre>
-_.rest([5, 4, 3, 2, 1]);
-=&gt; [4, 3, 2, 1]
-</pre>
-
-      <p id="compact">
-        <b class="header">compact</b><code>_.compact(array)</code>
-        <br />
-        Returns a copy of the <b>array</b> with all falsy values removed.
-        In JavaScript, <i>false</i>, <i>null</i>, <i>0</i>, <i>""</i>,
-        <i>undefined</i> and <i>NaN</i> are all falsy.
-      </p>
-      <pre>
-_.compact([0, 1, false, 2, '', 3]);
-=&gt; [1, 2, 3]
-</pre>
-
-      <p id="flatten">
-        <b class="header">flatten</b><code>_.flatten(array, [shallow])</code>
-        <br />
-        Flattens a nested <b>array</b> (the nesting can be to any depth). If you
-        pass <b>shallow</b>, the array will only be flattened a single level.
-      </p>
-      <pre>
-_.flatten([1, [2], [3, [[4]]]]);
-=&gt; [1, 2, 3, 4];
-
-_.flatten([1, [2], [3, [[4]]]], true);
-=&gt; [1, 2, 3, [[4]]];
-</pre>
-
-      <p id="without">
-        <b class="header">without</b><code>_.without(array, [*values])</code>
-        <br />
-        Returns a copy of the <b>array</b> with all instances of the <b>values</b>
-        removed. <i>===</i> is used for the equality test.
-      </p>
-      <pre>
-_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
-=&gt; [2, 3, 4]
-</pre>
-
-      <p id="union">
-        <b class="header">union</b><code>_.union(*arrays)</code>
-        <br />
-        Computes the union of the passed-in <b>arrays</b>: the list of unique items,
-        in order, that are present in one or more of the <b>arrays</b>.
-      </p>
-      <pre>
-_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
-=&gt; [1, 2, 3, 101, 10]
-</pre>
-
-      <p id="intersection">
-        <b class="header">intersection</b><code>_.intersection(*arrays)</code>
-        <br />
-        Computes the list of values that are the intersection of all the <b>arrays</b>.
-        Each value in the result is present in each of the <b>arrays</b>.
-      </p>
-      <pre>
-_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
-=&gt; [1, 2]
-</pre>
-
-      <p id="difference">
-        <b class="header">difference</b><code>_.difference(array, *others)</code>
-        <br />
-        Similar to <b>without</b>, but returns the values from <b>array</b> that
-        are not present in the <b>other</b> arrays.
-      </p>
-      <pre>
-_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
-=&gt; [1, 3, 4]
-</pre>
-
-      <p id="uniq">
-        <b class="header">uniq</b><code>_.uniq(array, [isSorted], [iterator])</code>
-        <span class="alias">Alias: <b>unique</b></span>
-        <br />
-        Produces a duplicate-free version of the <b>array</b>, using <i>===</i> to test
-        object equality. If you know in advance that the <b>array</b> is sorted,
-        passing <i>true</i> for <b>isSorted</b> will run a much faster algorithm.
-        If you want to compute unique items based on a transformation, pass an
-        <b>iterator</b> function.
-      </p>
-      <pre>
-_.uniq([1, 2, 1, 3, 1, 4]);
-=&gt; [1, 2, 3, 4]
-</pre>
-
-      <p id="zip">
-        <b class="header">zip</b><code>_.zip(*arrays)</code>
-        <br />
-        Merges together the values of each of the <b>arrays</b> with the
-        values at the corresponding position. Useful when you have separate
-        data sources that are coordinated through matching array indexes.
-        If you're working with a matrix of nested arrays, <b>zip.apply</b>
-        can transpose the matrix in a similar fashion.
-      </p>
-      <pre>
-_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
-=&gt; [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
-</pre>
-
-      <p id="indexOf">
-        <b class="header">indexOf</b><code>_.indexOf(array, value, [isSorted])</code>
-        <br />
-        Returns the index at which <b>value</b> can be found in the <b>array</b>,
-        or <i>-1</i> if value is not present in the <b>array</b>. Uses the native
-        <b>indexOf</b> function unless it's missing. If you're working with a
-        large array, and you know that the array is already sorted, pass <tt>true</tt>
-        for <b>isSorted</b> to use a faster binary search.
-      </p>
-      <pre>
-_.indexOf([1, 2, 3], 2);
-=&gt; 1
-</pre>
-
-      <p id="lastIndexOf">
-        <b class="header">lastIndexOf</b><code>_.lastIndexOf(array, value)</code>
-        <br />
-        Returns the index of the last occurrence of <b>value</b> in the <b>array</b>,
-        or <i>-1</i> if value is not present. Uses the native <b>lastIndexOf</b>
-        function if possible.
-      </p>
-      <pre>
-_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
-=&gt; 4
-</pre>
-
-      <p id="range">
-        <b class="header">range</b><code>_.range([start], stop, [step])</code>
-        <br />
-        A function to create flexibly-numbered lists of integers, handy for
-        <tt>each</tt> and <tt>map</tt> loops. <b>start</b>, if omitted, defaults
-        to <i>0</i>; <b>step</b> defaults to <i>1</i>. Returns a list of integers
-        from <b>start</b> to <b>stop</b>, incremented (or decremented) by <b>step</b>,
-        exclusive.
-      </p>
-      <pre>
-_.range(10);
-=&gt; [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
-_.range(1, 11);
-=&gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-_.range(0, 30, 5);
-=&gt; [0, 5, 10, 15, 20, 25]
-_.range(0, -10, -1);
-=&gt; [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
-_.range(0);
-=&gt; []
-</pre>
-
-      <h2 id="functions">Function (uh, ahem) Functions</h2>
-
-      <p id="bind">
-        <b class="header">bind</b><code>_.bind(function, object, [*arguments])</code>
-        <br />
-        Bind a <b>function</b> to an <b>object</b>, meaning that whenever
-        the function is called, the value of <i>this</i> will be the <b>object</b>.
-        Optionally, bind <b>arguments</b> to the <b>function</b> to pre-fill them,
-        also known as <b>partial application</b>.
-      </p>
-      <pre>
-var func = function(greeting){ return greeting + ': ' + this.name };
-func = _.bind(func, {name : 'moe'}, 'hi');
-func();
-=&gt; 'hi: moe'
-</pre>
-
-      <p id="bindAll">
-        <b class="header">bindAll</b><code>_.bindAll(object, [*methodNames])</code>
-        <br />
-        Binds a number of methods on the <b>object</b>, specified by
-        <b>methodNames</b>, to be run in the context of that object whenever they
-        are invoked. Very handy for binding functions that are going to be used
-        as event handlers, which would otherwise be invoked with a fairly useless
-        <i>this</i>. If no <b>methodNames</b> are provided, all of the object's
-        function properties will be bound to it.
-      </p>
-      <pre>
-var buttonView = {
-  label   : 'underscore',
-  onClick : function(){ alert('clicked: ' + this.label); },
-  onHover : function(){ console.log('hovering: ' + this.label); }
-};
-_.bindAll(buttonView);
-jQuery('#underscore_button').bind('click', buttonView.onClick);
-=&gt; When the button is clicked, this.label will have the correct value...
-</pre>
-
-      <p id="memoize">
-        <b class="header">memoize</b><code>_.memoize(function, [hashFunction])</code>
-        <br />
-        Memoizes a given <b>function</b> by caching the computed result. Useful
-        for speeding up slow-running computations. If passed an optional
-        <b>hashFunction</b>, it will be used to compute the hash key for storing
-        the result, based on the arguments to the original function. The default
-        <b>hashFunction</b> just uses the first argument to the memoized function
-        as the key.
-      </p>
-      <pre>
-var fibonacci = _.memoize(function(n) {
-  return n &lt; 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
-});
-</pre>
-
-      <p id="delay">
-        <b class="header">delay</b><code>_.delay(function, wait, [*arguments])</code>
-        <br />
-        Much like <b>setTimeout</b>, invokes <b>function</b> after <b>wait</b>
-        milliseconds. If you pass the optional <b>arguments</b>, they will be
-        forwarded on to the <b>function</b> when it is invoked.
-      </p>
-      <pre>
-var log = _.bind(console.log, console);
-_.delay(log, 1000, 'logged later');
-=&gt; 'logged later' // Appears after one second.
-</pre>
-
-      <p id="defer">
-        <b class="header">defer</b><code>_.defer(function)</code>
-        <br />
-        Defers invoking the <b>function</b> until the current call stack has cleared,
-        similar to using <b>setTimeout</b> with a delay of 0. Useful for performing
-        expensive computations or HTML rendering in chunks without blocking the UI thread
-        from updating.
-      </p>
-      <pre>
-_.defer(function(){ alert('deferred'); });
-// Returns from the function before the alert runs.
-</pre>
-
-      <p id="throttle">
-        <b class="header">throttle</b><code>_.throttle(function, wait)</code>
-        <br />
-        Creates and returns a new, throttled version of the passed function,
-        that, when invoked repeatedly, will only actually call the original function
-        at most once per every <b>wait</b>
-        milliseconds. Useful for rate-limiting events that occur faster than you
-        can keep up with.
-      </p>
-      <pre>
-var throttled = _.throttle(updatePosition, 100);
-$(window).scroll(throttled);
-</pre>
-
-      <p id="debounce">
-        <b class="header">debounce</b><code>_.debounce(function, wait, [immediate])</code>
-        <br />
-        Creates and returns a new debounced version of the passed function that
-        will postpone its execution until after
-        <b>wait</b> milliseconds have elapsed since the last time it
-        was invoked. Useful for implementing behavior that should only happen
-        <i>after</i> the input has stopped arriving. For example: rendering a
-        preview of a Markdown comment, recalculating a layout after the window
-        has stopped being resized, and so on.
-      </p>
-      
-      <p>
-        Pass <tt>true</tt> for the <b>immediate</b> parameter to cause 
-        <b>debounce</b> to trigger the function on the leading intead of the 
-        trailing edge of the <b>wait</b> interval. Useful in circumstances like 
-        preventing accidental double-clicks on a "submit" button from firing a 
-        second time.
-      </p>
-      
-      <pre>
-var lazyLayout = _.debounce(calculateLayout, 300);
-$(window).resize(lazyLayout);
-</pre>
-
-      <p id="once">
-        <b class="header">once</b><code>_.once(function)</code>
-        <br />
-        Creates a version of the function that can only be called one time.
-        Repeated calls to the modified function will have no effect, returning
-        the value from the original call. Useful for initialization functions,
-        instead of having to set a boolean flag and then check it later.
-      </p>
-      <pre>
-var initialize = _.once(createApplication);
-initialize();
-initialize();
-// Application is only created once.
-</pre>
-
-      <p id="after">
-        <b class="header">after</b><code>_.after(count, function)</code>
-        <br />
-        Creates a version of the function that will only be run after first
-        being called <b>count</b> times. Useful for grouping asynchronous responses,
-        where you want to be sure that all the async calls have finished, before
-        proceeding.
-      </p>
-      <pre>
-var renderNotes = _.after(notes.length, render);
-_.each(notes, function(note) {
-  note.asyncSave({success: renderNotes});
-});
-// renderNotes is run once, after all notes have saved.
-</pre>
-
-      <p id="wrap">
-        <b class="header">wrap</b><code>_.wrap(function, wrapper)</code>
-        <br />
-        Wraps the first <b>function</b> inside of the <b>wrapper</b> function,
-        passing it as the first argument. This allows the <b>wrapper</b> to
-        execute code before and after the <b>function</b> runs, adjust the arguments,
-        and execute it conditionally.
-      </p>
-      <pre>
-var hello = function(name) { return "hello: " + name; };
-hello = _.wrap(hello, function(func) {
-  return "before, " + func("moe") + ", after";
-});
-hello();
-=&gt; 'before, hello: moe, after'
-</pre>
-
-      <p id="compose">
-        <b class="header">compose</b><code>_.compose(*functions)</code>
-        <br />
-        Returns the composition of a list of <b>functions</b>, where each function
-        consumes the return value of the function that follows. In math terms,
-        composing the functions <i>f()</i>, <i>g()</i>, and <i>h()</i> produces
-        <i>f(g(h()))</i>.
-      </p>
-      <pre>
-var greet    = function(name){ return "hi: " + name; };
-var exclaim  = function(statement){ return statement + "!"; };
-var welcome = _.compose(exclaim, greet);
-welcome('moe');
-=&gt; 'hi: moe!'
-</pre>
-
-      <h2 id="objects">Object Functions</h2>
-
-      <p id="keys">
-        <b class="header">keys</b><code>_.keys(object)</code>
-        <br />
-        Retrieve all the names of the <b>object</b>'s properties.
-      </p>
-      <pre>
-_.keys({one : 1, two : 2, three : 3});
-=&gt; ["one", "two", "three"]
-</pre>
-
-      <p id="values">
-        <b class="header">values</b><code>_.values(object)</code>
-        <br />
-        Return all of the values of the <b>object</b>'s properties.
-      </p>
-      <pre>
-_.values({one : 1, two : 2, three : 3});
-=&gt; [1, 2, 3]
-</pre>
-
-      <p id="object-functions">
-        <b class="header">functions</b><code>_.functions(object)</code>
-        <span class="alias">Alias: <b>methods</b></span>
-        <br />
-        Returns a sorted list of the names of every method in an object &mdash;
-        that is to say, the name of every function property of the object.
-      </p>
-      <pre>
-_.functions(_);
-=&gt; ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
-</pre>
-
-      <p id="extend">
-        <b class="header">extend</b><code>_.extend(destination, *sources)</code>
-        <br />
-        Copy all of the properties in the <b>source</b> objects over to the
-        <b>destination</b> object, and return the <b>destination</b> object.
-        It's in-order, so the last source will override properties of the same
-        name in previous arguments.
-      </p>
-      <pre>
-_.extend({name : 'moe'}, {age : 50});
-=&gt; {name : 'moe', age : 50}
-</pre>
-
-      <p id="pick">
-        <b class="header">pick</b><code>_.pick(object, *keys)</code>
-        <br />
-        Return a copy of the <b>object</b>, filtered to only have values for
-        the whitelisted <b>keys</b> (or array of valid keys).
-      </p>
-      <pre>
-_.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
-=&gt; {name : 'moe', age : 50}
-</pre>
-
-      <p id="defaults">
-        <b class="header">defaults</b><code>_.defaults(object, *defaults)</code>
-        <br />
-        Fill in missing properties in <b>object</b> with default values from the
-        <b>defaults</b> objects, and return the <b>object</b>. As soon as the
-        property is filled, further defaults will have no effect.
-      </p>
-      <pre>
-var iceCream = {flavor : "chocolate"};
-_.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
-=&gt; {flavor : "chocolate", sprinkles : "lots"}
-</pre>
-
-      <p id="clone">
-        <b class="header">clone</b><code>_.clone(object)</code>
-        <br />
-        Create a shallow-copied clone of the <b>object</b>. Any nested objects
-        or arrays will be copied by reference, not duplicated.
-      </p>
-      <pre>
-_.clone({name : 'moe'});
-=&gt; {name : 'moe'};
-</pre>
-
-      <p id="tap">
-        <b class="header">tap</b><code>_.tap(object, interceptor)</code>
-        <br />
-        Invokes <b>interceptor</b> with the <b>object</b>, and then returns <b>object</b>.
-        The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
-      </p>
-      <pre>
-_.chain([1,2,3,200])
-  .filter(function(num) { return num % 2 == 0; })
-  .tap(alert)
-  .map(function(num) { return num * num })
-  .value();
-=&gt; // [2, 200] (alerted)
-=&gt; [4, 40000]
-</pre>
-
-      <p id="has">
-        <b class="header">has</b><code>_.has(object, key)</code>
-        <br />
-        Does the object contain the given key? Identical to
-        <tt>object.hasOwnProperty(key)</tt>, but uses a safe reference to the
-        <tt>hasOwnProperty</tt> function, in case it's been
-        <a href="http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/">overridden accidentally</a>.
-      </p>
-      <pre>
-_.has({a: 1, b: 2, c: 3}, "b");
-=&gt; true
-</pre>
-
-      <p id="isEqual">
-        <b class="header">isEqual</b><code>_.isEqual(object, other)</code>
-        <br />
-        Performs an optimized deep comparison between the two objects, to determine
-        if they should be considered equal.
-      </p>
-      <pre>
-var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
-var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
-moe == clone;
-=&gt; false
-_.isEqual(moe, clone);
-=&gt; true
-</pre>
-
-      <p id="isEmpty">
-        <b class="header">isEmpty</b><code>_.isEmpty(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> contains no values.
-      </p>
-      <pre>
-_.isEmpty([1, 2, 3]);
-=&gt; false
-_.isEmpty({});
-=&gt; true
-</pre>
-
-      <p id="isElement">
-        <b class="header">isElement</b><code>_.isElement(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a DOM element.
-      </p>
-      <pre>
-_.isElement(jQuery('body')[0]);
-=&gt; true
-</pre>
-
-      <p id="isArray">
-        <b class="header">isArray</b><code>_.isArray(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is an Array.
-      </p>
-      <pre>
-(function(){ return _.isArray(arguments); })();
-=&gt; false
-_.isArray([1,2,3]);
-=&gt; true
-</pre>
-
-      <p id="isObject">
-        <b class="header">isObject</b><code>_.isObject(value)</code>
-        <br />
-        Returns <i>true</i> if <b>value</b> is an Object.
-      </p>
-      <pre>
-_.isObject({});
-=&gt; true
-_.isObject(1);
-=&gt; false
-</pre>
-
-      <p id="isArguments">
-        <b class="header">isArguments</b><code>_.isArguments(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is an Arguments object.
-      </p>
-      <pre>
-(function(){ return _.isArguments(arguments); })(1, 2, 3);
-=&gt; true
-_.isArguments([1,2,3]);
-=&gt; false
-</pre>
-
-      <p id="isFunction">
-        <b class="header">isFunction</b><code>_.isFunction(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a Function.
-      </p>
-      <pre>
-_.isFunction(alert);
-=&gt; true
-</pre>
-
-      <p id="isString">
-        <b class="header">isString</b><code>_.isString(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a String.
-      </p>
-      <pre>
-_.isString("moe");
-=&gt; true
-</pre>
-
-      <p id="isNumber">
-        <b class="header">isNumber</b><code>_.isNumber(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a Number (including <tt>NaN</tt>).
-      </p>
-      <pre>
-_.isNumber(8.4 * 5);
-=&gt; true
-</pre>
-
-      <p id="isFinite">
-        <b class="header">isFinite</b><code>_.isFinite(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a finite Number.
-      </p>
-      <pre>
-_.isFinite(-101);
-=&gt; true
-
-_.isFinite(-Infinity);
-=&gt; false
-</pre>
-
-      <p id="isBoolean">
-        <b class="header">isBoolean</b><code>_.isBoolean(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is either <i>true</i> or <i>false</i>.
-      </p>
-      <pre>
-_.isBoolean(null);
-=&gt; false
-</pre>
-
-      <p id="isDate">
-        <b class="header">isDate</b><code>_.isDate(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a Date.
-      </p>
-      <pre>
-_.isDate(new Date());
-=&gt; true
-</pre>
-
-      <p id="isRegExp">
-        <b class="header">isRegExp</b><code>_.isRegExp(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is a RegExp.
-      </p>
-      <pre>
-_.isRegExp(/moe/);
-=&gt; true
-</pre>
-
-      <p id="isNaN">
-        <b class="header">isNaN</b><code>_.isNaN(object)</code>
-        <br />
-        Returns <i>true</i> if <b>object</b> is <i>NaN</i>.<br /> Note: this is not
-        the same as the native <b>isNaN</b> function, which will also return
-        true if the variable is <i>undefined</i>.
-      </p>
-      <pre>
-_.isNaN(NaN);
-=&gt; true
-isNaN(undefined);
-=&gt; true
-_.isNaN(undefined);
-=&gt; false
-</pre>
-
-      <p id="isNull">
-        <b class="header">isNull</b><code>_.isNull(object)</code>
-        <br />
-        Returns <i>true</i> if the value of <b>object</b> is <i>null</i>.
-      </p>
-      <pre>
-_.isNull(null);
-=&gt; true
-_.isNull(undefined);
-=&gt; false
-</pre>
-
-      <p id="isUndefined">
-        <b class="header">isUndefined</b><code>_.isUndefined(variable)</code>
-        <br />
-        Returns <i>true</i> if <b>variable</b> is <i>undefined</i>.
-      </p>
-      <pre>
-_.isUndefined(window.missingVariable);
-=&gt; true
-</pre>
-
-      <h2 id="utility">Utility Functions</h2>
-
-      <p id="noConflict">
-        <b class="header">noConflict</b><code>_.noConflict()</code>
-        <br />
-        Give control of the "_" variable back to its previous owner. Returns
-        a reference to the <b>Underscore</b> object.
-      </p>
-      <pre>
-var underscore = _.noConflict();</pre>
-
-      <p id="identity">
-        <b class="header">identity</b><code>_.identity(value)</code>
-        <br />
-        Returns the same value that is used as the argument. In math:
-        <tt>f(x) = x</tt><br />
-        This function looks useless, but is used throughout Underscore as
-        a default iterator.
-      </p>
-      <pre>
-var moe = {name : 'moe'};
-moe === _.identity(moe);
-=&gt; true</pre>
-
-      <p id="times">
-        <b class="header">times</b><code>_.times(n, iterator)</code>
-        <br />
-        Invokes the given iterator function <b>n</b> times.
-      </p>
-      <pre>
-_(3).times(function(){ genie.grantWish(); });</pre>
-
-      <p id="mixin">
-        <b class="header">mixin</b><code>_.mixin(object)</code>
-        <br />
-        Allows you to extend Underscore with your own utility functions. Pass
-        a hash of <tt>{name: function}</tt> definitions to have your functions
-        added to the Underscore object, as well as the OOP wrapper.
-      </p>
-      <pre>
-_.mixin({
-  capitalize : function(string) {
-    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
-  }
-});
-_("fabio").capitalize();
-=&gt; "Fabio"
-</pre>
-
-      <p id="uniqueId">
-        <b class="header">uniqueId</b><code>_.uniqueId([prefix])</code>
-        <br />
-        Generate a globally-unique id for client-side models or DOM elements
-        that need one. If <b>prefix</b> is passed, the id will be appended to it.
-        Without <b>prefix</b>, returns an integer.
-      </p>
-      <pre>
-_.uniqueId('contact_');
-=&gt; 'contact_104'</pre>
-
-      <p id="escape">
-        <b class="header">escape</b><code>_.escape(string)</code>
-        <br />
-        Escapes a string for insertion into HTML, replacing
-        <tt>&amp;</tt>, <tt>&lt;</tt>, <tt>&gt;</tt>, <tt>&quot;</tt>, <tt>&#x27;</tt>, and <tt>&#x2F;</tt> characters.
-      </p>
-      <pre>
-_.escape('Curly, Larry &amp; Moe');
-=&gt; "Curly, Larry &amp;amp; Moe"</pre>
-
-      <p id="result">
-        <b class="header">result</b><code>_.result(object, property)</code>
-        <br />
-        If the value of the named property is a function then invoke it; otherwise, return it.
-      </p>
-      <pre>
-var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
-_.result(object, 'cheese');
-=&gt; "crumpets"
-_.result(object, 'stuff');
-=&gt; "nonsense"</pre>
-
-      <p id="template">
-        <b class="header">template</b><code>_.template(templateString, [data], [settings])</code>
-        <br />
-        Compiles JavaScript templates into functions that can be evaluated
-        for rendering. Useful for rendering complicated bits of HTML from JSON
-        data sources. Template functions can both interpolate variables, using
-        <tt>&lt;%= &hellip; %&gt;</tt>, as well as execute arbitrary JavaScript code, with
-        <tt>&lt;% &hellip; %&gt;</tt>. If you wish to interpolate a value, and have
-        it be HTML-escaped, use <tt>&lt;%- &hellip; %&gt;</tt> When you evaluate a template function, pass in a
-        <b>data</b> object that has properties corresponding to the template's free
-        variables. If you're writing a one-off, you can pass the <b>data</b>
-        object as the second parameter to <b>template</b> in order to render
-        immediately instead of returning a template function.  The <b>settings</b> argument
-        should be a hash containing any <tt>_.templateSettings</tt> that should be overriden.
-      </p>
-
-      <pre>
-var compiled = _.template("hello: &lt;%= name %&gt;");
-compiled({name : 'moe'});
-=&gt; "hello: moe"
-
-var list = "&lt;% _.each(people, function(name) { %&gt; &lt;li&gt;&lt;%= name %&gt;&lt;/li&gt; &lt;% }); %&gt;";
-_.template(list, {people : ['moe', 'curly', 'larry']});
-=&gt; "&lt;li&gt;moe&lt;/li&gt;&lt;li&gt;curly&lt;/li&gt;&lt;li&gt;larry&lt;/li&gt;"
-
-var template = _.template("&lt;b&gt;&lt;%- value %&gt;&lt;/b&gt;");
-template({value : '&lt;script&gt;'});
-=&gt; "&lt;b&gt;&amp;lt;script&amp;gt;&lt;/b&gt;"</pre>
-
-      <p>
-        You can also use <tt>print</tt> from within JavaScript code.  This is
-        sometimes more convenient than using <tt>&lt;%= ... %&gt;</tt>.
-      </p>
-
-      <pre>
-var compiled = _.template("&lt;% print('Hello ' + epithet); %&gt;");
-compiled({epithet: "stooge"});
-=&gt; "Hello stooge."</pre>
-
-      <p>
-        If ERB-style delimiters aren't your cup of tea, you can change Underscore's
-        template settings to use different symbols to set off interpolated code.
-        Define an <b>interpolate</b> regex to match expressions that should be
-        interpolated verbatim, an <b>escape</b> regex to match expressions that should
-        be inserted after being HTML escaped, and an <b>evaluate</b> regex to match
-        expressions that should be evaluated without insertion into the resulting
-        string. You may define or omit any combination of the three.
-        For example, to perform
-        <a href="http://github.com/janl/mustache.js#readme">Mustache.js</a>
-        style templating:
-      </p>
-
-      <pre>
-_.templateSettings = {
-  interpolate : /\{\{(.+?)\}\}/g
-};
-
-var template = _.template("Hello {{ name }}!");
-template({name : "Mustache"});
-=&gt; "Hello Mustache!"</pre>
-
-      <p>
-        By default, <b>template</b> places the values from your data in the local scope
-        via the <tt>with</tt> statement.  However, you can specify a single variable name
-        with the <b>variable</b> setting. This can significantly improve the speed
-        at which a template is able to render.
-      </p>
-
-      <pre>
-_.template("<%= data.hasWith %>", {hasWith: 'no'}, {variable: 'data'});
-=&gt; "no"</pre>
-
-      <p>
-        Precompiling your templates can be a big help when debugging errors you can't
-        reproduce.  This is because precompiled templates can provide line numbers and
-        a stack trace, something that is not possible when compiling templates on the client.
-        The <b>source</b> property is available on the compiled template
-        function for easy precompilation.
-      </p>
-
-      <pre>&lt;script&gt;
-  JST.project = <%= _.template(jstText).source %>;
-&lt;/script&gt;</pre>
-
-
-      <h2 id="chaining">Chaining</h2>
-
-      <p>
-        You can use Underscore in either an object-oriented or a functional style,
-        depending on your preference. The following two lines of code are
-        identical ways to double a list of numbers.
-      </p>
-
-    <pre>
-_.map([1, 2, 3], function(n){ return n * 2; });
-_([1, 2, 3]).map(function(n){ return n * 2; });</pre>
-
-      <p>
-        Calling <tt>chain</tt> on a wrapped object will cause all future method calls to
-        return wrapped objects as well. When you've finished the computation,
-        use <tt>value</tt> to retrieve the final value. Here's an example of chaining
-        together a <b>map/flatten/reduce</b>, in order to get the word count of
-        every word in a song.
-      </p>
-
-<pre>
-var lyrics = [
-  {line : 1, words : "I'm a lumberjack and I'm okay"},
-  {line : 2, words : "I sleep all night and I work all day"},
-  {line : 3, words : "He's a lumberjack and he's okay"},
-  {line : 4, words : "He sleeps all night and he works all day"}
-];
-
-_.chain(lyrics)
-  .map(function(line) { return line.words.split(' '); })
-  .flatten()
-  .reduce(function(counts, word) {
-    counts[word] = (counts[word] || 0) + 1;
-    return counts;
-}, {}).value();
-
-=&gt; {lumberjack : 2, all : 4, night : 2 ... }</pre>
-
-      <p>
-        In addition, the
-        <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/prototype">Array prototype's methods</a>
-        are proxied through the chained Underscore object, so you can slip a
-        <tt>reverse</tt> or a <tt>push</tt> into your chain, and continue to
-        modify the array.
-      </p>
-
-      <p id="chain">
-        <b class="header">chain</b><code>_.chain(obj)</code>
-        <br />
-        Returns a wrapped object. Calling methods on this object will continue
-        to return wrapped objects until <tt>value</tt> is used.
-      </p>
-      <pre>
-var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
-var youngest = _.chain(stooges)
-  .sortBy(function(stooge){ return stooge.age; })
-  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
-  .first()
-  .value();
-=&gt; "moe is 21"
-</pre>
-
-      <p id="value">
-        <b class="header">value</b><code>_(obj).value()</code>
-        <br />
-        Extracts the value of a wrapped object.
-      </p>
-      <pre>
-_([1, 2, 3]).value();
-=&gt; [1, 2, 3]
-</pre>
-
-      <h2 id="links">Links &amp; Suggested Reading</h2>
-
-      <p>
-        <a href="http://mirven.github.com/underscore.lua/">Underscore.lua</a>,
-        a Lua port of the functions that are applicable in both languages.
-        Includes OOP-wrapping and chaining.
-        The <a href="http://github.com/mirven/underscore.lua">source</a> is
-        available on GitHub.
-      </p>
-
-      <p>
-        <a href="http://brianhaveri.github.com/Underscore.php/">Underscore.php</a>,
-        a PHP port of the functions that are applicable in both languages.
-        Includes OOP-wrapping and chaining.
-        The <a href="http://github.com/brianhaveri/Underscore.php">source</a> is
-        available on GitHub.
-      </p>
-
-      <p>
-        <a href="http://vti.github.com/underscore-perl/">Underscore-perl</a>,
-        a Perl port of many of the Underscore.js functions,
-        aimed at on Perl hashes and arrays, also
-        <a href="https://github.com/vti/underscore-perl/">available on GitHub</a>.
-      </p>
-
-      <p>
-        <a href="https://github.com/edtsech/underscore.string">Underscore.string</a>,
-        an Underscore extension that adds functions for string-manipulation:
-        <tt>trim</tt>, <tt>startsWith</tt>, <tt>contains</tt>, <tt>capitalize</tt>,
-        <tt>reverse</tt>, <tt>sprintf</tt>, and more.
-      </p>
-
-      <p>
-        Ruby's <a href="http://ruby-doc.org/core/classes/Enumerable.html">Enumerable</a> module.
-      </p>
-
-      <p>
-        <a href="http://www.prototypejs.org/">Prototype.js</a>, which provides
-        JavaScript with collection functions in the manner closest to Ruby's Enumerable.
-      </p>
-
-      <p>
-        Oliver Steele's
-        <a href="http://osteele.com/sources/javascript/functional/">Functional JavaScript</a>,
-        which includes comprehensive higher-order function support as well as string lambdas.
-      </p>
-
-      <p>
-        Michael Aufreiter's <a href="http://substance.io/#michael/data-js">Data.js</a>,
-        a data manipulation + persistence library for JavaScript.
-      </p>
-
-      <p>
-        Python's <a href="http://docs.python.org/library/itertools.html">itertools</a>.
-      </p>
-
-      <h2 id="changelog">Change Log</h2>
-      
-      <p>
-        <b class="header">1.3.3</b> &mdash; <small><i>April 10, 2012</i></small><br />
-        <ul>
-          <li>
-            Many improvements to <tt>_.template</tt>, which now provides the 
-            <tt>source</tt> of the template function as a property, for potentially
-            even more efficient pre-compilation on the server-side. You may now
-            also set the <tt>variable</tt> option when creating a template, 
-            which will cause your passed-in data to be made available under the 
-            variable you named, instead of using a <tt>with</tt> statement &mdash;
-            significantly improving the speed of rendering the template.
-          </li>
-          <li>
-            Added the <tt>pick</tt> function, which allows you to filter an 
-            object literal with a whitelist of allowed property names.
-          </li>
-          <li>
-            Added the <tt>result</tt> function, for convenience when working
-            with APIs that allow either functions or raw properties.
-          </li>
-          <li>
-            Added the <tt>isFinite</tt> function, because sometimes knowing that
-            a value is a number just ain't quite enough.
-          </li>
-          <li>
-            The <tt>sortBy</tt> function may now also be passed the string name
-            of a property to use as the sort order on each object.
-          </li>
-          <li>
-            Fixed <tt>uniq</tt> to work with sparse arrays.
-          </li>
-          <li>
-            The <tt>difference</tt> function now performs a shallow flatten
-            instead of a deep one when computing array differences.
-          </li>
-          <li>
-            The <tt>debounce</tt> function now takes an <tt>immediate</tt>
-            parameter, which will cause the callback to fire on the leading 
-            instead of the trailing edge.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.3.1</b> &mdash; <small><i>Jan. 23, 2012</i></small><br />
-        <ul>
-          <li>
-            Added an <tt>_.has</tt> function, as a safer way to use <tt>hasOwnProperty</tt>.
-          </li>
-          <li>
-            Added <tt>_.collect</tt> as an alias for <tt>_.map</tt>. Smalltalkers, rejoice.
-          </li>
-          <li>
-            Reverted an old change so that <tt>_.extend</tt> will correctly copy
-            over keys with undefined values again.
-          </li>
-          <li>
-            Bugfix to stop escaping slashes within interpolations in <tt>_.template</tt>.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.3.0</b> &mdash; <small><i>Jan. 11, 2012</i></small><br />
-        <ul>
-          <li>
-            Removed AMD (RequireJS) support from Underscore. If you'd like to use
-            Underscore with RequireJS, you can load it as a normal script, wrap
-            or patch your copy, or download a forked version.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.2.4</b> &mdash; <small><i>Jan. 4, 2012</i></small><br />
-        <ul>
-          <li>
-            You now can (and probably should, as it's simpler) 
-            write <tt>_.chain(list)</tt> 
-            instead of <tt>_(list).chain()</tt>.
-          </li>
-          <li>
-            Fix for escaped characters in Underscore templates, and for supporting
-            customizations of <tt>_.templateSettings</tt> that only define one or
-            two of the required regexes.
-          </li>
-          <li>
-            Fix for passing an array as the first argument to an <tt>_.wrap</tt>'d function.
-          </li>
-          <li>
-            Improved compatibility with ClojureScript, which adds a <tt>call</tt>
-            function to <tt>String.prototype</tt>.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.2.3</b> &mdash; <small><i>Dec. 7, 2011</i></small><br />
-        <ul>
-          <li>
-            Dynamic scope is now preserved for compiled <tt>_.template</tt> functions,
-            so you can use the value of <tt>this</tt> if you like.
-          </li>
-          <li>
-            Sparse array support of <tt>_.indexOf</tt>, <tt>_.lastIndexOf</tt>.
-          </li>
-          <li>
-            Both <tt>_.reduce</tt> and <tt>_.reduceRight</tt> can now be passed an
-            explicitly <tt>undefined</tt> value. (There's no reason why you'd
-            want to do this.)
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.2.2</b> &mdash; <small><i>Nov. 14, 2011</i></small><br />
-        <ul>
-          <li>
-            Continued tweaks to <tt>_.isEqual</tt> semantics. Now JS primitives are
-            considered equivalent to their wrapped versions, and arrays are compared
-            by their numeric properties only <small>(#351)</small>.
-          </li>
-          <li>
-            <tt>_.escape</tt> no longer tries to be smart about not double-escaping
-            already-escaped HTML entities. Now it just escapes regardless <small>(#350)</small>.
-          </li>
-          <li>
-            In <tt>_.template</tt>, you may now leave semicolons out of evaluated
-            statements if you wish: <tt>&lt;% }) %&gt;</tt> <small>(#369)</small>.
-          </li>
-          <li>
-            <tt>_.after(callback, 0)</tt> will now trigger the callback immediately,
-            making "after" easier to use with asynchronous APIs <small>(#366)</small>.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.2.1</b> &mdash; <small><i>Oct. 24, 2011</i></small><br />
-        <ul>
-          <li>
-            Several important bug fixes for <tt>_.isEqual</tt>, which should now
-            do better on mutated Arrays, and on non-Array objects with
-            <tt>length</tt> properties. <small>(#329)</small>
-          </li>
-          <li>
-            <b>jrburke</b> contributed Underscore exporting for AMD module loaders,
-            and <b>tonylukasavage</b> for Appcelerator Titanium.
-            <small>(#335, #338)</small>
-          </li>
-          <li>
-            You can now <tt>_.groupBy(list, 'property')</tt> as a shortcut for
-            grouping values by a particular common property.
-          </li>
-          <li>
-            <tt>_.throttle</tt>'d functions now fire immediately upon invocation,
-            and are rate-limited thereafter <small>(#170, #266)</small>.
-          </li>
-          <li>
-            Most of the <tt>_.is[Type]</tt> checks no longer ducktype.
-          </li>
-          <li>
-            The <tt>_.bind</tt> function now also works on constructors, a-la
-            ES5 ... but you would never want to use <tt>_.bind</tt> on a
-            constructor function.
-          </li>
-          <li>
-            <tt>_.clone</tt> no longer wraps non-object types in Objects.
-          </li>
-          <li>
-            <tt>_.find</tt> and <tt>_.filter</tt> are now the preferred names for
-            <tt>_.detect</tt> and <tt>_.select</tt>.
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.2.0</b> &mdash; <small><i>Oct. 5, 2011</i></small><br />
-        <ul>
-          <li>
-            The <tt>_.isEqual</tt> function now
-            supports true deep equality comparisons, with checks for cyclic structures,
-            thanks to Kit Cambridge.
-          </li>
-          <li>
-            Underscore templates now support HTML escaping interpolations, using
-            <tt>&lt;%- ... %&gt;</tt> syntax.
-          </li>
-          <li>
-            Ryan Tenney contributed <tt>_.shuffle</tt>, which uses a modified
-            Fisher-Yates to give you a shuffled copy of an array.
-          </li>
-          <li>
-            <tt>_.uniq</tt> can now be passed an optional iterator, to determine by
-            what criteria an object should be considered unique.
-          </li>
-          <li>
-            <tt>_.last</tt> now takes an optional argument which will return the last
-            N elements of the list.
-          </li>
-          <li>
-            A new <tt>_.initial</tt> function was added, as a mirror of <tt>_.rest</tt>,
-            which returns all the initial values of a list (except the last N).
-          </li>
-        </ul>
-      </p>
-
-      <p>
-        <b class="header">1.1.7</b> &mdash; <small><i>July 13, 2011</i></small><br />
-        Added <tt>_.groupBy</tt>, which aggregates a collection into groups of like items.
-        Added <tt>_.union</tt> and <tt>_.difference</tt>, to complement the
-        (re-named) <tt>_.intersection</tt>.
-        Various improvements for support of sparse arrays.
-        <tt>_.toArray</tt> now returns a clone, if directly passed an array.
-        <tt>_.functions</tt> now also returns the names of functions that are present
-        in the prototype chain.
-      </p>
-
-      <p>
-        <b class="header">1.1.6</b> &mdash; <small><i>April 18, 2011</i></small><br />
-        Added <tt>_.after</tt>, which will return a function that only runs after
-        first being called a specified number of times.
-        <tt>_.invoke</tt> can now take a direct function reference.
-        <tt>_.every</tt> now requires an iterator function to be passed, which
-        mirrors the ECMA5 API.
-        <tt>_.extend</tt> no longer copies keys when the value is undefined.
-        <tt>_.bind</tt> now errors when trying to bind an undefined value.
-      </p>
-
-      <p>
-        <b class="header">1.1.5</b> &mdash; <small><i>Mar 20, 2011</i></small><br />
-        Added an <tt>_.defaults</tt> function, for use merging together JS objects
-        representing default options.
-        Added an <tt>_.once</tt> function, for manufacturing functions that should
-        only ever execute a single time.
-        <tt>_.bind</tt> now delegates to the native ECMAScript 5 version,
-        where available.
-        <tt>_.keys</tt> now throws an error when used on non-Object values, as in
-        ECMAScript 5.
-        Fixed a bug with <tt>_.keys</tt> when used over sparse arrays.
-      </p>
-
-      <p>
-        <b class="header">1.1.4</b> &mdash; <small><i>Jan 9, 2011</i></small><br />
-        Improved compliance with ES5's Array methods when passing <tt>null</tt>
-        as a value. <tt>_.wrap</tt> now correctly sets <tt>this</tt> for the
-        wrapped function. <tt>_.indexOf</tt> now takes an optional flag for
-        finding the insertion index in an array that is guaranteed to already
-        be sorted. Avoiding the use of <tt>.callee</tt>, to allow <tt>_.isArray</tt>
-        to work properly in ES5's strict mode.
-      </p>
-
-      <p>
-        <b class="header">1.1.3</b> &mdash; <small><i>Dec 1, 2010</i></small><br />
-        In CommonJS, Underscore may now be required with just: <br />
-        <tt>var _ = require("underscore")</tt>.
-        Added <tt>_.throttle</tt> and <tt>_.debounce</tt> functions.
-        Removed <tt>_.breakLoop</tt>, in favor of an ECMA5-style un-<i>break</i>-able
-        each implementation &mdash; this removes the try/catch, and you'll now have
-        better stack traces for exceptions that are thrown within an Underscore iterator.
-        Improved the <b>isType</b> family of functions for better interoperability
-        with Internet Explorer host objects.
-        <tt>_.template</tt> now correctly escapes backslashes in templates.
-        Improved <tt>_.reduce</tt> compatibility with the ECMA5 version:
-        if you don't pass an initial value, the first item in the collection is used.
-        <tt>_.each</tt> no longer returns the iterated collection, for improved
-        consistency with ES5's <tt>forEach</tt>.
-      </p>
-
-      <p>
-        <b class="header">1.1.2</b><br />
-        Fixed <tt>_.contains</tt>, which was mistakenly pointing at
-        <tt>_.intersect</tt> instead of <tt>_.include</tt>, like it should
-        have been. Added <tt>_.unique</tt> as an alias for <tt>_.uniq</tt>.
-      </p>
-
-      <p>
-        <b class="header">1.1.1</b><br />
-        Improved the speed of <tt>_.template</tt>, and its handling of multiline
-        interpolations. Ryan Tenney contributed optimizations to many Underscore
-        functions. An annotated version of the source code is now available.
-      </p>
-
-      <p>
-        <b class="header">1.1.0</b><br />
-        The method signature of <tt>_.reduce</tt> has been changed to match
-        the ECMAScript 5 signature, instead of the Ruby/Prototype.js version.
-        This is a backwards-incompatible change. <tt>_.template</tt> may now be
-        called with no arguments, and preserves whitespace. <tt>_.contains</tt>
-        is a new alias for <tt>_.include</tt>.
-      </p>
-
-      <p>
-        <b class="header">1.0.4</b><br />
-        <a href="http://themoell.com/">Andri Möll</a> contributed the <tt>_.memoize</tt>
-        function, which can be used to speed up expensive repeated computations
-        by caching the results.
-      </p>
-
-      <p>
-        <b class="header">1.0.3</b><br />
-        Patch that makes <tt>_.isEqual</tt> return <tt>false</tt> if any property
-        of the compared object has a <tt>NaN</tt> value. Technically the correct
-        thing to do, but of questionable semantics. Watch out for NaN comparisons.
-      </p>
-
-      <p>
-        <b class="header">1.0.2</b><br />
-        Fixes <tt>_.isArguments</tt> in recent versions of Opera, which have
-        arguments objects as real Arrays.
-      </p>
-
-      <p>
-        <b class="header">1.0.1</b><br />
-        Bugfix for <tt>_.isEqual</tt>, when comparing two objects with the same
-        number of undefined keys, but with different names.
-      </p>
-
-      <p>
-        <b class="header">1.0.0</b><br />
-        Things have been stable for many months now, so Underscore is now
-        considered to be out of beta, at <b>1.0</b>. Improvements since <b>0.6</b>
-        include <tt>_.isBoolean</tt>, and the ability to have <tt>_.extend</tt>
-        take multiple source objects.
-      </p>
-
-      <p>
-        <b class="header">0.6.0</b><br />
-        Major release. Incorporates a number of
-        <a href="http://github.com/ratbeard">Mile Frawley's</a> refactors for
-        safer duck-typing on collection functions, and cleaner internals. A new
-        <tt>_.mixin</tt> method that allows you to extend Underscore with utility
-        functions of your own. Added <tt>_.times</tt>, which works the same as in
-        Ruby or Prototype.js. Native support for ECMAScript 5's <tt>Array.isArray</tt>,
-        and <tt>Object.keys</tt>.
-      </p>
-
-      <p>
-        <b class="header">0.5.8</b><br />
-        Fixed Underscore's collection functions to work on
-        <a href="https://developer.mozilla.org/En/DOM/NodeList">NodeLists</a> and
-        <a href="https://developer.mozilla.org/En/DOM/HTMLCollection">HTMLCollections</a>
-        once more, thanks to
-        <a href="http://github.com/jmtulloss">Justin Tulloss</a>.
-      </p>
-
-      <p>
-        <b class="header">0.5.7</b><br />
-        A safer implementation of <tt>_.isArguments</tt>, and a
-        faster <tt>_.isNumber</tt>,<br />thanks to
-        <a href="http://jedschmidt.com/">Jed Schmidt</a>.
-      </p>
-
-      <p>
-        <b class="header">0.5.6</b><br />
-        Customizable delimiters for <tt>_.template</tt>, contributed by
-        <a href="http://github.com/iamnoah">Noah Sloan</a>.
-      </p>
-
-      <p>
-        <b class="header">0.5.5</b><br />
-        Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object.
-      </p>
-
-      <p>
-        <b class="header">0.5.4</b><br />
-        Fix for multiple single quotes within a template string for
-        <tt>_.template</tt>. See:
-        <a href="http://www.west-wind.com/Weblog/posts/509108.aspx">Rick Strahl's blog post</a>.
-      </p>
-
-      <p>
-        <b class="header">0.5.2</b><br />
-        New implementations of <tt>isArray</tt>, <tt>isDate</tt>, <tt>isFunction</tt>,
-        <tt>isNumber</tt>, <tt>isRegExp</tt>, and <tt>isString</tt>, thanks to
-        a suggestion from
-        <a href="http://www.broofa.com/">Robert Kieffer</a>.
-        Instead of doing <tt>Object#toString</tt>
-        comparisons, they now check for expected properties, which is less safe,
-        but more than an order of magnitude faster. Most other Underscore
-        functions saw minor speed improvements as a result.
-        <a href="http://dolzhenko.org/">Evgeniy Dolzhenko</a>
-        contributed <tt>_.tap</tt>,
-        <a href="http://ruby-doc.org/core-1.9/classes/Object.html#M000191">similar to Ruby 1.9's</a>,
-        which is handy for injecting side effects (like logging) into chained calls.
-      </p>
-
-      <p>
-        <b class="header">0.5.1</b><br />
-        Added an <tt>_.isArguments</tt> function. Lots of little safety checks
-        and optimizations contributed by
-        <a href="http://github.com/iamnoah/">Noah Sloan</a> and
-        <a href="http://themoell.com/">Andri Möll</a>.
-      </p>
-
-      <p>
-        <b class="header">0.5.0</b><br />
-        <b>[API Changes]</b> <tt>_.bindAll</tt> now takes the context object as
-        its first parameter. If no method names are passed, all of the context
-        object's methods are bound to it, enabling chaining and easier binding.
-        <tt>_.functions</tt> now takes a single argument and returns the names
-        of its Function properties. Calling <tt>_.functions(_)</tt> will get you
-        the previous behavior.
-        Added <tt>_.isRegExp</tt> so that <tt>isEqual</tt> can now test for RegExp equality.
-        All of the "is" functions have been shrunk down into a single definition.
-        <a href="http://github.com/grayrest/">Karl Guertin</a> contributed patches.
-      </p>
-
-      <p>
-        <b class="header">0.4.7</b><br />
-        Added <tt>isDate</tt>, <tt>isNaN</tt>, and <tt>isNull</tt>, for completeness.
-        Optimizations for <tt>isEqual</tt> when checking equality between Arrays
-        or Dates. <tt>_.keys</tt> is now <small><i><b>25%&ndash;2X</b></i></small> faster (depending on your
-        browser) which speeds up the functions that rely on it, such as <tt>_.each</tt>.
-      </p>
-
-      <p>
-        <b class="header">0.4.6</b><br />
-        Added the <tt>range</tt> function, a port of the
-        <a href="http://docs.python.org/library/functions.html#range">Python
-        function of the same name</a>, for generating flexibly-numbered lists
-        of integers. Original patch contributed by
-        <a href="http://github.com/kylichuku">Kirill Ishanov</a>.
-      </p>
-
-      <p>
-        <b class="header">0.4.5</b><br />
-        Added <tt>rest</tt> for Arrays and arguments objects, and aliased
-        <tt>first</tt> as <tt>head</tt>, and <tt>rest</tt> as <tt>tail</tt>,
-        thanks to <a href="http://github.com/lukesutton/">Luke Sutton</a>'s patches.
-        Added tests ensuring that all Underscore Array functions also work on
-        <i>arguments</i> objects.
-      </p>
-
-      <p>
-        <b class="header">0.4.4</b><br />
-        Added <tt>isString</tt>, and <tt>isNumber</tt>, for consistency. Fixed
-        <tt>_.isEqual(NaN, NaN)</tt> to return <i>true</i> (which is debatable).
-      </p>
-
-      <p>
-        <b class="header">0.4.3</b><br />
-        Started using the native <tt>StopIteration</tt> object in browsers that support it.
-        Fixed Underscore setup for CommonJS environments.
-      </p>
-
-      <p>
-        <b class="header">0.4.2</b><br />
-        Renamed the unwrapping function to <tt>value</tt>, for clarity.
-      </p>
-
-      <p>
-        <b class="header">0.4.1</b><br />
-        Chained Underscore objects now support the Array prototype methods, so
-        that you can perform the full range of operations on a wrapped array
-        without having to break your chain. Added a <tt>breakLoop</tt> method
-        to <b>break</b> in the middle of any Underscore iteration. Added an
-        <tt>isEmpty</tt> function that works on arrays and objects.
-      </p>
-
-      <p>
-        <b class="header">0.4.0</b><br />
-        All Underscore functions can now be called in an object-oriented style,
-        like so: <tt>_([1, 2, 3]).map(...);</tt>. Original patch provided by
-        <a href="http://macournoyer.com/">Marc-André Cournoyer</a>.
-        Wrapped objects can be chained through multiple
-        method invocations. A <a href="#object-functions"><tt>functions</tt></a> method
-        was added, providing a sorted list of all the functions in Underscore.
-      </p>
-
-      <p>
-        <b class="header">0.3.3</b><br />
-        Added the JavaScript 1.8 function <tt>reduceRight</tt>. Aliased it
-        as <tt>foldr</tt>, and aliased <tt>reduce</tt> as <tt>foldl</tt>.
-      </p>
-
-      <p>
-        <b class="header">0.3.2</b><br />
-        Now runs on stock <a href="http://www.mozilla.org/rhino/">Rhino</a>
-        interpreters with: <tt>load("underscore.js")</tt>.
-        Added <a href="#identity"><tt>identity</tt></a> as a utility function.
-      </p>
-
-      <p>
-        <b class="header">0.3.1</b><br />
-        All iterators are now passed in the original collection as their third
-        argument, the same as JavaScript 1.6's <b>forEach</b>. Iterating over
-        objects is now called with <tt>(value, key, collection)</tt>, for details
-        see <a href="#each"><tt>_.each</tt></a>.
-      </p>
-
-      <p>
-        <b class="header">0.3.0</b><br />
-        Added <a href="http://github.com/dmitryBaranovskiy">Dmitry Baranovskiy</a>'s
-        comprehensive optimizations, merged in
-        <a href="http://github.com/kriskowal/">Kris Kowal</a>'s patches to make Underscore
-        <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> and
-        <a href="http://narwhaljs.org/">Narwhal</a> compliant.
-      </p>
-
-      <p>
-        <b class="header">0.2.0</b><br />
-        Added <tt>compose</tt> and <tt>lastIndexOf</tt>, renamed <tt>inject</tt> to
-        <tt>reduce</tt>, added aliases for <tt>inject</tt>, <tt>filter</tt>,
-        <tt>every</tt>, <tt>some</tt>, and <tt>forEach</tt>.
-      </p>
-
-      <p>
-        <b class="header">0.1.1</b><br />
-        Added <tt>noConflict</tt>, so that the "Underscore" object can be assigned to
-        other variables.
-      </p>
-
-      <p>
-        <b class="header">0.1.0</b><br />
-        Initial release of Underscore.js.
-      </p>
-
-      <p>
-        <a href="http://documentcloud.org/" title="A DocumentCloud Project" style="background:none;">
-          <img src="http://jashkenas.s3.amazonaws.com/images/a_documentcloud_project.png" alt="A DocumentCloud Project" />
-        </a>
-      </p>
-
-    </div>
-
-  </div>
-
-  <!-- Include Underscore, so you can play with it in the console. -->
-  <script type="text/javascript" src="underscore.js"></script>
-
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/index.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/index.js b/weinre.server/node_modules/underscore/index.js
deleted file mode 100644
index 2cf0ca5..0000000
--- a/weinre.server/node_modules/underscore/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./underscore');

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/package.json
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/package.json b/weinre.server/node_modules/underscore/package.json
index 5cf9010..0e87fa5 100644
--- a/weinre.server/node_modules/underscore/package.json
+++ b/weinre.server/node_modules/underscore/package.json
@@ -1,7 +1,7 @@
 {
   "name": "underscore",
   "description": "JavaScript's functional programming helper library.",
-  "homepage": "http://documentcloud.github.com/underscore/",
+  "homepage": "http://underscorejs.org",
   "keywords": [
     "util",
     "functional",
@@ -15,11 +15,37 @@
   },
   "repository": {
     "type": "git",
-    "url": "git://github.com/documentcloud/underscore.git"
+    "url": "git://github.com/jashkenas/underscore.git"
   },
   "main": "underscore.js",
-  "version": "1.3.3",
-  "readme": "                       __                                                         \n                      /\\ \\                                                         __           \n     __  __    ___    \\_\\ \\     __   _ __   ____    ___    ___   _ __    __       /\\_\\    ____  \n    /\\ \\/\\ \\ /' _ `\\  /'_  \\  /'__`\\/\\  __\\/ ,__\\  / ___\\ / __`\\/\\  __\\/'__`\\     \\/\\ \\  /',__\\ \n    \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\  __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\  __/  __  \\ \\ \\/\\__, `\\\n     \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n      \\/___/  \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/  \\/____/\\/___/  \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n                                                                                  \\ \\____/      \n                                                                                   \\/___/\n             
                                                                   \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n",
-  "_id": "underscore@1.3.3",
-  "_from": "underscore@1.3.x"
+  "version": "1.7.0",
+  "devDependencies": {
+    "docco": "0.6.x",
+    "phantomjs": "1.9.7-1",
+    "uglify-js": "2.4.x",
+    "eslint": "0.6.x"
+  },
+  "scripts": {
+    "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true && eslint underscore.js test/*.js test/vendor/runner.js",
+    "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/    .*/\" -m --source-map underscore-min.map -o underscore-min.js",
+    "doc": "docco underscore.js"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE"
+    }
+  ],
+  "files": [
+    "underscore.js",
+    "underscore-min.js",
+    "LICENSE"
+  ],
+  "readme": "                       __\n                      /\\ \\                                                         __\n     __  __    ___    \\_\\ \\     __   _ __   ____    ___    ___   _ __    __       /\\_\\    ____\n    /\\ \\/\\ \\ /' _ `\\  /'_  \\  /'__`\\/\\  __\\/ ,__\\  / ___\\ / __`\\/\\  __\\/'__`\\     \\/\\ \\  /',__\\\n    \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\  __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\  __/  __  \\ \\ \\/\\__, `\\\n     \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n      \\/___/  \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/  \\/____/\\/___/  \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n                                                                                  \\ \\____/\n                                                                                   \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usu
 al functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nUnderscore is an open-sourced component of DocumentCloud:\nhttps://github.com/documentcloud\n\nMany thanks to our contributors:\nhttps://github.com/jashkenas/underscore/contributors\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/jashkenas/underscore/issues"
+  },
+  "_id": "underscore@1.7.0",
+  "_from": "underscore@1.7.x"
 }

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/raw/underscore.psd
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/raw/underscore.psd b/weinre.server/node_modules/underscore/raw/underscore.psd
deleted file mode 100644
index 73ad2d7..0000000
Binary files a/weinre.server/node_modules/underscore/raw/underscore.psd and /dev/null differ


[13/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/HttpChannelHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/HttpChannelHandler.coffee b/weinre.server/lib/HttpChannelHandler.coffee
deleted file mode 100644
index dd7f2f4..0000000
--- a/weinre.server/lib/HttpChannelHandler.coffee
+++ /dev/null
@@ -1,154 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_ = require 'underscore'
-
-utils          = require './utils'
-Channel        = require './Channel'
-channelManager = require './channelManager'
-
-#-------------------------------------------------------------------------------
-module.exports = utils.registerClass class HttpChannelHandler
-
-    #---------------------------------------------------------------------------
-    constructor: (@pathPrefix) ->
-    
-        if @pathPrefix == '/ws/client'
-            @isClient = true
-            
-        else if @pathPrefix == '/ws/target'
-            @isClient = false
-            
-        else
-            utils.pitch "invalid pathPrefix: #{@pathPrefix}"
-            
-        @isTarget = !@isClient
-        
-    #---------------------------------------------------------------------------
-    handle: (request, response, uri) ->
-    
-        setCORSHeaders  request, response
-        setCacheHeaders request, response
-
-        #-----------------
-        
-        # * #{pathPrefix}a
-        if uri[0] != '/'
-            return handleError(request, response, 404)
-            
-        #-----------------
-        
-        if uri == '/'
-        
-            # OPTIONS #{pathPrefix}/
-            if request.method == 'OPTIONS'
-                return handleOptions(request, response)
-
-            # POST #{pathPrefix}/
-            if request.method == 'POST'
-                return handleCreate(@pathPrefix, @isClient, request, response)
-                
-            # * #{pathPrefix}/
-            return handleError(request, response, 405)
-            
-        #-----------------
-            
-        parts = uri.split('/')
-        
-        # * #{pathPrefix}/x/y
-        if parts.length > 2
-            return handleError(request, response, 404)
-
-        #-----------------
-        
-        channelName = parts[1]
-        
-        # OPTIONS #{pathPrefix}/x
-        if request.method == 'OPTIONS'
-            return handleOptions(request, response)
-
-        # GET #{pathPrefix}/x
-        if request.method == 'GET'
-            return handleGet(request, response, channelName)
-        
-        # POST #{pathPrefix}/x
-        if request.method == 'POST'
-            return handlePost(request, response, channelName)
-        
-        # anything else
-        return handleError(request, response, 405)
-
-#-------------------------------------------------------------------------------
-handleCreate = (pathPrefix, isClient, request, response) ->
-    id = request.body?.id
-    
-    remoteAddress = request.connection?.remoteAddress || ""
-    
-    channel = new Channel(pathPrefix, id, remoteAddress, isClient)
-    
-    response.contentType 'application/json'
-    response.send JSON.stringify
-        channel: channel.name
-        id:      channel.id
-
-#-------------------------------------------------------------------------------
-handleGet = (request, response, channelName) ->
-    remoteAddress = request.connection?.remoteAddress || ""
-    channel       = channelManager.getChannel(channelName, remoteAddress)
-    return handleError(request, response, 404) if !channel
-    
-    channel.getMessages (messages) => 
-        return handleError(request, response, 404) if channel.isClosed
-        return handleError(request, response, 404) if !messages
-        
-        response.contentType 'application/json'
-        response.send JSON.stringify(messages)
-
-#-------------------------------------------------------------------------------
-handlePost = (request, response, channelName) ->
-    remoteAddress = request.connection?.remoteAddress || ""
-    channel       = channelManager.getChannel(channelName, remoteAddress)
-    return handleError(request, response, 404) if !channel
-    
-    channel.handleMessages(request.body)
-    response.send('')
-
-#-------------------------------------------------------------------------------
-handleOptions = (request, response) ->
-    response.send('')
-
-#-------------------------------------------------------------------------------
-handleError = (request, response, status) ->
-    response.send(status)
-
-#-------------------------------------------------------------------------------
-setCORSHeaders = (request, response) ->
-    origin = request.header 'Origin'
-    return if !origin
-    
-    response.header 'Access-Control-Allow-Origin',  origin
-    response.header 'Access-Control-Max-Age',       '600'
-    response.header 'Access-Control-Allow-Methods', 'GET, POST'
-
-#-------------------------------------------------------------------------------
-setCacheHeaders = (request, response) ->
-    response.header 'Pragma',        'no-cache'
-    response.header 'Expires',       '0'
-    response.header 'Cache-Control', 'no-cache'
-    response.header 'Cache-Control', 'no-store'

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/HttpChannelHandler.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/HttpChannelHandler.js b/weinre.server/lib/HttpChannelHandler.js
new file mode 100644
index 0000000..223872d
--- /dev/null
+++ b/weinre.server/lib/HttpChannelHandler.js
@@ -0,0 +1,130 @@
+// Generated by CoffeeScript 1.8.0
+var Channel, HttpChannelHandler, channelManager, handleCreate, handleError, handleGet, handleOptions, handlePost, setCORSHeaders, setCacheHeaders, utils, _;
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+Channel = require('./Channel');
+
+channelManager = require('./channelManager');
+
+module.exports = utils.registerClass(HttpChannelHandler = (function() {
+  function HttpChannelHandler(pathPrefix) {
+    this.pathPrefix = pathPrefix;
+    if (this.pathPrefix === '/ws/client') {
+      this.isClient = true;
+    } else if (this.pathPrefix === '/ws/target') {
+      this.isClient = false;
+    } else {
+      utils.pitch("invalid pathPrefix: " + this.pathPrefix);
+    }
+    this.isTarget = !this.isClient;
+  }
+
+  HttpChannelHandler.prototype.handle = function(request, response, uri) {
+    var channelName, parts;
+    setCORSHeaders(request, response);
+    setCacheHeaders(request, response);
+    if (uri[0] !== '/') {
+      return handleError(request, response, 404);
+    }
+    if (uri === '/') {
+      if (request.method === 'OPTIONS') {
+        return handleOptions(request, response);
+      }
+      if (request.method === 'POST') {
+        return handleCreate(this.pathPrefix, this.isClient, request, response);
+      }
+      return handleError(request, response, 405);
+    }
+    parts = uri.split('/');
+    if (parts.length > 2) {
+      return handleError(request, response, 404);
+    }
+    channelName = parts[1];
+    if (request.method === 'OPTIONS') {
+      return handleOptions(request, response);
+    }
+    if (request.method === 'GET') {
+      return handleGet(request, response, channelName);
+    }
+    if (request.method === 'POST') {
+      return handlePost(request, response, channelName);
+    }
+    return handleError(request, response, 405);
+  };
+
+  return HttpChannelHandler;
+
+})());
+
+handleCreate = function(pathPrefix, isClient, request, response) {
+  var channel, id, remoteAddress, _ref, _ref1;
+  id = (_ref = request.body) != null ? _ref.id : void 0;
+  remoteAddress = ((_ref1 = request.connection) != null ? _ref1.remoteAddress : void 0) || "";
+  channel = new Channel(pathPrefix, id, remoteAddress, isClient);
+  response.contentType('application/json');
+  return response.send(JSON.stringify({
+    channel: channel.name,
+    id: channel.id
+  }));
+};
+
+handleGet = function(request, response, channelName) {
+  var channel, remoteAddress, _ref;
+  remoteAddress = ((_ref = request.connection) != null ? _ref.remoteAddress : void 0) || "";
+  channel = channelManager.getChannel(channelName, remoteAddress);
+  if (!channel) {
+    return handleError(request, response, 404);
+  }
+  return channel.getMessages((function(_this) {
+    return function(messages) {
+      if (channel.isClosed) {
+        return handleError(request, response, 404);
+      }
+      if (!messages) {
+        return handleError(request, response, 404);
+      }
+      response.contentType('application/json');
+      return response.send(JSON.stringify(messages));
+    };
+  })(this));
+};
+
+handlePost = function(request, response, channelName) {
+  var channel, remoteAddress, _ref;
+  remoteAddress = ((_ref = request.connection) != null ? _ref.remoteAddress : void 0) || "";
+  channel = channelManager.getChannel(channelName, remoteAddress);
+  if (!channel) {
+    return handleError(request, response, 404);
+  }
+  channel.handleMessages(request.body);
+  return response.send('');
+};
+
+handleOptions = function(request, response) {
+  return response.send('');
+};
+
+handleError = function(request, response, status) {
+  return response.send(status);
+};
+
+setCORSHeaders = function(request, response) {
+  var origin;
+  origin = request.header('Origin');
+  if (!origin) {
+    return;
+  }
+  response.header('Access-Control-Allow-Origin', origin);
+  response.header('Access-Control-Max-Age', '600');
+  return response.header('Access-Control-Allow-Methods', 'GET, POST');
+};
+
+setCacheHeaders = function(request, response) {
+  response.header('Pragma', 'no-cache');
+  response.header('Expires', '0');
+  response.header('Cache-Control', 'no-cache');
+  return response.header('Cache-Control', 'no-store');
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/MessageQueue.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/MessageQueue.coffee b/weinre.server/lib/MessageQueue.coffee
deleted file mode 100644
index 52af9ea..0000000
--- a/weinre.server/lib/MessageQueue.coffee
+++ /dev/null
@@ -1,87 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_ = require 'underscore'
-
-utils = require './utils'
-
-#-------------------------------------------------------------------------------
-module.exports = utils.registerClass class MessageQueue
-
-    #---------------------------------------------------------------------------
-    constructor: () ->
-        @messages     = []
-        @closed       = false
-        @callback     = null
-        @timer        = null
-        
-        _.bindAll @, '_timerExpired', '_updated'
-        
-    #---------------------------------------------------------------------------
-    shutdown: () ->
-        return if @closed
-
-        @closed = true
-
-        clearTimeout @timer if @timer
-        @callback.call(null, @messages) if @callback
-        
-        @callback = null
-        @messages = null 
-        @timer    = null
-    
-    #---------------------------------------------------------------------------
-    push: (message) ->
-        return if @closed
-        
-        @messages.push message
-        process.nextTick @_updated
-
-    #---------------------------------------------------------------------------
-    pullAll: (timeout, callback) ->
-        return callback.call(null, null) if @closed
-        return callback.call(null, [])   if @callback
-        
-        if @messages.length
-            callback.call(null, @messages)
-            @messages = []
-            return
-        
-        @callback = callback
-        @timer    = setTimeout @_timerExpired, timeout
-
-    #---------------------------------------------------------------------------
-    _timerExpired: () ->
-        @_updated()
-        
-    #---------------------------------------------------------------------------
-    _updated: () ->
-        return if @closed
-        return if !@callback
-        
-        callback = @callback
-        messages = @messages
-        clearTimeout @timer if @timer
-        
-        @callback = null
-        @messages = []
-        @timer    = null
-
-        callback.call(null, messages)      
-

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/MessageQueue.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/MessageQueue.js b/weinre.server/lib/MessageQueue.js
new file mode 100644
index 0000000..1afea40
--- /dev/null
+++ b/weinre.server/lib/MessageQueue.js
@@ -0,0 +1,82 @@
+// Generated by CoffeeScript 1.8.0
+var MessageQueue, utils, _;
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+module.exports = utils.registerClass(MessageQueue = (function() {
+  function MessageQueue() {
+    this.messages = [];
+    this.closed = false;
+    this.callback = null;
+    this.timer = null;
+    _.bindAll(this, '_timerExpired', '_updated');
+  }
+
+  MessageQueue.prototype.shutdown = function() {
+    if (this.closed) {
+      return;
+    }
+    this.closed = true;
+    if (this.timer) {
+      clearTimeout(this.timer);
+    }
+    if (this.callback) {
+      this.callback.call(null, this.messages);
+    }
+    this.callback = null;
+    this.messages = null;
+    return this.timer = null;
+  };
+
+  MessageQueue.prototype.push = function(message) {
+    if (this.closed) {
+      return;
+    }
+    this.messages.push(message);
+    return process.nextTick(this._updated);
+  };
+
+  MessageQueue.prototype.pullAll = function(timeout, callback) {
+    if (this.closed) {
+      return callback.call(null, null);
+    }
+    if (this.callback) {
+      return callback.call(null, []);
+    }
+    if (this.messages.length) {
+      callback.call(null, this.messages);
+      this.messages = [];
+      return;
+    }
+    this.callback = callback;
+    return this.timer = setTimeout(this._timerExpired, timeout);
+  };
+
+  MessageQueue.prototype._timerExpired = function() {
+    return this._updated();
+  };
+
+  MessageQueue.prototype._updated = function() {
+    var callback, messages;
+    if (this.closed) {
+      return;
+    }
+    if (!this.callback) {
+      return;
+    }
+    callback = this.callback;
+    messages = this.messages;
+    if (this.timer) {
+      clearTimeout(this.timer);
+    }
+    this.callback = null;
+    this.messages = [];
+    this.timer = null;
+    return callback.call(null, messages);
+  };
+
+  return MessageQueue;
+
+})());

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/channelManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/channelManager.coffee b/weinre.server/lib/channelManager.coffee
deleted file mode 100644
index d55bb01..0000000
--- a/weinre.server/lib/channelManager.coffee
+++ /dev/null
@@ -1,126 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_  = require 'underscore'
-
-utils          = require './utils'
-serviceManager = require './serviceManager'
-
-WeinreClientEvents = null
-WeinreTargetEvents = null
-
-channelManager = null
-
-#-------------------------------------------------------------------------------
-utils.registerClass class ChannelManager
-
-    #---------------------------------------------------------------------------
-    constructor: () ->
-        @channels  = {}
-
-    #---------------------------------------------------------------------------
-    initialize: ->
-
-        WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
-        WeinreTargetEvents = serviceManager.get 'WeinreTargetEvents'
-
-        if !WeinreClientEvents
-            utils.exit 'WeinreClientEvents service not registered'
-
-        if !WeinreTargetEvents
-            utils.exit 'WeinreTargetEvents service not registered'
-
-    #---------------------------------------------------------------------------
-    created: (channel) ->
-        @channels[channel.name] = channel
-
-    #---------------------------------------------------------------------------
-    destroyed: (channel) ->
-        if channel.isClient
-            for connection in channel.connections
-                @disconnectChannels(channel, connection)
-        else
-            for connection in channel.connections
-                @disconnectChannels(connection, channel)
-
-        clients = @getClientChannels(channel.id)
-
-        if channel.isClient
-            WeinreClientEvents.clientUnregistered(clients, channel.name)
-        else
-            WeinreClientEvents.targetUnregistered(clients, channel.name)
-
-        delete @channels[channel.name]
-
-    #---------------------------------------------------------------------------
-    getChannel: (name, remoteAddress) ->
-        return null if !_.has(@channels, name)
-
-        channel = @channels[name]
-
-        return null if !channel
-
-#        if remoteAddress
-#            return null if channel.remoteAddress != remoteAddress
-
-        channel
-
-    #---------------------------------------------------------------------------
-    connectChannels: (client, target) ->
-        return if client.isClosed or target.isClosed
-
-        if client.connections.length
-            @disconnectChannels(client, client.connections[0])
-
-        client.connections.push target
-        target.connections.push client
-
-        clients = @getClientChannels(client.id)
-
-        WeinreClientEvents.connectionCreated(clients, client.name, target.name)
-        WeinreTargetEvents.connectionCreated(target,  client.name, target.name)
-
-    #---------------------------------------------------------------------------
-    disconnectChannels: (client, target) ->
-
-        clients = @getClientChannels(client.id)
-
-        WeinreClientEvents.connectionDestroyed(clients, client.name, target.name)
-        WeinreTargetEvents.connectionDestroyed(target,  client.name, target.name)
-
-        client.connections = _.without(client.connections, target)
-        target.connections = _.without(target.connections, client)
-
-    #---------------------------------------------------------------------------
-    getChannels: (id) ->
-        if id?
-            _.filter(@channels, (item) -> item.id == id)
-        else
-            _.values(@channels)
-
-    #---------------------------------------------------------------------------
-    getClientChannels: (id) ->
-        _.filter(@channels, (item) -> item.isClient && item.id == id)
-
-    #---------------------------------------------------------------------------
-    getTargetChannels: (id) ->
-        _.filter(@channels, (item) -> item.isTarget && item.id == id)
-
-#-------------------------------------------------------------------------------
-module.exports = new ChannelManager

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/channelManager.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/channelManager.js b/weinre.server/lib/channelManager.js
new file mode 100644
index 0000000..fa0700d
--- /dev/null
+++ b/weinre.server/lib/channelManager.js
@@ -0,0 +1,122 @@
+// Generated by CoffeeScript 1.8.0
+var ChannelManager, WeinreClientEvents, WeinreTargetEvents, channelManager, serviceManager, utils, _;
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+serviceManager = require('./serviceManager');
+
+WeinreClientEvents = null;
+
+WeinreTargetEvents = null;
+
+channelManager = null;
+
+utils.registerClass(ChannelManager = (function() {
+  function ChannelManager() {
+    this.channels = {};
+  }
+
+  ChannelManager.prototype.initialize = function() {
+    WeinreClientEvents = serviceManager.get('WeinreClientEvents');
+    WeinreTargetEvents = serviceManager.get('WeinreTargetEvents');
+    if (!WeinreClientEvents) {
+      utils.exit('WeinreClientEvents service not registered');
+    }
+    if (!WeinreTargetEvents) {
+      return utils.exit('WeinreTargetEvents service not registered');
+    }
+  };
+
+  ChannelManager.prototype.created = function(channel) {
+    return this.channels[channel.name] = channel;
+  };
+
+  ChannelManager.prototype.destroyed = function(channel) {
+    var clients, connection, _i, _j, _len, _len1, _ref, _ref1;
+    if (channel.isClient) {
+      _ref = channel.connections;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        connection = _ref[_i];
+        this.disconnectChannels(channel, connection);
+      }
+    } else {
+      _ref1 = channel.connections;
+      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+        connection = _ref1[_j];
+        this.disconnectChannels(connection, channel);
+      }
+    }
+    clients = this.getClientChannels(channel.id);
+    if (channel.isClient) {
+      WeinreClientEvents.clientUnregistered(clients, channel.name);
+    } else {
+      WeinreClientEvents.targetUnregistered(clients, channel.name);
+    }
+    return delete this.channels[channel.name];
+  };
+
+  ChannelManager.prototype.getChannel = function(name, remoteAddress) {
+    var channel;
+    if (!_.has(this.channels, name)) {
+      return null;
+    }
+    channel = this.channels[name];
+    if (!channel) {
+      return null;
+    }
+    return channel;
+  };
+
+  ChannelManager.prototype.connectChannels = function(client, target) {
+    var clients;
+    if (client.isClosed || target.isClosed) {
+      return;
+    }
+    if (client.connections.length) {
+      this.disconnectChannels(client, client.connections[0]);
+    }
+    client.connections.push(target);
+    target.connections.push(client);
+    clients = this.getClientChannels(client.id);
+    WeinreClientEvents.connectionCreated(clients, client.name, target.name);
+    return WeinreTargetEvents.connectionCreated(target, client.name, target.name);
+  };
+
+  ChannelManager.prototype.disconnectChannels = function(client, target) {
+    var clients;
+    clients = this.getClientChannels(client.id);
+    WeinreClientEvents.connectionDestroyed(clients, client.name, target.name);
+    WeinreTargetEvents.connectionDestroyed(target, client.name, target.name);
+    client.connections = _.without(client.connections, target);
+    return target.connections = _.without(target.connections, client);
+  };
+
+  ChannelManager.prototype.getChannels = function(id) {
+    if (id != null) {
+      return _.filter(this.channels, function(item) {
+        return item.id === id;
+      });
+    } else {
+      return _.values(this.channels);
+    }
+  };
+
+  ChannelManager.prototype.getClientChannels = function(id) {
+    return _.filter(this.channels, function(item) {
+      return item.isClient && item.id === id;
+    });
+  };
+
+  ChannelManager.prototype.getTargetChannels = function(id) {
+    return _.filter(this.channels, function(item) {
+      return item.isTarget && item.id === id;
+    });
+  };
+
+  return ChannelManager;
+
+})());
+
+module.exports = new ChannelManager;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/cli.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/cli.coffee b/weinre.server/lib/cli.coffee
deleted file mode 100644
index 197e39c..0000000
--- a/weinre.server/lib/cli.coffee
+++ /dev/null
@@ -1,130 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-fs   = require 'fs'
-path = require 'path'
-
-_     = require 'underscore'
-nopt  = require 'nopt'
-
-utils  = require './utils'
-weinre = require './weinre'
-
-optionDefaults =
-    httpPort:     8080
-    boundHost:    'localhost'
-    verbose:      false
-    debug:        false
-    readTimeout:  5
-
-#-------------------------------------------------------------------------------
-exports.run = ->
-
-    knownOpts =
-        httpPort:     Number
-        boundHost:    String
-        verbose:      Boolean
-        debug:        Boolean
-        readTimeout:  Number
-        deathTimeout: Number
-        help:         Boolean
-
-    shortHands =
-        '?':  ['--help']
-        'h':  ['--help']
-
-    nopt.invalidHandler = printNoptError
-    parsedOpts = nopt(knownOpts, shortHands, process.argv, 2)
-
-    #----
-
-    printHelp() if parsedOpts.help
-
-    args = parsedOpts.argv.remain
-
-    printHelp() if args.length != 0
-
-    #----
-
-    delete parsedOpts.argv
-    opts = _.extend {}, optionDefaults, getDotWeinreServerProperties(), parsedOpts
-
-    if !opts.deathTimeout?
-        opts.deathTimeout = 3 * opts.readTimeout
-
-    utils.setOptions opts
-
-    weinre.run opts
-
-#-------------------------------------------------------------------------------
-printNoptError = (key, val, types) ->
-    utils.exit "error with option '#{key}', value '#{val}'"
-
-#-------------------------------------------------------------------------------
-printHelp = () ->
-    version = weinre.getVersion()
-
-    console.error """
-usage:   #{utils.Program} [options]
-version: #{version}
-
-options:
-    --httpPort     port to run the http server on        default: #{optionDefaults.httpPort}
-    --boundHost    ip address to bind the server to      default: #{optionDefaults.boundHost}
-    --verbose      print more diagnostics                default: #{optionDefaults.verbose}
-    --debug        print even more diagnostics           default: #{optionDefaults.debug}
-    --readTimeout  seconds to wait for a client message  default: #{optionDefaults.readTimeout}
-    --deathTimeout seconds to wait to kill client        default: 3*readTimeout
-
---boundHost can be an ip address, hostname, or -all-, where -all-
-means binding to all ip address on the current machine'
-
-for more info see: http://people.apache.org/~pmuellr/weinre/
-"""
-    process.exit()
-
-#-------------------------------------------------------------------------------
-getDotWeinreServerProperties = () ->
-    properties = {}
-
-    fileName = replaceTilde '~/.weinre/server.properties'
-    return properties if !utils.fileExistsSync(fileName)
-
-    contents = fs.readFileSync(fileName, 'utf8')
-    lines    = contents.split('\n')
-
-    for line in lines
-        line = line.replace(/#.*/,'')
-        match = line.match /\s*(\w+)\s*:\s*(.+)\s*/
-        continue if !match
-
-        key = utils.trim match[1]
-        val = utils.trim match[2]
-
-        properties[key] = val
-
-    properties
-
-#-------------------------------------------------------------------------------
-replaceTilde = (fileName) ->
-    fileName.replace('~', getTildeReplacement())
-
-#-------------------------------------------------------------------------------
-getTildeReplacement = () ->
-    process.env["HOME"] || process.env["USERPROFILE"] || '.'

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/cli.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/cli.js b/weinre.server/lib/cli.js
new file mode 100644
index 0000000..3c4b507
--- /dev/null
+++ b/weinre.server/lib/cli.js
@@ -0,0 +1,97 @@
+// Generated by CoffeeScript 1.8.0
+var fs, getDotWeinreServerProperties, getTildeReplacement, nopt, optionDefaults, path, printHelp, printNoptError, replaceTilde, utils, weinre, _;
+
+fs = require('fs');
+
+path = require('path');
+
+_ = require('underscore');
+
+nopt = require('nopt');
+
+utils = require('./utils');
+
+weinre = require('./weinre');
+
+optionDefaults = {
+  httpPort: 8080,
+  boundHost: 'localhost',
+  verbose: false,
+  debug: false,
+  readTimeout: 5
+};
+
+exports.run = function() {
+  var args, knownOpts, opts, parsedOpts, shortHands;
+  knownOpts = {
+    httpPort: Number,
+    boundHost: String,
+    verbose: Boolean,
+    debug: Boolean,
+    readTimeout: Number,
+    deathTimeout: Number,
+    help: Boolean
+  };
+  shortHands = {
+    '?': ['--help'],
+    'h': ['--help']
+  };
+  nopt.invalidHandler = printNoptError;
+  parsedOpts = nopt(knownOpts, shortHands, process.argv, 2);
+  if (parsedOpts.help) {
+    printHelp();
+  }
+  args = parsedOpts.argv.remain;
+  if (args.length !== 0) {
+    printHelp();
+  }
+  delete parsedOpts.argv;
+  opts = _.extend({}, optionDefaults, getDotWeinreServerProperties(), parsedOpts);
+  if (opts.deathTimeout == null) {
+    opts.deathTimeout = 3 * opts.readTimeout;
+  }
+  utils.setOptions(opts);
+  return weinre.run(opts);
+};
+
+printNoptError = function(key, val, types) {
+  return utils.exit("error with option '" + key + "', value '" + val + "'");
+};
+
+printHelp = function() {
+  var version;
+  version = weinre.getVersion();
+  console.error("usage:   " + utils.Program + " [options]\nversion: " + version + "\n\noptions:\n    --httpPort     port to run the http server on        default: " + optionDefaults.httpPort + "\n    --boundHost    ip address to bind the server to      default: " + optionDefaults.boundHost + "\n    --verbose      print more diagnostics                default: " + optionDefaults.verbose + "\n    --debug        print even more diagnostics           default: " + optionDefaults.debug + "\n    --readTimeout  seconds to wait for a client message  default: " + optionDefaults.readTimeout + "\n    --deathTimeout seconds to wait to kill client        default: 3*readTimeout\n\n--boundHost can be an ip address, hostname, or -all-, where -all-\nmeans binding to all ip address on the current machine'\n\nfor more info see: http://people.apache.org/~pmuellr/weinre/");
+  return process.exit();
+};
+
+getDotWeinreServerProperties = function() {
+  var contents, fileName, key, line, lines, match, properties, val, _i, _len;
+  properties = {};
+  fileName = replaceTilde('~/.weinre/server.properties');
+  if (!utils.fileExistsSync(fileName)) {
+    return properties;
+  }
+  contents = fs.readFileSync(fileName, 'utf8');
+  lines = contents.split('\n');
+  for (_i = 0, _len = lines.length; _i < _len; _i++) {
+    line = lines[_i];
+    line = line.replace(/#.*/, '');
+    match = line.match(/\s*(\w+)\s*:\s*(.+)\s*/);
+    if (!match) {
+      continue;
+    }
+    key = utils.trim(match[1]);
+    val = utils.trim(match[2]);
+    properties[key] = val;
+  }
+  return properties;
+};
+
+replaceTilde = function(fileName) {
+  return fileName.replace('~', getTildeReplacement());
+};
+
+getTildeReplacement = function() {
+  return process.env["HOME"] || process.env["USERPROFILE"] || '.';
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/dumpingHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/dumpingHandler.coffee b/weinre.server/lib/dumpingHandler.coffee
deleted file mode 100644
index 310852d..0000000
--- a/weinre.server/lib/dumpingHandler.coffee
+++ /dev/null
@@ -1,77 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_ = require 'underscore'
-
-utils = require './utils'
-
-#-------------------------------------------------------------------------------
-dumpingHandler = (request, response, uri) ->
-    originalSend = response.send
-    response.send = (body) ->
-        dumpResponse(originalSend, body, request, response, uri)
-    
-    return if request.method != 'POST'
-    
-    utils.logVerbose '--------------------------------------------------'
-    utils.logVerbose "#{request.method} #{uri} [request]"
-    
-    if _.isArray(request.body)
-        for element in request.body
-            utils.logVerbose "   #{enhance(JSON.parse(element))}"
-    else
-        utils.logVerbose "   #{enhance(request.body)}"
-
-#-------------------------------------------------------------------------------
-dumpResponse = (originalSend, body, request, response, uri) ->
-    originalSend.call(response, body)
-
-    return if request.method not in ['GET', 'POST']
-
-    try 
-        body = JSON.parse(body)
-    catch e
-        return
-
-    return if _.isArray(body) && (body.length == 0)
-        
-    utils.logVerbose '--------------------------------------------------'
-    utils.logVerbose "#{request.method} #{uri} #{response.statusCode} [response]"
-    
-    if _.isArray(body)
-        for element in body
-            utils.logVerbose "   #{enhance(JSON.parse(element))}"
-    else
-        utils.logVerbose "   #{enhance(body)}"
-
-#-------------------------------------------------------------------------------
-enhance = (object) ->
-    if !object.interface || !object.method || !object.args 
-        return JSON.stringify(object)
-        
-    signature = "#{object.interface}.#{object.method}"
-
-    args = JSON.stringify(object.args)
-    if args.length > 500
-        args = "#{args.substr(0,50)}..."
-    
-    return "#{signature}(#{args})"
-
-#-------------------------------------------------------------------------------
-module.exports = dumpingHandler

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/dumpingHandler.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/dumpingHandler.js b/weinre.server/lib/dumpingHandler.js
new file mode 100644
index 0000000..1b8c4ce
--- /dev/null
+++ b/weinre.server/lib/dumpingHandler.js
@@ -0,0 +1,74 @@
+// Generated by CoffeeScript 1.8.0
+var dumpResponse, dumpingHandler, enhance, utils, _;
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+dumpingHandler = function(request, response, uri) {
+  var element, originalSend, _i, _len, _ref, _results;
+  originalSend = response.send;
+  response.send = function(body) {
+    return dumpResponse(originalSend, body, request, response, uri);
+  };
+  if (request.method !== 'POST') {
+    return;
+  }
+  utils.logVerbose('--------------------------------------------------');
+  utils.logVerbose("" + request.method + " " + uri + " [request]");
+  if (_.isArray(request.body)) {
+    _ref = request.body;
+    _results = [];
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      element = _ref[_i];
+      _results.push(utils.logVerbose("   " + (enhance(JSON.parse(element)))));
+    }
+    return _results;
+  } else {
+    return utils.logVerbose("   " + (enhance(request.body)));
+  }
+};
+
+dumpResponse = function(originalSend, body, request, response, uri) {
+  var e, element, _i, _len, _ref, _results;
+  originalSend.call(response, body);
+  if ((_ref = request.method) !== 'GET' && _ref !== 'POST') {
+    return;
+  }
+  try {
+    body = JSON.parse(body);
+  } catch (_error) {
+    e = _error;
+    return;
+  }
+  if (_.isArray(body) && (body.length === 0)) {
+    return;
+  }
+  utils.logVerbose('--------------------------------------------------');
+  utils.logVerbose("" + request.method + " " + uri + " " + response.statusCode + " [response]");
+  if (_.isArray(body)) {
+    _results = [];
+    for (_i = 0, _len = body.length; _i < _len; _i++) {
+      element = body[_i];
+      _results.push(utils.logVerbose("   " + (enhance(JSON.parse(element)))));
+    }
+    return _results;
+  } else {
+    return utils.logVerbose("   " + (enhance(body)));
+  }
+};
+
+enhance = function(object) {
+  var args, signature;
+  if (!object["interface"] || !object.method || !object.args) {
+    return JSON.stringify(object);
+  }
+  signature = "" + object["interface"] + "." + object.method;
+  args = JSON.stringify(object.args);
+  if (args.length > 500) {
+    args = "" + (args.substr(0, 50)) + "...";
+  }
+  return "" + signature + "(" + args + ")";
+};
+
+module.exports = dumpingHandler;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/extensionManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/extensionManager.coffee b/weinre.server/lib/extensionManager.coffee
deleted file mode 100644
index c367425..0000000
--- a/weinre.server/lib/extensionManager.coffee
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-utils = require './utils'
-
-#-------------------------------------------------------------------------------
-utils.registerClass class ExtensionManager
-
-    #---------------------------------------------------------------------------
-    constructor: () ->
-        @extensions = []
-    
-#-------------------------------------------------------------------------------
-module.exports = new ExtensionManager

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/extensionManager.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/extensionManager.js b/weinre.server/lib/extensionManager.js
new file mode 100644
index 0000000..a3093cd
--- /dev/null
+++ b/weinre.server/lib/extensionManager.js
@@ -0,0 +1,15 @@
+// Generated by CoffeeScript 1.8.0
+var ExtensionManager, utils;
+
+utils = require('./utils');
+
+utils.registerClass(ExtensionManager = (function() {
+  function ExtensionManager() {
+    this.extensions = [];
+  }
+
+  return ExtensionManager;
+
+})());
+
+module.exports = new ExtensionManager;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/jsonBodyParser.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/jsonBodyParser.coffee b/weinre.server/lib/jsonBodyParser.coffee
deleted file mode 100644
index 58f755b..0000000
--- a/weinre.server/lib/jsonBodyParser.coffee
+++ /dev/null
@@ -1,47 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-#-------------------------------------------------------------------------------
-jsonBodyParser = -> 
-    return (request, response, next) -> parseBodyAsJSON(request, response, next)
-        
-#-------------------------------------------------------------------------------
-parseBodyAsJSON = (request, response, next) ->
-
-    return next() if request.body
-    
-    request.body = {}
-    
-    return next() if request.method != 'POST'
-    
-    request.setEncoding 'utf8'
-    
-    buffer = ''
-    request.on 'data', (chunk) -> buffer += chunk
-    request.on 'end', ->
-        return next() if '' == buffer
-
-        try 
-            request.body = JSON.parse(buffer)
-            next()
-        catch e
-            next(e)
-
-#-------------------------------------------------------------------------------
-module.exports = jsonBodyParser

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/jsonBodyParser.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/jsonBodyParser.js b/weinre.server/lib/jsonBodyParser.js
new file mode 100644
index 0000000..419d865
--- /dev/null
+++ b/weinre.server/lib/jsonBodyParser.js
@@ -0,0 +1,39 @@
+// Generated by CoffeeScript 1.8.0
+var jsonBodyParser, parseBodyAsJSON;
+
+jsonBodyParser = function() {
+  return function(request, response, next) {
+    return parseBodyAsJSON(request, response, next);
+  };
+};
+
+parseBodyAsJSON = function(request, response, next) {
+  var buffer;
+  if (request.body) {
+    return next();
+  }
+  request.body = {};
+  if (request.method !== 'POST') {
+    return next();
+  }
+  request.setEncoding('utf8');
+  buffer = '';
+  request.on('data', function(chunk) {
+    return buffer += chunk;
+  });
+  return request.on('end', function() {
+    var e;
+    if ('' === buffer) {
+      return next();
+    }
+    try {
+      request.body = JSON.parse(buffer);
+      return next();
+    } catch (_error) {
+      e = _error;
+      return next(e);
+    }
+  });
+};
+
+module.exports = jsonBodyParser;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/messageHandler.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/messageHandler.coffee b/weinre.server/lib/messageHandler.coffee
deleted file mode 100644
index 0c79430..0000000
--- a/weinre.server/lib/messageHandler.coffee
+++ /dev/null
@@ -1,59 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-utils             = require './utils'
-channelManager    = require './channelManager'
-serviceManager    = require './serviceManager'
-
-#-------------------------------------------------------------------------------
-utils.registerClass class MessageHandler
-
-    #---------------------------------------------------------------------------
-    handleMessage: (channel, message) ->
-        @_serviceMethodInvoker(channel, message.interface, message.method, message.args)
-
-    #---------------------------------------------------------------------------
-    _serviceMethodInvoker: (channel, intfName, method, args) ->
-        methodSignature = "#{intfName}.#{method}()"
-        # utils.logVerbose "MessageHandler._serviceMethodInvoker(#{methodSignature})"
-
-        service = serviceManager.get(intfName)
-        
-        if !service
-            return @_redirectToConnections(channel, intfName, method, args)
-
-        args = args.slice()
-        args.unshift channel
-        
-        try 
-            service[method].apply(service, args)
-            
-        catch e
-            utils.log "error running service method #{methodSignature}: #{e}"
-            utils.log "stack:\n#{e.stack}"
-
-    #---------------------------------------------------------------------------
-    _redirectToConnections: (channel, intfName, method, args) ->
-        # utils.logVerbose "MessageHandler._redirectToConnections(#{channel.name}, #{intfName}, #{method})"
-
-        for connection in channel.connections
-            connection.sendMessage(intfName, method, args...)
-            
-#-------------------------------------------------------------------------------
-module.exports = new MessageHandler

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/messageHandler.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/messageHandler.js b/weinre.server/lib/messageHandler.js
new file mode 100644
index 0000000..7cba7b3
--- /dev/null
+++ b/weinre.server/lib/messageHandler.js
@@ -0,0 +1,51 @@
+// Generated by CoffeeScript 1.8.0
+var MessageHandler, channelManager, serviceManager, utils,
+  __slice = [].slice;
+
+utils = require('./utils');
+
+channelManager = require('./channelManager');
+
+serviceManager = require('./serviceManager');
+
+utils.registerClass(MessageHandler = (function() {
+  function MessageHandler() {}
+
+  MessageHandler.prototype.handleMessage = function(channel, message) {
+    return this._serviceMethodInvoker(channel, message["interface"], message.method, message.args);
+  };
+
+  MessageHandler.prototype._serviceMethodInvoker = function(channel, intfName, method, args) {
+    var e, methodSignature, service;
+    methodSignature = "" + intfName + "." + method + "()";
+    service = serviceManager.get(intfName);
+    if (!service) {
+      return this._redirectToConnections(channel, intfName, method, args);
+    }
+    args = args.slice();
+    args.unshift(channel);
+    try {
+      return service[method].apply(service, args);
+    } catch (_error) {
+      e = _error;
+      utils.log("error running service method " + methodSignature + ": " + e);
+      return utils.log("stack:\n" + e.stack);
+    }
+  };
+
+  MessageHandler.prototype._redirectToConnections = function(channel, intfName, method, args) {
+    var connection, _i, _len, _ref, _results;
+    _ref = channel.connections;
+    _results = [];
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      connection = _ref[_i];
+      _results.push(connection.sendMessage.apply(connection, [intfName, method].concat(__slice.call(args))));
+    }
+    return _results;
+  };
+
+  return MessageHandler;
+
+})());
+
+module.exports = new MessageHandler;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/service/WeinreClientCommands.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/service/WeinreClientCommands.coffee b/weinre.server/lib/service/WeinreClientCommands.coffee
deleted file mode 100644
index 713a48b..0000000
--- a/weinre.server/lib/service/WeinreClientCommands.coffee
+++ /dev/null
@@ -1,126 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-_ = require('underscore')
-
-weinre             = require '../weinre'
-utils              = require '../utils'
-channelManager     = require '../channelManager'
-serviceManager     = require '../serviceManager'
-extensionManager   = require '../extensionManager'
-
-WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
-
-#-------------------------------------------------------------------------------
-module.exports = utils.registerClass class WeinreClientCommands
-
-    #---------------------------------------------------------------------------
-    registerClient: (channel, callbackId) ->
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId, channel.description)        
-
-        options = _.extend {}, utils.options
-        for own key, val of options
-            if typeof val in ['number', 'boolean']
-                options[key] = "#{val}"
-        
-        options.version = weinre.getVersion()
-        
-        WeinreClientEvents.serverProperties(channel, options)
-
-        clients = channelManager.getClientChannels(channel.id)
-        WeinreClientEvents.clientRegistered(clients, channel.description)
-
-    #---------------------------------------------------------------------------
-    getTargets: (channel, callbackId) ->
-        channels = channelManager.getTargetChannels(channel.id)
-        result = _.pluck(channels, 'description')
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId, [result])
-
-    #---------------------------------------------------------------------------
-    getClients: (channel, callbackId) ->
-        channels = channelManager.getClientChannels(channel.id)
-        result = _.pluck(channels, 'description')
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId, [result])
-
-    #---------------------------------------------------------------------------
-    getExtensions: (channel, callbackId) ->
-        result = for extension in extensionManager.extensions
-            { startPage: "extensions/#{extension}/extension.html" }
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId, [result])
-
-    #---------------------------------------------------------------------------
-    connectTarget: (channel, clientName, targetName, callbackId) ->
-        client = channelManager.getChannel(clientName)
-        return if !client
-
-        target = channelManager.getChannel(targetName)
-        return if !target
-
-        channelManager.connectChannels(client, target)
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)
-            
-    #---------------------------------------------------------------------------
-    disconnectTarget: (channel, clientName, callbackId) ->
-        client = connectionManager.getClient(clientName)
-        return if !client
-
-        target = client.getConnectedTarget()
-        return if !target
-
-        connectionManager.disconnect(client, target)
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)
-            
-    #---------------------------------------------------------------------------
-    logDebug: (channel, message, callbackId) ->
-        utils.logVerbose "client #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)
-            
-    #---------------------------------------------------------------------------
-    logInfo: (channel, message, callbackId) ->
-        utils.log "client #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)
-            
-    #---------------------------------------------------------------------------
-    logWarning: (channel, message, callbackId) ->
-        utils.log "client #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)
-            
-    #---------------------------------------------------------------------------
-    logError: (channel, message, callbackId) ->
-        utils.log "client #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreClientEvents.sendCallback(channel, callbackId)

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/service/WeinreClientCommands.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/service/WeinreClientCommands.js b/weinre.server/lib/service/WeinreClientCommands.js
new file mode 100644
index 0000000..675f2a4
--- /dev/null
+++ b/weinre.server/lib/service/WeinreClientCommands.js
@@ -0,0 +1,140 @@
+// Generated by CoffeeScript 1.8.0
+var WeinreClientCommands, WeinreClientEvents, channelManager, extensionManager, serviceManager, utils, weinre, _,
+  __hasProp = {}.hasOwnProperty;
+
+_ = require('underscore');
+
+weinre = require('../weinre');
+
+utils = require('../utils');
+
+channelManager = require('../channelManager');
+
+serviceManager = require('../serviceManager');
+
+extensionManager = require('../extensionManager');
+
+WeinreClientEvents = serviceManager.get('WeinreClientEvents');
+
+module.exports = utils.registerClass(WeinreClientCommands = (function() {
+  function WeinreClientCommands() {}
+
+  WeinreClientCommands.prototype.registerClient = function(channel, callbackId) {
+    var clients, key, options, val, _ref;
+    if (callbackId) {
+      WeinreClientEvents.sendCallback(channel, callbackId, channel.description);
+    }
+    options = _.extend({}, utils.options);
+    for (key in options) {
+      if (!__hasProp.call(options, key)) continue;
+      val = options[key];
+      if ((_ref = typeof val) === 'number' || _ref === 'boolean') {
+        options[key] = "" + val;
+      }
+    }
+    options.version = weinre.getVersion();
+    WeinreClientEvents.serverProperties(channel, options);
+    clients = channelManager.getClientChannels(channel.id);
+    return WeinreClientEvents.clientRegistered(clients, channel.description);
+  };
+
+  WeinreClientCommands.prototype.getTargets = function(channel, callbackId) {
+    var channels, result;
+    channels = channelManager.getTargetChannels(channel.id);
+    result = _.pluck(channels, 'description');
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);
+    }
+  };
+
+  WeinreClientCommands.prototype.getClients = function(channel, callbackId) {
+    var channels, result;
+    channels = channelManager.getClientChannels(channel.id);
+    result = _.pluck(channels, 'description');
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);
+    }
+  };
+
+  WeinreClientCommands.prototype.getExtensions = function(channel, callbackId) {
+    var extension, result;
+    result = (function() {
+      var _i, _len, _ref, _results;
+      _ref = extensionManager.extensions;
+      _results = [];
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        extension = _ref[_i];
+        _results.push({
+          startPage: "extensions/" + extension + "/extension.html"
+        });
+      }
+      return _results;
+    })();
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId, [result]);
+    }
+  };
+
+  WeinreClientCommands.prototype.connectTarget = function(channel, clientName, targetName, callbackId) {
+    var client, target;
+    client = channelManager.getChannel(clientName);
+    if (!client) {
+      return;
+    }
+    target = channelManager.getChannel(targetName);
+    if (!target) {
+      return;
+    }
+    channelManager.connectChannels(client, target);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  WeinreClientCommands.prototype.disconnectTarget = function(channel, clientName, callbackId) {
+    var client, target;
+    client = connectionManager.getClient(clientName);
+    if (!client) {
+      return;
+    }
+    target = client.getConnectedTarget();
+    if (!target) {
+      return;
+    }
+    connectionManager.disconnect(client, target);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  WeinreClientCommands.prototype.logDebug = function(channel, message, callbackId) {
+    utils.logVerbose("client " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  WeinreClientCommands.prototype.logInfo = function(channel, message, callbackId) {
+    utils.log("client " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  WeinreClientCommands.prototype.logWarning = function(channel, message, callbackId) {
+    utils.log("client " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  WeinreClientCommands.prototype.logError = function(channel, message, callbackId) {
+    utils.log("client " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreClientEvents.sendCallback(channel, callbackId);
+    }
+  };
+
+  return WeinreClientCommands;
+
+})());

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/service/WeinreTargetCommands.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/service/WeinreTargetCommands.coffee b/weinre.server/lib/service/WeinreTargetCommands.coffee
deleted file mode 100644
index 4603e20..0000000
--- a/weinre.server/lib/service/WeinreTargetCommands.coffee
+++ /dev/null
@@ -1,90 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-utils              = require '../utils'
-channelManager     = require '../channelManager'
-serviceManager     = require '../serviceManager'
-
-WeinreClientEvents = serviceManager.get 'WeinreClientEvents'
-WeinreTargetEvents = serviceManager.get 'WeinreTargetEvents'
-
-#-------------------------------------------------------------------------------
-module.exports = utils.registerClass class WeinreTargetCommands
-
-    #---------------------------------------------------------------------------
-    registerTarget: (channel, url, callbackId) -> 
-        channel.description.url = url
-
-        clients = channelManager.getClientChannels(channel.id)
-        WeinreClientEvents.targetRegistered(clients, channel.description)
-    
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, channel.description)
-
-    #---------------------------------------------------------------------------
-    sendClientCallback: (channel, clientCallbackId, args, callbackId) ->
-
-        # the channel to send the callback to is embedded in the callbackId
-        callbackChannel = getCallbackChannel(clientCallbackId)
-        if !callbackChannel
-            return main.warn "#{@constructor.name}.sendClientCallback() sent with invalid callbackId: #{clientCallbackId}"
-
-        callbackChannel = channelManager.getChannel(callbackChannel)
-        if !callbackChannel
-            # indication that channel was closed; this message may generate a lot of noise
-            return main.warn "#{@constructor.name}.sendClientCallback() unable to find channel : #{clientCallbackId}"
-
-        WeinreClientEvents.sendCallback(callbackChannel, clientCallbackId, args)
-            
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, description)
-
-    #---------------------------------------------------------------------------
-    logDebug: (channel, message, callbackId) ->
-        utils.logVerbose "target #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, description)
-
-    #---------------------------------------------------------------------------
-    logInfo: (channel, message, callbackId) ->
-        utils.log "target #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, description)
-
-    #---------------------------------------------------------------------------
-    logWarning: (channel, message, callbackId) ->
-        utils.log "target #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, description)
-
-    #---------------------------------------------------------------------------
-    logError: (channel, message, callbackId) ->
-        utils.log "target #{channel.name}: #{message}"
-
-        if callbackId
-            WeinreTargetEvents.sendCallback(channel, callbackId, description)
-
-#---------------------------------------------------------------------------
-getCallbackChannel = (callbackId) ->
-    callbackId = callbackId.toString()
-    callbackId.split('::')[0]
-

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/service/WeinreTargetCommands.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/service/WeinreTargetCommands.js b/weinre.server/lib/service/WeinreTargetCommands.js
new file mode 100644
index 0000000..eb76651
--- /dev/null
+++ b/weinre.server/lib/service/WeinreTargetCommands.js
@@ -0,0 +1,78 @@
+// Generated by CoffeeScript 1.8.0
+var WeinreClientEvents, WeinreTargetCommands, WeinreTargetEvents, channelManager, getCallbackChannel, serviceManager, utils;
+
+utils = require('../utils');
+
+channelManager = require('../channelManager');
+
+serviceManager = require('../serviceManager');
+
+WeinreClientEvents = serviceManager.get('WeinreClientEvents');
+
+WeinreTargetEvents = serviceManager.get('WeinreTargetEvents');
+
+module.exports = utils.registerClass(WeinreTargetCommands = (function() {
+  function WeinreTargetCommands() {}
+
+  WeinreTargetCommands.prototype.registerTarget = function(channel, url, callbackId) {
+    var clients;
+    channel.description.url = url;
+    clients = channelManager.getClientChannels(channel.id);
+    WeinreClientEvents.targetRegistered(clients, channel.description);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, channel.description);
+    }
+  };
+
+  WeinreTargetCommands.prototype.sendClientCallback = function(channel, clientCallbackId, args, callbackId) {
+    var callbackChannel;
+    callbackChannel = getCallbackChannel(clientCallbackId);
+    if (!callbackChannel) {
+      return main.warn("" + this.constructor.name + ".sendClientCallback() sent with invalid callbackId: " + clientCallbackId);
+    }
+    callbackChannel = channelManager.getChannel(callbackChannel);
+    if (!callbackChannel) {
+      return main.warn("" + this.constructor.name + ".sendClientCallback() unable to find channel : " + clientCallbackId);
+    }
+    WeinreClientEvents.sendCallback(callbackChannel, clientCallbackId, args);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, description);
+    }
+  };
+
+  WeinreTargetCommands.prototype.logDebug = function(channel, message, callbackId) {
+    utils.logVerbose("target " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, description);
+    }
+  };
+
+  WeinreTargetCommands.prototype.logInfo = function(channel, message, callbackId) {
+    utils.log("target " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, description);
+    }
+  };
+
+  WeinreTargetCommands.prototype.logWarning = function(channel, message, callbackId) {
+    utils.log("target " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, description);
+    }
+  };
+
+  WeinreTargetCommands.prototype.logError = function(channel, message, callbackId) {
+    utils.log("target " + channel.name + ": " + message);
+    if (callbackId) {
+      return WeinreTargetEvents.sendCallback(channel, callbackId, description);
+    }
+  };
+
+  return WeinreTargetCommands;
+
+})());
+
+getCallbackChannel = function(callbackId) {
+  callbackId = callbackId.toString();
+  return callbackId.split('::')[0];
+};

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/serviceManager.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/serviceManager.coffee b/weinre.server/lib/serviceManager.coffee
deleted file mode 100644
index ade070f..0000000
--- a/weinre.server/lib/serviceManager.coffee
+++ /dev/null
@@ -1,95 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-path = require 'path'
-fs   = require 'fs'
-
-_ = require 'underscore'
-
-utils = require './utils'
-
-Services = {}
-
-#-------------------------------------------------------------------------------
-utils.registerClass class ServiceManager
-    
-    #---------------------------------------------------------------------------
-    constructor: ->
-        @services = {}
-
-    #---------------------------------------------------------------------------
-    get: (name) ->
-        return @services[name] if _.has(@services, name)
-        
-        null
-
-    #---------------------------------------------------------------------------
-    registerLocalClass: (name) ->
-
-        serviceClass = null
-        try
-            serviceClass = require "./service/#{name}"
-        catch e
-            utils.log "local service class not found: #{name}"
-            throw e
-
-        @services[name] = new serviceClass
-    
-    #---------------------------------------------------------------------------
-    registerProxyClass: (name) ->
-    
-        intf = getServiceInterface(name)
-        
-        if !intf
-            utils.exit "proxy service class not found: #{name}"
-            
-        if intf.name != name
-            utils.exit "proxy interface '#{intf.name}' loaded when '#{name}' requested"
-            
-        service = {}
-        
-        for method in intf.methods
-            service[method.name] = getMethodProxy(name, method.name)    
-            
-        @services[name] = service
-
-
-#-------------------------------------------------------------------------------
-getMethodProxy = (intfName, methodName) ->
-    (channels, args...) ->
-        channels = [channels] if !_.isArray(channels) 
-        
-        for channel in channels
-            channel.sendMessage(intfName, methodName, args...)
-    
-#-------------------------------------------------------------------------------
-getServiceInterface = (name) ->
-    jsonName = "#{name}.json"
-    fileName = path.join utils.options.staticWebDir, 'interfaces', jsonName
-    
-    return null if !utils.fileExistsSync(fileName) 
-    
-    contents = fs.readFileSync(fileName, 'utf8')
-    
-    serviceInterface = JSON.parse(contents)
-    
-    return serviceInterface.interfaces[0]
-
-#-------------------------------------------------------------------------------
-module.exports = new ServiceManager
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/serviceManager.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/serviceManager.js b/weinre.server/lib/serviceManager.js
new file mode 100644
index 0000000..1d93021
--- /dev/null
+++ b/weinre.server/lib/serviceManager.js
@@ -0,0 +1,90 @@
+// Generated by CoffeeScript 1.8.0
+var ServiceManager, Services, fs, getMethodProxy, getServiceInterface, path, utils, _,
+  __slice = [].slice;
+
+path = require('path');
+
+fs = require('fs');
+
+_ = require('underscore');
+
+utils = require('./utils');
+
+Services = {};
+
+utils.registerClass(ServiceManager = (function() {
+  function ServiceManager() {
+    this.services = {};
+  }
+
+  ServiceManager.prototype.get = function(name) {
+    if (_.has(this.services, name)) {
+      return this.services[name];
+    }
+    return null;
+  };
+
+  ServiceManager.prototype.registerLocalClass = function(name) {
+    var e, serviceClass;
+    serviceClass = null;
+    try {
+      serviceClass = require("./service/" + name);
+    } catch (_error) {
+      e = _error;
+      utils.log("local service class not found: " + name);
+      throw e;
+    }
+    return this.services[name] = new serviceClass;
+  };
+
+  ServiceManager.prototype.registerProxyClass = function(name) {
+    var intf, method, service, _i, _len, _ref;
+    intf = getServiceInterface(name);
+    if (!intf) {
+      utils.exit("proxy service class not found: " + name);
+    }
+    if (intf.name !== name) {
+      utils.exit("proxy interface '" + intf.name + "' loaded when '" + name + "' requested");
+    }
+    service = {};
+    _ref = intf.methods;
+    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+      method = _ref[_i];
+      service[method.name] = getMethodProxy(name, method.name);
+    }
+    return this.services[name] = service;
+  };
+
+  return ServiceManager;
+
+})());
+
+getMethodProxy = function(intfName, methodName) {
+  return function() {
+    var args, channel, channels, _i, _len, _results;
+    channels = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+    if (!_.isArray(channels)) {
+      channels = [channels];
+    }
+    _results = [];
+    for (_i = 0, _len = channels.length; _i < _len; _i++) {
+      channel = channels[_i];
+      _results.push(channel.sendMessage.apply(channel, [intfName, methodName].concat(__slice.call(args))));
+    }
+    return _results;
+  };
+};
+
+getServiceInterface = function(name) {
+  var contents, fileName, jsonName, serviceInterface;
+  jsonName = "" + name + ".json";
+  fileName = path.join(utils.options.staticWebDir, 'interfaces', jsonName);
+  if (!utils.fileExistsSync(fileName)) {
+    return null;
+  }
+  contents = fs.readFileSync(fileName, 'utf8');
+  serviceInterface = JSON.parse(contents);
+  return serviceInterface.interfaces[0];
+};
+
+module.exports = new ServiceManager;

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/utils.coffee
----------------------------------------------------------------------
diff --git a/weinre.server/lib/utils.coffee b/weinre.server/lib/utils.coffee
deleted file mode 100644
index ee5a72b..0000000
--- a/weinre.server/lib/utils.coffee
+++ /dev/null
@@ -1,196 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-fs   = require 'fs'
-path = require 'path'
-
-utils = exports
-
-utils.Program = Program = path.basename process.argv[1]
-
-SequenceNumberMax = 100 * 1024 * 1024
-SequenceNumber    = 0
-
-#-------------------------------------------------------------------------------
-utils.getNextSequenceNumber = (g) -> 
-    SequenceNumber++
-    
-    if SequenceNumber > SequenceNumberMax
-        SequenceNumber = 0
-        
-    SequenceNumber
-
-#-------------------------------------------------------------------------------
-utils.trim = (string) -> 
-    string.replace(/(^\s+)|(\s+$)/g,'')
-
-#-------------------------------------------------------------------------------
-utils.log = log = (message) ->
-    date    = new Date()
-    time    = date.toISOString()
-    console.log "#{time} #{Program}: #{message}"
-
-#-------------------------------------------------------------------------------
-utils.logVerbose = (message) ->
-    return if !utils?.options?.verbose
-
-    log message
-
-#-------------------------------------------------------------------------------
-utils.logDebug = (message) ->
-    return if !utils?.options?.debug
-
-    log message
-
-#-------------------------------------------------------------------------------
-utils.exit = (message) ->
-    log message
-    process.exit 1
-
-#-------------------------------------------------------------------------------
-utils.pitch = (message) ->
-    log message
-    throw message
-
-#-------------------------------------------------------------------------------
-utils.setOptions = (options) ->
-    utils.options = options
-    
-#-------------------------------------------------------------------------------
-utils.ensureInteger = (value, message) ->
-    newValue = parseInt value
-    
-    if isNaN newValue
-        utils.exit "#{message}: '#{value}'"
-    
-    newValue    
-    
-#-------------------------------------------------------------------------------
-utils.ensureString = (value, message) ->
-    
-    if typeof value != 'string'
-        utils.exit "#{message}: '#{value}'"
-    
-    value    
-    
-#-------------------------------------------------------------------------------
-utils.ensureBoolean = (value, message) ->
-    uValue = value.toString().toUpperCase()
-
-    newValue = null    
-    switch uValue
-        when 'TRUE'  then newValue = true
-        when 'FALSE' then newValue = false
-    
-    if typeof(newValue) != 'boolean'
-        utils.exit "#{message}: '#{value}'"
-    
-    newValue
-
-#-------------------------------------------------------------------------------
-utils.setNamesForClass = (aClass) ->
-
-    for own key, val of aClass
-        if typeof(val) is "function"
-            val.signature   = "#{aClass.name}::#{key}"
-            val.displayName = val.signature
-            val.name        = val.signature
-
-    for own key, val of aClass.prototype
-        if typeof(val) is "function"
-            val.signature   = "#{aClass.name}.#{key}"
-            val.displayName = val.signature
-            val.name        = val.signature
-
-#-------------------------------------------------------------------------------
-utils.registerClass = (aClass) ->
-    utils.setNamesForClass(aClass)
-    aClass
-
-#-------------------------------------------------------------------------------
-utils.alignLeft = (string, length) ->
-    while string.length < length
-        string = "#{string} "
-        
-    string
-
-#-------------------------------------------------------------------------------
-utils.alignRight = (string, length) ->
-    while string.length < length
-        string = " #{string}"
-
-    string
-
-#-------------------------------------------------------------------------------
-utils.fileExistsSync = (name) ->
-    
-    if fs.existsSync
-        return fs.existsSync name
-        
-    return path.existsSync(name)
-
-#-------------------------------------------------------------------------------
-Error.prepareStackTrace = (error, structuredStackTrace) ->
-    result = []
-    result.push "---------------------------------------------------------"
-    result.push "error: #{error}"
-    result.push "---------------------------------------------------------"
-    result.push "stack: "
-
-    longestFile = 0
-    longestLine = 0
-    
-    for callSite in structuredStackTrace
-        file = callSite.getFileName()
-        line = callSite.getLineNumber()
-
-        file = path.basename(file)
-        line = "#{line}"
-        
-        if file.length > longestFile
-            longestFile = file.length
-    
-        if line.length > longestLine
-            longestLine = line.length
-    
-    for callSite in structuredStackTrace
-        func = callSite.getFunction()
-        file = callSite.getFileName()
-        line = callSite.getLineNumber()
-
-        file = path.basename(file)
-        line = "#{line}"
-        
-        file = utils.alignRight(file, longestFile)
-        line = utils.alignLeft( line, longestLine)
-        
-        funcName = func.displayName ||
-                   func.name || 
-                   callSite.getFunctionName()
-                   callSite.getMethodName()
-                   '???'
-        
-        if funcName == "Module._compile"
-            result.pop()
-            result.pop()
-            break
-            
-        result.push "   #{file}:#{line} - #{funcName}()"
-        
-    result.join "\n"

http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/lib/utils.js
----------------------------------------------------------------------
diff --git a/weinre.server/lib/utils.js b/weinre.server/lib/utils.js
new file mode 100644
index 0000000..ad5dc89
--- /dev/null
+++ b/weinre.server/lib/utils.js
@@ -0,0 +1,194 @@
+// Generated by CoffeeScript 1.8.0
+var Program, SequenceNumber, SequenceNumberMax, fs, log, path, utils,
+  __hasProp = {}.hasOwnProperty;
+
+fs = require('fs');
+
+path = require('path');
+
+utils = exports;
+
+utils.Program = Program = path.basename(process.argv[1]);
+
+SequenceNumberMax = 100 * 1024 * 1024;
+
+SequenceNumber = 0;
+
+utils.getNextSequenceNumber = function(g) {
+  SequenceNumber++;
+  if (SequenceNumber > SequenceNumberMax) {
+    SequenceNumber = 0;
+  }
+  return SequenceNumber;
+};
+
+utils.trim = function(string) {
+  return string.replace(/(^\s+)|(\s+$)/g, '');
+};
+
+utils.log = log = function(message) {
+  var date, time;
+  date = new Date();
+  time = date.toISOString();
+  return console.log("" + time + " " + Program + ": " + message);
+};
+
+utils.logVerbose = function(message) {
+  var _ref;
+  if (!(utils != null ? (_ref = utils.options) != null ? _ref.verbose : void 0 : void 0)) {
+    return;
+  }
+  return log(message);
+};
+
+utils.logDebug = function(message) {
+  var _ref;
+  if (!(utils != null ? (_ref = utils.options) != null ? _ref.debug : void 0 : void 0)) {
+    return;
+  }
+  return log(message);
+};
+
+utils.exit = function(message) {
+  log(message);
+  return process.exit(1);
+};
+
+utils.pitch = function(message) {
+  log(message);
+  throw message;
+};
+
+utils.setOptions = function(options) {
+  return utils.options = options;
+};
+
+utils.ensureInteger = function(value, message) {
+  var newValue;
+  newValue = parseInt(value);
+  if (isNaN(newValue)) {
+    utils.exit("" + message + ": '" + value + "'");
+  }
+  return newValue;
+};
+
+utils.ensureString = function(value, message) {
+  if (typeof value !== 'string') {
+    utils.exit("" + message + ": '" + value + "'");
+  }
+  return value;
+};
+
+utils.ensureBoolean = function(value, message) {
+  var newValue, uValue;
+  uValue = value.toString().toUpperCase();
+  newValue = null;
+  switch (uValue) {
+    case 'TRUE':
+      newValue = true;
+      break;
+    case 'FALSE':
+      newValue = false;
+  }
+  if (typeof newValue !== 'boolean') {
+    utils.exit("" + message + ": '" + value + "'");
+  }
+  return newValue;
+};
+
+utils.setNamesForClass = function(aClass) {
+  var key, val, _ref, _results;
+  for (key in aClass) {
+    if (!__hasProp.call(aClass, key)) continue;
+    val = aClass[key];
+    if (typeof val === "function") {
+      val.signature = "" + aClass.name + "::" + key;
+      val.displayName = val.signature;
+      val.name = val.signature;
+    }
+  }
+  _ref = aClass.prototype;
+  _results = [];
+  for (key in _ref) {
+    if (!__hasProp.call(_ref, key)) continue;
+    val = _ref[key];
+    if (typeof val === "function") {
+      val.signature = "" + aClass.name + "." + key;
+      val.displayName = val.signature;
+      _results.push(val.name = val.signature);
+    } else {
+      _results.push(void 0);
+    }
+  }
+  return _results;
+};
+
+utils.registerClass = function(aClass) {
+  utils.setNamesForClass(aClass);
+  return aClass;
+};
+
+utils.alignLeft = function(string, length) {
+  while (string.length < length) {
+    string = "" + string + " ";
+  }
+  return string;
+};
+
+utils.alignRight = function(string, length) {
+  while (string.length < length) {
+    string = " " + string;
+  }
+  return string;
+};
+
+utils.fileExistsSync = function(name) {
+  if (fs.existsSync) {
+    return fs.existsSync(name);
+  }
+  return path.existsSync(name);
+};
+
+Error.prepareStackTrace = function(error, structuredStackTrace) {
+  var callSite, file, func, funcName, line, longestFile, longestLine, result, _i, _j, _len, _len1;
+  result = [];
+  result.push("---------------------------------------------------------");
+  result.push("error: " + error);
+  result.push("---------------------------------------------------------");
+  result.push("stack: ");
+  longestFile = 0;
+  longestLine = 0;
+  for (_i = 0, _len = structuredStackTrace.length; _i < _len; _i++) {
+    callSite = structuredStackTrace[_i];
+    file = callSite.getFileName();
+    line = callSite.getLineNumber();
+    file = path.basename(file);
+    line = "" + line;
+    if (file.length > longestFile) {
+      longestFile = file.length;
+    }
+    if (line.length > longestLine) {
+      longestLine = line.length;
+    }
+  }
+  for (_j = 0, _len1 = structuredStackTrace.length; _j < _len1; _j++) {
+    callSite = structuredStackTrace[_j];
+    func = callSite.getFunction();
+    file = callSite.getFileName();
+    line = callSite.getLineNumber();
+    file = path.basename(file);
+    line = "" + line;
+    file = utils.alignRight(file, longestFile);
+    line = utils.alignLeft(line, longestLine);
+    funcName = func.displayName || func.name || callSite.getFunctionName();
+    callSite.getMethodName();
+    '???';
+    if (funcName === "Module._compile") {
+      result.pop();
+      result.pop();
+      break;
+    }
+    result.push("   " + file + ":" + line + " - " + funcName + "()");
+  }
+  return result.join("\n");
+};


[02/14] pre-compile CoffeeScript files in server

Posted by pm...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-weinre/blob/9b06777d/weinre.server/node_modules/underscore/underscore-min.js
----------------------------------------------------------------------
diff --git a/weinre.server/node_modules/underscore/underscore-min.js b/weinre.server/node_modules/underscore/underscore-min.js
index 5a0cb3b..11f1d96 100644
--- a/weinre.server/node_modules/underscore/underscore-min.js
+++ b/weinre.server/node_modules/underscore/underscore-min.js
@@ -1,32 +1,6 @@
-// Underscore.js 1.3.3
-// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-// Underscore is freely distributable under the MIT license.
-// Portions of Underscore are inspired or borrowed from Prototype,
-// Oliver Steele's Functional, and John Resig's Micro-Templating.
-// For all details and documentation:
-// http://documentcloud.github.com/underscore
-(function(){function r(a,c,d){if(a===c)return 0!==a||1/a==1/c;if(null==a||null==c)return a===c;a._chain&&(a=a._wrapped);c._chain&&(c=c._wrapped);if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return!1;switch(e){case "[object String]":return a==""+c;case "[object Number]":return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
-c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return!1;for(var f=d.length;f--;)if(d[f]==a)return!0;d.push(a);var f=0,g=!0;if("[object Array]"==e){if(f=a.length,g=f==c.length)for(;f--&&(g=f in a==f in c&&r(a[f],c[f],d)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return!1;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&r(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,h)&&!f--)break;
-g=!f}}d.pop();return g}var s=this,I=s._,o={},k=Array.prototype,p=Object.prototype,i=k.slice,J=k.unshift,l=p.toString,K=p.hasOwnProperty,y=k.forEach,z=k.map,A=k.reduce,B=k.reduceRight,C=k.filter,D=k.every,E=k.some,q=k.indexOf,F=k.lastIndexOf,p=Array.isArray,L=Object.keys,t=Function.prototype.bind,b=function(a){return new m(a)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=b),exports._=b):s._=b;b.VERSION="1.3.3";var j=b.each=b.forEach=function(a,
-c,d){if(a!=null)if(y&&a.forEach===y)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===o)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===o)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(z&&a.map===z)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(A&&
-a.reduce===A){e&&(c=b.bind(c,e));return f?a.reduce(c,d):a.reduce(c)}j(a,function(a,b,i){if(f)d=c.call(e,d,a,b,i);else{d=a;f=true}});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(B&&a.reduceRight===B){e&&(c=b.bind(c,e));return f?a.reduceRight(c,d):a.reduceRight(c)}var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=function(a,
-c,b){var e;G(a,function(a,g,h){if(c.call(b,a,g,h)){e=a;return true}});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(C&&a.filter===C)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(D&&a.every===D)return a.every(c,b);j(a,function(a,g,h){if(!(e=e&&c.call(b,
-a,g,h)))return o});return!!e};var G=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(E&&a.some===E)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return o});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;if(q&&a.indexOf===q)return a.indexOf(c)!=-1;return b=G(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
-function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&
-(e={value:a,computed:b})});return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){d=Math.floor(Math.random()*(f+1));b[f]=b[d];b[d]=a});return b};b.sortBy=function(a,c,d){var e=b.isFunction(c)?c:function(a){return a[c]};return b.pluck(b.map(a,function(a,b,c){return{value:a,criteria:e.call(d,a,b,c)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c===void 0?1:d===void 0?-1:c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};
-j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:b.isArray(a)||b.isArguments(a)?i.call(a):a.toArray&&b.isFunction(a.toArray)?a.toArray():b.values(a)};b.size=function(a){return b.isArray(a)?a.length:b.keys(a).length};b.first=b.head=b.take=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,
-0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,
-e=[];a.length<3&&(c=true);b.reduce(d,function(d,g,h){if(c?b.last(d)!==g||!d.length:!b.include(d,g)){d.push(g);e.push(a[h])}return d},[]);return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1),true);return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=
-i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,d){if(a==null)return-1;var e;if(d){d=b.sortedIndex(a,c);return a[d]===c?d:-1}if(q&&a.indexOf===q)return a.indexOf(c);d=0;for(e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(F&&a.lastIndexOf===F)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){if(arguments.length<=
-1){b=a||0;a=0}for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;){g[f++]=a;a=a+d}return g};var H=function(){};b.bind=function(a,c){var d,e;if(a.bind===t&&t)return t.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));H.prototype=a.prototype;var b=new H,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=
-i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(null,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i,j=b.debounce(function(){h=
-g=false},c);return function(){d=this;e=arguments;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);j()},c));g?h=true:i=a.apply(d,e);j();g=true;return i}};b.debounce=function(a,b,d){var e;return function(){var f=this,g=arguments;d&&!e&&a.apply(f,g);clearTimeout(e);e=setTimeout(function(){e=null;d||a.apply(f,g)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));
-return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=L||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&
-c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.pick=function(a){var c={};j(b.flatten(i.call(arguments,1)),function(b){b in a&&(c[b]=a[b])});return c};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return r(a,b,[])};b.isEmpty=
-function(a){if(a==null)return true;if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=p||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return l.call(a)=="[object Arguments]"};b.isArguments(arguments)||(b.isArguments=function(a){return!(!a||!b.has(a,"callee"))});b.isFunction=function(a){return l.call(a)=="[object Function]"};
-b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isFinite=function(a){return b.isNumber(a)&&isFinite(a)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,
-b){return K.call(a,b)};b.noConflict=function(){s._=I;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};b.result=function(a,c){if(a==null)return null;var d=a[c];return b.isFunction(d)?d.call(a):d};b.mixin=function(a){j(b.functions(a),function(c){M(c,b[c]=a[c])})};var N=0;b.uniqueId=
-function(a){var b=N++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var u=/.^/,n={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},v;for(v in n)n[n[v]]=v;var O=/\\|'|\r|\n|\t|\u2028|\u2029/g,P=/\\(\\|'|r|n|t|u2028|u2029)/g,w=function(a){return a.replace(P,function(a,b){return n[b]})};b.template=function(a,c,d){d=b.defaults(d||{},b.templateSettings);a="__p+='"+a.replace(O,function(a){return"\\"+n[a]}).replace(d.escape||
-u,function(a,b){return"'+\n_.escape("+w(b)+")+\n'"}).replace(d.interpolate||u,function(a,b){return"'+\n("+w(b)+")+\n'"}).replace(d.evaluate||u,function(a,b){return"';\n"+w(b)+"\n;__p+='"})+"';\n";d.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",e=new Function(d.variable||"obj","_",a);if(c)return e(c,b);c=function(a){return e.call(this,a,b)};c.source="function("+(d.variable||"obj")+"){\n"+a+"}";return c};
-b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var x=function(a,c){return c?b(a).chain():a},M=function(a,c){m.prototype[a]=function(){var a=i.call(arguments);J.call(a,this._wrapped);return x(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return x(d,
-this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return x(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
+//     Underscore.js 1.7.0
+//     http://underscorejs.org
+//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e
 =0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,
 function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(va
 r o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=func
 tion(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])<u?i=o+1:a=o}return i},h.toArray=function(n){return n?h.isArray(n)?a.call(n):n.length===+n.length?h.map(n,h.identity):h.values(n):[]},h.size=function(n){return null==n?0:n.length===+n.length?n.length:h.keys(n).length},h.partition=function(n,t,r){t=h.iteratee(t,r);var e=[],u=[];return h.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},h.first=h.head=h.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.l
 ength-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.p
 ush(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.c
 all(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},h.bindAll=function(n){var t,r,e=arguments.length;if(1>=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.de
 fer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--
 n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(argume
 nts,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i
 =r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.
 isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=funct
 ion(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source]
 .join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=
 function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this);
+//# sourceMappingURL=underscore-min.map
\ No newline at end of file